I opened a PR to add decontam to the pipeline: <ht...
# ampliseq
d
I opened a PR to add decontam to the pipeline: https://github.com/nf-core/ampliseq/pull/948 Feedback welcome!
šŸ™ 1
d
I had a look and left only a comment for now. Let me know when you want a full review.
d
Thanks! Questions: • About better documentation: I could add a paragraph just before https://nf-co.re/ampliseq/2.16.1/docs/usage/#taxonomic-classification about decontamination/decontam, or is there a better place? • What do you think about the sequence of events? Right now decontam after ASV generation with DADA2: VSEARCH -> decontam -> barrnap -> length filter -> codon filter -> ITSx -> taxonomic classification (all optional...). Is decontam at the right place? I thought its best do add it as early as possible, but after clustering with vsearch, do you agree? I have only minimal experience with decontam unfortunately.
d
What I was thinking specifically about in documentation is the
quant_reading
field in the input sheet.
I have never run Decontam myself, only had students who did. I'm confused by Vsearch -- is that an input to Decontam? Otherwise, I'm quite unsure what order would be best, since both barrnap, the length and codon filters and ITSx are there to remove what's likely artifacts. I could imagine that Decontam would be stronger if artifacts were already removed so the program only sees true target sequences. Moreover, if a user were to apply Decontam themselves, they would likely do so after any filtering by the pipeline. Also, assigning taxonomy to all ASVs, not only those that pass Decontam would make sense to me. But again, my experience is nil.
d
Yes, I see, I need to put that indeed in a proper documentation.
I'm confused by Vsearch -- is that an input to Decontam?
So after the ASVs are produced by DADA2, the pipelines offers various tools to reduce ASVs before taxonomic assignment. The first tool is VSEARCH for clustering ASVs to OTUs. In my PR, the next tool is decontam, so yes, the input is from VSEARCH or (DADA2 if OTU clustering is skipped). But generally, as a tool, decontam can take any abundance table and is not related to VSEARCH in any way.
I could imagine that Decontam would be stronger if artifacts were already removed so the program only sees true target sequences. Moreover, if a user were to apply Decontam themselves, they would likely do so after any filtering by the pipeline.
So I could move Decontam as last in the sequence, instead of first. You assume that this increases sensitivity, or do you know that? I tend to agree, but I dont know.
Also, assigning taxonomy to all ASVs, not only those that pass Decontam would make sense to me.
Currently in the PR, whenever the required column(s) are provided in the samplesheet, Decontam is run but nothing is filtered. That means, all ASVs are going into taxonomic classification. Decontam annotation is just treated as an information, not more. However, when -
-decontam decontaminate
or
--decontam notcontaminant
is used, then the correspoding Decontam results are applied to remove ASVs. My intention here was to be able to skip contamination and reduce runtime with taxonomic assignment, if desired. And to subsequently use QIIME2 visualisations on filtered ASVs. .
I found
You might want to apply other filters before or after decontam. But fundamentally decontam is operating on a per-feature basis, so it isn't really affected by filtering of features.
in https://github.com/benjjneb/decontam/issues/91, so it seems it doesnt matter at what step Decontam is applied!
d
OK. Then the only thing that matters might be what the user expects. And I can't say I have a strong feeling for what that might be. Easiest to keep the way you've already implemented it perhaps?
d
Sure, its easiest to keep it as is šŸ˜„ But otherwise it would be just copy paste to another place since the code is quite clean in that section of the script I think. I'm going to improve documentation and then mark the PR as ready.
šŸ‘ 1
I extended the documentation but I actually also want to activate decontam in one of the tests to make sure it doesnt get broken in future šŸ¤”
d
I agree: No feature without a test! I guess Decontam is using random numbers -- did you set the seed?
d
Uff, good point, no seed yet.
Added seed and managed tests, good to review now!