cnio-bu / beyondcell

Beyondcell is a computational methodology for identifying tumour cell subpopulations with distinct drug responses in single-cell RNA-seq and Spatial Transcriptomics data.
Other
40 stars 4 forks source link

Error about GenerateGenesets #129

Closed simaxiaoyao closed 5 months ago

simaxiaoyao commented 1 year ago

gs <- GenerateGenesets(SSc) Reading gmt file... Error in x[1] : object of type 'S4' is not subsettable or gs <- GenerateGenesets(PSc) Reading gmt file... Error in x[1] : object of type 'S4' is not subsettable

I just rum the code with the tutorial, but when I run 'gs <- GenerateGenesets(SSc)' or 'gs <- GenerateGenesets(PSc)', some errors happens. Could you tell me how solve this error?

CrazyOrange233 commented 1 year ago

I had the same problem when I was using the R package, did you solve it?

mj-jimenez commented 1 year ago

Hi everybody,

Sorry, we haven't updated the vignette yet. We have introduced a new function to charge pre-loaded collections. Please run

GetCollection(SSc, n.genes = 250, mode = c("up", "down"))

Note that the parameter comparison is not valid anymore as Beyondcell handles it internally.

Alternatively, if you have a custom GMT please run

GenerateGenesets(path_to_geneset)
SGMartin commented 1 year ago

Solved!

YongguangWei commented 5 months ago

Using the above method, it still appeared “Error in x[1] : object of type 'S4' is not subsettable”. How can we solve it

SGMartin commented 5 months ago

Hi @YongguangWei

To address your issue we need a couple of details:

  1. Which beyondcell version you are using at the moment.
  2. A minimal code snippet that triggers the error, so that we may attempt to reproduce it.

Yours

YongguangWei commented 5 months ago
  1. The version of r package "beyondcell" was 2.2.1 version.
  2. Code: >GetCollection(SSc, n.genes = 250, mode = c("up", "down"))

    gs <- GenerateGenesets(PSc) Reading gmt file... Error in x[1] : object of type 'S4' is not subsettable

SGMartin commented 5 months ago

It seems from your code that you are trying to load the PSc collection using GenerateGenesets instead of GetCollection.

PSc and SSc are predefined collections and thus, you can load both of them the same way using GetCollection. GenerateGenesets is now reserved for loading genesets from a gmt file.

YongguangWei commented 5 months ago

¡Muchas gracias!

SGMartin commented 5 months ago

Marked as solved