Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘colData’ for signature ‘"CellDataSet"’

468 views
Skip to first unread message

biomiha

unread,
Feb 13, 2020, 7:25:20 AM2/13/20
to garnett-users
Hi Hannah / everyone,

I am a big fan of the monocle package and garnett seems like an amazing addition. I've recently been using multiparameter mass cytometry and was wondering if garnett could be used for that as well.

I've managed to generate and train the classifier but I get the following error when I try to classify the cells:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘colData’ for signature ‘"CellDataSet"’

The code I use to train is:
cds_classifier <- train_cell_classifier(cds = cds,
                                        marker_file = "blood_garnett_markers.txt",
                                        db = "none", 
                                        cds_gene_id_type = "SYMBOL", 
                                        marker_file_gene_id_type = "SYMBOL",
                                        classifier_gene_id_type = "SYMBOL")

That works. However, when I run:

cds <- classify_cells(cds = cds, 
                      classifier = cds_classifier, 
                      db = "none", 
                      cds_gene_id_type = "SYMBOL", 
                      cluster_extend = FALSE, 
                      verbose = TRUE)

I get the "colData" error I pasted above. I'm pasting the traceback below:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘colData’ for signature ‘"CellDataSet"’
7.
stop(gettextf("unable to find an inherited method for function %s for signature %s", sQuote(fdef@generic), sQuote(cnames)), domain = NA)
6.
(function (classes, fdef, mtable) { methods <- .findInheritedMethods(classes, fdef, mtable) if (length(methods) == 1L) ...
5.
colData(cds)
4.
row.names(colData(cds))
3.
`[.data.frame`(class_df, row.names(colData(cds)), )
2.
class_df[row.names(colData(cds)), ]
1.
classify_cells(cds = cds, classifier = cds_classifier, db = "none", cds_gene_id_type = "SYMBOL", cluster_extend = FALSE, verbose = TRUE)

I imagine it's something to do with gene identifiers - obviously given that it's a mass cytometry dataset, they don't have ENSEMBL ids. But I thought specifying db = "none" and using "SYMBOL" wherever appropriate could do the trick. 

Can anyone shed some light on how to get over the final hurdle?

Many thanks.

Hannah Pliner

unread,
Feb 18, 2020, 10:38:51 AM2/18/20
to garnett-users
Hi,

On first glance, this looks like a monocle3/monocle compatibility issue. Can you check that you're either using (and only loading) monocle3 plus the monocle3 branch or garnett OR monocle and the master branch of garnett?

If that's not the issue, then posting your sessionInfo() will help with next ideas!

Best,
Hannah

biomiha

unread,
Feb 19, 2020, 2:14:34 AM2/19/20
to garnett-users
Hi Hannah,

Yes, you're right. I was using the wrong combination of monocle3 and garnett. This now runs without errors.
Apologies for the sloppiness.

Thank you so much for clearing this up.

Best wishes,
Miha
Reply all
Reply to author
Forward
0 new messages