qiime2 / q2-dada2

QIIME 2 plugin wrapping DADA2
BSD 3-Clause "New" or "Revised" License
19 stars 36 forks source link

dada2 drops samples without reads unfiltered reads from table but not denoising stats. #136

Open dwthomas opened 3 years ago

dwthomas commented 3 years ago

Bug Description dada2-paired appears to drop samples which have 0 sequences after filtering, or perhaps denoising, but keeps samples which have zero sequences from merging and beyond.
This leads to samples being dropped from the table, though they remain in the denoising stats.

I've not checked the behavior with the dada2 paired or dada2 pyro or with older versions of dada2.

Steps to reproduce the behavior Run a dataset including samples with no reads that pass the filtering step, I had a sample with 0 reads and a sample with 6 poor quality reads that were both dropped.

Expected behavior The samples should be retained with 0 frequency in the table.

Computation Environment

Questions

  1. Is this a qiime2 issue or a dada2 issue?

Comments

  1. Ideally blanks should be blank, so discarding them in dada2 means the user has to actively notice that they are missing.
  2. A trivial fix is something like: for i in set(denoising_stats.index) - set(table.index): table.loc[i] = 0 Though there may be a more clear way of getting the dropped samples. I can have a go at implementing that, but I wanted options on if this is something to change in dada2, or here?

Here is the data I noticed this behavior in: https://unh.box.com/s/pyz250peix6hiyrcye2fnwycidx171sz

benjjneb commented 3 years ago

Is this a qiime2 issue or a dada2 issue?

It's sort of a dada2 issue, in that we haven't robustly implemented processing zero-read samples through the whole pipeline, therefore they need to be removed from the processing before entering the post-filtering denoising workflow.

That said, it is probably an easy fix on the Q2 side by just adding those zero-read samples back into whatever final table where they are still wanted, as it seems like you are suggesting.