Elisseeff-Lab / domino

A software package for connecting cell level features in single cell RNA sequencing data with receptor ligand activity. Please be aware that an improved package, dominoSignal, is available.
https://fertiglab.github.io/dominoSignal/
GNU General Public License v3.0
15 stars 8 forks source link

Condition has length >1 and only the first element will be used #12

Closed agolfinos closed 3 years ago

agolfinos commented 3 years ago

Hi there!

Thanks so much for this wonderful new package. I am a first-time Domino user and I was following the README to set up my environment and run the analysis. I was having trouble with my actual data, so I decided to try the 2.7k PBMCs dataset used in the Seurat tutorial/mentioned in the tutorial vignette to see if I could get that to work. I actually ran into the same problem with the 2.7k PBMC dataset as I ran into with my own:

[1] "Reading in and processing signaling database" [1] "Getting z_scores, clusters, and counts" Warning in if (class(features) == "character") { : the condition has length > 1 and only the first element will be used Error in features[, colnames(dom@z_scores)] : subscript out of bounds

Here's the full code (I just did a standard Seurat-tutorial pre-processing of this data set to prep it to use with Domino):

Screen Shot 2021-09-02 at 4 45 01 PM

I originally suspected it had something to do with the Z-scores--in my own dataset, the scale.data slot only consisted of data from the variable genes, and I thought the difference in length of that slot vs. the rest of the matrix was causing an issue. That's why I switched over to the 2.7k PBMC dataset, which does not have that same discrepancy once I ran the scale.data function. However, I ran into the same issue. I looked up this error and it seems like most of the solutions to these issues involves making edits to an if loop, which I don't have here. So, I'm just a bit stumped. I'm also somewhat new to R, so any suggestions you might have would be wonderful. Thank you so much!

Chris-Cherry commented 3 years ago

Hi Agolfinos,

Thanks for writing up a good report of what happened. First, let me just note that there warning is distinct from the error. The warning is from an if statement inside my code where I use a vector inside of an if statement instead of an individual boolean value. The warning is to let you (me) know that it's only checking the first entry of the vector - in this case the code is only checking if the first entry of class(features) is a string matching 'character'. The way the code is written, it will function despite the warning with no problems.

The error is what's actually stopping the code from running. It's specifically indicating that the features that you provide (features=auc) do not have all of the column names of the z_scores you provide. Could you check that all of the cell names match between the two?

Chris

agolfinos commented 3 years ago

Hi Chris,

Thanks so much for that information! After looking at what files I've been working with, I was running the default output files (the ones you provide) as the SCENIC outputs when I now realize I should be calculating it myself (especially with my own dataset). I am not super familiar with Docker, would you be willing to give a couple more details on how to go about running the SCENIC calculations? I see you have a script to do that but I just want to make sure I'm recreating your pipeline as closely as possible. Thanks again, I really appreciate your feedback!

Chris-Cherry commented 3 years ago

I'd recommend you look at the SCENIC documentation here: https://pyscenic.readthedocs.io/en/latest/ . The script I provide is just to help assist with the process of running SCENIC but the documentation itself has much more detail. Best of luck