cNMF icon indicating copy to clipboard operation
cNMF copied to clipboard

Nan issue when linearly regressing out batch and zeroing negative values

Open carversh opened this issue 2 years ago • 1 comments

Hi, I wanted to try linearly regressing out batch from a TPM counts matrix and then zeroing negative values as the input for cNMF. I am getting the following error: ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). It's a bit strange because my TPM matrix does not have NA values and I flagged it as a TPM matrix in the prepare command. I can post my command below:

cnmf prepare --output-dir ./ --name $PARAM2 -c $PARAM1 -k 35 40 45 50 55 60 --n-iter 500 --seed 14 --numgenes 2000 --tpm $PARAM1 --total-workers 50

This issue is linked to this issue I posted earlier: https://github.com/dylkot/cNMF/issues/47 Also linked to this issue: https://github.com/dylkot/cNMF/issues/1

carversh avatar Sep 14 '22 16:09 carversh

Hi, I see. Sorry for the slow reply. Can you post the full error trace? My guess is maybe there are cells or genes with 0 counts? Or negative values introduced somewhere?

dylkot avatar Oct 20 '22 01:10 dylkot