From c23eb968f918317e33e3163ec7ed20f5bac2f765 Mon Sep 17 00:00:00 2001 From: Sofia Stamouli Date: Fri, 16 Dec 2022 15:20:06 +0100 Subject: [PATCH 01/17] Remove TODOs from test configs --- conf/test.config | 2 -- conf/test_krakenuniq.config | 2 -- conf/test_motus.config | 2 -- conf/test_nopreprocessing.config | 2 -- conf/test_noprofiling.config | 2 -- conf/test_nothing.config | 2 -- 6 files changed, 12 deletions(-) diff --git a/conf/test.config b/conf/test.config index db9f81d..68a3c6d 100644 --- a/conf/test.config +++ b/conf/test.config @@ -20,8 +20,6 @@ params { max_time = '6.h' // Input data - // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets - // TODO nf-core: Give any required params for the test so that command line flags are not needed input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv' databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database.csv' perform_shortread_qc = true diff --git a/conf/test_krakenuniq.config b/conf/test_krakenuniq.config index 67b559e..eda9c4c 100644 --- a/conf/test_krakenuniq.config +++ b/conf/test_krakenuniq.config @@ -24,8 +24,6 @@ params { max_time = '6.h' // Input data - // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets - // TODO nf-core: Give any required params for the test so that command line flags are not needed input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv' databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database_krakenuniq.csv' perform_shortread_qc = true diff --git a/conf/test_motus.config b/conf/test_motus.config index ee41447..f7e694d 100644 --- a/conf/test_motus.config +++ b/conf/test_motus.config @@ -24,8 +24,6 @@ params { max_time = '6.h' // Input data - // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets - // TODO nf-core: Give any required params for the test so that command line flags are not needed input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv' databases = 'database_motus.csv' perform_shortread_qc = false diff --git a/conf/test_nopreprocessing.config b/conf/test_nopreprocessing.config index 1a36159..d84e2ec 100644 --- a/conf/test_nopreprocessing.config +++ b/conf/test_nopreprocessing.config @@ -20,8 +20,6 @@ params { max_time = '6.h' // Input data - // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets - // TODO nf-core: Give any required params for the test so that command line flags are not needed input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv' databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database.csv' perform_shortread_qc = false diff --git a/conf/test_noprofiling.config b/conf/test_noprofiling.config index 3ca715b..e565491 100644 --- a/conf/test_noprofiling.config +++ b/conf/test_noprofiling.config @@ -20,8 +20,6 @@ params { max_time = '6.h' // Input data - // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets - // TODO nf-core: Give any required params for the test so that command line flags are not needed input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv' databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database.csv' perform_shortread_qc = true diff --git a/conf/test_nothing.config b/conf/test_nothing.config index b95deb4..e881731 100644 --- a/conf/test_nothing.config +++ b/conf/test_nothing.config @@ -20,8 +20,6 @@ params { max_time = '6.h' // Input data - // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets - // TODO nf-core: Give any required params for the test so that command line flags are not needed input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv' databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database.csv' perform_shortread_qc = false From ab0c62bdc152f9ed7d1642305979ecaa3f95069b Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Fri, 23 Dec 2022 16:23:29 +0100 Subject: [PATCH 02/17] Post-release tweaks to usage.md --- docs/usage.md | 216 +++++++++++++++++++++++++-------------- workflows/taxprofiler.nf | 2 +- 2 files changed, 138 insertions(+), 80 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 9539a5a..55ed43c 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -6,14 +6,25 @@ ## Introduction - +nf-core/taxprofiler is a pipeline for highly-parallelised taxonomic profiling of shotgun metagenomic data across multiple tools simultaneously. In addition to multiple profiling tools, at the same time it allows you to performing profiling across multiple databases and settings per tool, as well as produces standardised output tables to allow immediate cross comparison of results between tools. + +To run nf-core/taxprofiler, at a minimum two you require two inputs: + +- an sequenceing read samplesheet +- a database samplesheet + +Both contain metadata and paths to the data of your input samples and database. + +When running nf-core/taxprofiler, every step and tool is 'opt in'. To run a given profiler you must make sure to supply both a database in your `.csv` and supply `--run_` flag to your command. Omitting either will result in the profiling tool not executing. + +nf-core/profiler also includes optional pre-processing (adapter clipping, merge running etc.) or post-processing (visualisation) steps. These are also opt in with a `--perform_` flag. In some cases, the pre- and post-processing steps may also require additional files. Please check the parameters tab of this documentation for more information. + +Please see the rest of this page for information about how to prepare input samplesheets and databases and how to run Nextflow pipelines. See the [parameters](https://nf-co.re/taxprofiler/parameters) documentation for more information about specific options the pipeline also offers. ## Samplesheet inputs nf-core/taxprofiler can accept as input raw or preprocessed single- or paired-end short-read (e.g. Illumina) FASTQ files, long-read FASTQ files (e.g. Oxford Nanopore), or FASTA sequences (available for a subset of profilers). -> ⚠️ Input FASTQ and FASTA files _must_ be gzipped - You will need to create a samplesheet with information about the samples you would like to analyse before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 6 columns, and a header row as shown in the examples below. Furthermother, nf-core/taxprofiler also requires a second comma-separated file of 3 columns with a header row as in the examples below. This samplesheet is then specified on the command line as follows: @@ -51,6 +62,8 @@ sample,run_accession,instrument_platform,fastq_1,fastq_2,fasta ERR3201952,ERR3201952,OXFORD_NANOPORE,///fastq/ERR3201952.fastq.gz,, ``` +> ⚠️ Input FASTQ and FASTA files _must_ be gzipped + | Column | Description | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sample` | Unique sample name [required]. | @@ -97,18 +110,19 @@ Column specifications are as follows: nf-core/taxprofiler will automatically decompress and extract any compressed archives for you. -Expected (uncompressed) database files for each tool are as follows: +The (uncompressed) database paths (`db_path`) for each tool are expected to contain the contents of: -- [**Bracken** output](#bracken-custom-database) of a combined `kraken2-` and `bracken-build` process. -- [**Centrifuge** output](#centrifuge-custom-database) of `centrifuge-build`. -- [**DIAMOND** output](#diamond-custom-database) of `diamond makedb`. - to generate taxonomic profile. See [DIAMOND documentation](https://github.com/bbuchfink/diamond/wiki/3.-Command-line-options#makedb-options). -- [**Kaiju** output](#kaiju-custom-database) of `kaiju-makedb`. -- [**Kraken2** output](#kraken2-custom-database) of `kraken2-build` command(s). -- [**KrakenUniq** output](#krakenuniq-custom-database) of `krakenuniq-build` command(s). -- [**MALT** output](#malt-custom-database) of `malt-build`. -- [**MetaPhlAn3**](#metaphlan3-custom-database) generated with `metaphlan --install` or downloaded from links on the [MetaPhlAn3 wiki](https://github.com/biobakery/MetaPhlAn/wiki/MetaPhlAn-3.0#customizing-the-database). -- [**mOTUs**](#motus-custom-database) is composed of code and database together. +- [**Bracken**:](#bracken-custom-database) output of the combined `kraken2-build` and `bracken-build` process. +- [**Centrifuge**:](#centrifuge-custom-database) output of `centrifuge-build`. +- [**DIAMOND**:](#diamond-custom-database) output of `diamond makedb`. +- [**Kaiju**:](#kaiju-custom-database) output of `kaiju-makedb`. +- [**Kraken2**:](#kraken2-custom-database) output of `kraken2-build` command(s). +- [**KrakenUniq**:](#krakenuniq-custom-database) output of `krakenuniq-build` command(s). +- [**MALT**](#malt-custom-database) output of `malt-build`. +- [**MetaPhlAn3**:](#metaphlan3-custom-database) output of with `metaphlan --install` or downloaded from links on the [MetaPhlAn3 wiki](https://github.com/biobakery/MetaPhlAn/wiki/MetaPhlAn-3.0#customizing-the-database). +- [**mOTUs**:](#motus-custom-database) is composed of code and database together. + +Click the links in the list above for short quick-reference tutorials how to generate custom databases for each tool. ## Running the pipeline @@ -120,8 +134,6 @@ nextflow run nf-core/taxprofiler --input samplesheet.csv --databases databases.c This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. -When running nf-core/taxprofiler, every step and tool is 'opt in'. To run a given profiler you must make sure to supply both a database in your `.csv` and supply `--run_` flag to your command. Omitting either will result in the profiling tool not executing. If you wish to perform pre-processing (adapter clipping, merge running etc.) or post-processing (visualisation) steps, these are also opt in with a `--perform_` flag. In some cases, the pre- and post-processing steps may also require additional files. Please check the parameters tab of this documentation for more information. - Note that the pipeline will create the following files in your working directory: ```bash @@ -137,18 +149,18 @@ work # Directory containing the nextflow working files ### Preprocessing Steps -nf-core/taxprofiler offers four main preprocessing steps +nf-core/taxprofiler offers four main preprocessing steps for preprocessing raw sequencing reads: -- Read processing: adapter clipping and pair-merging. -- Complexity filtering: removal of low-sequence complexity reads. -- Host read-removal: removal of reads aligning to reference genome(s) of a host. -- Run merging: concatenation of multiple FASTQ chunks/sequencing runs/libraries of a sample. +- [**Read processing**](#read-processing): adapter clipping and pair-merging. +- [**Complexity filtering**](#complexity-filtering): removal of low-sequence complexity reads. +- [**Host read-removal**](#host-read-removal): removal of reads aligning to reference genome(s) of a host. +- [**Run merging**](#run-merging): concatenation of multiple FASTQ chunks/sequencing runs/libraries of a sample. #### Read Processing Raw sequencing read processing in the form of adapter clipping and paired-end read merging can be activated via the `--perform_shortread_qc` or `--perform_longread_qc` flags. -It is highly recommended to run this on raw reads to remove artifacts from sequencing that can cause false positive identification of taxa (e.g. contaminated reference genomes) and/or skews in taxonomic abundance profiles. If you have public data, normally these should have been corrected for however you should still check this is the case. +It is highly recommended to run this on raw reads to remove artifacts from sequencing that can cause false positive identification of taxa (e.g. contaminated reference genomes) and/or skews in taxonomic abundance profiles. If you have public data, normally these should have been corrected for, however you should still check these steps have indeed been already performed. There are currently two options for short-read preprocessing: [`fastp`](https://github.com/OpenGene/fastp) or [`adapterremoval`](https://github.com/MikkelSchubert/adapterremoval). @@ -201,34 +213,86 @@ You can optionally save the FASTQ output of the run merging with the `--save_run #### Profiling -The following suggestion gives you some tips and suggestions regarding running some of the different tools specifically _within the pipeline_. For advice as to which tool to run in your context, please see the documentation of each tool. +The following sections provides tips and suggestions for running the different metagenomic taxonomic profiling tools _within the pipeline_. For advice and/or guidance whether you should run a particular tool on your specific data, please see the documentation of each tool! -###### Bracken +Not all tools currently have dedicated tips, suggestions and/or recommendations, however we welcome further contributions for existing and additional tools via pull requests to the [nf-core/taxprofiler repository](https://github.com/nf-core/taxprofiler)! -It is unclear whether Bracken is suitable for running long reads, as it makes certain assumptions about read lengths. Furthemore, during testing we found issues where Bracken would fail on the long-read test data. Therefore nf-core/taxprofiler does not run Bracken on data specified as being sequenced with `OXFORD_NANOPORE` in the input samplesheet. If you would like to change this behaviour, please contact us on the nf-core slack and we can discuss this. +##### Bracken -###### Centrifuge +It is unclear whether Bracken is suitable for running long reads, as it makes certain assumptions about read lengths. Furthemore, during testing we found issues where Bracken would fail on the long-read test data. + +Therefore currently nf-core/taxprofiler does not run Bracken on data specified as being sequenced with `OXFORD_NANOPORE` in the input samplesheet. + +> 🖊️ If you would like to change this behaviour, please contact us on the [nf-core slack](https://nf-co.re/join) and we can discuss this. + +##### Bracken + +You must make sure to also activate Kraken2 to run Bracken in the pipeline. + +##### Centrifuge Centrifuge currently does not accept FASTA files as input, therefore no output will be produced for these input files. -###### DIAMOND +##### DIAMOND -DIAMOND only allows output of a single format at a time, therefore parameters such --diamond_save_reads supplied will result in only aligned reads in SAM format will be produced, no taxonomic profiles will be available. Be aware of this when setting up your pipeline runs, depending on your particular use case. +DIAMOND only allows output of a single file format at a time, therefore parameters such `--diamond_save_reads` supplied will result in only aligned reads in SAM format will be produced, no taxonomic profiles will be available. Be aware of this when setting up your pipeline runs, depending on your particular use case. -###### MALT +##### Kaiju + +Currently, no specific tips or suggestions. + +##### Kraken2 + +Currently, no specific tips or suggestions. + +##### KrakenUniq + +Currently, no specific tips or suggestions. + +##### MALT MALT does not support paired-end reads alignment (unlike other tools), therefore nf-core/taxprofiler aligns these as indepenent files if read-merging is skipped. If you skip merging, you can sum or average the results of the counts of the pairs. Krona can only be run on MALT output if path to Krona taxonomy database supplied to `--krona_taxonomy_directory`. Therefore if you do not supply the a Krona directory, Krona plots will not be produced for MALT. -###### MetaPhlAn3 +##### MetaPhlAn3 MetaPhlAn3 currently does not accept FASTA files as input, therefore no output will be produced for these input files. -###### mOTUs +##### mOTUs mOTUs currently does not accept FASTA files as input, therefore no output will be produced for these input files. +#### Post Processing + +##### Visualisation + +nf-core/taxprofiler supports generation of Krona interactive piechart plots for the following compatible tools. + +- Kraken2 +- Centrifuge +- Kaiju +- MALT + +> ⚠️ MALT KRONA plots cannot be generated automatically, you must also specify a Krona taxonomy directory with `--krona_taxonomy_directory` if you wish to generate these. + +##### Multi-Table Generation + +In addition to per-sample profiles, the pipeline also supports generation of 'native' multi-sample taxonomic profiles (i.e., those generated by the taxonomic profiling tools themselves or additional utility scripts provided by the tool authors). + +This are executed on a per-database level. I.e., you will get a multi-sample taxon table for each database you provide for each tool and will be placed in the same directory as the directories containing the per-sample profiles. + +The following tools will produce multi-sample taxon tables: + +- **Bracken** (via bracken's `combine_bracken_outputs.py` script) +- **Centrifuge** (via KrakenTools' `combine_kreports.py` script) +- **Kaiju** (via Kaiju's `kaiju2table` tool) +- **Kraken2** (via KrakenTools' `combine_kreports.py` script) +- **MetaPhlAn3** (via MetaPhlAn's `merge_metaphlan_tables.py` script) +- **mOTUs** (via the `motus merge` command) + +Note that the multi-sample tables from these folders are not inter-operable with each other as they can have different formats. + ### Updating the pipeline When you run the above command, Nextflow automatically pulls the pipeline code from GitHub and stores it as a cached version. When running the pipeline after this, it will always use the cached version if available - even if the pipeline has been updated since. To make sure that you're running the latest version of the pipeline, make sure that you regularly update the cached version of the pipeline: @@ -431,12 +495,15 @@ NXF_OPTS='-Xms1g -Xmx4g' ### Retrieving databases or building custom databases -Here we will give brief guidance on how to build databases for each supported taxonomic profiler. You should always consult the documentation of each tool for more information, here we provide these as quick reference guides (with no guarantee they are up to date). +Not all taxonomic profilers provide ready-made or default databases. Here we will give brief guidance on how to build custom databases for each supported taxonomic profiler. + +You should always consult the documentation of each tool for more information, as here we only provide short minimal-tutorials as quick reference guides (with no guarantee they are up to date). + The following tutorials assumes you already have the tool available (e.g. installed locally, or via conda, docker etc.), and you have already downloaded the FASTA files you wish to build into a database. #### Bracken custom database -Bracken does not provide any default databases for profiling, but rather building upon Kraken2 databases. See [Kraken2](#kraken2-custom-database) for more information on how to build these. +Bracken does not require an indepndent database construction, but rather builds upon Kraken2 databases. See [Kraken2](#kraken2-custom-database) for more information on how to build these. In addition to a Kraken2 database, you also need to have the (average) read lengths (in bp) of your sequencing experiment, the K-mer size used to build the Kraken2 database, and Kraken2 available on your machine. @@ -463,11 +530,13 @@ bracken-build -d -k -l -You can follow Bracken [tutorial](https://ccb.jhu.edu/software/bracken/index.shtml?t=manual) for more information. Alternatively, you can use one of the indexes that can be found [here](https://benlangmead.github.io/aws-indexes/k2). +You can follow Bracken [tutorial](https://ccb.jhu.edu/software/bracken/index.shtml?t=manual) for more information. #### Centrifuge custom database -Centrifuge allows the user to [build custom databases](https://ccb.jhu.edu/software/centrifuge/manual.shtml#custom-database). The user should download taxonomy files, make custom `seqid2taxid.map` and combine the fasta files together. You need four components: a tab-separated file mapping sequence IDs to taxonomy IDs (`--conversion-table`), a \t|\t-separated file mapping taxonomy IDs to their parents and rank, up to the root of the tree (`--taxonomy-tree`), a '|'-separated file mapping taxonomy IDs to a name (`--name-table`) and the reference sequences. +To build a custom Centrifuge database, a user needs to download taxonomy files, make a custom `seqid2taxid.map` and combine the fasta files together. + +In total You need four components: a tab-separated file mapping sequence IDs to taxonomy IDs (`--conversion-table`), a tab-separated file mapping taxonomy IDs to their parents and rank, up to the root of the tree (`--taxonomy-tree`), a pipe-separated file mapping taxonomy IDs to a name (`--name-table`), and the reference sequences. An example of custom `seqid2taxid.map`: @@ -478,7 +547,6 @@ NC_001135.5 4392 ```bash centrifuge-download -o taxonomy taxonomy - cat *.{fa,fna} > input-sequences.fna centrifuge-build -p 4 --conversion-table seqid2taxid.map --taxonomy-tree taxonomy/nodes.dmp --name-table taxonomy/names.dmp input-sequences.fna taxprofiler_cf ``` @@ -494,9 +562,13 @@ centrifuge-build -p 4 --conversion-table seqid2taxid.map --taxonomy-tree taxonom +For the Centrifuge custom database documentation, see [here](https://ccb.jhu.edu/software/centrifuge/manual.shtml#custom-database). + #### DIAMOND custom database -To create a custom database for DIAMOND, the user should download and unzip the NCBI's taxonomy files. The `makedb` needs to be executed afterwards. A detailed description can be found [here](https://github.com/bbuchfink/diamond/wiki/1.-Tutorial) +To create a custom database for DIAMOND, the user should download and unzip the NCBI's taxonomy files and the input FASTA files. + +The download and build steps are as follows: ```bash wget ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdmp.zip @@ -508,6 +580,7 @@ wget ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/prot.accession2taxi ## warning: takes a long time! cat ../raw/*.faa | diamond makedb -d testdb-diamond --taxonmap prot.accession2taxid.FULL.gz --taxonnodes nodes.dmp --taxonnames names.dmp +## clean up rm *dmp *txt *gz *prt *zip ``` @@ -519,15 +592,19 @@ rm *dmp *txt *gz *prt *zip +A detailed description can be found [here](https://github.com/bbuchfink/diamond/wiki/1.-Tutorial) + #### Kaiju custom database -It is possible to [create custom databases](https://github.com/bioinformatics-centre/kaiju#custom-database) with Kaiju. To build a kaiju database, you need three components: a FASTA file with the protein sequences (the headers are the numeric NCBI taxon identifiers of the protein sequences), number of threads and you need to define the uppercase characters of the standard 20 amino acids. +To build a kaiju database, you need three components: a FASTA file with the protein sequences (the headers are the numeric NCBI taxon identifiers of the protein sequences), and you need to define the uppercase characters of the standard 20 amino acids you wish to include. ```bash -kaiju-mkbwt -n 5 -a ACDEFGHIKLMNPQRSTVWY -o proteins proteins.faa +kaiju-mkbwt -a ACDEFGHIKLMNPQRSTVWY -o proteins proteins.faa kaiju-mkfmi proteins ``` +> 🛈 You can speed up database construction by supplying the threads parameter (`-t`). +
Expected files in database directory @@ -538,11 +615,13 @@ kaiju-mkfmi proteins
+For the Kaiju database construction documentation, see [here](https://github.com/bioinformatics-centre/kaiju#custom-database). + #### Kraken2 custom database To build a Kraken2 database you need two components: a taxonomy (consisting of `names.dmp`, `nodes.dmp`, and `*accession2taxid`) files, and the FASTA files you wish to include. -To install pulling the NCBI taxonomy, you can run the following: +To pull the NCBI taxonomy, you can run the following: ```bash kraken2-build --download-taxonomy --db @@ -556,20 +635,14 @@ kraken2-build --add-to-library *.fna --db You can repeat this step multiple times to iteratively add more genomes prior building. -You can also automatical download and add 'standard' libraries provided by Kraken2 (e.g. bacteria on RefSeq) - -```bash -kraken2-build --download-library bacteria --db -``` - Once all genomes are added to the library, you can build the database (and optionally clean it up): ```bash kraken2-build --build --db -kraken2-build --clean--db +kraken2-build --clean --db ``` -You can then add the / path to your nf-core/taxprofiler database input sheet. +You can then add the `/` path to your nf-core/taxprofiler database input sheet.
Expected files in database directory @@ -585,29 +658,17 @@ You can follow the Kraken2 [tutorial](https://github.com/DerrickWood/kraken2/blo #### KrakenUniq custom database -KrakenUniq allows to re-use Kraken(2) databases ([see above](#kraken2)) however with some restrictions. KrakenUniq also provides you with the ability to auto-download and build 'standard' NCBI reference datasets. +For any KrakenUniq database, you require: taxonomy files, the FASTA files you wish to include, a `seqid2mapid` file, and a k-mer length. -For any KrakenUniq databases, you require: taxonomy files, the FASTA files you wish to include, a `seqid2mapid` file, and a k-mer length. - -To auto-download and build a 'standard' database of Bacteria and Archaea genomes from RefSeq, you can run something like: - -```bash -krakenuniq-download --db taxonomy -krakenuniq-download --db --threads 10 --dust refseq/bacteria refseq/archaea -krakenuniq-build --db --kmer-len 31 --threads 10 --taxids-for-genomes --taxids-for-sequences -``` - -This will download all the required files for you and build the database. - -Alternatively, if you want to build your own you first must make a `seqid2taxid.map` file which is a two column text file containing the FASTA sequence header and the NCBI taxonomy ID for each sequence: +First you must make a `seqid2taxid.map` file which is a two column text file containing the FASTA sequence header and the NCBI taxonomy ID for each sequence: ``` MT192765.1 2697049 ``` -Then make a directory (`/`), containing the `seqid2taxid.map` file and your FASTA files in a subdirectory called `library/`. You must then run the `taxonomy` command on the `/` directory, and then build it. +Then make a directory (`/`), containing the `seqid2taxid.map` file, and your FASTA files in a subdirectory called `library/` (these FASTA files can be symlinked). You must then run the `taxonomy` command on the `/` directory, and then build it. -``` +```bash mkdir -p /library mv `seqid2taxid.map` / mv *.fna /library @@ -615,7 +676,7 @@ krakenuniq-download --db taxonomy krakenuniq-build --db --kmer-len 31 ``` -> 🛈 You can speed up database construction by supplying the threads parameter (`--threads`). +> 🛈 You can speed up database construction by supplying the threads parameter (`--threads`) to `krakenuniq-build`.
Expected files in database directory @@ -631,19 +692,15 @@ krakenuniq-build --db --kmer-len 31 Please see the [KrakenUniq documentation](https://github.com/fbreitwieser/krakenuniq#database-building) for more information. -```` - #### MALT custom database -MALT does not provide any default databases for profiling, therefore you must build your own. -You need FASTA files to include, and an (unzipped) [MEGAN mapping 'db' file](https://software-ab.informatik.uni-tuebingen.de/download/megan6/) for your FASTA type. -In addition to the input directory, output directory, and the mapping file database, you also need to specify the sequence type (DNA or Protein) with the `-s` flag. +To build a MALT database, you need the FASTA files to include, and an (unzipped) [MEGAN mapping 'db' file](https://software-ab.informatik.uni-tuebingen.de/download/megan6/) for your FASTA type. In addition to the input directory, output directory, and the mapping file database, you also need to specify the sequence type (DNA or Protein) with the `-s` flag. ```bash malt-build -i ///*.{fna,fa,fasta} -a2t //.db -d / -s DNA -```` +``` -You can then add the / path to your nf-core/taxprofiler database input sheet. +You can then add the `/` path to your nf-core/taxprofiler database input sheet. ⚠️ MALT generates very large database files and requires large amounts of RAM. You can reduce both by increasing the step size `-st` (with a reduction in sensitivity). @@ -669,8 +726,9 @@ See the [MALT manual](https://software-ab.informatik.uni-tuebingen.de/download/m #### MetaPhlAn3 custom database -MetaPhlAn3 provides a prebuilt database of marker genes. -This must be downloaded by the user. To do this you need to have `MetaPhlAn3` installed on your machine. +MetaPhlAn3 does not allow (easy) construction of custom databases. Therefore we recommend to use the prebuilt database of marker genes that is provided by the developers. + +To do this you need to have `MetaPhlAn3` installed on your machine. ```bash metaphlan --install --bowtie2db / @@ -678,7 +736,9 @@ metaphlan --install --bowtie2db / You can then add the `/` path to your nf-core/taxprofiler database input sheet. -> 🛈 It is generally not recommended to modify this database yourself, thus this is currently not supported in the pipeline. However, it is possible to customise the existing database by adding your own marker genomes following the instructions [here](https://github.com/biobakery/MetaPhlAn/wiki/MetaPhlAn-3.1#customizing-the-database). If using your own database is relevant for you, please contact the nf-core/taxprofiler developers on the [nf-core slack](https://nf-co.re/join) and we will investigate supporting this. +> 🛈 It is generally not recommended to modify this database yourself, thus this is currently not supported in the pipeline. However, it is possible to customise the existing database by adding your own marker genomes following the instructions [here](https://github.com/biobakery/MetaPhlAn/wiki/MetaPhlAn-3.1#customizing-the-database). + +> 🖊️ If using your own database is relevant for you, please contact the nf-core/taxprofiler developers on the [nf-core slack](https://nf-co.re/join) and we will investigate supporting this.
Expected files in database directory @@ -701,9 +761,9 @@ More information on the MetaPhlAn3 database can be found [here](https://github.c #### mOTUs custom database -mOTUs provides a prebuilt database of marker genes. +mOTUs does not provide the ability to construct custom databases. Therefore we recommend to use the the prebuilt database of marker genes provided by the developers. -This must be downloaded by the user. To do this you need to have `mOTUs` installed on your machine. +To do this you need to have `mOTUs` installed on your machine. ```bash motus downloadDB @@ -713,8 +773,6 @@ Then supply the `db_mOTU/` path to your nf-core/taxprofiler database input sheet > ⚠️ The `db_mOTU/` directory may be downloaded to somewhere in your Python's `site-package` directory. You will have to find this yourself as the exact location varies depends on installation method. -It is not possible to create a custom mOTUs database. - More information on the mOTUs database can be found [here](https://motu-tool.org/installation.html). ## Troubleshooting and FAQs diff --git a/workflows/taxprofiler.nf b/workflows/taxprofiler.nf index 07798ea..d1693be 100644 --- a/workflows/taxprofiler.nf +++ b/workflows/taxprofiler.nf @@ -291,7 +291,7 @@ workflow TAXPROFILER { ch_multiqc_files = ch_multiqc_files.mix(SHORTREAD_HOSTREMOVAL.out.mqc.collect{it[1]}.ifEmpty([])) } - if (params.perform_longread_hostremoval) { + if (params.perform_longread_hostremoval) { ch_multiqc_files = ch_multiqc_files.mix(LONGREAD_HOSTREMOVAL.out.mqc.collect{it[1]}.ifEmpty([])) } From b34a021db73f6fa1bb27a444d3f16959fa7f6eae Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Mon, 16 Jan 2023 14:43:46 +0100 Subject: [PATCH 03/17] Specify the difference between classification/profiling --- README.md | 4 ++-- docs/usage.md | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ba4022f..080a75b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ -**nf-core/taxprofiler** is a bioinformatics best-practice analysis pipeline for taxonomic profiling of shotgun metagenomic data. It allows for in-parallel profiling with multiple profiling tools against multiple databases, produces standardised output tables. +**nf-core/taxprofiler** is a bioinformatics best-practice analysis pipeline for taxonomic classification and profiling of shotgun metagenomic data. It allows for in-parallel taxonomic identification of reads or taxonomic abundance estimation with multiple classification and profiling tools against multiple databases, produces standardised output tables. The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community! @@ -37,7 +37,7 @@ On release, automated continuous integration tests run the pipeline on a full-si - Host-read removal (short-read: [BowTie2](http://bowtie-bio.sourceforge.net/bowtie2/); long-read: [Minimap2](https://github.com/lh3/minimap2)) - Run merging 3. Supports statistics for host-read removal ([Samtools](http://www.htslib.org/)) -4. Performs taxonomic profiling using one or more of: +4. Performs taxonomic classification and/or profiling using one or more of: - [Kraken2](https://ccb.jhu.edu/software/kraken2/) - [MetaPhlAn3](https://huttenhower.sph.harvard.edu/metaphlan/) - [MALT](https://uni-tuebingen.de/fakultaeten/mathematisch-naturwissenschaftliche-fakultaet/fachbereiche/informatik/lehrstuehle/algorithms-in-bioinformatics/software/malt/) diff --git a/docs/usage.md b/docs/usage.md index 9539a5a..d14198a 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -64,9 +64,9 @@ An [example samplesheet](../assets/samplesheet.csv) has been provided with the p ### Full database sheet -nf-core/taxprofiler supports multiple databases being profiled in parallel for each tool. +nf-core/taxprofiler supports multiple databases being classified/profiled against in parallel for each tool. Databases can be supplied either in the form of a compressed `.tar.gz` archive of a directory containing all relevant database files or the path to a directory on the filesystem. -The pipeline takes the locations and specific profiling parameters of the tool of these databases as input via a four column comma-separated sheet. +The pipeline takes the locations and specific classification/profiling parameters of the tool of these databases as input via a four column comma-separated sheet. > ⚠️ nf-core/taxprofiler does not provide any databases by default, nor does it currently generate them for you. This must be performed manually by the user. See below for more information of the expected database files. @@ -90,10 +90,10 @@ Column specifications are as follows: | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tool` | Taxonomic profiling tool (supported by nf-core/taxprofiler) that the database has been indexed for [required]. Please note that `bracken` also implies running `kraken2` on the same database. | | `db_name` | A unique name per tool for the particular database [required]. Please note that names need to be unique across both `kraken2` and `bracken` as well, even if re-using the same database. | -| `db_params` | Any parameters of the given taxonomic profiler that you wish to specify that the taxonomic profiling tool should use when profiling against this specific. Can be empty to use taxonomic profiler defaults. Must not be surrounded by quotes [required]. We generally do not recommend specifying parameters here that turn on/off saving of output files or specifying particular file extensions - this should be already addressed via pipeline parameters. | +| `db_params` | Any parameters of the given taxonomic classifier/profiler that you wish to specify that the taxonomic classifier/profiling tool should use when profiling against this specific database. Can be empty to use taxonomic classifier/profiler defaults. Must not be surrounded by quotes [required]. We generally do not recommend specifying parameters here that turn on/off saving of output files or specifying particular file extensions - this should be already addressed via pipeline parameters. | | `db_path` | Path to the database. Can either be a path to a directory containing the database index files or a `.tar.gz` file which contains the compressed database directory with the same name as the tar archive, minus `.tar.gz` [required]. | -> 💡 You can also specify the same database directory/file twice (ensuring unique `db_name`s) and specify different parameters for each database to compare the effect of different parameters during profiling. +> 💡 You can also specify the same database directory/file twice (ensuring unique `db_name`s) and specify different parameters for each database to compare the effect of different parameters during classification/profiling. nf-core/taxprofiler will automatically decompress and extract any compressed archives for you. @@ -120,7 +120,7 @@ nextflow run nf-core/taxprofiler --input samplesheet.csv --databases databases.c This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. -When running nf-core/taxprofiler, every step and tool is 'opt in'. To run a given profiler you must make sure to supply both a database in your `.csv` and supply `--run_` flag to your command. Omitting either will result in the profiling tool not executing. If you wish to perform pre-processing (adapter clipping, merge running etc.) or post-processing (visualisation) steps, these are also opt in with a `--perform_` flag. In some cases, the pre- and post-processing steps may also require additional files. Please check the parameters tab of this documentation for more information. +When running nf-core/taxprofiler, every step and tool is 'opt in'. To run a given classifier/profiler you must make sure to supply both a database in your `.csv` and supply `--run_` flag to your command. Omitting either will result in the classification/profiling tool not executing. If you wish to perform pre-processing (adapter clipping, merge running etc.) or post-processing (visualisation) steps, these are also opt in with a `--perform_` flag. In some cases, the pre- and post-processing steps may also require additional files. Please check the parameters tab of this documentation for more information. Note that the pipeline will create the following files in your working directory: @@ -153,9 +153,9 @@ It is highly recommended to run this on raw reads to remove artifacts from seque There are currently two options for short-read preprocessing: [`fastp`](https://github.com/OpenGene/fastp) or [`adapterremoval`](https://github.com/MikkelSchubert/adapterremoval). For adapter clipping, you can either rely on the tool's default adapter sequences, or supply your own adapters (`--shortread_qc_adapter1` and `--shortread_qc_adapter2`) -By default, paired-end merging is not activated. In this case paired-end 'alignment' against the reference databases is performed where supported, and if not, supported pairs will be independently profiled. If paired-end merging is activated you can also specify whether to include unmerged reads in the reads sent for profiling (`--shortread_qc_mergepairs` and `--shortread_qc_includeunmerged`). +By default, paired-end merging is not activated. In this case paired-end 'alignment' against the reference databases is performed where supported, and if not, supported pairs will be independently classified/profiled. If paired-end merging is activated you can also specify whether to include unmerged reads in the reads sent for classification/profiling (`--shortread_qc_mergepairs` and `--shortread_qc_includeunmerged`). You can also turn off clipping and only perform paired-end merging, if requested. This can be useful when processing data downloaded from the ENA, SRA, or DDBJ (`--shortread_qc_skipadaptertrim`). -Both tools support length filtering of reads and can be tuned with `--shortread_qc_minlength`. Performing length filtering can be useful to remove short (often low sequencing complexity) sequences that result in unspecific classification and therefore slow down runtime during profiling, with minimal gain. +Both tools support length filtering of reads and can be tuned with `--shortread_qc_minlength`. Performing length filtering can be useful to remove short (often low sequencing complexity) sequences that result in unspecific classification and therefore slow down runtime during classificationprofiling, with minimal gain. There is currently one option for long-read Oxford Nanopore processing: [`porechop`](https://github.com/rrwick/Porechop). @@ -165,7 +165,7 @@ For both short-read and long-read preprocessing, you can optionally save the res Complexity filtering can be activated via the `--perform_shortread_complexityfilter` flag. -Complexity filtering is primarily a run-time optimisation step. It is not necessary for accurate taxonomic profiling, however it can speed up run-time of each tool by removing reads with low-diversity of nucleotides (e.g. with mono-nucleotide - `AAAAAAAA`, or di-nucleotide repeats `GAGAGAGAGAGAGAG`) that have a low-chance of giving an informative taxonomic ID as they can be associated with many different taxa. Removing these reads therefore saves computational time and resources. +Complexity filtering is primarily a run-time optimisation step. It is not necessary for accurate taxonomic classification/profiling, however it can speed up run-time of each tool by removing reads with low-diversity of nucleotides (e.g. with mono-nucleotide - `AAAAAAAA`, or di-nucleotide repeats `GAGAGAGAGAGAGAG`) that have a low-chance of giving an informative taxonomic ID as they can be associated with many different taxa. Removing these reads therefore saves computational time and resources. There are currently three options for short-read complexity filtering: [`bbduk`](https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/bbduk-guide/), [`prinseq++`](https://github.com/Adrian-Cantu/PRINSEQ-plus-plus), and [`fastp`](https://github.com/OpenGene/fastp#low-complexity-filter). @@ -179,11 +179,11 @@ You can optionally save the FASTQ output of the run merging with the `--save_com #### Host Removal -Removal of possible-host reads from FASTQ files prior profiling can be activated with `--perform_shortread_hostremoval` or `--perform_longread_hostremoval`. +Removal of possible-host reads from FASTQ files prior classification/profiling can be activated with `--perform_shortread_hostremoval` or `--perform_longread_hostremoval`. -Similarly to complexity filtering, host-removal can be useful for runtime optimisation and reduction in misclassified reads. It is not always necessary to report classification of reads from a host when you already know the host of the sample, therefore you can gain a run-time and computational advantage by removing these prior typically resource-heavy profiling with more efficient methods. Furthermore, particularly with human samples, you can reduce the number of false positives during profiling that occur due to host-sequence contamination in reference genomes on public databases. +Similarly to complexity filtering, host-removal can be useful for runtime optimisation and reduction in misclassified reads. It is not always necessary to report classification of reads from a host when you already know the host of the sample, therefore you can gain a run-time and computational advantage by removing these prior typically resource-heavy classification/profiling with more efficient methods. Furthermore, particularly with human samples, you can reduce the number of false positives during classification/profiling that occur due to host-sequence contamination in reference genomes on public databases. -nf-core/taxprofiler currently offers host-removal via alignment against a reference genome with Bowtie2, and the use of the unaligned reads for downstream profiling. +nf-core/taxprofiler currently offers host-removal via alignment against a reference genome with Bowtie2, and the use of the unaligned reads for downstream classification/profiling. You can supply your reference genome in FASTA format with `--hostremoval_reference`. You can also optionally supply a directory containing pre-indexed Bowtie2 index files with `--shortread_hostremoval_index` or a minimap2 `.mmi` file for `--longread_hostremoval_index`, however nf-core/taxprofiler will generate these for you if necessary. Pre-supplying the index directory or files can greatly speed up the process, and these can be re-used. @@ -195,11 +195,11 @@ For samples that may have been sequenced over multiple runs, or for FASTQ files For more information how to set up your input samplesheet, see [Multiple runs of the same sample](#multiple-runs-of-the-same-sample). -Activating this functionality will concatenate the FASTQ files with the same sample name _after_ the optional preprocessing steps and _before_ profiling. Note that libraries with runs of different pairing types will **not** be merged and this will be indicated on output files with a `_se` or `_pe` suffix to the sample name accordingly. +Activating this functionality will concatenate the FASTQ files with the same sample name _after_ the optional preprocessing steps and _before_ classification/profiling. Note that libraries with runs of different pairing types will **not** be merged and this will be indicated on output files with a `_se` or `_pe` suffix to the sample name accordingly. You can optionally save the FASTQ output of the run merging with the `--save_runmerged_reads`. -#### Profiling +#### Classification and Profiling The following suggestion gives you some tips and suggestions regarding running some of the different tools specifically _within the pipeline_. For advice as to which tool to run in your context, please see the documentation of each tool. @@ -436,7 +436,7 @@ The following tutorials assumes you already have the tool available (e.g. instal #### Bracken custom database -Bracken does not provide any default databases for profiling, but rather building upon Kraken2 databases. See [Kraken2](#kraken2-custom-database) for more information on how to build these. +Bracken does not provide any default databases for classification/profiling, but rather building upon Kraken2 databases. See [Kraken2](#kraken2-custom-database) for more information on how to build these. In addition to a Kraken2 database, you also need to have the (average) read lengths (in bp) of your sequencing experiment, the K-mer size used to build the Kraken2 database, and Kraken2 available on your machine. @@ -635,7 +635,7 @@ Please see the [KrakenUniq documentation](https://github.com/fbreitwieser/kraken #### MALT custom database -MALT does not provide any default databases for profiling, therefore you must build your own. +MALT does not provide any default databases for classification/profiling, therefore you must build your own. You need FASTA files to include, and an (unzipped) [MEGAN mapping 'db' file](https://software-ab.informatik.uni-tuebingen.de/download/megan6/) for your FASTA type. In addition to the input directory, output directory, and the mapping file database, you also need to specify the sequence type (DNA or Protein) with the `-s` flag. From 11400b016cbbda47e3082a6be244cd5e33af8fa4 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Mon, 16 Jan 2023 14:11:18 +0000 Subject: [PATCH 04/17] [automated] Fix linting with Prettier --- docs/usage.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index d14198a..c8fda1b 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -86,12 +86,12 @@ motus,db_mOTU,,///motus/motus_database/ Column specifications are as follows: -| Column | Description | -| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `tool` | Taxonomic profiling tool (supported by nf-core/taxprofiler) that the database has been indexed for [required]. Please note that `bracken` also implies running `kraken2` on the same database. | -| `db_name` | A unique name per tool for the particular database [required]. Please note that names need to be unique across both `kraken2` and `bracken` as well, even if re-using the same database. | +| Column | Description | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `tool` | Taxonomic profiling tool (supported by nf-core/taxprofiler) that the database has been indexed for [required]. Please note that `bracken` also implies running `kraken2` on the same database. | +| `db_name` | A unique name per tool for the particular database [required]. Please note that names need to be unique across both `kraken2` and `bracken` as well, even if re-using the same database. | | `db_params` | Any parameters of the given taxonomic classifier/profiler that you wish to specify that the taxonomic classifier/profiling tool should use when profiling against this specific database. Can be empty to use taxonomic classifier/profiler defaults. Must not be surrounded by quotes [required]. We generally do not recommend specifying parameters here that turn on/off saving of output files or specifying particular file extensions - this should be already addressed via pipeline parameters. | -| `db_path` | Path to the database. Can either be a path to a directory containing the database index files or a `.tar.gz` file which contains the compressed database directory with the same name as the tar archive, minus `.tar.gz` [required]. | +| `db_path` | Path to the database. Can either be a path to a directory containing the database index files or a `.tar.gz` file which contains the compressed database directory with the same name as the tar archive, minus `.tar.gz` [required]. | > 💡 You can also specify the same database directory/file twice (ensuring unique `db_name`s) and specify different parameters for each database to compare the effect of different parameters during classification/profiling. From 33d4a84237596da6a76c04c682b0f29f1ec58d25 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 17 Jan 2023 15:23:59 +0100 Subject: [PATCH 05/17] Add explicit sentnece about classification/profiling --- docs/usage.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index c8fda1b..51ce004 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -201,7 +201,13 @@ You can optionally save the FASTQ output of the run merging with the `--save_run #### Classification and Profiling -The following suggestion gives you some tips and suggestions regarding running some of the different tools specifically _within the pipeline_. For advice as to which tool to run in your context, please see the documentation of each tool. +The following suggestion gives you some tips and suggestions regarding running some of the different tools specifically _within the pipeline_. + +An important distinction between the different tools in included in the pipeline is classification versus profiling. Taxonomic _classification_ is concerned with simply detecting the presence of species in a given sample. Taxonomic _profiling_ involves additionally estimating the _abundance_ of each species. + +Note that not all taxonomic classification tools (e.g. Kraken, MALT, Kaiju) performs _profiling_, but all taxonomic profilers (e.g. MetaPhlAn, mOTUs, Bracken) must perform some form of _classification_ prior to profiling. + +For advice as to which tool to run in your context, please see the documentation of each tool. ###### Bracken From 6d380fbbff4751365efcc075708bd4f95adebc4f Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Jan 2023 08:49:55 +0100 Subject: [PATCH 06/17] Apply suggestions from code review Co-authored-by: Sofia Stamouli <91951607+sofstam@users.noreply.github.com> --- docs/usage.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 55ed43c..b1adfa6 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -6,16 +6,16 @@ ## Introduction -nf-core/taxprofiler is a pipeline for highly-parallelised taxonomic profiling of shotgun metagenomic data across multiple tools simultaneously. In addition to multiple profiling tools, at the same time it allows you to performing profiling across multiple databases and settings per tool, as well as produces standardised output tables to allow immediate cross comparison of results between tools. +nf-core/taxprofiler is a pipeline for highly-parallelised taxonomic classification and profiling of shotgun metagenomic data across multiple tools simultaneously. In addition to multiple classification and profiling tools, at the same time it allows you to performing taxonomic classification and profiling across multiple databases and settings per tool, as well as produces standardised output tables to allow immediate cross comparison of results between tools. To run nf-core/taxprofiler, at a minimum two you require two inputs: -- an sequenceing read samplesheet +- a sequencing read samplesheet - a database samplesheet -Both contain metadata and paths to the data of your input samples and database. +Both contain metadata and paths to the data of your input samples and databases. -When running nf-core/taxprofiler, every step and tool is 'opt in'. To run a given profiler you must make sure to supply both a database in your `.csv` and supply `--run_` flag to your command. Omitting either will result in the profiling tool not executing. +When running nf-core/taxprofiler, every step and tool is 'opt in'. To run a given classifier or profiler you must make sure to supply both a database in your `.csv` and supply `--run_` flag to your command. Omitting either will result in the profiling tool not executing. nf-core/profiler also includes optional pre-processing (adapter clipping, merge running etc.) or post-processing (visualisation) steps. These are also opt in with a `--perform_` flag. In some cases, the pre- and post-processing steps may also require additional files. Please check the parameters tab of this documentation for more information. @@ -160,7 +160,7 @@ nf-core/taxprofiler offers four main preprocessing steps for preprocessing raw s Raw sequencing read processing in the form of adapter clipping and paired-end read merging can be activated via the `--perform_shortread_qc` or `--perform_longread_qc` flags. -It is highly recommended to run this on raw reads to remove artifacts from sequencing that can cause false positive identification of taxa (e.g. contaminated reference genomes) and/or skews in taxonomic abundance profiles. If you have public data, normally these should have been corrected for, however you should still check these steps have indeed been already performed. +It is highly recommended to run this on raw reads to remove artifacts from sequencing that can cause false positive identification of taxa (e.g. contaminated reference genomes) and/or skews in taxonomic abundance profiles. If you have public data, normally these should have been corrected for, however you should still check that these steps have indeed been already performed. There are currently two options for short-read preprocessing: [`fastp`](https://github.com/OpenGene/fastp) or [`adapterremoval`](https://github.com/MikkelSchubert/adapterremoval). @@ -213,7 +213,7 @@ You can optionally save the FASTQ output of the run merging with the `--save_run #### Profiling -The following sections provides tips and suggestions for running the different metagenomic taxonomic profiling tools _within the pipeline_. For advice and/or guidance whether you should run a particular tool on your specific data, please see the documentation of each tool! +The following sections provide tips and suggestions for running the different taxonomic classification and profiling tools _within the pipeline_. For advice and/or guidance whether you should run a particular tool on your specific data, please see the documentation of each tool! Not all tools currently have dedicated tips, suggestions and/or recommendations, however we welcome further contributions for existing and additional tools via pull requests to the [nf-core/taxprofiler repository](https://github.com/nf-core/taxprofiler)! @@ -267,7 +267,7 @@ mOTUs currently does not accept FASTA files as input, therefore no output will b ##### Visualisation -nf-core/taxprofiler supports generation of Krona interactive piechart plots for the following compatible tools. +nf-core/taxprofiler supports generation of Krona interactive pie chart plots for the following compatible tools. - Kraken2 - Centrifuge @@ -280,7 +280,7 @@ nf-core/taxprofiler supports generation of Krona interactive piechart plots for In addition to per-sample profiles, the pipeline also supports generation of 'native' multi-sample taxonomic profiles (i.e., those generated by the taxonomic profiling tools themselves or additional utility scripts provided by the tool authors). -This are executed on a per-database level. I.e., you will get a multi-sample taxon table for each database you provide for each tool and will be placed in the same directory as the directories containing the per-sample profiles. +These are executed on a per-database level. I.e., you will get a multi-sample taxon table for each database you provide for each tool and will be placed in the same directory as the directories containing the per-sample profiles. The following tools will produce multi-sample taxon tables: @@ -503,7 +503,7 @@ The following tutorials assumes you already have the tool available (e.g. instal #### Bracken custom database -Bracken does not require an indepndent database construction, but rather builds upon Kraken2 databases. See [Kraken2](#kraken2-custom-database) for more information on how to build these. +Bracken does not require an independent database construction, but rather builds upon Kraken2 databases. See [Kraken2](#kraken2-custom-database) for more information on how to build these. In addition to a Kraken2 database, you also need to have the (average) read lengths (in bp) of your sequencing experiment, the K-mer size used to build the Kraken2 database, and Kraken2 available on your machine. @@ -536,7 +536,7 @@ You can follow Bracken [tutorial](https://ccb.jhu.edu/software/bracken/index.sht To build a custom Centrifuge database, a user needs to download taxonomy files, make a custom `seqid2taxid.map` and combine the fasta files together. -In total You need four components: a tab-separated file mapping sequence IDs to taxonomy IDs (`--conversion-table`), a tab-separated file mapping taxonomy IDs to their parents and rank, up to the root of the tree (`--taxonomy-tree`), a pipe-separated file mapping taxonomy IDs to a name (`--name-table`), and the reference sequences. +In total, you need four components: a tab-separated file mapping sequence IDs to taxonomy IDs (`--conversion-table`), a tab-separated file mapping taxonomy IDs to their parents and rank, up to the root of the tree (`--taxonomy-tree`), a pipe-separated file mapping taxonomy IDs to a name (`--name-table`), and the reference sequences. An example of custom `seqid2taxid.map`: @@ -596,7 +596,7 @@ A detailed description can be found [here](https://github.com/bbuchfink/diamond/ #### Kaiju custom database -To build a kaiju database, you need three components: a FASTA file with the protein sequences (the headers are the numeric NCBI taxon identifiers of the protein sequences), and you need to define the uppercase characters of the standard 20 amino acids you wish to include. +To build a kaiju database, you need two components: a FASTA file with the protein sequences (the headers are the numeric NCBI taxon identifiers of the protein sequences), and you need to define the uppercase characters of the standard 20 amino acids you wish to include. ```bash kaiju-mkbwt -a ACDEFGHIKLMNPQRSTVWY -o proteins proteins.faa From 6e4369526439c682d651814389bed52d65b6dae3 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Jan 2023 08:55:23 +0100 Subject: [PATCH 07/17] Apply suggestions from code review Co-authored-by: Sofia Stamouli <91951607+sofstam@users.noreply.github.com> --- docs/usage.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 51ce004..64f5cdb 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -66,7 +66,7 @@ An [example samplesheet](../assets/samplesheet.csv) has been provided with the p nf-core/taxprofiler supports multiple databases being classified/profiled against in parallel for each tool. Databases can be supplied either in the form of a compressed `.tar.gz` archive of a directory containing all relevant database files or the path to a directory on the filesystem. -The pipeline takes the locations and specific classification/profiling parameters of the tool of these databases as input via a four column comma-separated sheet. +The pipeline takes the paths and specific classification/profiling parameters of the tool of these databases as input via a four column comma-separated sheet. > ⚠️ nf-core/taxprofiler does not provide any databases by default, nor does it currently generate them for you. This must be performed manually by the user. See below for more information of the expected database files. @@ -155,7 +155,7 @@ There are currently two options for short-read preprocessing: [`fastp`](https:// For adapter clipping, you can either rely on the tool's default adapter sequences, or supply your own adapters (`--shortread_qc_adapter1` and `--shortread_qc_adapter2`) By default, paired-end merging is not activated. In this case paired-end 'alignment' against the reference databases is performed where supported, and if not, supported pairs will be independently classified/profiled. If paired-end merging is activated you can also specify whether to include unmerged reads in the reads sent for classification/profiling (`--shortread_qc_mergepairs` and `--shortread_qc_includeunmerged`). You can also turn off clipping and only perform paired-end merging, if requested. This can be useful when processing data downloaded from the ENA, SRA, or DDBJ (`--shortread_qc_skipadaptertrim`). -Both tools support length filtering of reads and can be tuned with `--shortread_qc_minlength`. Performing length filtering can be useful to remove short (often low sequencing complexity) sequences that result in unspecific classification and therefore slow down runtime during classificationprofiling, with minimal gain. +Both tools support length filtering of reads and can be tuned with `--shortread_qc_minlength`. Performing length filtering can be useful to remove short (often low sequencing complexity) sequences that result in unspecific classification and therefore slow down runtime during classification/profiling, with minimal gain. There is currently one option for long-read Oxford Nanopore processing: [`porechop`](https://github.com/rrwick/Porechop). @@ -183,7 +183,7 @@ Removal of possible-host reads from FASTQ files prior classification/profiling c Similarly to complexity filtering, host-removal can be useful for runtime optimisation and reduction in misclassified reads. It is not always necessary to report classification of reads from a host when you already know the host of the sample, therefore you can gain a run-time and computational advantage by removing these prior typically resource-heavy classification/profiling with more efficient methods. Furthermore, particularly with human samples, you can reduce the number of false positives during classification/profiling that occur due to host-sequence contamination in reference genomes on public databases. -nf-core/taxprofiler currently offers host-removal via alignment against a reference genome with Bowtie2, and the use of the unaligned reads for downstream classification/profiling. +nf-core/taxprofiler currently offers host-removal via alignment against a reference genome with Bowtie2 for short reads and minimap2 for long reads, and the use of the unaligned reads for downstream classification/profiling. You can supply your reference genome in FASTA format with `--hostremoval_reference`. You can also optionally supply a directory containing pre-indexed Bowtie2 index files with `--shortread_hostremoval_index` or a minimap2 `.mmi` file for `--longread_hostremoval_index`, however nf-core/taxprofiler will generate these for you if necessary. Pre-supplying the index directory or files can greatly speed up the process, and these can be re-used. @@ -201,7 +201,7 @@ You can optionally save the FASTQ output of the run merging with the `--save_run #### Classification and Profiling -The following suggestion gives you some tips and suggestions regarding running some of the different tools specifically _within the pipeline_. +The following sections gives you some tips and suggestions regarding running some of the different tools specifically _within the pipeline_. An important distinction between the different tools in included in the pipeline is classification versus profiling. Taxonomic _classification_ is concerned with simply detecting the presence of species in a given sample. Taxonomic _profiling_ involves additionally estimating the _abundance_ of each species. From 2d646285524cd17b203a69680a198bfbf79b227f Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Fri, 20 Jan 2023 13:33:43 +0100 Subject: [PATCH 08/17] Fix left-over warns from loca modules --- modules/local/ensure_fastq_extension.nf | 2 +- modules/local/kraken2_standard_report.nf | 2 +- modules/local/krona_cleanup.nf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/local/ensure_fastq_extension.nf b/modules/local/ensure_fastq_extension.nf index 6de223b..034c9bb 100644 --- a/modules/local/ensure_fastq_extension.nf +++ b/modules/local/ensure_fastq_extension.nf @@ -2,7 +2,7 @@ process ENSURE_FASTQ_EXTENSION { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "conda-forge::bash=5.0" : null) + conda "conda-forge::bash=5.0 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv2/biocontainers_v1.2.0_cv2.img' : 'biocontainers/biocontainers:v1.2.0_cv2' }" diff --git a/modules/local/kraken2_standard_report.nf b/modules/local/kraken2_standard_report.nf index 09a98c1..4169c3a 100644 --- a/modules/local/kraken2_standard_report.nf +++ b/modules/local/kraken2_standard_report.nf @@ -2,7 +2,7 @@ process KRAKEN2_STANDARD_REPORT { tag "$meta.id" label 'process_single' - conda (params.enable_conda ? 'conda-forge::sed=4.8' : null) + conda "conda-forge::sed=4.8" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv2/biocontainers_v1.2.0_cv2.img' : 'biocontainers/biocontainers:v1.2.0_cv2' }" diff --git a/modules/local/krona_cleanup.nf b/modules/local/krona_cleanup.nf index 804cb69..f13dcc8 100644 --- a/modules/local/krona_cleanup.nf +++ b/modules/local/krona_cleanup.nf @@ -2,7 +2,7 @@ process KRONA_CLEANUP { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "conda-forge::sed=4.7" : null) + conda "conda-forge::sed=4.7" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : 'biocontainers/biocontainers:v1.2.0_cv1' }" From cac6f54d2d67b64e23e591813678f052afe20406 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Fri, 20 Jan 2023 13:36:17 +0100 Subject: [PATCH 09/17] [extra] Fix warn related to recently changed parameter --- workflows/taxprofiler.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/taxprofiler.nf b/workflows/taxprofiler.nf index d1693be..7a09573 100644 --- a/workflows/taxprofiler.nf +++ b/workflows/taxprofiler.nf @@ -29,7 +29,7 @@ if ( params.input ) { if (params.databases) { ch_databases = file(params.databases, checkIfExists: true) } else { exit 1, 'Input database sheet not specified!' } -if (params.shortread_qc_mergepairs && params.run_malt ) log.warn "[nf-core/taxprofiler] MALT does not accept uncollapsed paired-reads. Pairs will be profiled as separate files." +if (!params.shortread_qc_mergepairs && params.run_malt ) log.warn "[nf-core/taxprofiler] MALT does not accept uncollapsed paired-reads. Pairs will be profiled as separate files." if (params.shortread_qc_includeunmerged && !params.shortread_qc_mergepairs) exit 1, "ERROR: [nf-core/taxprofiler] cannot include unmerged reads when merging is not turned on. Please specify --shortread_qc_mergepairs" if (params.shortread_complexityfilter_tool == 'fastp' && ( params.perform_shortread_qc == false || params.shortread_qc_tool != 'fastp' )) exit 1, "ERROR: [nf-core/taxprofiler] cannot use fastp complexity filtering if preprocessing not turned on and/or tool is not fastp. Please specify --perform_shortread_qc and/or --shortread_qc_tool 'fastp'" From 606ffc0eb1a7385c2aaea4b4d3ebc5dbe721614c Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Fri, 20 Jan 2023 13:40:59 +0100 Subject: [PATCH 10/17] Remove platform specificity for MALT --- subworkflows/local/profiling.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/subworkflows/local/profiling.nf b/subworkflows/local/profiling.nf index 6613648..4b4952c 100644 --- a/subworkflows/local/profiling.nf +++ b/subworkflows/local/profiling.nf @@ -67,7 +67,6 @@ workflow PROFILING { // MALT: We groupTuple to have all samples in one channel for MALT as database // loading takes a long time, so we only want to run it once per database ch_input_for_malt = ch_input_for_profiling.malt - .filter { it[0]['instrument_platform'] == 'ILLUMINA' } .map { meta, reads, db_meta, db -> From 2439aa69d0195ca9a72893c8e4b0dc1a3112d243 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 24 Jan 2023 10:58:03 +0100 Subject: [PATCH 11/17] Use specific samplesheet for MALT without LR reads due to GHA memory limits --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a26c28b..ea98e78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -169,5 +169,5 @@ jobs: - name: Run pipeline with test data uses: Wandalen/wretry.action@v1.0.11 with: - command: nextflow run ${GITHUB_WORKSPACE} -profile test_nothing,docker --run_malt --outdir ./results + command: nextflow run ${GITHUB_WORKSPACE} -profile test_nothing,docker --run_malt --input 'https://github.com/nf-core/test-datasets/raw/taxprofiler/samplesheet_shortreadsonly.csv' --outdir ./results attempt_limit: 3 From 085d9e519cb91ace783ca33fb1e6ed47a0bff9c9 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 24 Jan 2023 11:39:37 +0100 Subject: [PATCH 12/17] [skip ci] add comment about recommendation to split SR/LR --- docs/usage.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index 3a4e55c..158cfab 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -64,6 +64,8 @@ ERR3201952,ERR3201952,OXFORD_NANOPORE,///fastq/ERR3201952.fastq.gz,, > ⚠️ Input FASTQ and FASTA files _must_ be gzipped +> ⚠️ While one can include both short-read and long-read data in one run, we recommend that you split these across _two_ pipeline runs and database sheets (see below). This will allow classification optmisation for each data type, and make MultiQC run-reports more readable (due to run statististics having vary large number differences). + | Column | Description | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sample` | Unique sample name [required]. | From 920583127347356b25b5a8a3b14db31100687100 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 24 Jan 2023 11:50:10 +0100 Subject: [PATCH 13/17] Start adding filter for long read and MP3 --- subworkflows/local/profiling.nf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subworkflows/local/profiling.nf b/subworkflows/local/profiling.nf index 6613648..38936eb 100644 --- a/subworkflows/local/profiling.nf +++ b/subworkflows/local/profiling.nf @@ -202,8 +202,11 @@ workflow PROFILING { ch_input_for_metaphlan3 = ch_input_for_profiling.metaphlan3 .filter{ - if (it[0].is_fasta) log.warn "[nf-core/taxprofiler] MetaPhlAn3 currently does not accept FASTA files as input. Skipping MetaPhlAn3 for sample ${it[0].id}." - !it[0].is_fasta + meta, report -> + if (meta.is_fasta) log.warn "[nf-core/taxprofiler] MetaPhlAn3 currently does not accept FASTA files as input. Skipping MetaPhlAn3 for sample ${meta.id}." + !meta.is_fasta + if ( meta['instrument_platform'] == 'OXFORD_NANOPORE' ) log.warn "[nf-core/taxprofiler] MetaPhlAn3 has not been evaluated for Nanopore data. Skipping MetaPhlAn3 for sample ${meta.id}." + meta['tool'] == 'metaphlan3' && meta['instrument_platform'] != 'OXFORD_NANOPORE' } .multiMap { it -> From 9cf2d8763f25ef4d9c9e20e7db425a841e593c4e Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 24 Jan 2023 11:50:58 +0100 Subject: [PATCH 14/17] [skip ci] Update docs/usage.md Co-authored-by: Sofia Stamouli <91951607+sofstam@users.noreply.github.com> --- docs/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index 158cfab..d37ba60 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -64,7 +64,7 @@ ERR3201952,ERR3201952,OXFORD_NANOPORE,///fastq/ERR3201952.fastq.gz,, > ⚠️ Input FASTQ and FASTA files _must_ be gzipped -> ⚠️ While one can include both short-read and long-read data in one run, we recommend that you split these across _two_ pipeline runs and database sheets (see below). This will allow classification optmisation for each data type, and make MultiQC run-reports more readable (due to run statististics having vary large number differences). +> ⚠️ While one can include both short-read and long-read data in one run, we recommend that you split these across _two_ pipeline runs and database sheets (see below). This will allow classification optimisation for each data type, and make MultiQC run-reports more readable (due to run statistics having vary large number differences). | Column | Description | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 0358489be0f4098b1f2cee1a9c396f5a37cd08e3 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 24 Jan 2023 13:05:52 +0100 Subject: [PATCH 15/17] Remove metaphlan profiling for nanopore as it appears to always result in 100% unclassified --- subworkflows/local/profiling.nf | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/subworkflows/local/profiling.nf b/subworkflows/local/profiling.nf index 38936eb..f6eddb0 100644 --- a/subworkflows/local/profiling.nf +++ b/subworkflows/local/profiling.nf @@ -202,11 +202,8 @@ workflow PROFILING { ch_input_for_metaphlan3 = ch_input_for_profiling.metaphlan3 .filter{ - meta, report -> - if (meta.is_fasta) log.warn "[nf-core/taxprofiler] MetaPhlAn3 currently does not accept FASTA files as input. Skipping MetaPhlAn3 for sample ${meta.id}." - !meta.is_fasta - if ( meta['instrument_platform'] == 'OXFORD_NANOPORE' ) log.warn "[nf-core/taxprofiler] MetaPhlAn3 has not been evaluated for Nanopore data. Skipping MetaPhlAn3 for sample ${meta.id}." - meta['tool'] == 'metaphlan3' && meta['instrument_platform'] != 'OXFORD_NANOPORE' + if (it[0].is_fasta || it[0].instrument_platform == 'OXFORD_NANOPORE' ) log.warn "[nf-core/taxprofiler] MetaPhlAn3 currently does not accept FASTA files as input and/or has not been evaluated for Nanopore data. Skipping MetaPhlAn3 for sample ${it[0].id}." + !(it[0].is_fasta || it[0].instrument_platform == 'OXFORD_NANOPORE') } .multiMap { it -> From 14826d52056b6251f68b50d6bc605f89d8294230 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 24 Jan 2023 13:20:58 +0100 Subject: [PATCH 16/17] Separate conditions, remove some left-over dumps --- subworkflows/local/db_check.nf | 2 +- subworkflows/local/profiling.nf | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/subworkflows/local/db_check.nf b/subworkflows/local/db_check.nf index a89b519..96ae7a1 100644 --- a/subworkflows/local/db_check.nf +++ b/subworkflows/local/db_check.nf @@ -40,7 +40,7 @@ workflow DB_CHECK { } //Filter the channel to run untar on DBs of tools actually using - ch_input_untar = ch_dbs_for_untar.untar.dump() + ch_input_untar = ch_dbs_for_untar.untar .filter { params.run_kraken2 && it[0]['tool'] == 'kraken2' || params.run_centrifuge && it[0]['tool'] == 'centrifuge' || params.run_bracken && it[0]['tool'] == 'bracken' || params.run_kaiju && it[0]['tool'] == 'kaiju' || params.run_krakenuniq && it [0]['tool'] == 'krakenuniq' || params.run_malt && it[0]['tool'] == 'malt' || params.run_metaphlan3 && it[0]['tool'] == 'metaphlan3' } UNTAR (ch_input_untar) ch_versions = ch_versions.mix(UNTAR.out.versions.first()) diff --git a/subworkflows/local/profiling.nf b/subworkflows/local/profiling.nf index f6eddb0..accab37 100644 --- a/subworkflows/local/profiling.nf +++ b/subworkflows/local/profiling.nf @@ -202,8 +202,10 @@ workflow PROFILING { ch_input_for_metaphlan3 = ch_input_for_profiling.metaphlan3 .filter{ - if (it[0].is_fasta || it[0].instrument_platform == 'OXFORD_NANOPORE' ) log.warn "[nf-core/taxprofiler] MetaPhlAn3 currently does not accept FASTA files as input and/or has not been evaluated for Nanopore data. Skipping MetaPhlAn3 for sample ${it[0].id}." - !(it[0].is_fasta || it[0].instrument_platform == 'OXFORD_NANOPORE') + if (it[0].is_fasta) log.warn "[nf-core/taxprofiler] MetaPhlAn3 currently does not accept FASTA files as input. Skipping MetaPhlAn3 for sample ${it[0].id}." + !it[0].is_fasta + if (it[0].instrument_platform == 'OXFORD_NANOPORE') log.warn "[nf-core/taxprofiler] MetaPhlAn3 has not been evaluated for Nanopore data. Skipping MetaPhlAn3 for sample ${it[0].id}." + !it[0].instrument_platform == 'OXFORD_NANOPORE' } .multiMap { it -> @@ -278,14 +280,13 @@ workflow PROFILING { [[id: db_meta.db_name, single_end: meta.single_end], reads, db_meta, db] } .groupTuple(by: [0,2,3]) - .dump(tag: "krakenuniq_premultimap") .multiMap { single_meta, reads, db_meta, db -> reads: [ single_meta + db_meta, reads.flatten() ] db: db } // Hardcode to _always_ produce the report file (which is our basic otput, and goes into) - KRAKENUNIQ_PRELOADEDKRAKENUNIQ ( ch_input_for_krakenuniq.reads.dump(tag: "krakenuniq_input"), ch_input_for_krakenuniq.db.dump(tag: "krakenuniq_db"), params.krakenuniq_ram_chunk_size, params.krakenuniq_save_reads, true, params.krakenuniq_save_readclassifications ) + KRAKENUNIQ_PRELOADEDKRAKENUNIQ ( ch_input_for_krakenuniq.reads, ch_input_for_krakenuniq.db, params.krakenuniq_ram_chunk_size, params.krakenuniq_save_reads, true, params.krakenuniq_save_readclassifications ) ch_multiqc_files = ch_multiqc_files.mix( KRAKENUNIQ_PRELOADEDKRAKENUNIQ.out.report ) ch_versions = ch_versions.mix( KRAKENUNIQ_PRELOADEDKRAKENUNIQ.out.versions.first() ) ch_raw_classifications = ch_raw_classifications.mix( KRAKENUNIQ_PRELOADEDKRAKENUNIQ.out.classified_assignment ) From 40f1e7b27aaa41484e4030340528302c398feeb1 Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Tue, 24 Jan 2023 14:15:51 +0100 Subject: [PATCH 17/17] fix: correct pattern to publish minimap2 index --- conf/modules.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/modules.config b/conf/modules.config index 28ede9d..30f057e 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -230,7 +230,7 @@ process { path: { "${params.outdir}/minimap2/index" }, mode: params.publish_dir_mode, enabled: params.save_hostremoval_index, - pattern: 'minimap2' + pattern: '*.mmi' ] }