MaestSi / MetONTIIME

A Meta-barcoding pipeline for analysing ONT data in QIIME2 framework
GNU General Public License v3.0
78 stars 17 forks source link

Missing `fromPath` parameter -- Check script 'metontiime2.nf' #99

Closed stephaniekoo closed 5 months ago

stephaniekoo commented 6 months ago

Hello

It is my first time trying MetONTIIME and I keep encountering an error. I have read through issues on this page and found similar ones (such as https://forum.qiime2.org/t/error-using-metontiime-missing-frompath-parameter/28345 and https://github.com/MaestSi/MetONTIIME/issues/65) and followed the relevant suggestions but it doesn't resolve mine. Could you help me take a look?

Error: N E X T F L O W ~ version 23.10.1 Launching metontiime2.nf [trusting_pauling] DSL2 - revision: 07203be030 Missing fromPath parameter -- Check script 'metontiime2.nf' at line: 609 or see '.nextflow.log' file for more details

Attached are the conf and nf files as well as the log file.

Thank you.

Best Regards Stephanie nextflow.log

metontiime2_nf.txt

metontiime2_conf.txt

MaestSi commented 6 months ago

Hi, I think the issue could be due to the fact that, also in case you are not going to use fasta and tsv files (because you already imported them), the following code lines require dbSequencesFasta and dbTaxonomyTsv to point to some files:

sequences_db=Channel.fromPath(params.dbSequencesFasta)
taxonomy_db=Channel.fromPath(params.dbTaxonomyTsv)

I think you should be ok creating an empty file, and setting that path as the value for the dbSequencesFasta and dbTaxonomyTsv parameters. Best, SM

stephaniekoo commented 6 months ago

Hi SM

Thank you for your reply. I followed your suggestion and managed to get it to run. However, I encountered an error at assignTaxonomy step.

Command error: Plugin error from feature-classifier:

'Reference taxonomy and search results do not match. The following identifiers were reported in the search results but are not present in the reference taxonomy: AB116294, AB116313'

Would you help with this?

Thanks again!

Best Regards Stephanie

nextflow.log

MaestSi commented 6 months ago

Hi, I assume there may be an issue with the qza files you used. In particular, there may be a naming inconsistency for the two taxa AB116294 and AB116313. You may unzip qza files, and look for fasta and tsv file into the two folders generated by the unzip. Then, you may grep for the two taxa and check whether they are named differently in the two files. If this is the case, you may manually fix them and then reimport fasta and tsv file using the appropriate process of the pipeline. SM

stephaniekoo commented 6 months ago

Hi SM

Thank you for your reply. I grep both rep-seqs.qza and 2022.10.backbone.full-length.fna.qza; I only find AB116294 and AB116313 in the latter but not in rep-seqs.qza. I cannot open rep-seqs.qza as the file size is over 2 GB (is it normal?) so I do not know how and what I should fix.

Best Regards Stephanie

MaestSi commented 6 months ago

I think you should be able to discard those entries in the fasta file with the following command:

seqtk seq -A dna-sequences.fasta | sed -e '/AB116313/,+1d' |  sed -e '/AB116294/,+1d'  > dna-sequences_fixed.fasta
mv  dna-sequences.fasta  dna-sequences_err.fasta

Then, you can import the fixed fasta file (and the original tsv file). Best, SM

stephaniekoo commented 6 months ago

Hi SM

Thank you for your reply.

I did what you suggested and I could proceed with the analysis. However, now I keep encountering another problem:

ERROR ~ Error executing process > 'derepSeq'

Caused by: Process requirement exceeds available memory -- req: 100 GB; avail: 62.6 GB

Initially I thought it was because I changed the maxNumReads to 150,000 (from the default 50,000), but after I changed back to 50,000, the problem still persists.

I also changed line 222 in the conf. file to

memory = { params.derepSeq ? 100.GB + (2.GB * (task.attempt-1)) : 1.GB }

as the computer I am using has 128GB RAM and 105 GB available physical memory. I do not run anything else except MetONTIIME.

Could you help me with this?

Thank you.

Best Regards Stephanie

MaestSi commented 6 months ago

Hi, you may just try setting to 60 GB the RAM memory for that process. It could be that previous processes in the pipeline (together with the OS and some "basal" activity of your pc) keep using some RAM memory after they are done, and that's why you may not have 100 GB available. SM

stephaniekoo commented 5 months ago

Hi SM

I followed the suggestion; this time I encountered another error.

ERROR ~ Error executing process > 'assignTaxonomy (1)'

Caused by: Process assignTaxonomy (1) terminated with an error exit status (137)

Command executed:

mkdir -p /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy

    classifier_uc=$(awk '{print toupper($0)'} <<< Vsearch)

