Closed roxyisat-rex closed 2 years ago
The CTD in MAGMA.Celltyping
should still be compatible with all the EWCE functions used in MAGMA.Celltyping
.
For uses outside of MAGMA.Celltyping
, you can edit the CTDs as needed. However, I'll make a note to update the CTDs in the future when we eventually move them to the official ewceData
R package.
I decided to make a short-term fix in the meantime by adding dummy $annot
data.frames to each CTD. They simply contain the celltype names. In the future, these will ideally contain more detailed information (e.g. celltype acronym-full name mappings, # cells per celltype).
arg_list <- rlang::fn_fmls(fn = MAGMA.Celltyping::get_ctd)
ctd_names <- eval(arg_list$ctd_name)
for(d in ctd_names){
message(d)
ctd <- MAGMA.Celltyping::get_ctd(ctd_name = d)
for(lv in seq_len(length(ctd))){
if(!"annot" %in% names(ctd[[lv]])){
ctd[[lv]]$annot <- data.frame(celltype=colnames(ctd[[lv]]$mean_exp))
}
}
names(ctd) <- paste0("level",seq_len(length(ctd)))
save_path <- file.path(tempdir(),paste0(d,".rda"))
save(ctd, file = save_path)
piggyback::pb_upload(file = save_path,
repo = "neurogenomics/MAGMA_Celltyping",
overwrite = TRUE)
}
Thanks!
From: Brian M. Schilder @.> Sent: 04 February 2022 14:43 To: neurogenomics/MAGMA_Celltyping @.> Cc: Subscribed @.***> Subject: Re: [neurogenomics/MAGMA_Celltyping] cell type data no longer compatible with EWCE (Issue #97)
This email from @.*** originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders listhttps://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.
I decided to make a short-term fix in the meantime by adding dummy $annot data.frames to each CTD. They simply contains the celltype names. In the future, these will ideally contain for details information (e.g. celltype acronym-full name mappings, # cells per celltype).
arg_list <- rlang::fn_fmls(fn = MAGMA.Celltyping::get_ctd) ctd_names <- eval(arg_list$ctd_name) for(d in ctd_names){ message(d) ctd <- MAGMA.Celltyping::get_ctd(ctd_name = d) for(lv in seq_len(length(ctd))){ if(!"annot" %in% ctd[[lv]]){ ctd[[lv]]$annot <- data.frame(celltype=colnames(ctd[[lv]]$mean_exp)) } } names(ctd) <- paste0("level",seq_len(length(ctd))) save_path <- file.path(tempdir(),paste0(d,".rds")) saveRDS(ctd, save_path) piggyback::pb_upload(file = save_path, repo = "neurogenomics/MAGMA_Celltyping", overwrite = TRUE) }
— Reply to this email directly, view it on GitHubhttps://github.com/neurogenomics/MAGMA_Celltyping/issues/97#issuecomment-1030051532, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AH5ZPE33G5Q6QP4UTOU35YLUZPQZBANCNFSM5NPOI4DA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.***>
The cell type data contained in MAGMA_Celltyping is no long compatible with EWCE. The ctd in MAGMA (I used the Zeisel 2018), did not contain "annot" which is needed for EWCE to run. Tracing back the functions, we pinned it to the EWCE:::is_celltypedataset function. "annot" (cell level data that states which cluster each cell is assigned to) is needed.