YosefLab / VISION

Signature Analysis and Visualization for Single-Cell RNA-seq
https://yoseflab.github.io/VISION/
MIT License
152 stars 31 forks source link

Error in data.frame(C = consistency, pValue = pvals, FDR = fdr)? #99

Open duocang opened 2 years ago

duocang commented 2 years ago

Hi.

I met an error and there is nowhere to debug. Can you please give some hints?

scaled_counts <- t(t(counts) / n.umi) * median(n.umi)
vision.score <- cal_vision(scaled_counts, gSets, n_cores = 1)

vis = VISION::Vision(scaled_counts, signatures = gS)
vis = VISION::analyze(vis)

Error message :

Beginning Analysis

Computing a latent space for expression data...

Determining projection genes...
    Applying Threshold filter...removing genes detected in less than 250 cells
      Genes Retained: 2679
    Applying Fano filter...removing genes with Fano < 2.0 MAD in each of 30 bins
      Genes Retained: 500

Clustering cells...completed

Projecting data into 2 dimensions...
  Running method 1/1: tSNE30 ...

Evaluating signature scores on cells...

Creating 0 background signature groups with the following parameters:
     sigSize sigBalance
  signatures per group: 3000
Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

  |================================================================================| 100%, Elapsed 00:00
Error in data.frame(C = consistency, pValue = pvals, FDR = fdr) : 
  arguments imply differing number of rows: 1, 0
mattjones315 commented 2 years ago

Hello,

Thanks for posting this issue -- can you please provide a minimal reproducible example and the script you used to launch this analysis? We'll need this information to help pinpoint the issue.

Thanks!

On Fri, Sep 24, 2021 at 8:17 AM Bai juyi @.***> wrote:

Hi.

I met an error and there is nowhere to debug. Can you please give some hints?

vis = VISION::analyze(vis)

Error message :

Beginning Analysis

Computing a latent space for expression data...

Determining projection genes...

Applying Threshold filter...removing genes detected in less than 250 cells

  Genes Retained: 2679

Applying Fano filter...removing genes with Fano < 2.0 MAD in each of 30 bins

  Genes Retained: 500

Clustering cells...completed

Projecting data into 2 dimensions...

Running method 1/1: tSNE30 ...

Evaluating signature scores on cells...

Creating 0 background signature groups with the following parameters:

 sigSize sigBalance

signatures per group: 3000

Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

|================================================================================| 100%, Elapsed 00:00

Error in data.frame(C = consistency, pValue = pvals, FDR = fdr) :

arguments imply differing number of rows: 1, 0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/YosefLab/VISION/issues/99, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKWFHQMEHDZPTZLJAB7D5LUDSJA5ANCNFSM5EWFZC7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

duocang commented 2 years ago

@mattjones315 Hi. I have found the problem. Since vision asks gmt file but I do not have it before so I converted GSEABSE::geneset into gene signature needed by VISION with mistakes.

I now create singatures:

 singatures <- lapply(names(gSets), function(gSet){
      genes <- unlist(geneIds(gSets)[gSet]) %>% unname()
      value <- rep(1, length(genes))
      names(value) <- genes

Maybe you can provide an option to use GSEABASE::geneset? It is not easy to use if a local file is always needed.

Immugent commented 2 years ago

"Error in data.frame(C = consistency, pValue = pvals, FDR = fdr) : arguments imply differing number of rows: 1, 0 In addition: Warning message: In readSignaturesInput(signatures) : NAs introduced by coercion" I also get this error when running scMetabolism, Could you provide a solution?

mattjones315 commented 2 years ago

Hi @duocang ,

Apologies for the very delayed response to this issue, I somehow missed this a while back. We support a very flexible way for adding signatures through the createGeneSignature function which takes in a list of gene names. You can read more about this on our vignette here. I believe this will be flexible enough to handle work with geneset objects.

@Immugent I'll need a minimal working example to help you on this. I'm also unaware of what scMetabolism is, I've never tried working with it and VISION. However, in the times I've seen this error, it's often because of a NAs in the meta data / signature scores. Happy to help if you can provide more information about the data and code used to generate this error.

Immugent commented 2 years ago

scMetabolism adopts the VISION method in its process. I already know the reason for this error is because scMetabolism only works with human data.

hujiaoxueba commented 2 years ago

Hi, do you know how to get the scMetabolism work with mouse data?

Immugent commented 2 years ago

I have asked the author and the analysis of mouse data is not currently supported.