d.sh` if [ "$classifier_uc" == "BLAST" ]; then qiime feature-classifier makeblastdb --i-sequences /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/2022.10.backbone.full-length1.fna.qza --o-database /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/blastIndexedDb.qza

            qiime feature-classifier classify-consensus-blast                       --i-query /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/derepSeq/rep-seqs.qza                    --i-blastdb /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/blastIndexedDb.qza           --i-reference-taxonomy /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/2022.10.taxonomy.asv.tsv.qza                        --p-num-threads 6                       --p-perc-identity 0.9          --p-query-cov 0.8                        --p-maxaccepts 3                        --p-min-consensus 0.7                  --o-classification /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/taxonomy.qza                      --o-search-results /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/search_results.qza
    elif [ "$classifier_uc" == "VSEARCH" ]; then
            qiime feature-classifier classify-consensus-vsearch                     --i-query /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/derepSeq/rep-seqs.qza                    --i-reference-reads /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/2022.10.backbone.full-length1.fna.qza                         --i-reference-taxonomy /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/2022.10.taxonomy.asv.tsv.qza                       --p-perc-identity 0.9          --p-query-cov 0.8                        --p-maxaccepts 100                      --p-maxrejects 100                     --p-maxhits 3                    --p-min-consensus 0.7                   --p-strand 'both'                       --p-unassignable-label 'Unassigned'                     --p-threads 6                   --o-classification /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/taxonomy.qza                     --o-search-results /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/search_results.qza
    else
            echo "Classifier Vsearch is not supported (choose between Blast and Vsearch)"
    fi

qiime metadata tabulate --m-input-file /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/taxonomy.qza --o-visualization /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/taxonomy.qzv

    qiime taxa filter-table                 --i-table /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/derepSeq/table.qza               --i-taxonomy /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/taxonomy.qza           --p-exclude Unassigned          --o-filtered-table /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/derepSeq/table-no-Unassigned.qz

Command exit status: 137

Command output: (empty)

Command error: .command.sh: line 14: 10 Killed qiime feature-classifier classify-consensus-vsearch --i-query /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/derepSeq/rep-seqs.qza --i-reference-reads /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/2022.10.backbone.full-length1.fna.qza --i-reference-taxonomy /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/importDb/2022.10.taxonomy.asv.tsv.qza --p-perc-identity 0.9 --p-query-cov 0.8 --p-maxaccepts 100 --p-maxrejects 100 --p-maxhits 3 --p-min-consensus 0.7 --p-strand 'both' --p-unassignable-label 'Unassigned' --p-threads 6 --o-classification /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/taxonomy.qza --o-search-results /mnt/e/Stephanie/VIVA/VIVA/20240306_1158_MN32384_FAT93443_508d730d/assignTaxonomy/search_results.qza

Could you help me see what went wrong this time?

Thank you!

Best Regards Stephanie

MaestSi commented 5 months ago

Hi, same memory issue as before, but with assignTaxonomy process. Please increase also RAM memory for that process, and restart (or try to -resume) the pipeline. Edit: I'm not sure -resume will enable to update the parameter value, such as the available RAM memory for each process. I'd advice restarting the pipeline from scratch. SM

stephaniekoo commented 5 months ago

Hi SM

Thank you for your reply!

I restarted the pipeline from scratch after increasing the RAM to 60.GB (the same as derepSeq) for assignTaxonomy as well as taxonomyVisualization, collapseTables, filterTaxa, and diversityAnalyses. However, I encountered the same problem at assignTaxonomy.

ERROR ~ Error executing process > 'assignTaxonomy (1)'

Caused by: Process assignTaxonomy (1) terminated with an error exit status (137)

Please let me know what I should do now.

Thanks again.

Best Regards Stephanie

MaestSi commented 5 months ago

Hi, since the error is always the same, it means that 60 GB is still not enough for the assignTaxonomy process. Please increase further, e.g. to 150 GB, if you have enough resources. Best, SM

MaestSi commented 5 months ago

Closing due to inactivity. Feel free to reopen it, in case yoy have any further issues. Best, SM