Improving Immgen Annotations
0
0
Entering edit mode
Adam • 0
@542da5c3
Last seen 3.1 years ago
United States

Hello!

Singler is wonderful, and I appreciate the ability to autoannotate cells. However, the Immgen reference is overly complex; the main dataset does not include all of the differences I need to look for, while the immgen fine dataset consists of a lot of repeating labels.

For example: the immgen.fine data labels include annotations for the following:

"T cells (T.4NVE)", "T cells (T.4NVE44-49D-11A-)", "T cells (T.4Nve)"),

Which for my purposes, can all be clumped into the group "T cells (T.4Nve)".

I cannot wrap my brain around how to condense these labels immgen is applying onto my sce data in a meaningful way, and then applying it to my data.

Of course, a tribble:

ann2 <- ann_fine
ann2 <- tribble(
    ~label.main, ~label.fine,
    "CD4 Naive", c("T cells (T.4NVE)", "T cells (T.4NVE44-49D-11A-)", "T cells (T.4Nve)"))

immgen.tc <- SingleR(test = sce, ref = immgen.tc, assay.type.test=1,
    labels = manual$label.fine)

## Filter based on manual new annotation
immgen.tc <- immgen[, immgen$label.fine %in% manual$label.fine]

## Append new label
immgen.tc$label.manual <- manual.vec[immgen.tc$label.fine]

Does not seem to work, as I recieve the following error:

Error in FUN(X[[i]], ...) : 
  failed to convert data.frame into a numeric matrix

Any ideas as to what to do?

Thank you!

Annotations • 1.0k views
ADD COMMENT
0
Entering edit mode

Just an update for posterity: i sorted it out!

Long story short, after pruning cells I did the following:


zsme$fine_groups[grepl("Tgd", zsme$fine_groups, fixed = T) ] <- "gd T Cells"
zsme$fine_groups[grepl("T.4N", zsme$fine_groups, fixed = T) ] <- "Naive T Cells"
zsme$fine_groups[grepl("T.8N", zsme$fine_groups, fixed = T) ] <- "Naive T Cells"
zsme$fine_groups[grepl("T.4EF", zsme$fine_groups, fixed = T) ] <- "Other"
zsme$fine_groups[grepl("T.4M", zsme$fine_groups, fixed = T) ] <- "Memory CD4 Cells"
zsme$fine_groups[grepl("T.8EFF", zsme$fine_groups, fixed = T) ] <- "Effector CD8 Cells"
zsme$fine_groups[grepl("T.8M", zsme$fine_groups, fixed = T) ] <- "Memory CD8 Cells"
zsme$fine_groups[grepl("T.Tregs", zsme$fine_groups, fixed = T) ] <- "T Reg Cells"
zsme$fine_groups[grepl("DC", zsme$fine_groups, fixed = T) ] <- "Other"
zsme$fine_groups[grepl("B" , zsme$fine_groups, fixed = T) ] <- "B Cells"
zsme$fine_groups[grepl("MF", zsme$fine_groups, fixed = T) ] <- "Other"
zsme$fine_groups[grepl("MO.", zsme$fine_groups, fixed = T) ] <- "Other"
zsme$fine_groups[grepl("T.CD8", zsme$fine_groups, fixed = T) ] <- "CD8 T cells"
zsme$fine_groups[grepl("T.8SP", zsme$fine_groups, fixed = T) ] <- "CD8 T cells"
zsme$fine_groups[grepl("T.CD4", zsme$fine_groups, fixed = T) ] <- "CD4 T cells"
zsme$fine_groups[grepl("T.4", zsme$fine_groups, fixed = T) ] <- "CD4 T cells"
zsme$fine_groups[grepl("ILC", zsme$fine_groups, fixed = T) ] <- "Other"
zsme$fine_groups[grepl("NK", zsme$fine_groups, fixed = T) ] <- "Other"
table(zsme$fine_groups)

Was it efficient? no, probably not. but it worked!

ADD REPLY

Login before adding your answer.

Traffic: 956 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6