Vivianstats / scImpute

Accurate and robust imputation of scRNA-seq data
https://www.nature.com/articles/s41467-018-03405-7
90 stars 34 forks source link

error of 'missing value where TRUE/FALSE needed' #28

Open helianthuszhu opened 4 years ago

helianthuszhu commented 4 years ago

Hi Vivian, I am using scImpute on my several scRNA data sets. Thank you very much for providing such wonderful tools for us. Actually, some of my data sets worked really well but not all of them. Here is my script: scimpute(file.path(outDir,"tumor.tpm"),infile="csv",outfile="csv",outdir=file.path(outDir,"malignant"), labeled=TRUE,labels=as.vector(labels_tumor), type="TPM",genelen=genelen,drop_thre=0.5,ncores=num_cores) And I got error like this when run one data set: [1] "reading in raw count matrix ..." [1] "number of genes in raw count matrix 21985" [1] "number of cells in raw count matrix 317" Error in if (min(raw_count) < 0) { : missing value where TRUE/FALSE needed

Do you have any suggestion on this error? Thanks in advance!

zhengtaoxiao commented 3 years ago

@Vivianstats Hi Vivian, this error might be raised when there are NA or empty values in the input file. It would be very helpful if you could add a function to check the input file or give a warning message that tells users to remove genes containing NAs or replace NAs with real numbers.

xutongran commented 2 years ago

Hi Vivian, .Thank you very much for providing such wonderful tools for us. Actually, some of my data sets worked really well but not all of them. Here is my script: scimpute(file.path(outDir,"tumor.tpm"),infile="csv",outfile="csv",outdir=file.path(outDir,"malignant"), labeled=TRUE,labels=as.vector(labels_tumor), type="TPM",genelen=genelen,drop_thre=0.5,ncores=num_cores) And I got error like this when run one data set: [1] "reading in raw count matrix ..." [1] "number of genes in raw count matrix 21985" [1] "number of cells in raw count matrix 317" Error in if (min(raw_count) < 0) { : missing value where TRUE/FALSE needed

Do you have any suggestion on this error? Thanks in advance!

Vivianstats commented 2 years ago

Hello xutongran,

Can you check if your tumor.tpm file is in the csv format? Does it contain any missing or negative values?

gloknar commented 2 years ago

You probably have Inf TPM values, due to having large log2(TPM+1) values

Bing978 commented 1 year ago

Same problems met, and I checked the tumor.tpm file, no NAs or negative values existed.

Vivianstats commented 1 year ago

Hello @Bing978,

If you could directly try min(count) in R, where count is the raw count matrix, that might tell us what the issue is.