grisslab / scAnnotatR

Other
15 stars 2 forks source link

unable to replicate the vignette #11

Closed Yijia-Jiang closed 10 months ago

Yijia-Jiang commented 1 year ago

Hello, thank you for developing the tool. I am trying to replicate the code provided in vignette tutorial, but cannot run due to the following error:

snapshotDate(): 2022-10-31 loading from cache Error in marker_genes(x) : trying to get slot "marker_genes" from an object of a basic class ("NULL") with no slots

The code I used is below:

default_models <- load_models("default") names(default_models) default_models[['B cells']]

data("tirosh_mel80_example")

tirosh_mel80_example marker_genes(default_models) seurat.obj <- classify_cells(classify_obj = tirosh_mel80_example, assay = 'RNA', slot = 'counts',

cell_types = "all",

                         path_to_models = 'default')

I used the exactly same code as tutorial, and am not sure how this error happens. Can you help? Thank you

nttvy commented 1 year ago

Hi @Yijia-Jiang

Thank you for having been interested in scAnnotatR.

The error occurs when you run:

marker_genes(default_models)

because marker_genes() only accepts the input of class scAnnotatR. Here the default_models object is a list of scAnnotatR objects, so the marker_genes() function gave you an error. You can use this function for any element of the list instead, for example:

marker_genes(default_models[['B cells']])
marker_genes(default_models[[1]])

I hope this answer helps. Bests, Vy