constantAmateur / SoupX

R package to quantify and remove cell free mRNAs from droplet based scRNA-seq data
249 stars 34 forks source link

Error in setContaminationFraction: Contamination fraction greater than 1 detected #64

Closed MohamedRefaat92 closed 3 years ago

MohamedRefaat92 commented 3 years ago

Dear developer,

I tried to manually set the cells that are used to estimate contamination and then pass it to calculateContaminationFraction. I have multiple samples from two different sequencing runs and one of them shows a high expression of hemoglobin genes. I've set cells from this problematic run as TRUE in the and the rest to FALSE. The problem is when I pass this matrix to calculateContaminationFraction I get the following error:

Error in setContaminationFraction(sc, exp(coef(sc$fit)), forceAccept = forceAccept) : Contamination fraction greater than 1 detected. This is impossible and likely represents a failure in the estimation procedure used.

Could you please help me understand what might be causing this error?

Best, Mohamed

constantAmateur commented 3 years ago

I can't 100% follow what you're trying to do, but the error you're seeing indicates that the calculation of the contamination fraction returned a result that was greater than 1. As this is the fraction of reads that are contamination, a value of 1 is impossible and so it returns an error.