broadinstitute / chronos

Modeling of time series data for CRISPR KO experiments
BSD 3-Clause "New" or "Revised" License
24 stars 8 forks source link

"X out of Y possible nulls found"? #6

Open albertoriva opened 4 months ago

albertoriva commented 4 months ago

Hello,

I'm trying to run chronos on one of my CRISPR datasets, following the code in the README, and I get the following error in the model construction step, ie the call to Chronos(...):

Traceback (most recent call last): File "/blue/runs/CRISPR-Project/Chronos-test/./runchronos.py", line 35, in main(args[0], args[1], args[2]) File "/blue/runs/CRISPR-Project/Chronos-test/./runchronos.py", line 25, in main m = chronos.Chronos( File "/blue/icbrbi/apps/chronos2/lib/python3.10/site-packages/chronos/model.py", line 960, in init self.nan_check() File "/blue/icbrbi/apps/chronos2/lib/python3.10/site-packages/chronos/model.py", line 1856, in nan_check assert False, "%i out of %i possible nulls found in self._predicted_readcounts[%s]" % ( AssertionError: 128 out of 305704 possible nulls found in self._predicted_readcounts[my_library]

Any idea what the problem is?

Thank you!

joshdempster commented 3 months ago

Hi Albert, apologies for missing this. This points to an issue in your inputs that was missed by Chronos' preliminary checks. One possible cause is that for one or more guides you have 0 pDNA readcounts. I'm guessing 128 is (number of guides with 0 pDNA counts) * (number of your replicates). This causes Chronos to predict exactly 0 reads for late time points and is leading to infinities after normalizing. If that's the case I would drop those guides. You can't learn anything from them. I'll also add a check for this case so the error is more informative. If that's not the case, if you want to send your data I can look at it, or I can offer some ways to dig deeper.