Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in matrix(0, nrow = length(eids), ncol = ncol(expTPM)): "non-numeric matrix extent" #3

Closed
Darlingfuer opened this issue May 17, 2017 · 9 comments

Comments

@Darlingfuer
Copy link

Hi,

I have been trying to run CellNet locally on my Mac. But there's error "non-numeric matrix extent" at the step "Estimation of expression levels".

Here's my code:
expList<-cn_salmon(stQuery, refDir="ref/", salmonIndex=iFileMouse,salmonPath=pathToSalmon)

When I trace back, it's the line "ansTPM<-matrix(0, nrow=length(eids), ncol=ncol(expTPM))" at function "gene_expr_sum" at "cn_salmon".

I'm not familiar with R, so would you please help with this?

@Darlingfuer
Copy link
Author

I've checked the class of expTPM. After the line "expTPM<-expDatList[['TPM']]", class(expTPM) is matrix. But after the line "expTPM<-expTPM[sameProbes,]", class(expTPM) is numeric. Then when it gets to "ncol=ncol(expTPM)", the "ncol" is NULL.

@pcahan1
Copy link
Collaborator

pcahan1 commented May 17, 2017

How many fastqs are you trying to process?

@Darlingfuer
Copy link
Author

@pcahan1 Sorry, I realized I was trying to test with only one fastq file.
But when I tried to test with three fastq files, I got another error at cn_salmon:

./salmonRes_FKO_mESC/quant.sf
./salmonRes_WT/quant.sf
./salmonRes_FKO_diff/quant.sf
Error in geneIndexList[[i]] : subscript out of bounds

Actually I didn't got any error when I test on my Mac. But I couldn't figure out what's going on when I tried to test it on server. I used the latest version of salmon and build the index myself.

@Darlingfuer
Copy link
Author

I wonder where I can download the fasta file you used to build index: Mus_musculus.GRCm38.cdna.ncrna.exo.fa

@pcahan1
Copy link
Collaborator

pcahan1 commented May 23, 2017

Hi, We are working on this and hope to have a fix very soon. Will post here as soon as we can. Thanks.

@pcahan1 pcahan1 closed this as completed May 23, 2017
@pcahan1 pcahan1 reopened this May 23, 2017
@pcahan1
Copy link
Collaborator

pcahan1 commented May 23, 2017

The latter issue

./salmonRes_FKO_mESC/quant.sf
./salmonRes_WT/quant.sf
./salmonRes_FKO_diff/quant.sf
Error in geneIndexList[[i]] : subscript out of bounds

is likely due to using a different index that what we have provided.

We have fixed the earlier error in gene_expr_sum that pops up when the pipeline is applied to one query sample.

Please let us know if you have any more issues. Thanks!

@Darlingfuer
Copy link
Author

@pcahan1 Thanks!
I then used cdna and ncrna files from Ensembl to rebuild the index with the latest salmon software and it works throughout the cn_salmon function.
I noticed that the index file that you provided (that is "salmon.index.mouse.122116") doesn't work well with the latest version of salmon(0.8.2), which would raise a error so that we need to rebuild the index with latest version of salmon.
However, I got another problem at the "Reconstruction of GRNs" step when using the "cn_make_grn" function:
esc : 5
liver : 3
neuron : 5
VE : 1
Number of samples per CT: 1
Error in expDat[, rownames(stGRN)] : incorrect number of dimensions
Calls: cn_make_grn
In addition: Warning message:
In if (is.na(tfs)) { :
the condition has length > 1 and only the first element will be used

I was trying to use my own data to train a new CellNet, btw. The training metadata table is in ".rda" format in your paper. I just read my csv file and save as ".rda" in R and then use it for cn_make_grn function together with the output of cn_salmon function. Is there anything wrong with this conversion ? I hope that I describe my situation clearly.

@Darlingfuer
Copy link
Author

The output file of cn_salmon is a list, while the parameter for cn_make_grn need to be a matrix ? Step 13-16 in your Nature Protocol paper doesn't describe how to build a new CellNet in details. So far, I have just finished collecting fast files, creating a training metadata table in "csv" format and run through the cn_salmon function...

@pcahan1
Copy link
Collaborator

pcahan1 commented May 24, 2017

Hi, I am going to move this last error

Error in expDat[, rownames(stGRN)] : incorrect number of dimensions

to another issue and close this one as it is not related to the original bug. I cannot recommend using so few samples per cell type or tissue. In the original CellNet paper, the minimum was around 60 samples per cell type, and in the rna-seq we have gone as low as 30-40.

@pcahan1 pcahan1 closed this as completed May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants