nf-core / ampliseq

Amplicon sequencing analysis workflow using DADA2 and QIIME2
https://nf-co.re/ampliseq
MIT License
182 stars 115 forks source link

QIIME2_DIVERSITY_CORE gaps in mindepth piecewise #589

Closed lam-c closed 1 year ago

lam-c commented 1 year ago

Description of the bug

Hi, there. Thank you for bringing us this magic tool to accelerate amplicon sequence analysis! Recently I caught an error when running the module qiime2 diversity core. The parameter mindepth I chose was 10000, then it accidentally leads to incomplete output files, lacking the required *.rarefaction.txt, while the diversity calculation works fine.

I'm sorry that intermediate files .command.log and .command.err were not saved, cause they were overwritten when I tried to modify relevant scripts .command.sh and re-runed. Here are the code snippets that lead to the aforementioned problem (and the suggestion shown in the comment line):

# file: module/local/qiime2_diversity_core.nf
32    mindepth=\$(count_table_minmax_reads.py $stats minimum 2>&1)
33    if [ \"\$mindepth\" -lt \"$mindepth\" ]; then mindepth=$mindepth; fi
        # better replace "-gt" with "-ge"
34    if [ \"\$mindepth\" -gt \"10000\" ]; then echo \$mindepth >\"Use the sampling depth of \$mindepth for rarefaction.txt\" ; fi
        # better replace "-gt" with "-ge"
35    if [ \"\$mindepth\" -lt \"10000\" -a \"\$mindepth\" -gt \"5000\" ]; then echo \$mindepth >\"WARNING The sampling depth of \$mindepth is quite small for rarefaction.txt\" ; fi
        # better replace "-gt" with "-ge"
36    if [ \"\$mindepth\" -lt \"5000\" -a \"\$mindepth\" -gt \"1000\" ]; then echo \$mindepth >\"WARNING The sampling depth of \$mindepth is very small for rarefaction.txt\" ; fi
37    if [ \"\$mindepth\" -lt \"1000\" ]; then echo \$mindepth >\"WARNING The sampling depth of \$mindepth seems too small for rarefaction.txt\" ; fi

Command used and terminal output

No response

Relevant files

No response

System information

nf-core/ampliseq: 2.5.0 (branch master, 78b7514) Nextflow:

d4straub commented 1 year ago

I see, seems like a good catch, will fix when I have the time. Thanks for reporting!

lam-c commented 1 year ago

Thanks for considering this and for active development😊

d4straub commented 1 year ago

Fix is in the dev branch now, thanks again for reporting. I'll close that issue.