scImpute icon indicating copy to clipboard operation
scImpute copied to clipboard

error of 'missing value where TRUE/FALSE needed'

Open helianthuszhu opened this issue 4 years ago • 6 comments

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",out_dir=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!

helianthuszhu avatar Oct 08 '19 07:10 helianthuszhu

@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.

zhengtaoxiao avatar May 03 '21 15:05 zhengtaoxiao

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",out_dir=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!

xutongran avatar Oct 17 '21 05:10 xutongran

Hello xutongran,

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

Vivianstats avatar Oct 17 '21 21:10 Vivianstats

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

gloknar avatar Nov 22 '21 16:11 gloknar