biocore / metagenomics_pooling_notebook

Jupyter notebooks to assist with sample processing
MIT License
8 stars 16 forks source link

Potential divide/0 errors in calculate_norm_vol() #76

Open charles-cowart opened 2 years ago

charles-cowart commented 2 years ago

There is potential to have a divide by zero error occur in calculate_norm_vol() if one or more of the values in the dna_concs array is zero, say because of a BLANK.

RodolfoSalido commented 5 months ago

I think this is addressed approrpiately with the np.nan_to_num() cast and the subsequent np.clip()

https://github.com/biocore/metagenomics_pooling_notebook/blob/1be1c87f317c7eb99471091703f47d2774c27fa2/metapool/metapool.py#L454

Empirically, we haven't seen any issues when there is no quant data, or there is a zero in the quant data for a sample.