├── .prettierrc.yml ├── modules ├── nf-core │ ├── fastp │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.save_failed.config │ │ │ └── nextflow.interleaved.config │ │ └── environment.yml │ ├── untar │ │ ├── tests │ │ │ ├── tags.yml │ │ │ └── main.nf.test │ │ ├── environment.yml │ │ ├── meta.yml │ │ └── main.nf │ ├── multiqc │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.config │ │ │ ├── main.nf.test.snap │ │ │ └── main.nf.test │ │ ├── environment.yml │ │ ├── main.nf │ │ └── meta.yml │ ├── xz │ │ └── decompress │ │ │ ├── tests │ │ │ ├── nextflow.config │ │ │ ├── tags.yml │ │ │ ├── main.nf.test.snap │ │ │ └── main.nf.test │ │ │ ├── environment.yml │ │ │ ├── meta.yml │ │ │ └── main.nf │ ├── samtools │ │ ├── merge │ │ │ ├── tests │ │ │ │ ├── index.config │ │ │ │ └── tags.yml │ │ │ ├── environment.yml │ │ │ ├── main.nf │ │ │ └── meta.yml │ │ ├── index │ │ │ ├── tests │ │ │ │ ├── tags.yml │ │ │ │ └── csi.nextflow.config │ │ │ ├── environment.yml │ │ │ ├── main.nf │ │ │ └── meta.yml │ │ └── sort │ │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.config │ │ │ └── nextflow_cram.config │ │ │ ├── environment.yml │ │ │ ├── samtools-sort.diff │ │ │ ├── main.nf │ │ │ └── meta.yml │ ├── bowtie2 │ │ ├── align │ │ │ ├── tests │ │ │ │ ├── tags.yml │ │ │ │ ├── sam2.config │ │ │ │ ├── sam.config │ │ │ │ ├── large_index.config │ │ │ │ └── cram_crai.config │ │ │ ├── environment.yml │ │ │ └── bowtie2-align.diff │ │ └── build │ │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── main.nf.test │ │ │ └── main.nf.test.snap │ │ │ ├── environment.yml │ │ │ ├── main.nf │ │ │ └── meta.yml │ ├── quartonotebook │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── with-parametrization.config │ │ │ └── no-parametrization.config │ │ ├── environment.yml │ │ ├── parametrize.nf │ │ ├── Dockerfile │ │ └── quartonotebook.diff │ ├── fastqc │ │ ├── environment.yml │ │ ├── meta.yml │ │ └── main.nf │ ├── kraken2 │ │ └── kraken2 │ │ │ ├── tests │ │ │ ├── tags.yml │ │ │ └── main.nf.test.snap │ │ │ ├── environment.yml │ │ │ └── meta.yml │ ├── sourcepredict │ │ ├── tests │ │ │ ├── nextflow.config │ │ │ └── main.nf.test.snap │ │ ├── environment.yml │ │ ├── main.nf │ │ └── meta.yml │ ├── sam2lca │ │ └── analyze │ │ │ ├── tests │ │ │ ├── nextflow.config │ │ │ ├── main.nf.test │ │ │ └── main.nf.test.snap │ │ │ ├── environment.yml │ │ │ ├── main.nf │ │ │ └── meta.yml │ ├── pydamage │ │ └── analyze │ │ │ ├── environment.yml │ │ │ ├── tests │ │ │ ├── main.nf.test │ │ │ └── main.nf.test.snap │ │ │ ├── main.nf │ │ │ ├── pydamage-analyze.diff │ │ │ └── meta.yml │ └── damageprofiler │ │ ├── environment.yml │ │ ├── main.nf │ │ └── meta.yml └── local │ ├── create_acc2tax │ ├── environment.yml │ └── main.nf │ ├── sam2lca │ ├── prep_db │ │ ├── environment.yml │ │ └── main.nf │ ├── updatedb │ │ ├── environment.yml │ │ ├── tests │ │ │ └── main.nf.test │ │ ├── main.nf │ │ └── meta.yml │ └── merge │ │ └── main.nf │ ├── pydamage │ └── merge │ │ └── main.nf │ ├── kraken │ ├── merge │ │ └── main.nf │ └── parse │ │ └── main.nf │ └── damageprofiler │ └── merge │ └── main.nf ├── .vscode └── settings.json ├── docs ├── images │ ├── coproid_workflow.jpg │ ├── mqc_fastqc_counts.png │ ├── mqc_fastqc_adapter.png │ ├── mqc_fastqc_quality.png │ ├── nf-core-coproid_logo_dark.png │ └── nf-core-coproid_logo_light.png └── README.md ├── assets ├── nf-core-coproid_logo_light.png ├── _extensions │ └── nf-core │ │ ├── nf-core-coproid_logo_light.png │ │ ├── toc.html │ │ └── _extension.yml ├── genomesheet.csv ├── genomesheet_full.csv ├── samplesheet.csv ├── samplesheet_full.csv ├── multiqc_config.yml ├── email_template.txt ├── sendmail_template.txt ├── schema_input.json ├── slackreport.json ├── schema_genomes.json ├── email_template.html ├── adaptivecard.json └── methods_description_template.yml ├── .gitignore ├── subworkflows ├── nf-core │ ├── utils_nfcore_pipeline │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.config │ │ │ ├── main.workflow.nf.test.snap │ │ │ └── main.workflow.nf.test │ │ └── meta.yml │ ├── utils_nextflow_pipeline │ │ ├── tests │ │ │ ├── tags.yml │ │ │ ├── nextflow.config │ │ │ ├── main.function.nf.test.snap │ │ │ ├── main.function.nf.test │ │ │ └── main.workflow.nf.test │ │ └── meta.yml │ └── utils_nfschema_plugin │ │ ├── tests │ │ ├── nextflow.config │ │ └── main.nf.test │ │ ├── meta.yml │ │ └── main.nf └── local │ ├── align_index │ └── main.nf │ ├── merge_sort_index_samtools │ └── main.nf │ ├── quarto_reporting │ └── main.nf │ ├── sam2lca_db │ └── main.nf │ ├── prepare_genome_indices │ └── main.nf │ └── kraken2_classification │ └── main.nf ├── .gitattributes ├── tower.yml ├── .github ├── .dockstore.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ └── bug_report.yml ├── workflows │ ├── linting_comment.yml │ ├── clean-up.yml │ ├── awstest.yml │ ├── release-announcements.yml │ ├── template_version_comment.yml │ ├── branch.yml │ ├── awsfulltest.yml │ ├── linting.yml │ └── ci.yml └── PULL_REQUEST_TEMPLATE.md ├── .prettierignore ├── .gitpod.yml ├── .pre-commit-config.yaml ├── .nf-core.yml ├── conf ├── igenomes_ignored.config ├── test_full.config ├── test.config └── base.config ├── .devcontainer └── devcontainer.json ├── .editorconfig ├── bin ├── create_acc2tax.py ├── sam2lca_json.py ├── pydamage_merge.py ├── sam2lca_merge.py ├── kraken_merge.py └── kraken_parse.py ├── CHANGELOG.md └── LICENSE /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | printWidth: 120 2 | -------------------------------------------------------------------------------- /modules/nf-core/fastp/tests/tags.yml: -------------------------------------------------------------------------------- 1 | fastp: 2 | - modules/nf-core/fastp/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/untar/tests/tags.yml: -------------------------------------------------------------------------------- 1 | untar: 2 | - modules/nf-core/untar/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/tests/tags.yml: -------------------------------------------------------------------------------- 1 | multiqc: 2 | - modules/nf-core/multiqc/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/xz/decompress/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | cpus = 1 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "markdown.styles": ["public/vscode_markdown.css"] 3 | } 4 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/merge/tests/index.config: -------------------------------------------------------------------------------- 1 | process { 2 | ext.args = "--write-index" 3 | } -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/tests/tags.yml: -------------------------------------------------------------------------------- 1 | bowtie2/align: 2 | - modules/nf-core/bowtie2/align/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/tests/tags.yml: -------------------------------------------------------------------------------- 1 | bowtie2/build: 2 | - modules/nf-core/bowtie2/build/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/index/tests/tags.yml: -------------------------------------------------------------------------------- 1 | samtools/index: 2 | - modules/nf-core/samtools/index/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/xz/decompress/tests/tags.yml: -------------------------------------------------------------------------------- 1 | xz/decompress: 2 | - "modules/nf-core/xz/decompress/**" 3 | -------------------------------------------------------------------------------- /modules/nf-core/quartonotebook/tests/tags.yml: -------------------------------------------------------------------------------- 1 | quartonotebook: 2 | - "modules/nf-core/quartonotebook/**" 3 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/merge/tests/tags.yml: -------------------------------------------------------------------------------- 1 | samtools/merge: 2 | - "modules/nf-core/samtools/merge/**" 3 | -------------------------------------------------------------------------------- /docs/images/coproid_workflow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/docs/images/coproid_workflow.jpg -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_counts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/docs/images/mqc_fastqc_counts.png -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/docs/images/mqc_fastqc_adapter.png -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/docs/images/mqc_fastqc_quality.png -------------------------------------------------------------------------------- /assets/nf-core-coproid_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/assets/nf-core-coproid_logo_light.png -------------------------------------------------------------------------------- /docs/images/nf-core-coproid_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/docs/images/nf-core-coproid_logo_dark.png -------------------------------------------------------------------------------- /docs/images/nf-core-coproid_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/docs/images/nf-core-coproid_logo_light.png -------------------------------------------------------------------------------- /modules/nf-core/multiqc/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: 'MULTIQC' { 3 | ext.prefix = null 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nextflow* 2 | work/ 3 | data/ 4 | results/ 5 | .DS_Store 6 | testing/ 7 | testing* 8 | *.pyc 9 | null/ 10 | .qodo 11 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/tests/sam2.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: BOWTIE2_ALIGN { 3 | ext.args2 = '-O SAM' 4 | } 5 | } -------------------------------------------------------------------------------- /modules/nf-core/fastp/tests/nextflow.save_failed.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: FASTP { 3 | ext.args = "-e 30" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /modules/nf-core/fastqc/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | dependencies: 5 | - bioconda::fastqc=0.12.1 6 | -------------------------------------------------------------------------------- /modules/nf-core/kraken2/kraken2/tests/tags.yml: -------------------------------------------------------------------------------- 1 | kraken2/kraken2: 2 | - modules/nf-core/kraken2/kraken2/** 3 | - modules/nf-core/untar/** 4 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | dependencies: 5 | - bioconda::multiqc=1.27 6 | -------------------------------------------------------------------------------- /modules/local/create_acc2tax/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | dependencies: 5 | - bioconda::sam2lca=1.1.4 6 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/tests/sam.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: BOWTIE2_ALIGN { 3 | ext.args2 = '--output-fmt SAM' 4 | } 5 | } -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/tests/large_index.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: BOWTIE2_BUILD { 3 | ext.args = '--large-index' 4 | } 5 | } -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/tests/tags.yml: -------------------------------------------------------------------------------- 1 | samtools/sort: 2 | - modules/nf-core/samtools/sort/** 3 | - tests/modules/nf-core/samtools/sort/** 4 | -------------------------------------------------------------------------------- /modules/nf-core/sourcepredict/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: 'SOURCEPREDICT' { 3 | ext.args = '-me MDS' 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/tags.yml: -------------------------------------------------------------------------------- 1 | subworkflows/utils_nfcore_pipeline: 2 | - subworkflows/nf-core/utils_nfcore_pipeline/** 3 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/tags.yml: -------------------------------------------------------------------------------- 1 | subworkflows/utils_nextflow_pipeline: 2 | - subworkflows/nf-core/utils_nextflow_pipeline/** 3 | -------------------------------------------------------------------------------- /modules/local/sam2lca/prep_db/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | dependencies: 5 | - bioconda::sam2lca=1.1.4--pyhdfd78af_0 6 | -------------------------------------------------------------------------------- /modules/nf-core/fastp/tests/nextflow.interleaved.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: FASTP { 3 | ext.args = "--interleaved_in -e 30" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /modules/nf-core/sam2lca/analyze/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName : SAM2LCA_ANALYZE { 3 | ext.args = '-a test -t test' 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/index/tests/csi.nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | 3 | withName: SAMTOOLS_INDEX { 4 | ext.args = '-c' 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /assets/_extensions/nf-core/nf-core-coproid_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/coproid/HEAD/assets/_extensions/nf-core/nf-core-coproid_logo_light.png -------------------------------------------------------------------------------- /modules/nf-core/quartonotebook/tests/with-parametrization.config: -------------------------------------------------------------------------------- 1 | profiles { 2 | docker { 3 | docker.runOptions = '-u $(id -u):$(id -g)' 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/tests/cram_crai.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: BOWTIE2_ALIGN { 3 | ext.args2 = '--output-fmt cram --write-index' 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.config linguist-language=nextflow 2 | *.nf.test linguist-language=nextflow 3 | modules/nf-core/** linguist-generated 4 | subworkflows/nf-core/** linguist-generated 5 | -------------------------------------------------------------------------------- /tower.yml: -------------------------------------------------------------------------------- 1 | reports: 2 | multiqc_report.html: 3 | display: "MultiQC HTML report" 4 | samplesheet.csv: 5 | display: "Auto-created samplesheet with collated metadata and FASTQ paths" 6 | -------------------------------------------------------------------------------- /.github/.dockstore.yml: -------------------------------------------------------------------------------- 1 | # Dockstore config version, not pipeline version 2 | version: 1.2 3 | workflows: 4 | - subclass: nfl 5 | primaryDescriptorPath: /nextflow.config 6 | publish: True 7 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | 3 | withName: SAMTOOLS_SORT { 4 | ext.prefix = { "${meta.id}.sorted" } 5 | ext.args = "--write-index" 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | email_template.html 2 | adaptivecard.json 3 | slackreport.json 4 | .nextflow* 5 | work/ 6 | data/ 7 | results/ 8 | .DS_Store 9 | testing/ 10 | testing* 11 | *.pyc 12 | bin/ 13 | ro-crate-metadata.json 14 | -------------------------------------------------------------------------------- /modules/nf-core/quartonotebook/tests/no-parametrization.config: -------------------------------------------------------------------------------- 1 | profiles { 2 | docker { 3 | docker.runOptions = '-u $(id -u):$(id -g)' 4 | } 5 | } 6 | 7 | process { 8 | ext.parametrize = false 9 | } 10 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/tests/nextflow_cram.config: -------------------------------------------------------------------------------- 1 | process { 2 | 3 | withName: SAMTOOLS_SORT { 4 | ext.prefix = { "${meta.id}.sorted" } 5 | ext.args = "--write-index --output-fmt cram" 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /modules/nf-core/xz/decompress/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - xz=5.2.6 8 | -------------------------------------------------------------------------------- /modules/nf-core/fastp/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::fastp=0.23.4 8 | -------------------------------------------------------------------------------- /modules/local/sam2lca/updatedb/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::sam2lca=1.1.4" 8 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::bowtie2=2.5.2 8 | -------------------------------------------------------------------------------- /modules/nf-core/pydamage/analyze/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::pydamage=0.70 8 | -------------------------------------------------------------------------------- /modules/nf-core/sam2lca/analyze/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::sam2lca=1.1.2 8 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "nf-schema@2.1.0" 3 | } 4 | 5 | validation { 6 | parametersSchema = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" 7 | monochromeLogs = true 8 | } -------------------------------------------------------------------------------- /modules/nf-core/damageprofiler/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::damageprofiler=1.1 8 | -------------------------------------------------------------------------------- /modules/nf-core/sourcepredict/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::sourcepredict=0.5.1 8 | -------------------------------------------------------------------------------- /assets/_extensions/nf-core/toc.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /assets/genomesheet.csv: -------------------------------------------------------------------------------- 1 | genome_name,taxid,genome_size,igenome,fasta,index 2 | Escherichia_coli,562,5000000,,https://github.com/nf-core/test-datasets/raw/coproid/genomes/ecoli/genome.fa, 3 | Bacillus_subtilis,1423,4200000,,https://github.com/nf-core/test-datasets/raw/coproid/genomes/bsubtilis/genome.fa, 4 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/index/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::htslib=1.21 8 | - bioconda::samtools=1.21 9 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/merge/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::htslib=1.21 8 | - bioconda::samtools=1.21 9 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::htslib=1.21 8 | - bioconda::samtools=1.21 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Join nf-core 3 | url: https://nf-co.re/join 4 | about: Please join the nf-core community here 5 | - name: "Slack #coproid channel" 6 | url: https://nfcore.slack.com/channels/coproid 7 | about: Discussion about the nf-core/coproid pipeline 8 | -------------------------------------------------------------------------------- /modules/nf-core/kraken2/kraken2/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::kraken2=2.1.3 8 | - coreutils=9.4 9 | - pigz=2.8 10 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: nfcore/gitpod:latest 2 | tasks: 3 | - name: Update Nextflow and setup pre-commit 4 | command: | 5 | pre-commit install --install-hooks 6 | nextflow self-update 7 | 8 | vscode: 9 | extensions: 10 | - nf-core.nf-core-extensionpack # https://github.com/nf-core/vscode-extensionpack 11 | -------------------------------------------------------------------------------- /assets/genomesheet_full.csv: -------------------------------------------------------------------------------- 1 | genome_name,taxid,genome_size,igenome,fasta,index 2 | Homo_sapiens,9606,3200000000,,s3://ngi-igenomes/igenomes/Homo_sapiens/Ensembl/GRCh37/Sequence/WholeGenomeFasta/genome.fa, 3 | Canis_familiaris,9615,2400000000,,s3://ngi-igenomes/igenomes/Canis_familiaris/UCSC/canFam3/Sequence/WholeGenomeFasta/genome.fa, 4 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - bioconda::bowtie2=2.5.2 8 | - bioconda::samtools=1.18 9 | - conda-forge::pigz=2.6 10 | -------------------------------------------------------------------------------- /assets/samplesheet.csv: -------------------------------------------------------------------------------- 1 | sample,fastq_1,fastq_2 2 | SAMPLE_BSUB,https://github.com/nf-core/test-datasets/raw/coproid/reads/metagenome.1.fastq.gz,https://github.com/nf-core/test-datasets/raw/coproid/reads/metagenome.2.fastq.gz 3 | SAMPLE_ECOLI,https://github.com/nf-core/test-datasets/raw/coproid/reads/metagenomebis.1.fastq.gz,https://github.com/nf-core/test-datasets/raw/coproid/reads/metagenomebis.2.fastq.gz 4 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | manifest { 2 | name = 'nextflow_workflow' 3 | author = """nf-core""" 4 | homePage = 'https://127.0.0.1' 5 | description = """Dummy pipeline""" 6 | nextflowVersion = '!>=24.04.0' 7 | version = '9.9.9' 8 | doi = 'https://doi.org/10.5281/zenodo.5070524' 9 | } 10 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | manifest { 2 | name = 'nextflow_workflow' 3 | author = """nf-core""" 4 | homePage = 'https://127.0.0.1' 5 | description = """Dummy pipeline""" 6 | nextflowVersion = '!>=24.04.0' 7 | version = '9.9.9' 8 | doi = 'https://doi.org/10.5281/zenodo.5070524' 9 | } 10 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/mirrors-prettier 3 | rev: "v3.1.0" 4 | hooks: 5 | - id: prettier 6 | additional_dependencies: 7 | - prettier@3.2.5 8 | 9 | - repo: https://github.com/editorconfig-checker/editorconfig-checker.python 10 | rev: "3.1.2" 11 | hooks: 12 | - id: editorconfig-checker 13 | alias: ec 14 | -------------------------------------------------------------------------------- /assets/samplesheet_full.csv: -------------------------------------------------------------------------------- 1 | sample,fastq_1,fastq_2 2 | ERR3201918,s3://ngi-igenomes/test-data/mag/ERR3201918_1.fastq.gz,s3://ngi-igenomes/test-data/mag/ERR3201918_2.fastq.gz 3 | ERR3201928,s3://ngi-igenomes/test-data/mag/ERR3201928_1.fastq.gz,s3://ngi-igenomes/test-data/mag/ERR3201928_2.fastq.gz 4 | ERR3201914,s3://ngi-igenomes/test-data/mag/ERR3201914_1.fastq.gz,s3://ngi-igenomes/test-data/mag/ERR3201914_2.fastq.gz 5 | -------------------------------------------------------------------------------- /modules/nf-core/untar/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - conda-forge::coreutils=9.5 8 | - conda-forge::grep=3.11 9 | - conda-forge::gzip=1.13 10 | - conda-forge::lbzip2=2.5 11 | - conda-forge::sed=4.8 12 | - conda-forge::tar=1.34 13 | -------------------------------------------------------------------------------- /.nf-core.yml: -------------------------------------------------------------------------------- 1 | lint: 2 | files_unchanged: 3 | - docs/images/nf-core-coproid_logo_light.png 4 | - docs/images/nf-core-coproid_logo_dark.png 5 | nf_core_version: 3.2.0 6 | repository_type: pipeline 7 | template: 8 | author: Maxime Borry & Meriam Van Os 9 | description: " COPROlite host IDentification " 10 | force: false 11 | is_nfcore: true 12 | name: coproid 13 | org: nf-core 14 | outdir: . 15 | skip_features: [] 16 | version: 2.0.0 17 | -------------------------------------------------------------------------------- /conf/igenomes_ignored.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for iGenomes paths 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Empty genomes dictionary to use when igenomes is ignored. 6 | ---------------------------------------------------------------------------------------- 7 | */ 8 | 9 | params.genomes = [:] 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for the nf-core/coproid pipeline 3 | labels: enhancement 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Description of feature 9 | description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered. 10 | validations: 11 | required: true 12 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Should run without failures": { 3 | "content": [ 4 | { 5 | "0": [ 6 | true 7 | ], 8 | "valid_config": [ 9 | true 10 | ] 11 | } 12 | ], 13 | "meta": { 14 | "nf-test": "0.8.4", 15 | "nextflow": "23.10.1" 16 | }, 17 | "timestamp": "2024-02-28T12:03:25.726491" 18 | } 19 | } -------------------------------------------------------------------------------- /modules/nf-core/quartonotebook/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | # renovate: datasource=conda depName=conda-forge/quarto 8 | # FIXME https://github.com/nf-core/modules/issues/7006 9 | - conda-forge::jupyter=1.0.0 10 | - conda-forge::matplotlib=3.4.3 11 | - conda-forge::papermill=2.4.0 12 | - conda-forge::quarto=1.5.57 13 | - conda-forge::r-rmarkdown=2.25 14 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # nf-core/coproid: Documentation 2 | 3 | The nf-core/coproid documentation is split into the following pages: 4 | 5 | - [Usage](usage.md) 6 | - An overview of how the pipeline works, how to run it and a description of all of the different command-line flags. 7 | - [Output](output.md) 8 | - An overview of the different results produced by the pipeline and how to interpret them. 9 | 10 | You can find a lot more documentation about installing, configuring and running nf-core pipelines on the website: [https://nf-co.re](https://nf-co.re) 11 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Test Function getWorkflowVersion": { 3 | "content": [ 4 | "v9.9.9" 5 | ], 6 | "meta": { 7 | "nf-test": "0.8.4", 8 | "nextflow": "23.10.1" 9 | }, 10 | "timestamp": "2024-02-28T12:02:05.308243" 11 | }, 12 | "Test Function checkCondaChannels": { 13 | "content": null, 14 | "meta": { 15 | "nf-test": "0.8.4", 16 | "nextflow": "23.10.1" 17 | }, 18 | "timestamp": "2024-02-28T12:02:12.425833" 19 | } 20 | } -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "UTILS_NFCORE_PIPELINE" 3 | description: Subworkflow with utility functions specific to the nf-core pipeline template 4 | keywords: 5 | - utility 6 | - pipeline 7 | - initialise 8 | - version 9 | components: [] 10 | input: 11 | - nextflow_cli_args: 12 | type: list 13 | description: | 14 | Nextflow CLI positional arguments 15 | output: 16 | - success: 17 | type: boolean 18 | description: | 19 | Dummy output to indicate success 20 | authors: 21 | - "@adamrtalbot" 22 | maintainers: 23 | - "@adamrtalbot" 24 | - "@maxulysse" 25 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nfcore", 3 | "image": "nfcore/gitpod:latest", 4 | "remoteUser": "gitpod", 5 | "runArgs": ["--privileged"], 6 | 7 | // Configure tool-specific properties. 8 | "customizations": { 9 | // Configure properties specific to VS Code. 10 | "vscode": { 11 | // Set *default* container specific settings.json values on container create. 12 | "settings": { 13 | "python.defaultInterpreterPath": "/opt/conda/bin/python" 14 | }, 15 | 16 | // Add the IDs of extensions you want installed when the container is created. 17 | "extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"] 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /assets/_extensions/nf-core/_extension.yml: -------------------------------------------------------------------------------- 1 | title: nf-core Quarto Extension 2 | author: Maxime Borry and Meriam van Os 3 | version: 2.0.0 4 | quarto-required: ">=1.2.0" 5 | contributes: 6 | formats: 7 | html: 8 | code-fold: true 9 | df-print: paged 10 | embed-resources: true 11 | highlight-style: nf-core.theme 12 | smooth-scroll: true 13 | theme: [default, nf-core.scss] 14 | toc: true 15 | toc-image: nf-core-coproid_logo_light.png 16 | toc-location: left 17 | template-partials: 18 | - toc.html 19 | revealjs: 20 | code-line-numbers: false 21 | embed-resources: true 22 | logo: nf-core-coproid_logo_light.png 23 | slide-level: 2 24 | slide-number: false 25 | theme: [default, nf-core.scss] 26 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process BOWTIE2_BUILD" 4 | script "modules/nf-core/bowtie2/build/main.nf" 5 | process "BOWTIE2_BUILD" 6 | tag "modules" 7 | tag "modules_nfcore" 8 | tag "bowtie2" 9 | tag "bowtie2/build" 10 | 11 | test("Should run without failures") { 12 | 13 | when { 14 | process { 15 | """ 16 | input[0] = [ 17 | [ id:'test' ], 18 | file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) 19 | ] 20 | """ 21 | } 22 | } 23 | 24 | then { 25 | assert process.success 26 | assert snapshot(process.out).match() 27 | } 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_workflow { 2 | 3 | name "Test Workflow UTILS_NFCORE_PIPELINE" 4 | script "../main.nf" 5 | config "subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config" 6 | workflow "UTILS_NFCORE_PIPELINE" 7 | tag "subworkflows" 8 | tag "subworkflows_nfcore" 9 | tag "utils_nfcore_pipeline" 10 | tag "subworkflows/utils_nfcore_pipeline" 11 | 12 | test("Should run without failures") { 13 | 14 | when { 15 | workflow { 16 | """ 17 | input[0] = [] 18 | """ 19 | } 20 | } 21 | 22 | then { 23 | assertAll( 24 | { assert workflow.success }, 25 | { assert snapshot(workflow.out).match() } 26 | ) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /assets/multiqc_config.yml: -------------------------------------------------------------------------------- 1 | report_comment: > 2 | This report has been generated by the nf-core/coproid 3 | analysis pipeline. For information about how to interpret these results, please see the 4 | documentation. 5 | report_section_order: 6 | general_stats: 7 | order: 1000 8 | fastqc: 9 | order: 900 10 | fastp: 11 | order: 750 12 | bowtie2: 13 | order: 700 14 | kraken: 15 | order: 650 16 | damageprofiler: 17 | order: 600 18 | mapdamage: 19 | order: 550 20 | "nf-core-coproid-methods-description": 21 | order: -1000 22 | software_versions: 23 | order: -1001 24 | "nf-core-coproid-summary": 25 | order: -1002 26 | 27 | export_plots: true 28 | 29 | disable_version_detection: true 30 | -------------------------------------------------------------------------------- /modules/local/sam2lca/updatedb/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process SAM2LCA_UPDATEDB" 4 | script "../main.nf" 5 | process "SAM2LCA_UPDATEDB" 6 | 7 | tag "modules" 8 | tag "modules_nfcore" 9 | tag "sam2lca" 10 | tag "sam2lca/updatedb" 11 | 12 | test("test-sam2lca-updatedb - test dataset") { 13 | when { 14 | process { 15 | """ 16 | input[0] = 'test' 17 | input[1] = 'test' 18 | input[2] = [] 19 | input[3] = [] 20 | input[4] = [] 21 | input[5] = [] 22 | input[6] = [] 23 | input[7] = [] 24 | """ 25 | } 26 | } 27 | 28 | then { 29 | assertAll( 30 | { assert process.success } 31 | ) 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /subworkflows/local/align_index/main.nf: -------------------------------------------------------------------------------- 1 | include { BOWTIE2_ALIGN } from '../../../modules/nf-core/bowtie2/align/main' 2 | include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' 3 | 4 | workflow ALIGN_INDEX { 5 | take: 6 | reads_genomes 7 | 8 | main: 9 | ch_versions = Channel.empty() 10 | BOWTIE2_ALIGN ( 11 | reads_genomes, 12 | true, 13 | true 14 | ) 15 | 16 | SAMTOOLS_INDEX(BOWTIE2_ALIGN.out.bam) 17 | 18 | ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions.first()) 19 | ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) 20 | 21 | emit: 22 | bam = BOWTIE2_ALIGN.out.bam 23 | bai = SAMTOOLS_INDEX.out.bai 24 | fastq = BOWTIE2_ALIGN.out.fastq 25 | versions = ch_versions 26 | multiqc_files = BOWTIE2_ALIGN.out.log 27 | } 28 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_size = 4 9 | indent_style = space 10 | 11 | [*.{md,yml,yaml,html,css,scss,js}] 12 | indent_size = 2 13 | 14 | # These files are edited and tested upstream in nf-core/modules 15 | [/modules/nf-core/**] 16 | charset = unset 17 | end_of_line = unset 18 | insert_final_newline = unset 19 | trim_trailing_whitespace = unset 20 | indent_style = unset 21 | [/subworkflows/nf-core/**] 22 | charset = unset 23 | end_of_line = unset 24 | insert_final_newline = unset 25 | trim_trailing_whitespace = unset 26 | indent_style = unset 27 | 28 | [/assets/email*] 29 | indent_size = unset 30 | 31 | # ignore python and markdown 32 | [*.{py,md}] 33 | indent_style = unset 34 | 35 | # ignore quarto markdown report 36 | [*.{py,md,qmd}] 37 | indent_style = unset 38 | end_of_line = unset 39 | insert_final_newline = unset 40 | 41 | # ignore ro-crate metadata files 42 | [**/ro-crate-metadata.json] 43 | insert_final_newline = unset 44 | -------------------------------------------------------------------------------- /subworkflows/local/merge_sort_index_samtools/main.nf: -------------------------------------------------------------------------------- 1 | include { SAMTOOLS_MERGE } from '../../../modules/nf-core/samtools/merge/main' 2 | include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' 3 | include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' 4 | 5 | workflow MERGE_SORT_INDEX_SAMTOOLS { 6 | take: 7 | ch_bam // [val(meta), [bams]] 8 | main: 9 | 10 | ch_versions = Channel.empty() 11 | 12 | SAMTOOLS_MERGE( 13 | ch_bam, 14 | [[],[]], 15 | [[],[]] 16 | ) 17 | 18 | SAMTOOLS_SORT ( SAMTOOLS_MERGE.out.bam, 19 | [[],[]] 20 | ) 21 | SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) 22 | 23 | ch_versions = ch_versions.mix(SAMTOOLS_MERGE.out.versions.first()) 24 | ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) 25 | ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) 26 | 27 | emit: 28 | bam = SAMTOOLS_SORT.out.bam 29 | bai = SAMTOOLS_INDEX.out.bai 30 | versions = ch_versions 31 | } 32 | -------------------------------------------------------------------------------- /.github/workflows/linting_comment.yml: -------------------------------------------------------------------------------- 1 | name: nf-core linting comment 2 | # This workflow is triggered after the linting action is complete 3 | # It posts an automated comment to the PR, even if the PR is coming from a fork 4 | 5 | on: 6 | workflow_run: 7 | workflows: ["nf-core linting"] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Download lint results 14 | uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8 15 | with: 16 | workflow: linting.yml 17 | workflow_conclusion: completed 18 | 19 | - name: Get PR number 20 | id: pr_number 21 | run: echo "pr_number=$(cat linting-logs/PR_number.txt)" >> $GITHUB_OUTPUT 22 | 23 | - name: Post PR comment 24 | uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2 25 | with: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | number: ${{ steps.pr_number.outputs.pr_number }} 28 | path: linting-logs/lint_results.md 29 | -------------------------------------------------------------------------------- /modules/nf-core/pydamage/analyze/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_process { 3 | 4 | name "Test Process PYDAMAGE_ANALYZE" 5 | script "../main.nf" 6 | process "PYDAMAGE_ANALYZE" 7 | 8 | tag "modules" 9 | tag "modules_nfcore" 10 | tag "pydamage" 11 | tag "pydamage/analyze" 12 | 13 | test("test-pydamage") { 14 | 15 | when { 16 | process { 17 | """ 18 | input[0] = [ 19 | [ id:'test', single_end:false ], // meta map 20 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), 21 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) 22 | ] 23 | 24 | """ 25 | } 26 | } 27 | 28 | then { 29 | assertAll( 30 | { assert process.success }, 31 | { assert snapshot(process.out).match() } 32 | ) 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /bin/create_acc2tax.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Written by Maxime Borry, released under the MIT license 4 | # See https://opensource.org/license/mit for details 5 | 6 | """Create an acc2tax mapping file from a genome FASTA.""" 7 | 8 | import argparse 9 | import pysam 10 | from pathlib import Path 11 | 12 | def parse_args(): 13 | parser = argparse.ArgumentParser("Create acc2tax file") 14 | parser.add_argument("genome", type=Path, help="Path to genome file") 15 | parser.add_argument("-t", type=int, dest="taxid", help="taxid") 16 | 17 | return parser.parse_args() 18 | 19 | 20 | def acc2tax(genome, taxid): 21 | entry_dict = dict() 22 | with pysam.FastxFile(genome) as fh: 23 | for entry in fh: 24 | entry_dict[entry.name] = [entry.name.split(".")[0], taxid] 25 | with open(f"{taxid}.accession2taxid", "w") as fh: 26 | fh.write("accession\taccession.version\ttaxid\n") 27 | for k, v in entry_dict.items(): 28 | fh.write(f"{v[0]}\t{k}\t{v[1]}\n") 29 | 30 | 31 | if __name__ == "__main__": 32 | args = parse_args() 33 | acc2tax(args.genome, args.taxid) 34 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # nf-core/coproid: Changelog 2 | 3 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) 4 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 5 | 6 | ## v2.0.0 - 22/05/2025 7 | 8 | nf-core/coproid v2.0 is based on [nf-core](https://nf-co.re/) DSL2 template. 9 | This release is a complete rewrite of the original nf-core/coproid pipeline, originally written in Nextflow DSL1. It also includes new features, and/or updated tools. 10 | 11 | ### Changed: 12 | 13 | - DSL2 rewrite 14 | - fastp replaced AdapterRemoval for read quality trimming/merging. 15 | - sam2lca is now used for computing the endogenous host DNA quantity, instead of custom python scripts, allowing for handling more flexibly test host genomes. 16 | - Pipeline reporting is now performed using Quarto, instead of Jupyter notebook 17 | - Minor JSON schema updates 18 | 19 | ### New 20 | 21 | - aDNA damage testing using PyDamage 22 | - Interactive plots in report 23 | - Unit testing of most modules in the pipeline. 24 | 25 | ### `Added` 26 | 27 | ### `Fixed` 28 | 29 | ### `Dependencies` 30 | 31 | ### `Deprecated` 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) The nf-core/coproid team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /modules/local/create_acc2tax/main.nf: -------------------------------------------------------------------------------- 1 | process CREATE_ACC2TAX { 2 | tag "${meta.genome_name}" 3 | label 'process_short' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/sam2lca:1.1.4--pyhdfd78af_0' : 8 | 'biocontainers/sam2lca:1.1.4--pyhdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | path("*.accession2taxid"), emit: acc2tax 15 | path "versions.yml" , emit: versions 16 | 17 | script: 18 | def args = task.ext.args ?: "" 19 | 20 | """ 21 | create_acc2tax.py $fasta -t ${meta.taxid} 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | python: \$(python --version | sed 's/Python //g') 26 | END_VERSIONS 27 | """ 28 | 29 | stub: 30 | """ 31 | touch ${meta.taxid}.accession2taxid 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | python: \$(python --version | sed 's/Python //g') 36 | END_VERSIONS 37 | """ 38 | } 39 | -------------------------------------------------------------------------------- /modules/local/pydamage/merge/main.nf: -------------------------------------------------------------------------------- 1 | process PYDAMAGE_MERGE { 2 | label 'process_short' 3 | 4 | conda "conda-forge::pandas=1.4.3" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/pandas:1.4.3' : 7 | 'biocontainers/pandas:1.4.3' }" 8 | 9 | input: 10 | path pydamage_reports 11 | 12 | output: 13 | path("*.csv") , emit: pydamage_merged_report 14 | path "versions.yml", emit: versions 15 | 16 | script: 17 | def args = task.ext.args ?: '' 18 | prefix = task.ext.prefix 19 | """ 20 | pydamage_merge.py ${prefix}.pydamage_merged_report.csv $pydamage_reports 21 | 22 | cat <<-END_VERSIONS > versions.yml 23 | "${task.process}": 24 | python: \$(python --version | sed 's/Python //g') 25 | END_VERSIONS 26 | """ 27 | 28 | stub: 29 | prefix = task.ext.prefix 30 | """ 31 | touch ${prefix}.pydamage_merged_report.csv 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | python: \$(python --version | sed 's/Python //g') 36 | END_VERSIONS 37 | """ 38 | } 39 | -------------------------------------------------------------------------------- /modules/local/sam2lca/merge/main.nf: -------------------------------------------------------------------------------- 1 | process SAM2LCA_MERGE { 2 | // tag "kraken_merge" 3 | label 'process_short' 4 | 5 | conda "conda-forge::pandas=1.4.3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/pandas:1.4.3' : 8 | 'biocontainers/pandas:1.4.3' }" 9 | 10 | input: 11 | path sam2lca_reports 12 | 13 | output: 14 | path("*.csv") , emit: sam2lca_merged_report 15 | path "versions.yml", emit: versions 16 | 17 | script: 18 | def args = task.ext.args ?: '' 19 | prefix = task.ext.prefix 20 | """ 21 | sam2lca_merge.py ${prefix}.sam2lca_merged_report.csv $sam2lca_reports 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | python: \$(python --version | sed 's/Python //g') 26 | END_VERSIONS 27 | """ 28 | 29 | stub: 30 | prefix = task.ext.prefix 31 | """ 32 | touch ${prefix}.sam2lca_merged_report.csv 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | python: \$(python --version | sed 's/Python //g') 37 | END_VERSIONS 38 | """ 39 | } 40 | -------------------------------------------------------------------------------- /modules/local/kraken/merge/main.nf: -------------------------------------------------------------------------------- 1 | process KRAKEN_MERGE { 2 | // tag "kraken_merge" 3 | label 'process_single' 4 | 5 | conda "conda-forge::pandas=1.4.3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/pandas:1.4.3' : 8 | 'biocontainers/pandas:1.4.3' }" 9 | 10 | input: 11 | path kraken2_reports 12 | 13 | output: 14 | path("*.csv") , emit: kraken_merged_report 15 | path "versions.yml", emit: versions 16 | 17 | script: 18 | def args = task.ext.args ?: '' 19 | prefix = task.ext.prefix 20 | """ 21 | kraken_merge.py \\ 22 | -or ${prefix}.kraken2_merged_report.csv \\ 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | python: \$(python --version | sed 's/Python //g') 27 | END_VERSIONS 28 | """ 29 | 30 | stub: 31 | prefix = task.ext.prefix 32 | """ 33 | touch ${prefix}.kraken2_merged_report.csv \\ 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | python: \$(python --version | sed 's/Python //g') 38 | END_VERSIONS 39 | """ 40 | } 41 | -------------------------------------------------------------------------------- /subworkflows/local/quarto_reporting/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Subworkflow for quarto reporting 3 | // 4 | 5 | include { QUARTONOTEBOOK } from '../../../modules/nf-core/quartonotebook/main' 6 | 7 | workflow QUARTO_REPORTING { 8 | 9 | take: 10 | ch_quarto 11 | 12 | main: 13 | 14 | ch_versions = Channel.empty() 15 | 16 | // 17 | // Quarto reports and extension files 18 | // 19 | coproid_notebook = file("${projectDir}/bin/coproid_quarto_report.qmd", checkIfExists: true) 20 | extensions = Channel.fromPath("${projectDir}/assets/_extensions").collect() 21 | 22 | // Create a channel from the file 23 | Channel 24 | .of(coproid_notebook) 25 | .map { 26 | coproid_notebook -> 27 | [ 28 | [ 29 | 'id': 'quarto_notebook' 30 | ], 31 | coproid_notebook 32 | ] 33 | } 34 | .set { ch_coproid_notebook } 35 | 36 | QUARTONOTEBOOK ( 37 | ch_coproid_notebook, 38 | [], 39 | ch_quarto, 40 | extensions 41 | ) 42 | 43 | ch_versions = ch_versions.mix(QUARTONOTEBOOK.out.versions.first()) 44 | 45 | emit: 46 | versions = ch_versions 47 | 48 | } 49 | -------------------------------------------------------------------------------- /bin/sam2lca_json.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Written by Maxime Borry, released under the MIT license 4 | # See https://opensource.org/license/mit for details 5 | 6 | """Generate a sam2lca JSON configuration file from acc2tax and MD5 inputs.""" 7 | 8 | import os 9 | import json 10 | import argparse 11 | from pathlib import Path 12 | 13 | def parse_args(): 14 | parser = argparse.ArgumentParser("Create sam2lca json file") 15 | parser.add_argument( 16 | "acc2taxid", type=Path, help="Path to accession2taxid gzip compressed file" 17 | ) 18 | parser.add_argument( 19 | "md5", 20 | type=Path, 21 | help="Path to accession2taxid gzip compressed md5 checksum file", 22 | ) 23 | 24 | return parser.parse_args() 25 | 26 | 27 | def write_json(acc2taxid, md5): 28 | db_name = "adnamap" 29 | sam2lca_dict = { 30 | "mapfiles": {db_name: [acc2taxid.as_posix()]}, 31 | "mapmd5": {db_name: [md5.as_posix()]}, 32 | "map_db": {db_name: f"{db_name}.db"}, 33 | } 34 | with open(f"{db_name}.sam2lca.json", "w") as fh: 35 | json.dump(sam2lca_dict, fh) 36 | 37 | 38 | if __name__ == "__main__": 39 | args = parse_args() 40 | write_json(args.acc2taxid, args.md5) 41 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "UTILS_NEXTFLOW_PIPELINE" 3 | description: Subworkflow with functionality that may be useful for any Nextflow pipeline 4 | keywords: 5 | - utility 6 | - pipeline 7 | - initialise 8 | - version 9 | components: [] 10 | input: 11 | - print_version: 12 | type: boolean 13 | description: | 14 | Print the version of the pipeline and exit 15 | - dump_parameters: 16 | type: boolean 17 | description: | 18 | Dump the parameters of the pipeline to a JSON file 19 | - output_directory: 20 | type: directory 21 | description: Path to output dir to write JSON file to. 22 | pattern: "results/" 23 | - check_conda_channel: 24 | type: boolean 25 | description: | 26 | Check if the conda channel priority is correct. 27 | output: 28 | - dummy_emit: 29 | type: boolean 30 | description: | 31 | Dummy emit to make nf-core subworkflows lint happy 32 | authors: 33 | - "@adamrtalbot" 34 | - "@drpatelh" 35 | maintainers: 36 | - "@adamrtalbot" 37 | - "@drpatelh" 38 | - "@maxulysse" 39 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "multiqc_versions_single": { 3 | "content": [ 4 | [ 5 | "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" 6 | ] 7 | ], 8 | "meta": { 9 | "nf-test": "0.9.2", 10 | "nextflow": "24.10.4" 11 | }, 12 | "timestamp": "2025-01-27T09:29:57.631982377" 13 | }, 14 | "multiqc_stub": { 15 | "content": [ 16 | [ 17 | "multiqc_report.html", 18 | "multiqc_data", 19 | "multiqc_plots", 20 | "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" 21 | ] 22 | ], 23 | "meta": { 24 | "nf-test": "0.9.2", 25 | "nextflow": "24.10.4" 26 | }, 27 | "timestamp": "2025-01-27T09:30:34.743726958" 28 | }, 29 | "multiqc_versions_config": { 30 | "content": [ 31 | [ 32 | "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" 33 | ] 34 | ], 35 | "meta": { 36 | "nf-test": "0.9.2", 37 | "nextflow": "24.10.4" 38 | }, 39 | "timestamp": "2025-01-27T09:30:21.44383553" 40 | } 41 | } -------------------------------------------------------------------------------- /modules/nf-core/pydamage/analyze/main.nf: -------------------------------------------------------------------------------- 1 | process PYDAMAGE_ANALYZE { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/pydamage:0.70--pyhdfd78af_0' : 8 | 'biocontainers/pydamage:0.70--pyhdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bam), path(bai) 12 | 13 | output: 14 | tuple val(meta), path("pydamage_results/*_pydamage_results.csv"), emit: csv 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def prefix = task.ext.prefix ?: "${meta.id}" 23 | """ 24 | pydamage \\ 25 | analyze \\ 26 | $args \\ 27 | -p $task.cpus \\ 28 | $bam 29 | 30 | mv pydamage_results/pydamage_results.csv pydamage_results/${prefix}_pydamage_results.csv 31 | 32 | cat <<-END_VERSIONS > versions.yml 33 | "${task.process}": 34 | pydamage: \$(pydamage --version | sed -n 's/pydamage, version \\(.*\\)/\\1/p') 35 | END_VERSIONS 36 | """ 37 | } 38 | -------------------------------------------------------------------------------- /.github/workflows/clean-up.yml: -------------------------------------------------------------------------------- 1 | name: "Close user-tagged issues and PRs" 2 | on: 3 | schedule: 4 | - cron: "0 0 * * 0" # Once a week 5 | 6 | jobs: 7 | clean-up: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | pull-requests: write 12 | steps: 13 | - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9 14 | with: 15 | stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days." 16 | stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful." 17 | close-issue-message: "This issue was closed because it has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor and then staled for 20 days with no activity." 18 | days-before-stale: 30 19 | days-before-close: 20 20 | days-before-pr-close: -1 21 | any-of-labels: "awaiting-changes,awaiting-feedback" 22 | exempt-issue-labels: "WIP" 23 | exempt-pr-labels: "WIP" 24 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 25 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/bowtie2-align.diff: -------------------------------------------------------------------------------- 1 | Changes in component 'nf-core/bowtie2/align' 2 | 'modules/nf-core/bowtie2/align/environment.yml' is unchanged 3 | Changes in 'bowtie2/align/main.nf': 4 | --- modules/nf-core/bowtie2/align/main.nf 5 | +++ modules/nf-core/bowtie2/align/main.nf 6 | @@ -8,9 +8,7 @@ 7 | 'biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:f70b31a2db15c023d641c32f433fb02cd04df5a6-0' }" 8 | 9 | input: 10 | - tuple val(meta) , path(reads) 11 | - tuple val(meta2), path(index) 12 | - tuple val(meta3), path(fasta) 13 | + tuple val(meta), path(reads), path(index), path(fasta) 14 | val save_unaligned 15 | val sort_bam 16 | 17 | 18 | 'modules/nf-core/bowtie2/align/meta.yml' is unchanged 19 | 'modules/nf-core/bowtie2/align/tests/large_index.config' is unchanged 20 | 'modules/nf-core/bowtie2/align/tests/sam.config' is unchanged 21 | 'modules/nf-core/bowtie2/align/tests/sam2.config' is unchanged 22 | 'modules/nf-core/bowtie2/align/tests/tags.yml' is unchanged 23 | 'modules/nf-core/bowtie2/align/tests/cram_crai.config' is unchanged 24 | 'modules/nf-core/bowtie2/align/tests/main.nf.test' is unchanged 25 | 'modules/nf-core/bowtie2/align/tests/main.nf.test.snap' is unchanged 26 | ************************************************************ 27 | -------------------------------------------------------------------------------- /assets/email_template.txt: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------- 2 | ,--./,-. 3 | ___ __ __ __ ___ /,-._.--~\\ 4 | |\\ | |__ __ / ` / \\ |__) |__ } { 5 | | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, 6 | `._,._,' 7 | nf-core/coproid ${version} 8 | ---------------------------------------------------- 9 | Run Name: $runName 10 | 11 | <% if (success){ 12 | out << "## nf-core/coproid execution completed successfully! ##" 13 | } else { 14 | out << """#################################################### 15 | ## nf-core/coproid execution completed unsuccessfully! ## 16 | #################################################### 17 | The exit status of the task that caused the workflow execution to fail was: $exitStatus. 18 | The full error message was: 19 | 20 | ${errorReport} 21 | """ 22 | } %> 23 | 24 | 25 | The workflow was completed at $dateComplete (duration: $duration) 26 | 27 | The command used to launch the workflow was as follows: 28 | 29 | $commandLine 30 | 31 | 32 | 33 | Pipeline Configuration: 34 | ----------------------- 35 | <% out << summary.collect{ k,v -> " - $k: $v" }.join("\n") %> 36 | 37 | -- 38 | nf-core/coproid 39 | https://github.com/nf-core/coproid 40 | -------------------------------------------------------------------------------- /modules/nf-core/pydamage/analyze/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "test-pydamage": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test", 9 | "single_end": false 10 | }, 11 | "test_pydamage_results.csv:md5,37ee6b4dee6890fd2ec8550337f21ac9" 12 | ] 13 | ], 14 | "1": [ 15 | "versions.yml:md5,f414bcb9adc4a92de490ba29d794b4bb" 16 | ], 17 | "csv": [ 18 | [ 19 | { 20 | "id": "test", 21 | "single_end": false 22 | }, 23 | "test_pydamage_results.csv:md5,37ee6b4dee6890fd2ec8550337f21ac9" 24 | ] 25 | ], 26 | "versions": [ 27 | "versions.yml:md5,f414bcb9adc4a92de490ba29d794b4bb" 28 | ] 29 | } 30 | ], 31 | "meta": { 32 | "nf-test": "0.9.0", 33 | "nextflow": "24.04.4" 34 | }, 35 | "timestamp": "2024-11-26T15:13:19.888455981" 36 | } 37 | } -------------------------------------------------------------------------------- /.github/workflows/awstest.yml: -------------------------------------------------------------------------------- 1 | name: nf-core AWS test 2 | # This workflow can be triggered manually with the GitHub actions workflow dispatch button. 3 | # It runs the -profile 'test' on AWS batch 4 | 5 | on: 6 | workflow_dispatch: 7 | jobs: 8 | run-platform: 9 | name: Run AWS tests 10 | if: github.repository == 'nf-core/coproid' 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Launch workflow using Seqera Platform CLI tool action 14 | - name: Launch workflow via Seqera Platform 15 | uses: seqeralabs/action-tower-launch@v2 16 | with: 17 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 18 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 19 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 20 | revision: ${{ github.sha }} 21 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/coproid/work-${{ github.sha }} 22 | parameters: | 23 | { 24 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/coproid/results-test-${{ github.sha }}" 25 | } 26 | profiles: test 27 | 28 | - uses: actions/upload-artifact@v4 29 | with: 30 | name: Seqera Platform debug log file 31 | path: | 32 | seqera_platform_action_*.log 33 | seqera_platform_action_*.json 34 | -------------------------------------------------------------------------------- /modules/nf-core/quartonotebook/parametrize.nf: -------------------------------------------------------------------------------- 1 | import org.yaml.snakeyaml.Yaml 2 | import org.yaml.snakeyaml.DumperOptions 3 | 4 | 5 | /** 6 | * Multiline code blocks need to have the same indentation level 7 | * as the `script:` section. This function re-indents code to the specified level. 8 | */ 9 | def indentCodeBlock(code, n_spaces) { 10 | def indent_str = " ".multiply(n_spaces) 11 | return code.stripIndent().split("\n").join("\n" + indent_str) 12 | } 13 | 14 | /** 15 | * Create a config YAML file from a groovy map 16 | * 17 | * @params task The process' `task` variable 18 | * @returns a line to be inserted in the bash script. 19 | */ 20 | def dumpParamsYaml(params) { 21 | DumperOptions options = new DumperOptions(); 22 | options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); 23 | def yaml = new Yaml(options) 24 | def yaml_str = yaml.dump(params) 25 | 26 | // Writing the params.yml file directly as follows does not work. 27 | // It only works in 'exec:', but not if there is a `script:` section: 28 | // task.workDir.resolve('params.yml').text = yaml_str 29 | 30 | // Therefore, we inject it into the bash script: 31 | return """\ 32 | cat <<"END_PARAMS_SECTION" > ./params.yml 33 | ${indentCodeBlock(yaml_str, 8)} 34 | END_PARAMS_SECTION 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/local/damageprofiler/merge/main.nf: -------------------------------------------------------------------------------- 1 | process DAMAGEPROFILER_MERGE { 2 | label 'process_short' 3 | 4 | conda "conda-forge::pandas=1.4.3" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/pandas:1.4.3' : 7 | 'biocontainers/pandas:1.4.3' }" 8 | 9 | input: 10 | path damageprofiler_reports 11 | 12 | output: 13 | path("*.csv") , emit: damageprofiler_merged_report 14 | path "versions.yml", emit: versions 15 | 16 | script: 17 | def args = task.ext.args ?: '' 18 | prefix = task.ext.prefix 19 | """ 20 | for file in *-*/*_freq.txt; do 21 | echo "\${file}" >> file_paths.txt 22 | done 23 | 24 | damageprofiler_merge.py ${prefix}.damageprofiler_merged_report.csv file_paths.txt 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | python: \$(python --version | sed 's/Python //g') 29 | END_VERSIONS 30 | """ 31 | 32 | stub: 33 | prefix = task.ext.prefix 34 | """ 35 | touch ${prefix}.damageprofiler_merged_report.csv 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | python: \$(python --version | sed 's/Python //g') 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /modules/nf-core/damageprofiler/main.nf: -------------------------------------------------------------------------------- 1 | process DAMAGEPROFILER { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/damageprofiler:1.1--hdfd78af_2' : 8 | 'biocontainers/damageprofiler:1.1--hdfd78af_2' }" 9 | 10 | input: 11 | tuple val(meta), path(bam) 12 | path fasta 13 | path fai 14 | path specieslist 15 | 16 | output: 17 | tuple val(meta), path("${prefix}"), emit: results 18 | path "versions.yml" , emit: versions 19 | 20 | when: 21 | task.ext.when == null || task.ext.when 22 | 23 | script: 24 | def args = task.ext.args ?: '' 25 | prefix = task.ext.prefix ?: "${meta.id}" 26 | def reference = fasta ? "-r $fasta" : "" 27 | def species_list = specieslist ? "-sf $specieslist" : "" 28 | """ 29 | damageprofiler \\ 30 | -i $bam \\ 31 | -o $prefix/ \\ 32 | $args \\ 33 | $reference \\ 34 | $species_list 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | damageprofiler: \$(damageprofiler -v | sed 's/^DamageProfiler v//') 39 | END_VERSIONS 40 | """ 41 | } 42 | -------------------------------------------------------------------------------- /assets/sendmail_template.txt: -------------------------------------------------------------------------------- 1 | To: $email 2 | Subject: $subject 3 | Mime-Version: 1.0 4 | Content-Type: multipart/related;boundary="nfcoremimeboundary" 5 | 6 | --nfcoremimeboundary 7 | Content-Type: text/html; charset=utf-8 8 | 9 | $email_html 10 | 11 | --nfcoremimeboundary 12 | Content-Type: image/png;name="nf-core-coproid_logo.png" 13 | Content-Transfer-Encoding: base64 14 | Content-ID: 15 | Content-Disposition: inline; filename="nf-core-coproid_logo_light.png" 16 | 17 | <% out << new File("$projectDir/assets/nf-core-coproid_logo_light.png"). 18 | bytes. 19 | encodeBase64(). 20 | toString(). 21 | tokenize( '\n' )*. 22 | toList()*. 23 | collate( 76 )*. 24 | collect { it.join() }. 25 | flatten(). 26 | join( '\n' ) %> 27 | 28 | <% 29 | if (mqcFile){ 30 | def mqcFileObj = new File("$mqcFile") 31 | if (mqcFileObj.length() < mqcMaxSize){ 32 | out << """ 33 | --nfcoremimeboundary 34 | Content-Type: text/html; name=\"multiqc_report\" 35 | Content-Transfer-Encoding: base64 36 | Content-ID: 37 | Content-Disposition: attachment; filename=\"${mqcFileObj.getName()}\" 38 | 39 | ${mqcFileObj. 40 | bytes. 41 | encodeBase64(). 42 | toString(). 43 | tokenize( '\n' )*. 44 | toList()*. 45 | collate( 76 )*. 46 | collect { it.join() }. 47 | flatten(). 48 | join( '\n' )} 49 | """ 50 | }} 51 | %> 52 | 53 | --nfcoremimeboundary-- 54 | -------------------------------------------------------------------------------- /modules/local/kraken/parse/main.nf: -------------------------------------------------------------------------------- 1 | process KRAKEN_PARSE { 2 | tag "${meta.id}" 3 | label 'process_single' 4 | 5 | conda "conda-forge::pandas=1.4.3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/pandas:1.4.3' : 8 | 'biocontainers/pandas:1.4.3' }" 9 | 10 | input: 11 | tuple val(meta), path(kraken2_report) 12 | 13 | output: 14 | tuple val(meta), path("*.read_kraken_parsed.csv"), emit: kraken_read_count 15 | tuple val(meta), path("*.kmer_kraken_parsed.csv"), emit: kraken_kmer_count 16 | path "versions.yml" , emit: versions 17 | 18 | script: 19 | def args = task.ext.args ?: '' 20 | prefix = task.ext.prefix ?: "${meta.id}" 21 | """ 22 | kraken_parse.py $kraken2_report 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | python: \$(python --version | sed 's/Python //g') 27 | END_VERSIONS 28 | """ 29 | 30 | stub: 31 | prefix = task.ext.prefix ?: "${meta.id}" 32 | """ 33 | touch ${prefix}.read_kraken_parsed.csv 34 | touch ${prefix}.kmer_kraken_parsed.csv 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | python: \$(python --version | sed 's/Python //g') 39 | END_VERSIONS 40 | """ 41 | } 42 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "utils_nfschema_plugin" 3 | description: Run nf-schema to validate parameters and create a summary of changed parameters 4 | keywords: 5 | - validation 6 | - JSON schema 7 | - plugin 8 | - parameters 9 | - summary 10 | components: [] 11 | input: 12 | - input_workflow: 13 | type: object 14 | description: | 15 | The workflow object of the used pipeline. 16 | This object contains meta data used to create the params summary log 17 | - validate_params: 18 | type: boolean 19 | description: Validate the parameters and error if invalid. 20 | - parameters_schema: 21 | type: string 22 | description: | 23 | Path to the parameters JSON schema. 24 | This has to be the same as the schema given to the `validation.parametersSchema` config 25 | option. When this input is empty it will automatically use the configured schema or 26 | "${projectDir}/nextflow_schema.json" as default. The schema should not be given in this way 27 | for meta pipelines. 28 | output: 29 | - dummy_emit: 30 | type: boolean 31 | description: Dummy emit to make nf-core subworkflows lint happy 32 | authors: 33 | - "@nvnieuwk" 34 | maintainers: 35 | - "@nvnieuwk" 36 | -------------------------------------------------------------------------------- /modules/nf-core/quartonotebook/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM condaforge/mambaforge:24.9.2-0 2 | #@sha256:e4edd160d0a10c6f577b127021d853b460e7e8c1bf1850c9aa4a52c4b8d9c8ee 3 | ARG QUARTO_VERSION=1.3.433 4 | ARG TARGETARCH 5 | 6 | LABEL org.opencontainers.image.authors="Erik Fasterius" 7 | LABEL org.opencontainers.image.description="Dockerfile for the quartonotebook nf-core module" 8 | LABEL org.opencontainers.image.version="$QUARTO_VERSION" 9 | LABEL org.opencontainers.image.documentation="https://github.com/nf-core/modules/blob/master/modules/nf-core/quartonotebook/README.md" 10 | LABEL org.opencontainers.image.source="https://github.com/nf-core/modules" 11 | LABEL org.opencontainers.image.vendor="nf-core" 12 | LABEL org.opencontainers.image.license="https://github.com/nf-core/modules/blob/master/LICENSE" 13 | 14 | ADD https://github.com/quarto-dev/quarto-cli#v${QUARTO_VERSION} /opt/quarto 15 | ENV PATH="${PATH}:/opt/quarto/bin" 16 | 17 | # Install packages using Mamba; also remove static libraries, python bytecode 18 | # files and javascript source maps that are not required for execution 19 | COPY environment.yml ./ 20 | RUN mamba env update --name base --file environment.yml \ 21 | && mamba clean --all --force-pkgs-dirs --yes \ 22 | && find /opt/conda -follow -type f -name '*.a' -delete \ 23 | && find /opt/conda -follow -type f -name '*.pyc' -delete \ 24 | && find /opt/conda -follow -type f -name '*.js.map' -delete 25 | 26 | CMD /bin/bash 27 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/main.nf: -------------------------------------------------------------------------------- 1 | process BOWTIE2_BUILD { 2 | tag "$fasta" 3 | label 'process_high' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bowtie2:2.5.2--py39h6fed5c7_0' : 8 | 'biocontainers/bowtie2:2.5.2--py39h6fed5c7_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | tuple val(meta), path('bowtie2') , emit: index 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | """ 23 | mkdir bowtie2 24 | bowtie2-build $args --threads $task.cpus $fasta bowtie2/${fasta.baseName} 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') 28 | END_VERSIONS 29 | """ 30 | 31 | stub: 32 | """ 33 | mkdir bowtie2 34 | touch bowtie2/${fasta.baseName}.{1..4}.bt2 35 | touch bowtie2/${fasta.baseName}.rev.{1,2}.bt2 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /modules/nf-core/untar/meta.yml: -------------------------------------------------------------------------------- 1 | name: untar 2 | description: Extract files. 3 | keywords: 4 | - untar 5 | - uncompress 6 | - extract 7 | tools: 8 | - untar: 9 | description: | 10 | Extract tar.gz files. 11 | documentation: https://www.gnu.org/software/tar/manual/ 12 | licence: ["GPL-3.0-or-later"] 13 | identifier: "" 14 | input: 15 | - - meta: 16 | type: map 17 | description: | 18 | Groovy Map containing sample information 19 | e.g. [ id:'test', single_end:false ] 20 | - archive: 21 | type: file 22 | description: File to be untar 23 | pattern: "*.{tar}.{gz}" 24 | output: 25 | - untar: 26 | - meta: 27 | type: map 28 | description: | 29 | Groovy Map containing sample information 30 | e.g. [ id:'test', single_end:false ] 31 | pattern: "*/" 32 | - ${prefix}: 33 | type: map 34 | description: | 35 | Groovy Map containing sample information 36 | e.g. [ id:'test', single_end:false ] 37 | pattern: "*/" 38 | - versions: 39 | - versions.yml: 40 | type: file 41 | description: File containing software versions 42 | pattern: "versions.yml" 43 | authors: 44 | - "@joseespinosa" 45 | - "@drpatelh" 46 | - "@matthdsm" 47 | - "@jfy133" 48 | maintainers: 49 | - "@joseespinosa" 50 | - "@drpatelh" 51 | - "@matthdsm" 52 | - "@jfy133" 53 | -------------------------------------------------------------------------------- /assets/schema_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/nf-core/coproid/master/assets/schema_input.json", 4 | "title": "nf-core/coproid pipeline - params.input schema", 5 | "description": "Schema for the file provided with params.input", 6 | "type": "array", 7 | "items": { 8 | "type": "object", 9 | "properties": { 10 | "sample": { 11 | "type": "string", 12 | "pattern": "^\\S+$", 13 | "errorMessage": "Sample name must be provided as a string value and cannot contain spaces", 14 | "meta": ["id"] 15 | }, 16 | "fastq_1": { 17 | "type": "string", 18 | "format": "file-path", 19 | "exists": true, 20 | "pattern": "^\\S+\\.f(ast)?q\\.gz$", 21 | "errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces, has to exist and must have extension '.fq.gz' or '.fastq.gz'" 22 | }, 23 | "fastq_2": { 24 | "type": "string", 25 | "format": "file-path", 26 | "exists": true, 27 | "pattern": "^\\S+\\.f(ast)?q\\.gz$", 28 | "errorMessage": "FastQ file for reads 2 cannot contain spaces, has to exist and must have extension '.fq.gz' or '.fastq.gz'" 29 | } 30 | }, 31 | "required": ["sample", "fastq_1"] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /subworkflows/local/sam2lca_db/main.nf: -------------------------------------------------------------------------------- 1 | include { CREATE_ACC2TAX } from '../../../modules/local/create_acc2tax/main' 2 | include { SAM2LCA_PREPDB } from '../../../modules/local/sam2lca/prep_db/main' 3 | include { SAM2LCA_UPDATEDB } from '../../../modules/local/sam2lca/updatedb/main' 4 | 5 | workflow SAM2LCA_DB { 6 | take: 7 | genomes // meta, fasta 8 | taxonomy_db_name // value 9 | taxo_nodes // nodes.dmp 10 | taxo_names // names.dmp 11 | taxo_merged // merged.dmp 12 | 13 | main: 14 | 15 | ch_versions = Channel.empty() 16 | 17 | CREATE_ACC2TAX(genomes) 18 | 19 | ch_versions = ch_versions.mix(CREATE_ACC2TAX.out.versions.first()) 20 | 21 | acc2tax = CREATE_ACC2TAX.out.acc2tax.collectFile( 22 | name: 'adnamap.accession2taxid', 23 | keepHeader: true 24 | ) 25 | 26 | SAM2LCA_PREPDB(acc2tax) 27 | 28 | ch_versions = ch_versions.mix(SAM2LCA_PREPDB.out.versions.first()) 29 | 30 | SAM2LCA_UPDATEDB( 31 | "adnamap", 32 | taxonomy_db_name, 33 | taxo_nodes, 34 | taxo_names, 35 | taxo_merged, 36 | SAM2LCA_PREPDB.out.acc2tax_json, 37 | SAM2LCA_PREPDB.out.acc2tax_gz, 38 | SAM2LCA_PREPDB.out.acc2tax_md5 39 | ) 40 | 41 | ch_versions = ch_versions.mix(SAM2LCA_UPDATEDB.out.versions.first()) 42 | 43 | emit: 44 | sam2lca_db = SAM2LCA_UPDATEDB.out.sam2lca_db 45 | versions = ch_versions 46 | } 47 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_function { 3 | 4 | name "Test Functions" 5 | script "subworkflows/nf-core/utils_nextflow_pipeline/main.nf" 6 | config "subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config" 7 | tag 'subworkflows' 8 | tag 'utils_nextflow_pipeline' 9 | tag 'subworkflows/utils_nextflow_pipeline' 10 | 11 | test("Test Function getWorkflowVersion") { 12 | 13 | function "getWorkflowVersion" 14 | 15 | then { 16 | assertAll( 17 | { assert function.success }, 18 | { assert snapshot(function.result).match() } 19 | ) 20 | } 21 | } 22 | 23 | test("Test Function dumpParametersToJSON") { 24 | 25 | function "dumpParametersToJSON" 26 | 27 | when { 28 | function { 29 | """ 30 | // define inputs of the function here. Example: 31 | input[0] = "$outputDir" 32 | """.stripIndent() 33 | } 34 | } 35 | 36 | then { 37 | assertAll( 38 | { assert function.success } 39 | ) 40 | } 41 | } 42 | 43 | test("Test Function checkCondaChannels") { 44 | 45 | function "checkCondaChannels" 46 | 47 | then { 48 | assertAll( 49 | { assert function.success }, 50 | { assert snapshot(function.result).match() } 51 | ) 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/meta.yml: -------------------------------------------------------------------------------- 1 | name: bowtie2_build 2 | description: Builds bowtie index for reference genome 3 | keywords: 4 | - build 5 | - index 6 | - fasta 7 | - genome 8 | - reference 9 | tools: 10 | - bowtie2: 11 | description: | 12 | Bowtie 2 is an ultrafast and memory-efficient tool for aligning 13 | sequencing reads to long reference sequences. 14 | homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml 15 | documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml 16 | doi: 10.1038/nmeth.1923 17 | licence: ["GPL-3.0-or-later"] 18 | identifier: "" 19 | input: 20 | - - meta: 21 | type: map 22 | description: | 23 | Groovy Map containing reference information 24 | e.g. [ id:'test', single_end:false ] 25 | - fasta: 26 | type: file 27 | description: Input genome fasta file 28 | output: 29 | - index: 30 | - meta: 31 | type: map 32 | description: | 33 | Groovy Map containing reference information 34 | e.g. [ id:'test', single_end:false ] 35 | - bowtie2: 36 | type: file 37 | description: Bowtie2 genome index files 38 | pattern: "*.bt2" 39 | - versions: 40 | - versions.yml: 41 | type: file 42 | description: File containing software versions 43 | pattern: "versions.yml" 44 | authors: 45 | - "@joseespinosa" 46 | - "@drpatelh" 47 | maintainers: 48 | - "@joseespinosa" 49 | - "@drpatelh" 50 | -------------------------------------------------------------------------------- /modules/nf-core/quartonotebook/quartonotebook.diff: -------------------------------------------------------------------------------- 1 | Changes in component 'nf-core/quartonotebook' 2 | 'modules/nf-core/quartonotebook/environment.yml' is unchanged 3 | 'modules/nf-core/quartonotebook/meta.yml' is unchanged 4 | Changes in 'quartonotebook/main.nf': 5 | --- modules/nf-core/quartonotebook/main.nf 6 | +++ modules/nf-core/quartonotebook/main.nf 7 | @@ -9,9 +9,7 @@ 8 | tag "${meta.id}" 9 | label 'process_low' 10 | conda "${moduleDir}/environment.yml" 11 | - container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container 12 | - ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/25/25d0a9decefd5d369b8f9b8c934640bd61493df2c95c39b0c580e765e0d2a644/data' 13 | - : 'community.wave.seqera.io/library/quarto_jupyter_matplotlib_papermill_r-rmarkdown:95c6620495eabcd1'}" 14 | + container = 'library://meriamos/coproid/quarto_container:latest' 15 | 16 | input: 17 | tuple val(meta), path(notebook) 18 | 19 | 'modules/nf-core/quartonotebook/Dockerfile' is unchanged 20 | 'modules/nf-core/quartonotebook/parametrize.nf' is unchanged 21 | 'modules/nf-core/quartonotebook/tests/tags.yml' is unchanged 22 | 'modules/nf-core/quartonotebook/tests/with-parametrization.config' is unchanged 23 | 'modules/nf-core/quartonotebook/tests/no-parametrization.config' is unchanged 24 | 'modules/nf-core/quartonotebook/tests/main.nf.test' is unchanged 25 | 'modules/nf-core/quartonotebook/tests/main.nf.test.snap' is unchanged 26 | ************************************************************ 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 13 | 14 | ## PR checklist 15 | 16 | - [ ] This comment contains a description of changes (with reason). 17 | - [ ] If you've fixed a bug or added code that should be tested, add tests! 18 | - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/coproid/tree/master/.github/CONTRIBUTING.md) 19 | - [ ] If necessary, also make a PR on the nf-core/coproid _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. 20 | - [ ] Make sure your code lints (`nf-core pipelines lint`). 21 | - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). 22 | - [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir `). 23 | - [ ] Usage Documentation in `docs/usage.md` is updated. 24 | - [ ] Output Documentation in `docs/output.md` is updated. 25 | - [ ] `CHANGELOG.md` is updated. 26 | - [ ] `README.md` is updated (including new tool citations and authors/contributors). 27 | -------------------------------------------------------------------------------- /modules/nf-core/xz/decompress/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "sarscov2 - genome - fasta": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test" 9 | }, 10 | "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" 11 | ] 12 | ], 13 | "1": [ 14 | "versions.yml:md5,d553f465fcd5e126295bfbc24cacb728" 15 | ], 16 | "file": [ 17 | [ 18 | { 19 | "id": "test" 20 | }, 21 | "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" 22 | ] 23 | ], 24 | "versions": [ 25 | "versions.yml:md5,d553f465fcd5e126295bfbc24cacb728" 26 | ] 27 | } 28 | ], 29 | "meta": { 30 | "nf-test": "0.8.4", 31 | "nextflow": "24.04.3" 32 | }, 33 | "timestamp": "2023-12-11T20:14:03.096152" 34 | }, 35 | "sarscov2 - genome - fasta - stub": { 36 | "content": [ 37 | "test", 38 | [ 39 | "versions.yml:md5,d553f465fcd5e126295bfbc24cacb728" 40 | ] 41 | ], 42 | "meta": { 43 | "nf-test": "0.8.4", 44 | "nextflow": "24.04.3" 45 | }, 46 | "timestamp": "2024-08-07T10:46:06.451374" 47 | } 48 | } -------------------------------------------------------------------------------- /modules/nf-core/xz/decompress/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 2 | name: "xz_decompress" 3 | description: Decompresses files with xz. 4 | keywords: 5 | - xz 6 | - decompression 7 | - compression 8 | tools: 9 | - "xz": 10 | description: "xz is a general-purpose data compression tool with command line 11 | syntax similar to gzip and bzip2." 12 | homepage: "https://tukaani.org/xz/" 13 | documentation: "https://tukaani.org/xz/man/xz.1.html" 14 | tool_dev_url: "https://github.com/tukaani-project/xz" 15 | licence: ["GNU LGPLv2.1", "GNU GPLv2", "GNU GPLv3"] 16 | identifier: "" 17 | 18 | input: 19 | - - meta: 20 | type: map 21 | description: | 22 | Groovy Map containing sample information 23 | e.g. `[ id:'sample1', single_end:false ]` 24 | - archive: 25 | type: file 26 | description: File to be decompressed 27 | pattern: "*.{xz}" 28 | output: 29 | - file: 30 | - meta: 31 | type: map 32 | description: | 33 | Groovy Map containing sample information 34 | e.g. `[ id:'sample1', single_end:false ]` 35 | - $decompressed_file: 36 | type: file 37 | description: The decompressed file 38 | pattern: "*.*" 39 | - versions: 40 | - versions.yml: 41 | type: file 42 | description: File containing software versions 43 | pattern: "versions.yml" 44 | authors: 45 | - "@leoisl" 46 | maintainers: 47 | - "@leoisl" 48 | -------------------------------------------------------------------------------- /modules/local/sam2lca/prep_db/main.nf: -------------------------------------------------------------------------------- 1 | process SAM2LCA_PREPDB { 2 | label 'process_single' 3 | 4 | conda "${moduleDir}/environment.yml" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/sam2lca:1.1.4--pyhdfd78af_0' : 7 | 'quay.io/biocontainers/sam2lca:1.1.4--pyhdfd78af_0' }" 8 | 9 | input: 10 | path(acc2tax) 11 | 12 | output: 13 | path("*.md5") , emit: acc2tax_md5 14 | path("*.json") , emit: acc2tax_json 15 | path("*.gz") , emit: acc2tax_gz 16 | path "versions.yml", emit: versions 17 | 18 | script: 19 | def args = task.ext.args ?: "" 20 | 21 | """ 22 | gzip $acc2tax 23 | md5sum ${acc2tax}.gz > ${acc2tax}.gz.md5 24 | sam2lca_json.py ${acc2tax}.gz ${acc2tax}.gz.md5 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | gzip: \$(gzip --version | head -n1 | awk '{print \$NF}') 29 | md5sum: \$(md5sum --version | head -n1 | awk '{print \$NF}') 30 | python: \$(python --version | sed 's/Python //g') 31 | END_VERSIONS 32 | """ 33 | 34 | stub: 35 | """ 36 | touch acc2tax.gz 37 | touch acc2tax.gz.md5 38 | touch acc2tax.json 39 | 40 | cat <<-END_VERSIONS > versions.yml 41 | "${task.process}": 42 | gzip: \$(gzip --version | head -n1 | awk '{print \$NF}') 43 | md5sum: \$(md5sum --version | head -n1 | awk '{print \$NF}') 44 | python: \$(python --version | sed 's/Python //g') 45 | END_VERSIONS 46 | """ 47 | } 48 | -------------------------------------------------------------------------------- /modules/nf-core/pydamage/analyze/pydamage-analyze.diff: -------------------------------------------------------------------------------- 1 | Changes in module 'nf-core/pydamage/analyze' 2 | 'modules/nf-core/pydamage/analyze/environment.yml' is unchanged 3 | Changes in 'pydamage/analyze/meta.yml': 4 | --- modules/nf-core/pydamage/analyze/meta.yml 5 | +++ modules/nf-core/pydamage/analyze/meta.yml 6 | @@ -42,7 +42,7 @@ 7 | description: | 8 | Groovy Map containing sample information 9 | e.g. [ id:'test', single_end:false ] 10 | - - pydamage_results/pydamage_results.csv: 11 | + - pydamage_results.csv: 12 | type: file 13 | description: PyDamage results as csv files 14 | pattern: "*.csv" 15 | 16 | Changes in 'pydamage/analyze/main.nf': 17 | --- modules/nf-core/pydamage/analyze/main.nf 18 | +++ modules/nf-core/pydamage/analyze/main.nf 19 | @@ -11,7 +11,7 @@ 20 | tuple val(meta), path(bam), path(bai) 21 | 22 | output: 23 | - tuple val(meta), path("pydamage_results/pydamage_results.csv"), emit: csv 24 | + tuple val(meta), path("pydamage_results/*_pydamage_results.csv"), emit: csv 25 | path "versions.yml" , emit: versions 26 | 27 | when: 28 | @@ -26,6 +26,8 @@ 29 | $args \\ 30 | -p $task.cpus \\ 31 | $bam 32 | + 33 | + mv pydamage_results/pydamage_results.csv pydamage_results/${prefix}_pydamage_results.csv 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | 38 | 'modules/nf-core/pydamage/analyze/tests/main.nf.test' is unchanged 39 | 'modules/nf-core/pydamage/analyze/tests/main.nf.test.snap' is unchanged 40 | ************************************************************ 41 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/index/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_INDEX { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : 8 | 'biocontainers/samtools:1.21--h50ea8bc_0' }" 9 | 10 | input: 11 | tuple val(meta), path(input) 12 | 13 | output: 14 | tuple val(meta), path("*.bai") , optional:true, emit: bai 15 | tuple val(meta), path("*.csi") , optional:true, emit: csi 16 | tuple val(meta), path("*.crai"), optional:true, emit: crai 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | def args = task.ext.args ?: '' 24 | """ 25 | samtools \\ 26 | index \\ 27 | -@ ${task.cpus-1} \\ 28 | $args \\ 29 | $input 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 34 | END_VERSIONS 35 | """ 36 | 37 | stub: 38 | def args = task.ext.args ?: '' 39 | def extension = file(input).getExtension() == 'cram' ? 40 | "crai" : args.contains("-c") ? "csi" : "bai" 41 | """ 42 | touch ${input}.${extension} 43 | 44 | cat <<-END_VERSIONS > versions.yml 45 | "${task.process}": 46 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 47 | END_VERSIONS 48 | """ 49 | } 50 | -------------------------------------------------------------------------------- /bin/pydamage_merge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Written by Meriam van Os, released under the MIT license 4 | # See https://opensource.org/license/mit for details 5 | 6 | """Merge pydamage results from multiple samples into a single CSV file used for the Quarto report.""" 7 | 8 | import pandas as pd 9 | import sys 10 | import pathlib 11 | 12 | def process_file(file_path): 13 | # Extract sample and taxa names from the directory structure 14 | sample_file = pathlib.Path(file_path).stem 15 | sample_name, taxa_name = sample_file.split("-") 16 | taxa_name = taxa_name.replace("_pydamage_results","") 17 | 18 | # Read the CSV file 19 | df = pd.read_csv(file_path) 20 | 21 | # Select relevant columns and add sample and taxa information 22 | df_filtered = df[['pvalue', 'damage_model_pmax']].copy() 23 | df_filtered['Sample'] = sample_name 24 | df_filtered['Taxa'] = taxa_name 25 | 26 | # Reorder columns 27 | return df_filtered[['Sample', 'Taxa', 'pvalue', 'damage_model_pmax']] 28 | 29 | def main(): 30 | if len(sys.argv) < 3: 31 | print("Usage: python script.py ...") 32 | sys.exit(1) 33 | 34 | # Get output file name and input CSV file paths 35 | output_file = sys.argv[1] 36 | input_files = sys.argv[2:] 37 | 38 | # Process all input files 39 | results = [process_file(file_path) for file_path in input_files] 40 | 41 | # Combine results into a single DataFrame 42 | final_df = pd.concat(results, ignore_index=True) 43 | 44 | # Save the combined DataFrame to the output file 45 | final_df.to_csv(output_file, index=False) 46 | 47 | if __name__ == "__main__": 48 | main() 49 | -------------------------------------------------------------------------------- /modules/nf-core/pydamage/analyze/meta.yml: -------------------------------------------------------------------------------- 1 | name: pydamage_analyze 2 | description: Damage parameter estimation for ancient DNA 3 | keywords: 4 | - ancient DNA 5 | - aDNA 6 | - de novo assembly 7 | - filtering 8 | - damage 9 | - deamination 10 | - miscoding lesions 11 | - C to T 12 | - palaeogenomics 13 | - archaeogenomics 14 | - palaeogenetics 15 | - archaeogenetics 16 | tools: 17 | - pydamage: 18 | description: Damage parameter estimation for ancient DNA 19 | homepage: https://github.com/maxibor/pydamage 20 | documentation: https://pydamage.readthedocs.io/ 21 | tool_dev_url: https://github.com/maxibor/pydamage 22 | licence: ["GPL v3"] 23 | identifier: "" 24 | input: 25 | - - meta: 26 | type: map 27 | description: | 28 | Groovy Map containing sample information 29 | e.g. [ id:'test', single_end:false ] 30 | - bam: 31 | type: file 32 | description: BAM/CRAM/SAM file 33 | pattern: "*.{bam,cram,sam}" 34 | - bai: 35 | type: file 36 | description: BAM/CRAM/SAM index file 37 | pattern: "*.{bai,crai,sai}" 38 | output: 39 | - csv: 40 | - meta: 41 | type: map 42 | description: | 43 | Groovy Map containing sample information 44 | e.g. [ id:'test', single_end:false ] 45 | - pydamage_results/*_pydamage_results.csv: 46 | type: file 47 | description: PyDamage results as csv files 48 | pattern: "*.csv" 49 | - versions: 50 | - versions.yml: 51 | type: file 52 | description: File containing software versions 53 | pattern: "versions.yml" 54 | authors: 55 | - "@maxibor" 56 | maintainers: 57 | - "@maxibor" 58 | -------------------------------------------------------------------------------- /subworkflows/local/prepare_genome_indices/main.nf: -------------------------------------------------------------------------------- 1 | include { BOWTIE2_BUILD } from '../../../modules/nf-core/bowtie2/build/main' 2 | 3 | workflow PREPARE_GENOMES { 4 | take: 5 | ch_genomesheet 6 | 7 | main: 8 | 9 | ch_versions = Channel.empty() 10 | 11 | ch_genomesheet 12 | .map { create_genome_channel(it) } 13 | .set { genomes } 14 | 15 | genomes 16 | .branch { 17 | index_avail: it.size() > 2 18 | no_index_avail: it.size() == 2 19 | } 20 | .set { genomes_fork } 21 | 22 | BOWTIE2_BUILD ( 23 | genomes_fork.no_index_avail 24 | ) 25 | 26 | genomes_fork.no_index_avail.join( 27 | BOWTIE2_BUILD.out.index 28 | ).mix( 29 | genomes_fork.index_avail 30 | ).set { 31 | ch_genomes 32 | } 33 | 34 | ch_versions = ch_versions.mix(BOWTIE2_BUILD.out.versions.first()) 35 | 36 | emit: 37 | genomes = ch_genomes 38 | versions = ch_versions 39 | } 40 | 41 | def create_genome_channel(LinkedHashMap row) { 42 | def meta = [:] 43 | meta.genome_name = row.genome_name 44 | meta.taxid = row.taxid 45 | meta.genome_size = row.genome_size 46 | def genome_meta = [] 47 | if (row.igenome) { 48 | genome_meta = [meta, file(params.genomes[ igenome ][ fasta ]), path(params.genomes[ igenome ][ bowtie2 ])] 49 | } else if (row.fasta && row.index) { 50 | genome_meta = [meta, file(row.fasta), file(row.index)] 51 | } else if (row.fasta && ! row.index){ 52 | genome_meta = [meta, file(row.fasta)] 53 | } else { 54 | exit 1, "Genome ${row.genome_name} is not available. Please provide either a iGenome or a fasta reference file" 55 | } 56 | 57 | return genome_meta 58 | } 59 | -------------------------------------------------------------------------------- /conf/test_full.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running full-size tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a full size pipeline test. 6 | 7 | Use as follows: 8 | nextflow run nf-core/coproid -profile test_full, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Full test profile' 15 | config_profile_description = 'Full test dataset to check pipeline function' 16 | 17 | input = 'https://github.com/nf-core/test-datasets/raw/coproid/reads/samplesheet_full.csv' 18 | genome_sheet = 'https://github.com/nf-core/test-datasets/raw/coproid/genomes/genomesheet_full.csv' 19 | file_prefix = 'coproid' 20 | sam2lca_identity = 0.8 21 | sam2lca_acc2tax = 'adnamap' //'adnamap' for db build, 'nucl' for default 22 | kraken2_db = 'https://github.com/nf-core/test-datasets/raw/coproid/kraken.tar.gz' 23 | sp_sources = 'https://github.com/nf-core/test-datasets/raw/coproid/sourcepredict/test_full_sources.csv' 24 | sp_labels = 'https://github.com/nf-core/test-datasets/raw/coproid/sourcepredict/test_full_labels.csv' 25 | taxa_sqlite = params.modules_testdata_base_path + '/genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite.xz' 26 | taxa_sqlite_traverse_pkl = params.modules_testdata_base_path + '/genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite_traverse.pkl' 27 | } 28 | -------------------------------------------------------------------------------- /modules/nf-core/sam2lca/analyze/main.nf: -------------------------------------------------------------------------------- 1 | 2 | process SAM2LCA_ANALYZE { 3 | tag "$meta.id" 4 | label 'process_medium' 5 | 6 | conda "${moduleDir}/environment.yml" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/sam2lca:1.1.2--pyhdfd78af_1': 9 | 'biocontainers/sam2lca:1.1.2--pyhdfd78af_1' }" 10 | 11 | input: 12 | tuple val(meta), path(bam), path(bai) 13 | path(database) 14 | 15 | output: 16 | tuple val(meta), path("*.csv") , emit: csv 17 | tuple val(meta), path("*.json") , emit: json 18 | tuple val(meta), path("*.bam") , emit: bam , optional: true 19 | path "versions.yml" , emit: versions 20 | 21 | when: 22 | task.ext.when == null || task.ext.when 23 | 24 | script: 25 | def args = task.ext.args ?: '' 26 | def prefix = task.ext.prefix ?: "${meta.id}" 27 | def make_db = database ? "" : "mkdir sam2lca_db" 28 | def database = database ? "${database}" : "sam2lca_db" 29 | """ 30 | $make_db 31 | sam2lca \\ 32 | -d $database \\ 33 | analyze \\ 34 | $args \\ 35 | -o ${prefix} \\ 36 | $bam 37 | 38 | cat <<-END_VERSIONS > versions.yml 39 | "${task.process}": 40 | sam2lca: \$(echo \$(sam2lca --version 2>&1) | sed 's/^sam2lca, version //' )) 41 | END_VERSIONS 42 | """ 43 | 44 | stub: 45 | def args = task.ext.args ?: '' 46 | def prefix = task.ext.prefix ?: "${meta.id}" 47 | """ 48 | touch ${prefix}.csv 49 | touch ${prefix}.json 50 | 51 | cat <<-END_VERSIONS > versions.yml 52 | "${task.process}": 53 | sam2lca: \$(echo \$(sam2lca --version 2>&1) | sed 's/^sam2lca, version //' )) 54 | END_VERSIONS 55 | """ 56 | } 57 | -------------------------------------------------------------------------------- /bin/sam2lca_merge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Written by Meriam van Os, released under the MIT license 4 | # See https://opensource.org/license/mit for details 5 | 6 | """Merge sam2lca results from multiple samples into a single CSV file used for the Quarto report.""" 7 | 8 | import sys 9 | import os 10 | import pandas as pd 11 | 12 | # Get command-line arguments 13 | if len(sys.argv) < 3: 14 | print("Usage: python script.py ...") 15 | sys.exit(1) 16 | 17 | # Extract output file and CSV files 18 | output_file = sys.argv[1] 19 | csv_files = sys.argv[2:] 20 | 21 | # Initialize an empty list to store filtered dataframes 22 | filtered_data = [] 23 | 24 | # Loop through each CSV file 25 | for file in csv_files: 26 | # Extract sample name from the file name 27 | sample_name = os.path.basename(file).split(".")[0] 28 | 29 | # Read the CSV file 30 | df = pd.read_csv(file) 31 | 32 | # Filter rows where 'count_taxon' > 0 33 | df_filtered = df[df['count_taxon'] > 0].copy() 34 | 35 | # Filter rows where 'count_taxon' > 0 and 'rank' is 'species' or 'subspecies' 36 | df_filtered = df[(df['count_taxon'] > 0) & (df['rank'].isin(['species', 'subspecies', 'strain']))].copy() 37 | 38 | # Keep relevant columns and rename 'count_taxon' to the sample name 39 | df_filtered = df_filtered[['TAXID', 'name', 'rank', 'count_taxon']].rename(columns={'count_taxon': sample_name}) 40 | 41 | # Append to the list 42 | filtered_data.append(df_filtered) 43 | 44 | # Merge all filtered dataframes on TAXID, name, and rank 45 | final_df = filtered_data[0] 46 | for df in filtered_data[1:]: 47 | final_df = pd.merge(final_df, df, on=['TAXID', 'name', 'rank'], how='outer') 48 | 49 | # Save the final table to the specified output file 50 | final_df.to_csv(output_file, index=False) 51 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Subworkflow that uses the nf-schema plugin to validate parameters and render the parameter summary 3 | // 4 | 5 | include { paramsSummaryLog } from 'plugin/nf-schema' 6 | include { validateParameters } from 'plugin/nf-schema' 7 | 8 | workflow UTILS_NFSCHEMA_PLUGIN { 9 | 10 | take: 11 | input_workflow // workflow: the workflow object used by nf-schema to get metadata from the workflow 12 | validate_params // boolean: validate the parameters 13 | parameters_schema // string: path to the parameters JSON schema. 14 | // this has to be the same as the schema given to `validation.parametersSchema` 15 | // when this input is empty it will automatically use the configured schema or 16 | // "${projectDir}/nextflow_schema.json" as default. This input should not be empty 17 | // for meta pipelines 18 | 19 | main: 20 | 21 | // 22 | // Print parameter summary to stdout. This will display the parameters 23 | // that differ from the default given in the JSON schema 24 | // 25 | if(parameters_schema) { 26 | log.info paramsSummaryLog(input_workflow, parameters_schema:parameters_schema) 27 | } else { 28 | log.info paramsSummaryLog(input_workflow) 29 | } 30 | 31 | // 32 | // Validate the parameters using nextflow_schema.json or the schema 33 | // given via the validation.parametersSchema configuration option 34 | // 35 | if(validate_params) { 36 | if(parameters_schema) { 37 | validateParameters(parameters_schema:parameters_schema) 38 | } else { 39 | validateParameters() 40 | } 41 | } 42 | 43 | emit: 44 | dummy_emit = true 45 | } 46 | 47 | -------------------------------------------------------------------------------- /bin/kraken_merge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Written by Maxime Borry and released under the MIT license. 4 | # See git repository (https://github.com/nf-core/eager) for full license text. 5 | 6 | import argparse 7 | import os 8 | import pandas as pd 9 | import numpy as np 10 | 11 | 12 | def _get_args(): 13 | """This function parses and return arguments passed in""" 14 | parser = argparse.ArgumentParser( 15 | prog="merge_kraken_res", 16 | formatter_class=argparse.RawDescriptionHelpFormatter, 17 | description="Merging csv count files in one table", 18 | ) 19 | parser.add_argument( 20 | "-or", 21 | dest="readout", 22 | default="kraken_read_count_table.csv", 23 | help="Read count output file. Default = kraken_read_count_table.csv", 24 | ) 25 | args = parser.parse_args() 26 | 27 | readout = args.readout 28 | 29 | return readout 30 | 31 | 32 | def get_csv(): 33 | tmp = [i for i in os.listdir() if ".csv" in i] 34 | read = [i for i in tmp if ".read_" in i] 35 | return read 36 | 37 | 38 | def _get_basename(file_name): 39 | if ("/") in file_name: 40 | basename = file_name.split("/")[-1].split(".")[0] 41 | else: 42 | basename = file_name.split(".")[0] 43 | return basename 44 | 45 | 46 | def merge_csv(all_csv): 47 | df = pd.read_csv(all_csv[0], index_col=0) 48 | for i in range(1, len(all_csv)): 49 | df_tmp = pd.read_csv(all_csv[i], index_col=0) 50 | df = pd.merge(left=df, right=df_tmp, on="TAXID", how="outer") 51 | df.fillna(0, inplace=True) 52 | return df 53 | 54 | 55 | def write_csv(pd_dataframe, outfile): 56 | pd_dataframe.to_csv(outfile) 57 | 58 | 59 | if __name__ == "__main__": 60 | READOUT = _get_args() 61 | reads = get_csv() 62 | read_df = merge_csv(reads) 63 | write_csv(read_df, READOUT) 64 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/samtools-sort.diff: -------------------------------------------------------------------------------- 1 | Changes in module 'nf-core/samtools/sort' 2 | 'modules/nf-core/samtools/sort/environment.yml' is unchanged 3 | Changes in 'samtools/sort/meta.yml': 4 | --- modules/nf-core/samtools/sort/meta.yml 5 | +++ modules/nf-core/samtools/sort/meta.yml 6 | @@ -89,4 +89,4 @@ 7 | maintainers: 8 | - "@drpatelh" 9 | - "@ewels" 10 | - - "@matthdsm" 11 | + - "@matthdsm" 12 | Changes in 'samtools/sort/main.nf': 13 | --- modules/nf-core/samtools/sort/main.nf 14 | +++ modules/nf-core/samtools/sort/main.nf 15 | @@ -28,7 +28,7 @@ 16 | args.contains("--output-fmt cram") ? "cram" : 17 | "bam" 18 | def reference = fasta ? "--reference ${fasta}" : "" 19 | - if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 20 | + if ("$bam" == "${prefix}.sorted.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 21 | 22 | """ 23 | samtools cat \\ 24 | @@ -39,7 +39,7 @@ 25 | -T ${prefix} \\ 26 | --threads $task.cpus \\ 27 | ${reference} \\ 28 | - -o ${prefix}.${extension} \\ 29 | + -o ${prefix}.sorted.${extension} \\ 30 | - 31 | 32 | cat <<-END_VERSIONS > versions.yml 33 | @@ -69,4 +69,4 @@ 34 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 35 | END_VERSIONS 36 | """ 37 | -} 38 | +} 39 | 'modules/nf-core/samtools/sort/tests/nextflow_cram.config' is unchanged 40 | 'modules/nf-core/samtools/sort/tests/nextflow.config' is unchanged 41 | 'modules/nf-core/samtools/sort/tests/tags.yml' is unchanged 42 | 'modules/nf-core/samtools/sort/tests/main.nf.test' is unchanged 43 | 'modules/nf-core/samtools/sort/tests/main.nf.test.snap' is unchanged 44 | ************************************************************ 45 | -------------------------------------------------------------------------------- /.github/workflows/release-announcements.yml: -------------------------------------------------------------------------------- 1 | name: release-announcements 2 | # Automatic release toot and tweet anouncements 3 | on: 4 | release: 5 | types: [published] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | toot: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: get topics and convert to hashtags 13 | id: get_topics 14 | run: | 15 | echo "topics=$(curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ')" | sed 's/-//g' >> $GITHUB_OUTPUT 16 | 17 | - uses: rzr/fediverse-action@master 18 | with: 19 | access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} 20 | host: "mstdn.science" # custom host if not "mastodon.social" (default) 21 | # GitHub event payload 22 | # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release 23 | message: | 24 | Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! 25 | 26 | Please see the changelog: ${{ github.event.release.html_url }} 27 | 28 | ${{ steps.get_topics.outputs.topics }} #nfcore #openscience #nextflow #bioinformatics 29 | 30 | bsky-post: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: zentered/bluesky-post-action@80dbe0a7697de18c15ad22f4619919ceb5ccf597 # v0.1.0 34 | with: 35 | post: | 36 | Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! 37 | 38 | Please see the changelog: ${{ github.event.release.html_url }} 39 | env: 40 | BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }} 41 | BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} 42 | # 43 | -------------------------------------------------------------------------------- /assets/slackreport.json: -------------------------------------------------------------------------------- 1 | { 2 | "attachments": [ 3 | { 4 | "fallback": "Plain-text summary of the attachment.", 5 | "color": "<% if (success) { %>good<% } else { %>danger<%} %>", 6 | "author_name": "nf-core/coproid ${version} - ${runName}", 7 | "author_icon": "https://www.nextflow.io/docs/latest/_static/favicon.ico", 8 | "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors<% } %>", 9 | "fields": [ 10 | { 11 | "title": "Command used to launch the workflow", 12 | "value": "```${commandLine}```", 13 | "short": false 14 | } 15 | <% 16 | if (!success) { %> 17 | , 18 | { 19 | "title": "Full error message", 20 | "value": "```${errorReport}```", 21 | "short": false 22 | }, 23 | { 24 | "title": "Pipeline configuration", 25 | "value": "<% out << summary.collect{ k,v -> k == "hook_url" ? "_${k}_: (_hidden_)" : ( ( v.class.toString().contains('Path') || ( v.class.toString().contains('String') && v.contains('/') ) ) ? "_${k}_: `${v}`" : (v.class.toString().contains('DateTime') ? ("_${k}_: " + v.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM))) : "_${k}_: ${v}") ) }.join(",\n") %>", 26 | "short": false 27 | } 28 | <% } 29 | %> 30 | ], 31 | "footer": "Completed at <% out << dateComplete.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM)) %> (duration: ${duration})" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /modules/nf-core/xz/decompress/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | name "Test Process XZ_DECOMPRESS" 3 | script "../main.nf" 4 | process "XZ_DECOMPRESS" 5 | config "./nextflow.config" 6 | 7 | tag "modules" 8 | tag "modules_nfcore" 9 | tag "xz" 10 | tag "xz/decompress" 11 | tag "xz/compress" 12 | 13 | test("sarscov2 - genome - fasta") { 14 | setup { 15 | run("XZ_COMPRESS") { 16 | script "../../compress/main.nf" 17 | process { 18 | """ 19 | input[0] = [ 20 | [ id:'test'], // meta map 21 | file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) 22 | ] 23 | """ 24 | } 25 | } 26 | } 27 | when { 28 | process { 29 | """ 30 | input[0] = XZ_COMPRESS.out.archive 31 | """ 32 | } 33 | } 34 | then { 35 | assertAll( 36 | { assert process.success }, 37 | { assert snapshot(process.out).match() } 38 | ) 39 | } 40 | } 41 | 42 | test("sarscov2 - genome - fasta - stub") { 43 | options "-stub-run" 44 | when { 45 | process { 46 | """ 47 | input[0] = [ 48 | [ id:'test'], // meta map 49 | file("test.xz") 50 | ] 51 | """ 52 | } 53 | } 54 | then { 55 | assertAll( 56 | { assert process.success }, 57 | { assert snapshot( 58 | file(process.out.file[0][1]).name, 59 | process.out.versions 60 | ).match() 61 | } 62 | ) 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /modules/nf-core/xz/decompress/main.nf: -------------------------------------------------------------------------------- 1 | process XZ_DECOMPRESS { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/mulled-v2-796b0610595ad1995b121d0b85375902097b78d4:a3a3220eb9ee55710d743438b2ab9092867c98c6-0' : 8 | 'biocontainers/mulled-v2-796b0610595ad1995b121d0b85375902097b78d4:a3a3220eb9ee55710d743438b2ab9092867c98c6-0' }" 9 | 10 | input: 11 | tuple val(meta), path(archive) 12 | 13 | output: 14 | tuple val(meta), path("$decompressed_file"), emit: file 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | decompressed_file = archive.toString().replaceAll(".xz\$", "") 23 | """ 24 | # Note 1: needs --stdout for xz --decompress to avoid two issues: 25 | # 1. xz: ${archive}: Is a symbolic link, skipping 26 | # 2. xz: ${archive}: Cannot set the file group: Operation not permitted 27 | # Note 2: using several threads in xz --decompress will only work on files that contain multiple blocks with size 28 | # information in block headers. All files compressed in multi-threaded mode meet this condition. 29 | xz -T ${task.cpus} --decompress --stdout ${args} ${archive} > ${decompressed_file} 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | xz: \$(xz --version | head -n1 | awk '{print \$NF}') 34 | END_VERSIONS 35 | """ 36 | 37 | stub: 38 | decompressed_file = archive.toString().replaceAll(".xz\$", "") 39 | """ 40 | touch "${decompressed_file}" 41 | 42 | cat <<-END_VERSIONS > versions.yml 43 | "${task.process}": 44 | xz: \$(xz --version | head -n1 | awk '{print \$NF}') 45 | END_VERSIONS 46 | """ 47 | } 48 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Report something that is broken or incorrect 3 | labels: bug 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Before you post this issue, please check the documentation: 9 | 10 | - [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting) 11 | - [nf-core/coproid pipeline documentation](https://nf-co.re/coproid/usage) 12 | - type: textarea 13 | id: description 14 | attributes: 15 | label: Description of the bug 16 | description: A clear and concise description of what the bug is. 17 | validations: 18 | required: true 19 | 20 | - type: textarea 21 | id: command_used 22 | attributes: 23 | label: Command used and terminal output 24 | description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal. 25 | render: console 26 | placeholder: | 27 | $ nextflow run ... 28 | 29 | Some output where something broke 30 | 31 | - type: textarea 32 | id: files 33 | attributes: 34 | label: Relevant files 35 | description: | 36 | Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed. 37 | Your verbose log file `.nextflow.log` is often useful _(this is a hidden file in the directory where you launched the pipeline)_ as well as custom Nextflow configuration files. 38 | 39 | - type: textarea 40 | id: system 41 | attributes: 42 | label: System information 43 | description: | 44 | * Nextflow version _(eg. 23.04.0)_ 45 | * Hardware _(eg. HPC, Desktop, Cloud)_ 46 | * Executor _(eg. slurm, local, awsbatch)_ 47 | * Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_ 48 | * OS _(eg. CentOS Linux, macOS, Linux Mint)_ 49 | * Version of nf-core/coproid _(eg. 1.1, 1.5, 1.8.2)_ 50 | -------------------------------------------------------------------------------- /conf/test.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running minimal tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a fast and simple pipeline test. 6 | 7 | Use as follows: 8 | nextflow run nf-core/coproid -profile test, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | process { 14 | resourceLimits = [ 15 | cpus: 4, 16 | memory: '15.GB', 17 | time: '1.h' 18 | ] 19 | } 20 | 21 | params { 22 | config_profile_name = 'Test profile' 23 | config_profile_description = 'Minimal test dataset to check pipeline function' 24 | 25 | // Input data 26 | input = 'https://github.com/nf-core/test-datasets/raw/coproid/reads/samplesheet.csv' 27 | genome_sheet = 'https://github.com/nf-core/test-datasets/raw/coproid/genomes/genomesheet.csv' 28 | file_prefix = 'coproid' 29 | sam2lca_identity = 0.8 30 | sam2lca_acc2tax = 'adnamap' //'adnamap' for db build, 'nucl' for default 31 | kraken2_db = 'https://github.com/nf-core/test-datasets/raw/coproid/kraken.tar.gz' 32 | sp_sources = 'https://github.com/nf-core/test-datasets/raw/coproid/sourcepredict/test_sources.csv' 33 | sp_labels = 'https://github.com/nf-core/test-datasets/raw/coproid/sourcepredict/test_labels.csv' 34 | taxa_sqlite = params.modules_testdata_base_path + '/genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite.xz' 35 | taxa_sqlite_traverse_pkl = params.modules_testdata_base_path + '/genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite_traverse.pkl' 36 | } 37 | 38 | process { 39 | withName: BOWTIE2_ALIGN { 40 | ext.args = '-N 1 -D 20 -R 3 -L 20 -i S,1,0.50' 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Should run without failures": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test" 9 | }, 10 | [ 11 | "genome.1.bt2:md5,cbe3d0bbea55bc57c99b4bfa25b5fbdf", 12 | "genome.2.bt2:md5,47b153cd1319abc88dda532462651fcf", 13 | "genome.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", 14 | "genome.4.bt2:md5,c25be5f8b0378abf7a58c8a880b87626", 15 | "genome.rev.1.bt2:md5,52be6950579598a990570fbcf5372184", 16 | "genome.rev.2.bt2:md5,e3b4ef343dea4dd571642010a7d09597" 17 | ] 18 | ] 19 | ], 20 | "1": [ 21 | "versions.yml:md5,1df11e9b82891527271c889c880d3974" 22 | ], 23 | "index": [ 24 | [ 25 | { 26 | "id": "test" 27 | }, 28 | [ 29 | "genome.1.bt2:md5,cbe3d0bbea55bc57c99b4bfa25b5fbdf", 30 | "genome.2.bt2:md5,47b153cd1319abc88dda532462651fcf", 31 | "genome.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", 32 | "genome.4.bt2:md5,c25be5f8b0378abf7a58c8a880b87626", 33 | "genome.rev.1.bt2:md5,52be6950579598a990570fbcf5372184", 34 | "genome.rev.2.bt2:md5,e3b4ef343dea4dd571642010a7d09597" 35 | ] 36 | ] 37 | ], 38 | "versions": [ 39 | "versions.yml:md5,1df11e9b82891527271c889c880d3974" 40 | ] 41 | } 42 | ], 43 | "timestamp": "2023-11-23T11:51:01.107681997" 44 | } 45 | } -------------------------------------------------------------------------------- /.github/workflows/template_version_comment.yml: -------------------------------------------------------------------------------- 1 | name: nf-core template version comment 2 | # This workflow is triggered on PRs to check if the pipeline template version matches the latest nf-core version. 3 | # It posts a comment to the PR, even if it comes from a fork. 4 | 5 | on: pull_request_target 6 | 7 | jobs: 8 | template_version: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Check out pipeline code 12 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 13 | with: 14 | ref: ${{ github.event.pull_request.head.sha }} 15 | 16 | - name: Read template version from .nf-core.yml 17 | uses: nichmor/minimal-read-yaml@v0.0.2 18 | id: read_yml 19 | with: 20 | config: ${{ github.workspace }}/.nf-core.yml 21 | 22 | - name: Install nf-core 23 | run: | 24 | python -m pip install --upgrade pip 25 | pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} 26 | 27 | - name: Check nf-core outdated 28 | id: nf_core_outdated 29 | run: echo "OUTPUT=$(pip list --outdated | grep nf-core)" >> ${GITHUB_ENV} 30 | 31 | - name: Post nf-core template version comment 32 | uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 33 | if: | 34 | contains(env.OUTPUT, 'nf-core') 35 | with: 36 | repo-token: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }} 37 | allow-repeats: false 38 | message: | 39 | > [!WARNING] 40 | > Newer version of the nf-core template is available. 41 | > 42 | > Your pipeline is using an old version of the nf-core template: ${{ steps.read_yml.outputs['nf_core_version'] }}. 43 | > Please update your pipeline to the latest version. 44 | > 45 | > For more documentation on how to update your pipeline, please see the [nf-core documentation](https://github.com/nf-core/tools?tab=readme-ov-file#sync-a-pipeline-with-the-template) and [Synchronisation documentation](https://nf-co.re/docs/contributing/sync). 46 | # 47 | -------------------------------------------------------------------------------- /modules/nf-core/sam2lca/analyze/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_process { 3 | 4 | name "Test Process SAM2LCA_ANALYZE" 5 | script "../main.nf" 6 | process "SAM2LCA_ANALYZE" 7 | config "./nextflow.config" 8 | 9 | tag "modules" 10 | tag "modules_nfcore" 11 | tag "sam2lca" 12 | tag "sam2lca/analyze" 13 | 14 | test("test-sam2lca-analyze") { 15 | 16 | when { 17 | process { 18 | """ 19 | input[0] = [ 20 | [ id:'test', single_end:false ], // meta map 21 | file("https://raw.githubusercontent.com/maxibor/sam2lca/1.1.2/tests/data/microtest.sorted.bam", checkIfExists: true), 22 | file("https://raw.githubusercontent.com/maxibor/sam2lca/1.1.2/tests/data/microtest.sorted.bam.bai", checkIfExists: true) 23 | ] 24 | input[1] = [] 25 | 26 | """ 27 | } 28 | } 29 | 30 | then { 31 | assertAll( 32 | { assert process.success }, 33 | { assert snapshot( 34 | file(process.out.csv[0][1]).name, 35 | process.out.json, 36 | process.out.bam, 37 | process.out.versions 38 | ).match() 39 | } 40 | ) 41 | } 42 | } 43 | 44 | test("test-sam2lca-analyze-stub") { 45 | options '-stub' 46 | 47 | when { 48 | process { 49 | """ 50 | input[0] = [ 51 | [ id:'test', single_end:false ], // meta map 52 | file("https://raw.githubusercontent.com/maxibor/sam2lca/1.1.2/tests/data/microtest.sorted.bam", checkIfExists: true), 53 | file("https://raw.githubusercontent.com/maxibor/sam2lca/1.1.2/tests/data/microtest.sorted.bam.bai", checkIfExists: true) 54 | ] 55 | input[1] = [] 56 | 57 | """ 58 | } 59 | } 60 | 61 | then { 62 | assertAll( 63 | { assert process.success }, 64 | { assert snapshot(process.out).match() } 65 | ) 66 | } 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /modules/nf-core/sourcepredict/main.nf: -------------------------------------------------------------------------------- 1 | process SOURCEPREDICT { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/sourcepredict:0.5.1--pyhdfd78af_0': 8 | 'biocontainers/sourcepredict:0.5.1--pyhdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(kraken_parse) 12 | path sources 13 | path labels 14 | path(taxa_sqlite, stageAs: '.etetoolkit/taxa.sqlite') 15 | path(taxa_sqlite_traverse_pkl, stageAs: '.etetoolkit/*') 16 | val save_embedding 17 | 18 | output: 19 | tuple val(meta), path("*.embedding.sourcepredict.csv") , optional:true, emit: embedding 20 | tuple val(meta), path("*.report.sourcepredict.csv") , emit: report 21 | path "versions.yml" , emit: versions 22 | 23 | when: 24 | task.ext.when == null || task.ext.when 25 | 26 | script: 27 | def args = task.ext.args ?: '' 28 | def prefix = task.ext.prefix ?: "${meta.id}" 29 | def save_embedding = save_embedding ? "-e ${prefix}.embedding.sourcepredict.csv" : "" 30 | """ 31 | export NUMBA_CACHE_DIR='./tmp' 32 | export HOME='./' 33 | 34 | sourcepredict \\ 35 | -s $sources \\ 36 | -l $labels \\ 37 | $args \\ 38 | $save_embedding \\ 39 | -t $task.cpus \\ 40 | -o ${prefix}.report.sourcepredict.csv \\ 41 | ${kraken_parse} 42 | 43 | cat <<-END_VERSIONS > versions.yml 44 | "${task.process}": 45 | sourcepredict: \$(python -c "import sourcepredict; print(sourcepredict.__version__)") 46 | END_VERSIONS 47 | """ 48 | 49 | stub: 50 | def args = task.ext.args ?: '' 51 | def prefix = task.ext.prefix ?: "${meta.id}" 52 | """ 53 | touch ${prefix}.sourcepredict.csv 54 | 55 | cat <<-END_VERSIONS > versions.yml 56 | "${task.process}": 57 | sourcepredict: \$(python -c "import sourcepredict; print(sourcepredict.__version__)") 58 | END_VERSIONS 59 | """ 60 | } 61 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/main.nf: -------------------------------------------------------------------------------- 1 | process MULTIQC { 2 | label 'process_single' 3 | 4 | conda "${moduleDir}/environment.yml" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/multiqc:1.27--pyhdfd78af_0' : 7 | 'biocontainers/multiqc:1.27--pyhdfd78af_0' }" 8 | 9 | input: 10 | path multiqc_files, stageAs: "?/*" 11 | path(multiqc_config) 12 | path(extra_multiqc_config) 13 | path(multiqc_logo) 14 | path(replace_names) 15 | path(sample_names) 16 | 17 | output: 18 | path "*multiqc_report.html", emit: report 19 | path "*_data" , emit: data 20 | path "*_plots" , optional:true, emit: plots 21 | path "versions.yml" , emit: versions 22 | 23 | when: 24 | task.ext.when == null || task.ext.when 25 | 26 | script: 27 | def args = task.ext.args ?: '' 28 | def prefix = task.ext.prefix ? "--filename ${task.ext.prefix}.html" : '' 29 | def config = multiqc_config ? "--config $multiqc_config" : '' 30 | def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' 31 | def logo = multiqc_logo ? "--cl-config 'custom_logo: \"${multiqc_logo}\"'" : '' 32 | def replace = replace_names ? "--replace-names ${replace_names}" : '' 33 | def samples = sample_names ? "--sample-names ${sample_names}" : '' 34 | """ 35 | multiqc \\ 36 | --force \\ 37 | $args \\ 38 | $config \\ 39 | $prefix \\ 40 | $extra_config \\ 41 | $logo \\ 42 | $replace \\ 43 | $samples \\ 44 | . 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 49 | END_VERSIONS 50 | """ 51 | 52 | stub: 53 | """ 54 | mkdir multiqc_data 55 | mkdir multiqc_plots 56 | touch multiqc_report.html 57 | 58 | cat <<-END_VERSIONS > versions.yml 59 | "${task.process}": 60 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 61 | END_VERSIONS 62 | """ 63 | } 64 | -------------------------------------------------------------------------------- /modules/nf-core/fastqc/meta.yml: -------------------------------------------------------------------------------- 1 | name: fastqc 2 | description: Run FastQC on sequenced reads 3 | keywords: 4 | - quality control 5 | - qc 6 | - adapters 7 | - fastq 8 | tools: 9 | - fastqc: 10 | description: | 11 | FastQC gives general quality metrics about your reads. 12 | It provides information about the quality score distribution 13 | across your reads, the per base sequence content (%A/C/G/T). 14 | 15 | You get information about adapter contamination and other 16 | overrepresented sequences. 17 | homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ 18 | documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/ 19 | licence: ["GPL-2.0-only"] 20 | identifier: biotools:fastqc 21 | input: 22 | - - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing sample information 26 | e.g. [ id:'test', single_end:false ] 27 | - reads: 28 | type: file 29 | description: | 30 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 31 | respectively. 32 | output: 33 | - html: 34 | - meta: 35 | type: map 36 | description: | 37 | Groovy Map containing sample information 38 | e.g. [ id:'test', single_end:false ] 39 | - "*.html": 40 | type: file 41 | description: FastQC report 42 | pattern: "*_{fastqc.html}" 43 | - zip: 44 | - meta: 45 | type: map 46 | description: | 47 | Groovy Map containing sample information 48 | e.g. [ id:'test', single_end:false ] 49 | - "*.zip": 50 | type: file 51 | description: FastQC report archive 52 | pattern: "*_{fastqc.zip}" 53 | - versions: 54 | - versions.yml: 55 | type: file 56 | description: File containing software versions 57 | pattern: "versions.yml" 58 | authors: 59 | - "@drpatelh" 60 | - "@grst" 61 | - "@ewels" 62 | - "@FelixKrueger" 63 | maintainers: 64 | - "@drpatelh" 65 | - "@grst" 66 | - "@ewels" 67 | - "@FelixKrueger" 68 | -------------------------------------------------------------------------------- /modules/local/sam2lca/updatedb/main.nf: -------------------------------------------------------------------------------- 1 | process SAM2LCA_UPDATEDB { 2 | tag "${acc2tax_name}" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/sam2lca:1.1.4--pyhdfd78af_0': 8 | 'biocontainers/sam2lca:1.1.4--pyhdfd78af_0' }" 9 | 10 | input: 11 | val(acc2tax_name) 12 | val(taxo_db_name) 13 | path(taxo_nodes)// nodes.dmp 14 | path(taxo_names) // names.dmp 15 | path(taxo_merged) // merged.dmp 16 | path(acc2tax_json) // optional 17 | path(acc2tax) // acc2tax.gz 18 | path(acc2tax_md5) // acc2tax.gz.md5 19 | 20 | output: 21 | path "sam2lca_db" , emit: sam2lca_db 22 | path "versions.yml", emit: versions 23 | 24 | when: 25 | task.ext.when == null || task.ext.when 26 | 27 | script: 28 | def args = task.ext.args ?: '' 29 | def names = taxo_names ? "--taxo_names ${taxo_names}" : '' 30 | def nodes = taxo_nodes ? "--taxo_nodes ${taxo_nodes}" : '' 31 | def merged = taxo_merged ? "--taxo_merged ${taxo_merged}" : '' 32 | def json = acc2tax_json ? "--acc2tax_json ${acc2tax_json}" : '' 33 | """ 34 | mkdir -p sam2lca_db 35 | 36 | sam2lca -d sam2lca_db \\ 37 | update-db \\ 38 | -t $taxo_db_name \\ 39 | $names \\ 40 | $nodes \\ 41 | $merged \\ 42 | -a $acc2tax_name \\ 43 | $json \\ 44 | $args 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | sam2lca: \$(echo \$(sam2lca --version 2>&1) | sed 's/^sam2lca, version //' ) 49 | END_VERSIONS 50 | """ 51 | 52 | stub: 53 | """ 54 | mkdir -p sam2lca_db 55 | touch sam2lca_db/test.pkl 56 | 57 | cat <<-END_VERSIONS > versions.yml 58 | "${task.process}": 59 | sam2lca: \$(echo \$(sam2lca --version 2>&1) | sed 's/^sam2lca, version //' ) 60 | END_VERSIONS 61 | """ 62 | } 63 | -------------------------------------------------------------------------------- /modules/nf-core/damageprofiler/meta.yml: -------------------------------------------------------------------------------- 1 | name: damageprofiler 2 | description: A Java based tool to determine damage patterns on ancient DNA as a replacement 3 | for mapDamage 4 | keywords: 5 | - damage 6 | - deamination 7 | - miscoding lesions 8 | - C to T 9 | - ancient DNA 10 | - aDNA 11 | - palaeogenomics 12 | - archaeogenomics 13 | - palaeogenetics 14 | - archaeogenetics 15 | tools: 16 | - damageprofiler: 17 | description: A Java based tool to determine damage patterns on ancient DNA as 18 | a replacement for mapDamage 19 | homepage: https://github.com/Integrative-Transcriptomics/DamageProfiler 20 | documentation: https://damageprofiler.readthedocs.io/ 21 | tool_dev_url: https://github.com/Integrative-Transcriptomics/DamageProfiler 22 | doi: "10.1093/bioinformatics/btab190" 23 | licence: ["GPL v3"] 24 | identifier: biotools:damageprofiler 25 | input: 26 | - - meta: 27 | type: map 28 | description: | 29 | Groovy Map containing sample information 30 | e.g. [ id:'test', single_end:false ] 31 | - bam: 32 | type: file 33 | description: BAM/CRAM/SAM file 34 | pattern: "*.{bam,cram,sam}" 35 | - - fasta: 36 | type: file 37 | description: OPTIONAL FASTA reference file 38 | pattern: "*.{fasta,fna,fa}" 39 | - - fai: 40 | type: file 41 | description: OPTIONAL FASTA index file from samtools faidx 42 | pattern: "*.{fai}" 43 | - - specieslist: 44 | type: file 45 | description: OPTIONAL text file with list of target reference headers 46 | pattern: "*.{txt}" 47 | output: 48 | - results: 49 | - meta: 50 | type: directory 51 | description: DamageProfiler results directory 52 | pattern: "*/*" 53 | - ${prefix}: 54 | type: directory 55 | description: DamageProfiler results directory 56 | pattern: "*/*" 57 | - versions: 58 | - versions.yml: 59 | type: file 60 | description: File containing software versions 61 | pattern: "versions.yml" 62 | authors: 63 | - "@jfy133" 64 | maintainers: 65 | - "@jfy133" 66 | -------------------------------------------------------------------------------- /conf/base.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | nf-core/coproid Nextflow base config file 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | A 'blank slate' config file, appropriate for general use on most high performance 6 | compute environments. Assumes that all software is installed and available on 7 | the PATH. Runs in `local` mode - all jobs will be run on the logged in environment. 8 | ---------------------------------------------------------------------------------------- 9 | */ 10 | 11 | process { 12 | 13 | cpus = { 1 * task.attempt } 14 | memory = { 6.GB * task.attempt } 15 | time = { 4.h * task.attempt } 16 | 17 | errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } 18 | maxRetries = 1 19 | maxErrors = '-1' 20 | 21 | withLabel:process_single { 22 | cpus = { 1 } 23 | memory = { 6.GB * task.attempt } 24 | time = { 4.h * task.attempt } 25 | } 26 | withLabel:process_low { 27 | cpus = { 2 * task.attempt } 28 | memory = { 12.GB * task.attempt } 29 | time = { 4.h * task.attempt } 30 | } 31 | withLabel:process_medium { 32 | cpus = { 6 * task.attempt } 33 | memory = { 36.GB * task.attempt } 34 | time = { 8.h * task.attempt } 35 | } 36 | withLabel:process_high { 37 | cpus = { 12 * task.attempt } 38 | memory = { 72.GB * task.attempt } 39 | time = { 16.h * task.attempt } 40 | } 41 | withLabel:process_long { 42 | time = { 20.h * task.attempt } 43 | } 44 | withLabel:process_high_memory { 45 | memory = { 200.GB * task.attempt } 46 | } 47 | withLabel:error_ignore { 48 | errorStrategy = 'ignore' 49 | } 50 | withLabel:error_retry { 51 | errorStrategy = 'retry' 52 | maxRetries = 2 53 | } 54 | 55 | // Custom label for process that need very few resources 56 | withLabel:process_short { 57 | cpus = { 1 } 58 | memory = { 6.GB * task.attempt } 59 | time = { 10.m * task.attempt } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/index/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_index 2 | description: Index SAM/BAM/CRAM file 3 | keywords: 4 | - index 5 | - bam 6 | - sam 7 | - cram 8 | tools: 9 | - samtools: 10 | description: | 11 | SAMtools is a set of utilities for interacting with and post-processing 12 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 13 | These files are generated as output by short read aligners like BWA. 14 | homepage: http://www.htslib.org/ 15 | documentation: http://www.htslib.org/doc/samtools.html 16 | doi: 10.1093/bioinformatics/btp352 17 | licence: ["MIT"] 18 | identifier: biotools:samtools 19 | input: 20 | - - meta: 21 | type: map 22 | description: | 23 | Groovy Map containing sample information 24 | e.g. [ id:'test', single_end:false ] 25 | - input: 26 | type: file 27 | description: input file 28 | output: 29 | - bai: 30 | - meta: 31 | type: map 32 | description: | 33 | Groovy Map containing sample information 34 | e.g. [ id:'test', single_end:false ] 35 | - "*.bai": 36 | type: file 37 | description: BAM/CRAM/SAM index file 38 | pattern: "*.{bai,crai,sai}" 39 | - csi: 40 | - meta: 41 | type: map 42 | description: | 43 | Groovy Map containing sample information 44 | e.g. [ id:'test', single_end:false ] 45 | - "*.csi": 46 | type: file 47 | description: CSI index file 48 | pattern: "*.{csi}" 49 | - crai: 50 | - meta: 51 | type: map 52 | description: | 53 | Groovy Map containing sample information 54 | e.g. [ id:'test', single_end:false ] 55 | - "*.crai": 56 | type: file 57 | description: BAM/CRAM/SAM index file 58 | pattern: "*.{bai,crai,sai}" 59 | - versions: 60 | - versions.yml: 61 | type: file 62 | description: File containing software versions 63 | pattern: "versions.yml" 64 | authors: 65 | - "@drpatelh" 66 | - "@ewels" 67 | - "@maxulysse" 68 | maintainers: 69 | - "@drpatelh" 70 | - "@ewels" 71 | - "@maxulysse" 72 | -------------------------------------------------------------------------------- /assets/schema_genomes.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://raw.githubusercontent.com/nf-core/coproid/master/assets/schema_genomes.json", 4 | "title": "nf-core/coproid pipeline - params.genomes schema", 5 | "description": "Schema for the file provided with params.genomes", 6 | "type": "array", 7 | "items": { 8 | "type": "object", 9 | "properties": { 10 | "genome_name": { 11 | "type": "string", 12 | "pattern": "^\\S+$", 13 | "errorMessage": "Genome name must be provided as a string value and cannot contain spaces", 14 | "meta": ["genome_name"] 15 | }, 16 | "taxid": { 17 | "type": "integer", 18 | "pattern": "^\\d+$", 19 | "errorMessage": "Taxid must be provided as an integer value", 20 | "meta": ["taxid"] 21 | }, 22 | "genome_size": { 23 | "type": "integer", 24 | "pattern": "^\\d+$", 25 | "errorMessage": "Genome size must be provided as an integer value and cannot contain spaces", 26 | "meta": ["genome_size"] 27 | }, 28 | "igenome": { 29 | "type": "string", 30 | "format": "file-path", 31 | "pattern": "^\\S+$", 32 | "exists": true, 33 | "errorMessage": "iGenome name or fasta must be an existing file path that does not contain spaces" 34 | }, 35 | "fasta": { 36 | "type": "string", 37 | "format": "file-path", 38 | "pattern": "^\\S+\\.(fasta|fas|fa|fna)(\\.gz)?$", 39 | "exists": true, 40 | "errorMessage": "Fasta must be an existing file that ends with '.fasta', '.fai', '.fna' or '.fa'. This file can be gzipped" 41 | }, 42 | "index": { 43 | "type": "string", 44 | "format": "path", 45 | "exists": true 46 | } 47 | }, 48 | "required": ["genome_name", "taxid", "genome_size"], 49 | "oneOf": [{ "required": ["igenome"] }, { "required": ["fasta"] }] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /modules/nf-core/sourcepredict/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "metagenome - csv - stub": { 3 | "content": [ 4 | { 5 | "0": [ 6 | [ 7 | { 8 | "id": "test" 9 | }, 10 | "test.sourcepredict.csv:md5,d41d8cd98f00b204e9800998ecf8427e" 11 | ] 12 | ], 13 | "1": [ 14 | "versions.yml:md5,d0e1400b2ad38aa0f76376e617a80015" 15 | ], 16 | "report": [ 17 | [ 18 | { 19 | "id": "test" 20 | }, 21 | "test.sourcepredict.csv:md5,d41d8cd98f00b204e9800998ecf8427e" 22 | ] 23 | ], 24 | "versions": [ 25 | "versions.yml:md5,d0e1400b2ad38aa0f76376e617a80015" 26 | ] 27 | } 28 | ], 29 | "meta": { 30 | "nf-test": "0.9.0", 31 | "nextflow": "24.04.4" 32 | }, 33 | "timestamp": "2024-10-28T10:34:52.530249987" 34 | }, 35 | "metagenome - csv": { 36 | "content": [ 37 | { 38 | "0": [ 39 | [ 40 | { 41 | "id": "test" 42 | }, 43 | "test.sourcepredict.csv:md5,fd90e16e7d7ce577d9b561afb1ebb24b" 44 | ] 45 | ], 46 | "1": [ 47 | "versions.yml:md5,d0e1400b2ad38aa0f76376e617a80015" 48 | ], 49 | "report": [ 50 | [ 51 | { 52 | "id": "test" 53 | }, 54 | "test.sourcepredict.csv:md5,fd90e16e7d7ce577d9b561afb1ebb24b" 55 | ] 56 | ], 57 | "versions": [ 58 | "versions.yml:md5,d0e1400b2ad38aa0f76376e617a80015" 59 | ] 60 | } 61 | ], 62 | "meta": { 63 | "nf-test": "0.9.0", 64 | "nextflow": "24.04.4" 65 | }, 66 | "timestamp": "2024-10-28T10:34:21.413712277" 67 | } 68 | } -------------------------------------------------------------------------------- /modules/nf-core/untar/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process UNTAR" 4 | script "../main.nf" 5 | process "UNTAR" 6 | tag "modules" 7 | tag "modules_nfcore" 8 | tag "untar" 9 | 10 | test("test_untar") { 11 | 12 | when { 13 | process { 14 | """ 15 | input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true) ] 16 | """ 17 | } 18 | } 19 | 20 | then { 21 | assertAll ( 22 | { assert process.success }, 23 | { assert snapshot(process.out).match() }, 24 | ) 25 | } 26 | } 27 | 28 | test("test_untar_onlyfiles") { 29 | 30 | when { 31 | process { 32 | """ 33 | input[0] = [ [], file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true) ] 34 | """ 35 | } 36 | } 37 | 38 | then { 39 | assertAll ( 40 | { assert process.success }, 41 | { assert snapshot(process.out).match() }, 42 | ) 43 | } 44 | } 45 | 46 | test("test_untar - stub") { 47 | 48 | options "-stub" 49 | 50 | when { 51 | process { 52 | """ 53 | input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true) ] 54 | """ 55 | } 56 | } 57 | 58 | then { 59 | assertAll ( 60 | { assert process.success }, 61 | { assert snapshot(process.out).match() }, 62 | ) 63 | } 64 | } 65 | 66 | test("test_untar_onlyfiles - stub") { 67 | 68 | options "-stub" 69 | 70 | when { 71 | process { 72 | """ 73 | input[0] = [ [], file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true) ] 74 | """ 75 | } 76 | } 77 | 78 | then { 79 | assertAll ( 80 | { assert process.success }, 81 | { assert snapshot(process.out).match() }, 82 | ) 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/merge/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_MERGE { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : 8 | 'biocontainers/samtools:1.21--h50ea8bc_0' }" 9 | 10 | input: 11 | tuple val(meta), path(input_files, stageAs: "?/*") 12 | tuple val(meta2), path(fasta) 13 | tuple val(meta3), path(fai) 14 | 15 | output: 16 | tuple val(meta), path("${prefix}.bam") , optional:true, emit: bam 17 | tuple val(meta), path("${prefix}.cram"), optional:true, emit: cram 18 | tuple val(meta), path("*.csi") , optional:true, emit: csi 19 | tuple val(meta), path("*.crai") , optional:true, emit: crai 20 | path "versions.yml" , emit: versions 21 | 22 | 23 | when: 24 | task.ext.when == null || task.ext.when 25 | 26 | script: 27 | def args = task.ext.args ?: '' 28 | prefix = task.ext.prefix ?: "${meta.id}" 29 | def file_type = input_files instanceof List ? input_files[0].getExtension() : input_files.getExtension() 30 | def reference = fasta ? "--reference ${fasta}" : "" 31 | """ 32 | samtools \\ 33 | merge \\ 34 | --threads ${task.cpus-1} \\ 35 | $args \\ 36 | ${reference} \\ 37 | ${prefix}.${file_type} \\ 38 | $input_files 39 | 40 | cat <<-END_VERSIONS > versions.yml 41 | "${task.process}": 42 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 43 | END_VERSIONS 44 | """ 45 | 46 | stub: 47 | def args = task.ext.args ?: '' 48 | prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" 49 | def file_type = input_files instanceof List ? input_files[0].getExtension() : input_files.getExtension() 50 | def index_type = file_type == "bam" ? "csi" : "crai" 51 | def index = args.contains("--write-index") ? "touch ${prefix}.${index_type}" : "" 52 | """ 53 | touch ${prefix}.${file_type} 54 | ${index} 55 | 56 | cat <<-END_VERSIONS > versions.yml 57 | "${task.process}": 58 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 59 | END_VERSIONS 60 | """ 61 | } 62 | -------------------------------------------------------------------------------- /modules/nf-core/kraken2/kraken2/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "sarscov2 illumina single end [fastq]": { 3 | "content": [ 4 | [ 5 | [ 6 | { 7 | "id": "test", 8 | "single_end": true 9 | }, 10 | "test.kraken2.report.txt:md5,4227755fe40478b8d7dc8634b489761e" 11 | ] 12 | ], 13 | [ 14 | "versions.yml:md5,79adf2ca1cfc625cb77e391b27142c43" 15 | ] 16 | ], 17 | "meta": { 18 | "nf-test": "0.8.4", 19 | "nextflow": "23.10.1" 20 | }, 21 | "timestamp": "2024-04-04T18:47:03.745692" 22 | }, 23 | "sarscov2 illumina paired end [fastq]": { 24 | "content": [ 25 | [ 26 | [ 27 | { 28 | "id": "test", 29 | "single_end": false 30 | }, 31 | "test.kraken2.report.txt:md5,4227755fe40478b8d7dc8634b489761e" 32 | ] 33 | ], 34 | [ 35 | "versions.yml:md5,79adf2ca1cfc625cb77e391b27142c43" 36 | ] 37 | ], 38 | "meta": { 39 | "nf-test": "0.8.4", 40 | "nextflow": "23.10.1" 41 | }, 42 | "timestamp": "2024-04-04T18:47:13.75649" 43 | }, 44 | "sarscov2 illumina single end [fastq] + save_reads_assignment": { 45 | "content": [ 46 | [ 47 | [ 48 | { 49 | "id": "test", 50 | "single_end": true 51 | }, 52 | "test.kraken2.report.txt:md5,4227755fe40478b8d7dc8634b489761e" 53 | ] 54 | ], 55 | [ 56 | [ 57 | { 58 | "id": "test", 59 | "single_end": true 60 | }, 61 | "test.kraken2.classifiedreads.txt:md5,e7a90531f0d8d777316515c36fe4cae0" 62 | ] 63 | ], 64 | [ 65 | "versions.yml:md5,79adf2ca1cfc625cb77e391b27142c43" 66 | ] 67 | ], 68 | "meta": { 69 | "nf-test": "0.8.4", 70 | "nextflow": "23.10.1" 71 | }, 72 | "timestamp": "2024-04-04T18:47:22.459465" 73 | } 74 | } -------------------------------------------------------------------------------- /modules/nf-core/sam2lca/analyze/meta.yml: -------------------------------------------------------------------------------- 1 | name: "sam2lca_analyze" 2 | description: Calling lowest common ancestors from multi-mapped reads in SAM/BAM/CRAM 3 | files 4 | keywords: 5 | - LCA 6 | - alignment 7 | - bam 8 | - metagenomics 9 | - Ancestor 10 | - multimapper 11 | tools: 12 | - "sam2lca": 13 | description: "Lowest Common Ancestor on SAM/BAM/CRAM alignment files" 14 | homepage: "https://github.com/maxibor/sam2lca" 15 | documentation: "https://sam2lca.readthedocs.io" 16 | doi: "10.21105/joss.04360" 17 | licence: ["GPL v3"] 18 | identifier: "" 19 | input: 20 | - - meta: 21 | type: map 22 | description: | 23 | Groovy Map containing sample information 24 | e.g. [ id:'test', single_end:false ] 25 | - bam: 26 | type: file 27 | description: BAM/CRAM/SAM file 28 | pattern: "*.{bam,cram,sam}" 29 | - bai: 30 | type: file 31 | description: BAM/CRAM/SAM index 32 | pattern: "*.{bai,.crai}" 33 | - - database: 34 | type: file 35 | description: Directory containing the sam2lca database 36 | pattern: "*" 37 | output: 38 | - csv: 39 | - meta: 40 | type: map 41 | description: | 42 | Groovy Map containing sample information 43 | e.g. [ id:'test', single_end:false ] 44 | - "*.csv": 45 | type: file 46 | description: CSV file containing the sam2lca results 47 | pattern: "*.csv" 48 | - json: 49 | - meta: 50 | type: map 51 | description: | 52 | Groovy Map containing sample information 53 | e.g. [ id:'test', single_end:false ] 54 | - "*.json": 55 | type: file 56 | description: JSON file containing the sam2lca results 57 | pattern: "*.json" 58 | - bam: 59 | - meta: 60 | type: map 61 | description: | 62 | Groovy Map containing sample information 63 | e.g. [ id:'test', single_end:false ] 64 | - "*.bam": 65 | type: file 66 | description: Optional sorted BAM/CRAM/SAM file annotated with LCA taxonomic 67 | information 68 | pattern: "*.bam" 69 | - versions: 70 | - versions.yml: 71 | type: file 72 | description: File containing software versions 73 | pattern: "versions.yml" 74 | authors: 75 | - "@maxibor" 76 | maintainers: 77 | - "@maxibor" 78 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_SORT { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : 8 | 'biocontainers/samtools:1.21--h50ea8bc_0' }" 9 | 10 | input: 11 | tuple val(meta) , path(bam) 12 | tuple val(meta2), path(fasta) 13 | 14 | output: 15 | tuple val(meta), path("*.bam"), emit: bam, optional: true 16 | tuple val(meta), path("*.cram"), emit: cram, optional: true 17 | tuple val(meta), path("*.crai"), emit: crai, optional: true 18 | tuple val(meta), path("*.csi"), emit: csi, optional: true 19 | path "versions.yml", emit: versions 20 | 21 | when: 22 | task.ext.when == null || task.ext.when 23 | 24 | script: 25 | def args = task.ext.args ?: '' 26 | def prefix = task.ext.prefix ?: "${meta.id}" 27 | def extension = args.contains("--output-fmt sam") ? "sam" : 28 | args.contains("--output-fmt cram") ? "cram" : 29 | "bam" 30 | def reference = fasta ? "--reference ${fasta}" : "" 31 | if ("$bam" == "${prefix}.sorted.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 32 | 33 | """ 34 | samtools cat \\ 35 | ${bam} \\ 36 | | \\ 37 | samtools sort \\ 38 | $args \\ 39 | -T ${prefix} \\ 40 | --threads $task.cpus \\ 41 | ${reference} \\ 42 | -o ${prefix}.sorted.${extension} \\ 43 | - 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 48 | END_VERSIONS 49 | """ 50 | 51 | stub: 52 | def args = task.ext.args ?: '' 53 | def prefix = task.ext.prefix ?: "${meta.id}" 54 | def extension = args.contains("--output-fmt sam") ? "sam" : 55 | args.contains("--output-fmt cram") ? "cram" : 56 | "bam" 57 | """ 58 | touch ${prefix}.${extension} 59 | if [ "${extension}" == "bam" ]; 60 | then 61 | touch ${prefix}.${extension}.csi 62 | elif [ "${extension}" == "cram" ]; 63 | then 64 | touch ${prefix}.${extension}.crai 65 | fi 66 | 67 | cat <<-END_VERSIONS > versions.yml 68 | "${task.process}": 69 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 70 | END_VERSIONS 71 | """ 72 | } -------------------------------------------------------------------------------- /.github/workflows/branch.yml: -------------------------------------------------------------------------------- 1 | name: nf-core branch protection 2 | # This workflow is triggered on PRs to `main`/`master` branch on the repository 3 | # It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev` 4 | on: 5 | pull_request_target: 6 | branches: 7 | - main 8 | - master 9 | 10 | jobs: 11 | test: 12 | runs-on: ubuntu-latest 13 | steps: 14 | # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches 15 | - name: Check PRs 16 | if: github.repository == 'nf-core/coproid' 17 | run: | 18 | { [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/coproid ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] 19 | 20 | # If the above check failed, post a comment on the PR explaining the failure 21 | # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets 22 | - name: Post PR comment 23 | if: failure() 24 | uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 25 | with: 26 | message: | 27 | ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: 28 | 29 | * Do not close this PR 30 | * Click _Edit_ and change the `base` to `dev` 31 | * This CI test will remain failed until you push a new commit 32 | 33 | --- 34 | 35 | Hi @${{ github.event.pull_request.user.login }}, 36 | 37 | It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) ${{github.event.pull_request.base.ref}} branch. 38 | The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release. 39 | Because of this, PRs to ${{github.event.pull_request.base.ref}} are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. 40 | 41 | You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. 42 | Note that even after this, the test will continue to show as failing until you push a new commit. 43 | 44 | Thanks again for your contribution! 45 | repo-token: ${{ secrets.GITHUB_TOKEN }} 46 | allow-repeats: false 47 | -------------------------------------------------------------------------------- /assets/email_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | nf-core/coproid Pipeline Report 9 | 10 | 11 |
12 | 13 | 14 | 15 |

nf-core/coproid ${version}

16 |

Run Name: $runName

17 | 18 | <% if (!success){ 19 | out << """ 20 |
21 |

nf-core/coproid execution completed unsuccessfully!

22 |

The exit status of the task that caused the workflow execution to fail was: $exitStatus.

23 |

The full error message was:

24 |
${errorReport}
25 |
26 | """ 27 | } else { 28 | out << """ 29 |
30 | nf-core/coproid execution completed successfully! 31 |
32 | """ 33 | } 34 | %> 35 | 36 |

The workflow was completed at $dateComplete (duration: $duration)

37 |

The command used to launch the workflow was as follows:

38 |
$commandLine
39 | 40 |

Pipeline Configuration:

41 | 42 | 43 | <% out << summary.collect{ k,v -> "" }.join("\n") %> 44 | 45 |
$k
$v
46 | 47 |

nf-core/coproid

48 |

https://github.com/nf-core/coproid

49 | 50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /modules/local/sam2lca/updatedb/meta.yml: -------------------------------------------------------------------------------- 1 | name: "sam2lca_updatedb" 2 | description: Build sam2lca database for calling lowest common ancestors from multi-mapped reads in SAM/BAM/CRAM 3 | files 4 | keywords: 5 | - LCA 6 | - alignment 7 | - bam 8 | - metagenomics 9 | - Ancestor 10 | - multimapper 11 | - build 12 | - database 13 | tools: 14 | - "sam2lca": 15 | description: "Lowest Common Ancestor on SAM/BAM/CRAM alignment files" 16 | homepage: "https://github.com/maxibor/sam2lca" 17 | documentation: "https://sam2lca.readthedocs.io" 18 | doi: "10.21105/joss.04360" 19 | licence: ["GPL v3"] 20 | identifier: "" 21 | 22 | input: 23 | - - acc2tax_name: 24 | type: string 25 | description: Name of accession2taxid type to use 26 | - - taxo_db_name: 27 | type: string 28 | description: Name of taxonomy dabase type to use 29 | - - taxo_nodes: 30 | type: file 31 | description: "NCBI taxonomy nodes file" 32 | pattern: "*.dmp" 33 | ontologies: 34 | - edam: http://edamontology.org/format_2330 35 | - - taxo_names: 36 | type: file 37 | description: NCBI taxonomy names file 38 | pattern: "*.dmp" 39 | ontologies: 40 | - edam: http://edamontology.org/format_2330 41 | - - taxo_merged: 42 | type: file 43 | description: NCBI taxonomy merged file 44 | pattern: "*.dmp" 45 | ontologies: 46 | - edam: http://edamontology.org/format_2330 47 | - - acc2tax_json: 48 | type: file 49 | description: JSON file listing accession2taxid mapping files. Only required if using a custom database 50 | pattern: "*.json" 51 | ontologies: 52 | - edam: "http://edamontology.org/format_3464" 53 | - - acc2tax: 54 | type: string 55 | description: accession2taxid mapping file compressed with gzip. Only required if using a custom database 56 | pattern: "*.gz" 57 | ontologies: 58 | - edam: http://edamontology.org/format_3989 59 | - - acc2tax_md5: 60 | type: file 61 | description: MD5 checksum of the accession2taxid mapping file. Only required if using a custom database 62 | pattern: "*.md5" 63 | ontologies: 64 | - edam: http://edamontology.org/format_2330 65 | 66 | output: 67 | - sam2lca_db: 68 | - sam2lca_db: 69 | type: directory 70 | description: "sam2lca database" 71 | - versions: 72 | - "versions.yml": 73 | type: file 74 | description: File containing software versions 75 | pattern: "versions.yml" 76 | 77 | authors: 78 | - "@maxibor" 79 | maintainers: 80 | - "@maxibor" 81 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/meta.yml: -------------------------------------------------------------------------------- 1 | name: multiqc 2 | description: Aggregate results from bioinformatics analyses across many samples into 3 | a single report 4 | keywords: 5 | - QC 6 | - bioinformatics tools 7 | - Beautiful stand-alone HTML report 8 | tools: 9 | - multiqc: 10 | description: | 11 | MultiQC searches a given directory for analysis logs and compiles a HTML report. 12 | It's a general use tool, perfect for summarising the output from numerous bioinformatics tools. 13 | homepage: https://multiqc.info/ 14 | documentation: https://multiqc.info/docs/ 15 | licence: ["GPL-3.0-or-later"] 16 | identifier: biotools:multiqc 17 | input: 18 | - - multiqc_files: 19 | type: file 20 | description: | 21 | List of reports / files recognised by MultiQC, for example the html and zip output of FastQC 22 | - - multiqc_config: 23 | type: file 24 | description: Optional config yml for MultiQC 25 | pattern: "*.{yml,yaml}" 26 | - - extra_multiqc_config: 27 | type: file 28 | description: Second optional config yml for MultiQC. Will override common sections 29 | in multiqc_config. 30 | pattern: "*.{yml,yaml}" 31 | - - multiqc_logo: 32 | type: file 33 | description: Optional logo file for MultiQC 34 | pattern: "*.{png}" 35 | - - replace_names: 36 | type: file 37 | description: | 38 | Optional two-column sample renaming file. First column a set of 39 | patterns, second column a set of corresponding replacements. Passed via 40 | MultiQC's `--replace-names` option. 41 | pattern: "*.{tsv}" 42 | - - sample_names: 43 | type: file 44 | description: | 45 | Optional TSV file with headers, passed to the MultiQC --sample_names 46 | argument. 47 | pattern: "*.{tsv}" 48 | output: 49 | - report: 50 | - "*multiqc_report.html": 51 | type: file 52 | description: MultiQC report file 53 | pattern: "multiqc_report.html" 54 | - data: 55 | - "*_data": 56 | type: directory 57 | description: MultiQC data dir 58 | pattern: "multiqc_data" 59 | - plots: 60 | - "*_plots": 61 | type: file 62 | description: Plots created by MultiQC 63 | pattern: "*_data" 64 | - versions: 65 | - versions.yml: 66 | type: file 67 | description: File containing software versions 68 | pattern: "versions.yml" 69 | authors: 70 | - "@abhi18av" 71 | - "@bunop" 72 | - "@drpatelh" 73 | - "@jfy133" 74 | maintainers: 75 | - "@abhi18av" 76 | - "@bunop" 77 | - "@drpatelh" 78 | - "@jfy133" 79 | -------------------------------------------------------------------------------- /modules/nf-core/fastqc/main.nf: -------------------------------------------------------------------------------- 1 | process FASTQC { 2 | tag "${meta.id}" 3 | label 'process_medium' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/fastqc:0.12.1--hdfd78af_0' : 8 | 'biocontainers/fastqc:0.12.1--hdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(reads) 12 | 13 | output: 14 | tuple val(meta), path("*.html"), emit: html 15 | tuple val(meta), path("*.zip") , emit: zip 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | // Make list of old name and new name pairs to use for renaming in the bash while loop 25 | def old_new_pairs = reads instanceof Path || reads.size() == 1 ? [[ reads, "${prefix}.${reads.extension}" ]] : reads.withIndex().collect { entry, index -> [ entry, "${prefix}_${index + 1}.${entry.extension}" ] } 26 | def rename_to = old_new_pairs*.join(' ').join(' ') 27 | def renamed_files = old_new_pairs.collect{ _old_name, new_name -> new_name }.join(' ') 28 | 29 | // The total amount of allocated RAM by FastQC is equal to the number of threads defined (--threads) time the amount of RAM defined (--memory) 30 | // https://github.com/s-andrews/FastQC/blob/1faeea0412093224d7f6a07f777fad60a5650795/fastqc#L211-L222 31 | // Dividing the task.memory by task.cpu allows to stick to requested amount of RAM in the label 32 | def memory_in_mb = task.memory ? task.memory.toUnit('MB').toFloat() / task.cpus : null 33 | // FastQC memory value allowed range (100 - 10000) 34 | def fastqc_memory = memory_in_mb > 10000 ? 10000 : (memory_in_mb < 100 ? 100 : memory_in_mb) 35 | 36 | """ 37 | printf "%s %s\\n" ${rename_to} | while read old_name new_name; do 38 | [ -f "\${new_name}" ] || ln -s \$old_name \$new_name 39 | done 40 | 41 | fastqc \\ 42 | ${args} \\ 43 | --threads ${task.cpus} \\ 44 | --memory ${fastqc_memory} \\ 45 | ${renamed_files} 46 | 47 | cat <<-END_VERSIONS > versions.yml 48 | "${task.process}": 49 | fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) 50 | END_VERSIONS 51 | """ 52 | 53 | stub: 54 | def prefix = task.ext.prefix ?: "${meta.id}" 55 | """ 56 | touch ${prefix}.html 57 | touch ${prefix}.zip 58 | 59 | cat <<-END_VERSIONS > versions.yml 60 | "${task.process}": 61 | fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) 62 | END_VERSIONS 63 | """ 64 | } 65 | -------------------------------------------------------------------------------- /modules/nf-core/sourcepredict/meta.yml: -------------------------------------------------------------------------------- 1 | name: "sourcepredict" 2 | description: Classifies and predicts the origin of metagenomic samples 3 | keywords: 4 | - source tracking 5 | - metagenomics 6 | - machine learning 7 | tools: 8 | - "sourcepredict": 9 | description: "Classification and prediction of the origin of metagenomic samples." 10 | homepage: "https://github.com/maxibor/sourcepredict" 11 | documentation: "https://sourcepredict.readthedocs.io/en/latest/index.html" 12 | tool_dev_url: "https://github.com/maxibor/sourcepredict" 13 | doi: "10.21105/joss.01540" 14 | licence: ["GPL v3-or-later"] 15 | identifier: biotools:sourcepredict 16 | 17 | input: 18 | - - meta: 19 | type: map 20 | description: | 21 | Groovy Map containing sample information 22 | e.g. `[ id:'sample1' ]` 23 | - kraken_parse: 24 | type: file 25 | description: Sink TAXID count table in csv format 26 | pattern: "*.csv" 27 | 28 | - - sources: 29 | type: file 30 | description: Sources TAXID count table in csv format. Default can be downloaded from 31 | https://raw.githubusercontent.com/maxibor/sourcepredict/master/data/modern_gut_microbiomes_sources.csv 32 | pattern: "*.csv" 33 | 34 | - - labels: 35 | type: file 36 | description: Labels for the sources table in csv format. Default can be downloaded from 37 | https://raw.githubusercontent.com/maxibor/sourcepredict/master/data/modern_gut_microbiomes_labels.csv 38 | pattern: "*.csv" 39 | 40 | - - taxa_sqlite: 41 | type: file 42 | description: taxa.sqlite file downloaded with ete3 toolkit 43 | pattern: "taxa.sqlite" 44 | 45 | - - taxa_sqlite_traverse_pkl: 46 | type: file 47 | description: taxa.sqlite.traverse.pkl file downloaded with ete3 toolkit 48 | pattern: "taxa.sqlite.traverse.pkl" 49 | 50 | - - save_embedding: 51 | type: string 52 | description: | 53 | If true, an optional command is added to save a file reporting the embedding file 54 | 55 | output: 56 | - report: 57 | - meta: 58 | type: map 59 | description: | 60 | Groovy Map containing sample information 61 | e.g. `[ id:'sample1', single_end:false ]` 62 | - "*.sourcepredict.csv": 63 | type: file 64 | description: Table containing the predicted proportion of each source in each sample 65 | pattern: "*.sourcepredict.csv" 66 | 67 | - versions: 68 | - "versions.yml": 69 | type: file 70 | description: File containing software versions 71 | pattern: "versions.yml" 72 | 73 | authors: 74 | - "@MeriamOs" 75 | maintainers: 76 | - "@MeriamOs" 77 | -------------------------------------------------------------------------------- /modules/nf-core/sam2lca/analyze/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "test-sam2lca-analyze": { 3 | "content": [ 4 | "test.sam2lca.csv", 5 | [ 6 | [ 7 | { 8 | "id": "test", 9 | "single_end": false 10 | }, 11 | "test.sam2lca.json:md5,a49d71ab3aa4d06e3a3094409f71eff0" 12 | ] 13 | ], 14 | [ 15 | 16 | ], 17 | [ 18 | "versions.yml:md5,b6ea36b43b69f73dfa5d2fc7a1ddb1e2" 19 | ] 20 | ], 21 | "meta": { 22 | "nf-test": "0.8.4", 23 | "nextflow": "24.04.4" 24 | }, 25 | "timestamp": "2024-08-27T16:10:41.635602" 26 | }, 27 | "test-sam2lca-analyze-stub": { 28 | "content": [ 29 | { 30 | "0": [ 31 | [ 32 | { 33 | "id": "test", 34 | "single_end": false 35 | }, 36 | "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" 37 | ] 38 | ], 39 | "1": [ 40 | [ 41 | { 42 | "id": "test", 43 | "single_end": false 44 | }, 45 | "test.json:md5,d41d8cd98f00b204e9800998ecf8427e" 46 | ] 47 | ], 48 | "2": [ 49 | 50 | ], 51 | "3": [ 52 | "versions.yml:md5,b6ea36b43b69f73dfa5d2fc7a1ddb1e2" 53 | ], 54 | "bam": [ 55 | 56 | ], 57 | "csv": [ 58 | [ 59 | { 60 | "id": "test", 61 | "single_end": false 62 | }, 63 | "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" 64 | ] 65 | ], 66 | "json": [ 67 | [ 68 | { 69 | "id": "test", 70 | "single_end": false 71 | }, 72 | "test.json:md5,d41d8cd98f00b204e9800998ecf8427e" 73 | ] 74 | ], 75 | "versions": [ 76 | "versions.yml:md5,b6ea36b43b69f73dfa5d2fc7a1ddb1e2" 77 | ] 78 | } 79 | ], 80 | "meta": { 81 | "nf-test": "0.8.4", 82 | "nextflow": "24.04.4" 83 | }, 84 | "timestamp": "2024-08-27T16:10:47.050282" 85 | } 86 | } -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_sort 2 | description: Sort SAM/BAM/CRAM file 3 | keywords: 4 | - sort 5 | - bam 6 | - sam 7 | - cram 8 | tools: 9 | - samtools: 10 | description: | 11 | SAMtools is a set of utilities for interacting with and post-processing 12 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 13 | These files are generated as output by short read aligners like BWA. 14 | homepage: http://www.htslib.org/ 15 | documentation: http://www.htslib.org/doc/samtools.html 16 | doi: 10.1093/bioinformatics/btp352 17 | licence: ["MIT"] 18 | identifier: biotools:samtools 19 | input: 20 | - - meta: 21 | type: map 22 | description: | 23 | Groovy Map containing sample information 24 | e.g. [ id:'test', single_end:false ] 25 | - bam: 26 | type: file 27 | description: BAM/CRAM/SAM file(s) 28 | pattern: "*.{bam,cram,sam}" 29 | - - meta2: 30 | type: map 31 | description: | 32 | Groovy Map containing reference information 33 | e.g. [ id:'genome' ] 34 | - fasta: 35 | type: file 36 | description: Reference genome FASTA file 37 | pattern: "*.{fa,fasta,fna}" 38 | optional: true 39 | output: 40 | - bam: 41 | - meta: 42 | type: map 43 | description: | 44 | Groovy Map containing sample information 45 | e.g. [ id:'test', single_end:false ] 46 | - "*.bam": 47 | type: file 48 | description: Sorted BAM file 49 | pattern: "*.{bam}" 50 | - cram: 51 | - meta: 52 | type: map 53 | description: | 54 | Groovy Map containing sample information 55 | e.g. [ id:'test', single_end:false ] 56 | - "*.cram": 57 | type: file 58 | description: Sorted CRAM file 59 | pattern: "*.{cram}" 60 | - crai: 61 | - meta: 62 | type: map 63 | description: | 64 | Groovy Map containing sample information 65 | e.g. [ id:'test', single_end:false ] 66 | - "*.crai": 67 | type: file 68 | description: CRAM index file (optional) 69 | pattern: "*.crai" 70 | - csi: 71 | - meta: 72 | type: map 73 | description: | 74 | Groovy Map containing sample information 75 | e.g. [ id:'test', single_end:false ] 76 | - "*.csi": 77 | type: file 78 | description: BAM index file (optional) 79 | pattern: "*.csi" 80 | - versions: 81 | - versions.yml: 82 | type: file 83 | description: File containing software versions 84 | pattern: "versions.yml" 85 | authors: 86 | - "@drpatelh" 87 | - "@ewels" 88 | - "@matthdsm" 89 | maintainers: 90 | - "@drpatelh" 91 | - "@ewels" 92 | - "@matthdsm" 93 | -------------------------------------------------------------------------------- /.github/workflows/awsfulltest.yml: -------------------------------------------------------------------------------- 1 | name: nf-core AWS full size tests 2 | # This workflow is triggered on PRs opened against the main/master branch. 3 | # It can be additionally triggered manually with GitHub actions workflow dispatch button. 4 | # It runs the -profile 'test_full' on AWS batch 5 | 6 | on: 7 | pull_request: 8 | branches: 9 | - main 10 | - master 11 | workflow_dispatch: 12 | pull_request_review: 13 | types: [submitted] 14 | 15 | jobs: 16 | run-platform: 17 | name: Run AWS full tests 18 | # run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered 19 | if: github.repository == 'nf-core/coproid' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch' 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Get PR reviews 23 | uses: octokit/request-action@v2.x 24 | if: github.event_name != 'workflow_dispatch' 25 | id: check_approvals 26 | continue-on-error: true 27 | with: 28 | route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | 32 | - name: Check for approvals 33 | if: ${{ failure() && github.event_name != 'workflow_dispatch' }} 34 | run: | 35 | echo "No review approvals found. At least 2 approvals are required to run this action automatically." 36 | exit 1 37 | 38 | - name: Check for enough approvals (>=2) 39 | id: test_variables 40 | if: github.event_name != 'workflow_dispatch' 41 | run: | 42 | JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}' 43 | CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length') 44 | test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required 45 | 46 | - name: Launch workflow via Seqera Platform 47 | uses: seqeralabs/action-tower-launch@v2 48 | with: 49 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 50 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 51 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 52 | revision: ${{ github.sha }} 53 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/coproid/work-${{ github.sha }} 54 | parameters: | 55 | { 56 | "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", 57 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/coproid/results-${{ github.sha }}" 58 | } 59 | profiles: test_full 60 | 61 | - uses: actions/upload-artifact@v4 62 | with: 63 | name: Seqera Platform debug log file 64 | path: | 65 | seqera_platform_action_*.log 66 | seqera_platform_action_*.json 67 | -------------------------------------------------------------------------------- /assets/adaptivecard.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "message", 3 | "attachments": [ 4 | { 5 | "contentType": "application/vnd.microsoft.card.adaptive", 6 | "contentUrl": null, 7 | "content": { 8 | "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", 9 | "msteams": { 10 | "width": "Full" 11 | }, 12 | "type": "AdaptiveCard", 13 | "version": "1.2", 14 | "body": [ 15 | { 16 | "type": "TextBlock", 17 | "size": "Large", 18 | "weight": "Bolder", 19 | "color": "<% if (success) { %>Good<% } else { %>Attention<%} %>", 20 | "text": "nf-core/coproid v${version} - ${runName}", 21 | "wrap": true 22 | }, 23 | { 24 | "type": "TextBlock", 25 | "spacing": "None", 26 | "text": "Completed at ${dateComplete} (duration: ${duration})", 27 | "isSubtle": true, 28 | "wrap": true 29 | }, 30 | { 31 | "type": "TextBlock", 32 | "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors. The full error message was: ${errorReport}.<% } %>", 33 | "wrap": true 34 | }, 35 | { 36 | "type": "TextBlock", 37 | "text": "The command used to launch the workflow was as follows:", 38 | "wrap": true 39 | }, 40 | { 41 | "type": "TextBlock", 42 | "text": "${commandLine}", 43 | "isSubtle": true, 44 | "wrap": true 45 | } 46 | ], 47 | "actions": [ 48 | { 49 | "type": "Action.ShowCard", 50 | "title": "Pipeline Configuration", 51 | "card": { 52 | "type": "AdaptiveCard", 53 | "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", 54 | "body": [ 55 | { 56 | "type": "FactSet", 57 | "facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}"}.join(",\n") %> 58 | ] 59 | } 60 | ] 61 | } 62 | } 63 | ] 64 | } 65 | } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /modules/nf-core/untar/main.nf: -------------------------------------------------------------------------------- 1 | process UNTAR { 2 | tag "${archive}" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container 7 | ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data' 8 | : 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}" 9 | 10 | input: 11 | tuple val(meta), path(archive) 12 | 13 | output: 14 | tuple val(meta), path("${prefix}"), emit: untar 15 | path "versions.yml", emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def args2 = task.ext.args2 ?: '' 23 | prefix = task.ext.prefix ?: (meta.id ? "${meta.id}" : archive.baseName.toString().replaceFirst(/\.tar$/, "")) 24 | 25 | """ 26 | mkdir ${prefix} 27 | 28 | ## Ensures --strip-components only applied when top level of tar contents is a directory 29 | ## If just files or multiple directories, place all in prefix 30 | if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then 31 | tar \\ 32 | -C ${prefix} --strip-components 1 \\ 33 | -xavf \\ 34 | ${args} \\ 35 | ${archive} \\ 36 | ${args2} 37 | else 38 | tar \\ 39 | -C ${prefix} \\ 40 | -xavf \\ 41 | ${args} \\ 42 | ${archive} \\ 43 | ${args2} 44 | fi 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') 49 | END_VERSIONS 50 | """ 51 | 52 | stub: 53 | prefix = task.ext.prefix ?: (meta.id ? "${meta.id}" : archive.toString().replaceFirst(/\.[^\.]+(.gz)?$/, "")) 54 | """ 55 | mkdir ${prefix} 56 | ## Dry-run untaring the archive to get the files and place all in prefix 57 | if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then 58 | for i in `tar -tf ${archive}`; 59 | do 60 | if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; 61 | then 62 | touch \${i} 63 | else 64 | mkdir -p \${i} 65 | fi 66 | done 67 | else 68 | for i in `tar -tf ${archive}`; 69 | do 70 | if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; 71 | then 72 | touch ${prefix}/\${i} 73 | else 74 | mkdir -p ${prefix}/\${i} 75 | fi 76 | done 77 | fi 78 | 79 | cat <<-END_VERSIONS > versions.yml 80 | "${task.process}": 81 | untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') 82 | END_VERSIONS 83 | """ 84 | } 85 | -------------------------------------------------------------------------------- /.github/workflows/linting.yml: -------------------------------------------------------------------------------- 1 | name: nf-core linting 2 | # This workflow is triggered on pushes and PRs to the repository. 3 | # It runs the `nf-core pipelines lint` and markdown lint tests to ensure 4 | # that the code meets the nf-core guidelines. 5 | on: 6 | push: 7 | branches: 8 | - dev 9 | pull_request: 10 | release: 11 | types: [published] 12 | 13 | jobs: 14 | pre-commit: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 18 | 19 | - name: Set up Python 3.12 20 | uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 21 | with: 22 | python-version: "3.12" 23 | 24 | - name: Install pre-commit 25 | run: pip install pre-commit 26 | 27 | - name: Run pre-commit 28 | run: pre-commit run --all-files 29 | 30 | nf-core: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Check out pipeline code 34 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 35 | 36 | - name: Install Nextflow 37 | uses: nf-core/setup-nextflow@v2 38 | 39 | - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 40 | with: 41 | python-version: "3.12" 42 | architecture: "x64" 43 | 44 | - name: read .nf-core.yml 45 | uses: pietrobolcato/action-read-yaml@1.1.0 46 | id: read_yml 47 | with: 48 | config: ${{ github.workspace }}/.nf-core.yml 49 | 50 | - name: Install dependencies 51 | run: | 52 | python -m pip install --upgrade pip 53 | pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} 54 | 55 | - name: Run nf-core pipelines lint 56 | if: ${{ github.base_ref != 'master' }} 57 | env: 58 | GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} 59 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 60 | GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} 61 | run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md 62 | 63 | - name: Run nf-core pipelines lint --release 64 | if: ${{ github.base_ref == 'master' }} 65 | env: 66 | GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} 67 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 68 | GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} 69 | run: nf-core -l lint_log.txt pipelines lint --release --dir ${GITHUB_WORKSPACE} --markdown lint_results.md 70 | 71 | - name: Save PR number 72 | if: ${{ always() }} 73 | run: echo ${{ github.event.pull_request.number }} > PR_number.txt 74 | 75 | - name: Upload linting log file artifact 76 | if: ${{ always() }} 77 | uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 78 | with: 79 | name: linting-logs 80 | path: | 81 | lint_log.txt 82 | lint_results.md 83 | PR_number.txt 84 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: nf-core CI 2 | # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | pull_request: 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | env: 13 | NXF_ANSI_LOG: false 14 | NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity 15 | NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity 16 | 17 | concurrency: 18 | group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" 19 | cancel-in-progress: true 20 | 21 | jobs: 22 | test: 23 | name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})" 24 | # Only run on push if this is the nf-core dev branch (merged PRs) 25 | if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/coproid') }}" 26 | runs-on: ubuntu-latest 27 | strategy: 28 | matrix: 29 | NXF_VER: 30 | - "24.10.0" 31 | profile: 32 | - "docker" 33 | - "singularity" 34 | test_name: 35 | - "test" 36 | isMaster: 37 | - ${{ github.base_ref == 'master' }} 38 | # Exclude conda and singularity on dev 39 | exclude: 40 | - isMaster: false 41 | profile: "conda" 42 | - isMaster: false 43 | profile: "singularity" 44 | steps: 45 | - name: Check out pipeline code 46 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 47 | with: 48 | fetch-depth: 0 49 | 50 | - name: Set up Nextflow 51 | uses: nf-core/setup-nextflow@v2 52 | with: 53 | version: "${{ matrix.NXF_VER }}" 54 | 55 | - name: Set up Apptainer 56 | if: matrix.profile == 'singularity' 57 | uses: eWaterCycle/setup-apptainer@main 58 | 59 | - name: Set up Singularity 60 | if: matrix.profile == 'singularity' 61 | run: | 62 | mkdir -p $NXF_SINGULARITY_CACHEDIR 63 | mkdir -p $NXF_SINGULARITY_LIBRARYDIR 64 | 65 | - name: Set up Miniconda 66 | if: matrix.profile == 'conda' 67 | uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3 68 | with: 69 | miniconda-version: "latest" 70 | auto-update-conda: true 71 | conda-solver: libmamba 72 | channels: conda-forge,bioconda 73 | 74 | - name: Set up Conda 75 | if: matrix.profile == 'conda' 76 | run: | 77 | echo $(realpath $CONDA)/condabin >> $GITHUB_PATH 78 | echo $(realpath python) >> $GITHUB_PATH 79 | 80 | - name: Clean up Disk space 81 | uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 82 | 83 | - name: "Run pipeline with test data ${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }}" 84 | run: | 85 | nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test_name }},${{ matrix.profile }} --outdir ./results 86 | -------------------------------------------------------------------------------- /assets/methods_description_template.yml: -------------------------------------------------------------------------------- 1 | id: "nf-core-coproid-methods-description" 2 | description: "Suggested text and references to use when describing pipeline usage within the methods section of a publication." 3 | section_name: "nf-core/coproid Methods Description" 4 | section_href: "https://github.com/nf-core/coproid" 5 | plot_type: "html" 6 | data: | 7 |

Methods

8 |

Data was processed using nf-core/coproid v${workflow.manifest.version} ${doi_text} of the nf-core collection of workflows (Ewels et al., 2020), utilising reproducible software environments from the Bioconda (Grüning et al., 2018) and Biocontainers (da Veiga Leprevost et al., 2017) projects.

9 |

The pipeline was executed with Nextflow v${workflow.nextflow.version} (Di Tommaso et al., 2017) with the following command:

10 |
${workflow.commandLine}
11 |

${tool_citations}

12 |

References

13 |
    14 |
  • Di Tommaso, P., Chatzou, M., Floden, E. W., Barja, P. P., Palumbo, E., & Notredame, C. (2017). Nextflow enables reproducible computational workflows. Nature Biotechnology, 35(4), 316-319. doi: 10.1038/nbt.3820
  • 15 |
  • Ewels, P. A., Peltzer, A., Fillinger, S., Patel, H., Alneberg, J., Wilm, A., Garcia, M. U., Di Tommaso, P., & Nahnsen, S. (2020). The nf-core framework for community-curated bioinformatics pipelines. Nature Biotechnology, 38(3), 276-278. doi: 10.1038/s41587-020-0439-x
  • 16 |
  • Grüning, B., Dale, R., Sjödin, A., Chapman, B. A., Rowe, J., Tomkins-Tinch, C. H., Valieris, R., Köster, J., & Bioconda Team. (2018). Bioconda: sustainable and comprehensive software distribution for the life sciences. Nature Methods, 15(7), 475–476. doi: 10.1038/s41592-018-0046-7
  • 17 |
  • da Veiga Leprevost, F., Grüning, B. A., Alves Aflitos, S., Röst, H. L., Uszkoreit, J., Barsnes, H., Vaudel, M., Moreno, P., Gatto, L., Weber, J., Bai, M., Jimenez, R. C., Sachsenberg, T., Pfeuffer, J., Vera Alvarez, R., Griss, J., Nesvizhskii, A. I., & Perez-Riverol, Y. (2017). BioContainers: an open-source and community-driven framework for software standardization. Bioinformatics (Oxford, England), 33(16), 2580–2582. doi: 10.1093/bioinformatics/btx192
  • 18 | ${tool_bibliography} 19 |
20 |
21 |
Notes:
22 |
    23 | ${nodoi_text} 24 |
  • The command above does not include parameters contained in any configs or profiles that may have been used. Ensure the config file is also uploaded with your publication!
  • 25 |
  • You should also cite all software used within this run. Check the "Software Versions" of this report to get version information.
  • 26 |
27 |
28 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process MULTIQC" 4 | script "../main.nf" 5 | process "MULTIQC" 6 | 7 | tag "modules" 8 | tag "modules_nfcore" 9 | tag "multiqc" 10 | 11 | config "./nextflow.config" 12 | 13 | test("sarscov2 single-end [fastqc]") { 14 | 15 | when { 16 | process { 17 | """ 18 | input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) 19 | input[1] = [] 20 | input[2] = [] 21 | input[3] = [] 22 | input[4] = [] 23 | input[5] = [] 24 | """ 25 | } 26 | } 27 | 28 | then { 29 | assertAll( 30 | { assert process.success }, 31 | { assert process.out.report[0] ==~ ".*/multiqc_report.html" }, 32 | { assert process.out.data[0] ==~ ".*/multiqc_data" }, 33 | { assert snapshot(process.out.versions).match("multiqc_versions_single") } 34 | ) 35 | } 36 | 37 | } 38 | 39 | test("sarscov2 single-end [fastqc] [config]") { 40 | 41 | when { 42 | process { 43 | """ 44 | input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) 45 | input[1] = Channel.of(file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true)) 46 | input[2] = [] 47 | input[3] = [] 48 | input[4] = [] 49 | input[5] = [] 50 | """ 51 | } 52 | } 53 | 54 | then { 55 | assertAll( 56 | { assert process.success }, 57 | { assert process.out.report[0] ==~ ".*/multiqc_report.html" }, 58 | { assert process.out.data[0] ==~ ".*/multiqc_data" }, 59 | { assert snapshot(process.out.versions).match("multiqc_versions_config") } 60 | ) 61 | } 62 | } 63 | 64 | test("sarscov2 single-end [fastqc] - stub") { 65 | 66 | options "-stub" 67 | 68 | when { 69 | process { 70 | """ 71 | input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) 72 | input[1] = [] 73 | input[2] = [] 74 | input[3] = [] 75 | input[4] = [] 76 | input[5] = [] 77 | """ 78 | } 79 | } 80 | 81 | then { 82 | assertAll( 83 | { assert process.success }, 84 | { assert snapshot(process.out.report.collect { file(it).getName() } + 85 | process.out.data.collect { file(it).getName() } + 86 | process.out.plots.collect { file(it).getName() } + 87 | process.out.versions ).match("multiqc_stub") } 88 | ) 89 | } 90 | 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_workflow { 2 | 3 | name "Test Subworkflow UTILS_NFSCHEMA_PLUGIN" 4 | script "../main.nf" 5 | workflow "UTILS_NFSCHEMA_PLUGIN" 6 | 7 | tag "subworkflows" 8 | tag "subworkflows_nfcore" 9 | tag "subworkflows/utils_nfschema_plugin" 10 | tag "plugin/nf-schema" 11 | 12 | config "./nextflow.config" 13 | 14 | test("Should run nothing") { 15 | 16 | when { 17 | 18 | params { 19 | test_data = '' 20 | } 21 | 22 | workflow { 23 | """ 24 | validate_params = false 25 | input[0] = workflow 26 | input[1] = validate_params 27 | input[2] = "" 28 | """ 29 | } 30 | } 31 | 32 | then { 33 | assertAll( 34 | { assert workflow.success } 35 | ) 36 | } 37 | } 38 | 39 | test("Should validate params") { 40 | 41 | when { 42 | 43 | params { 44 | test_data = '' 45 | outdir = null 46 | } 47 | 48 | workflow { 49 | """ 50 | validate_params = true 51 | input[0] = workflow 52 | input[1] = validate_params 53 | input[2] = "" 54 | """ 55 | } 56 | } 57 | 58 | then { 59 | assertAll( 60 | { assert workflow.failed }, 61 | { assert workflow.stdout.any { it.contains('ERROR ~ Validation of pipeline parameters failed!') } } 62 | ) 63 | } 64 | } 65 | 66 | test("Should run nothing - custom schema") { 67 | 68 | when { 69 | 70 | params { 71 | test_data = '' 72 | } 73 | 74 | workflow { 75 | """ 76 | validate_params = false 77 | input[0] = workflow 78 | input[1] = validate_params 79 | input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" 80 | """ 81 | } 82 | } 83 | 84 | then { 85 | assertAll( 86 | { assert workflow.success } 87 | ) 88 | } 89 | } 90 | 91 | test("Should validate params - custom schema") { 92 | 93 | when { 94 | 95 | params { 96 | test_data = '' 97 | outdir = null 98 | } 99 | 100 | workflow { 101 | """ 102 | validate_params = true 103 | input[0] = workflow 104 | input[1] = validate_params 105 | input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" 106 | """ 107 | } 108 | } 109 | 110 | then { 111 | assertAll( 112 | { assert workflow.failed }, 113 | { assert workflow.stdout.any { it.contains('ERROR ~ Validation of pipeline parameters failed!') } } 114 | ) 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /bin/kraken_parse.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Written by Maxime Borry and released under the MIT license. 4 | # See git repository (https://github.com/nf-core/eager) for full license text. 5 | 6 | import argparse 7 | import csv 8 | 9 | 10 | def _get_args(): 11 | """This function parses and return arguments passed in""" 12 | parser = argparse.ArgumentParser( 13 | prog="kraken_parse", formatter_class=argparse.RawDescriptionHelpFormatter, description="Parsing kraken" 14 | ) 15 | parser.add_argument("krakenReport", help="path to kraken report file") 16 | parser.add_argument( 17 | "-c", dest="count", default=50, help="Minimum number of hits on clade to report it. Default = 50" 18 | ) 19 | parser.add_argument( 20 | "-or", dest="readout", default=None, help="Read count output file. Default = .read_kraken_parsed.csv" 21 | ) 22 | parser.add_argument( 23 | "-ok", dest="kmerout", default=None, help="Kmer Output file. Default = .kmer_kraken_parsed.csv" 24 | ) 25 | 26 | args = parser.parse_args() 27 | 28 | infile = args.krakenReport 29 | countlim = int(args.count) 30 | readout = args.readout 31 | kmerout = args.kmerout 32 | 33 | return (infile, countlim, readout, kmerout) 34 | 35 | 36 | def _get_basename(file_name): 37 | if ("/") in file_name: 38 | basename = file_name.split("/")[-1].split(".")[0] 39 | else: 40 | basename = file_name.split(".")[0] 41 | return basename 42 | 43 | 44 | def parse_kraken(infile, countlim): 45 | """ 46 | INPUT: 47 | infile (str): path to kraken report file 48 | countlim (int): lowest count threshold to report hit 49 | OUTPUT: 50 | resdict (dict): key=taxid, value=readCount 51 | 52 | """ 53 | with open(infile, "r") as f: 54 | read_dict = {} 55 | kmer_dict = {} 56 | csvreader = csv.reader(f, delimiter="\t") 57 | for line in csvreader: 58 | reads = int(line[1]) 59 | if reads >= countlim: 60 | taxid = line[6] 61 | kmer = line[3] 62 | unique_kmer = line[4] 63 | try: 64 | kmer_duplicity = float(kmer) / float(unique_kmer) 65 | except ZeroDivisionError: 66 | kmer_duplicity = 0 67 | read_dict[taxid] = reads 68 | kmer_dict[taxid] = kmer_duplicity 69 | 70 | return (read_dict, kmer_dict) 71 | 72 | 73 | def write_output(resdict, infile, outfile): 74 | with open(outfile, "w") as f: 75 | basename = _get_basename(infile) 76 | f.write(f"TAXID,{basename}\n") 77 | for akey in resdict.keys(): 78 | f.write(f"{akey},{resdict[akey]}\n") 79 | 80 | 81 | if __name__ == "__main__": 82 | INFILE, COUNTLIM, readout, kmerout = _get_args() 83 | 84 | if not readout: 85 | read_outfile = _get_basename(INFILE) + ".read_kraken_parsed.csv" 86 | else: 87 | read_outfile = readout 88 | if not kmerout: 89 | kmer_outfile = _get_basename(INFILE) + ".kmer_kraken_parsed.csv" 90 | else: 91 | kmer_outfile = kmerout 92 | 93 | read_dict, kmer_dict = parse_kraken(infile=INFILE, countlim=COUNTLIM) 94 | write_output(resdict=read_dict, infile=INFILE, outfile=read_outfile) 95 | write_output(resdict=kmer_dict, infile=INFILE, outfile=kmer_outfile) 96 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_workflow { 2 | 3 | name "Test Workflow UTILS_NEXTFLOW_PIPELINE" 4 | script "../main.nf" 5 | config "subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config" 6 | workflow "UTILS_NEXTFLOW_PIPELINE" 7 | tag 'subworkflows' 8 | tag 'utils_nextflow_pipeline' 9 | tag 'subworkflows/utils_nextflow_pipeline' 10 | 11 | test("Should run no inputs") { 12 | 13 | when { 14 | workflow { 15 | """ 16 | print_version = false 17 | dump_parameters = false 18 | outdir = null 19 | check_conda_channels = false 20 | 21 | input[0] = print_version 22 | input[1] = dump_parameters 23 | input[2] = outdir 24 | input[3] = check_conda_channels 25 | """ 26 | } 27 | } 28 | 29 | then { 30 | assertAll( 31 | { assert workflow.success } 32 | ) 33 | } 34 | } 35 | 36 | test("Should print version") { 37 | 38 | when { 39 | workflow { 40 | """ 41 | print_version = true 42 | dump_parameters = false 43 | outdir = null 44 | check_conda_channels = false 45 | 46 | input[0] = print_version 47 | input[1] = dump_parameters 48 | input[2] = outdir 49 | input[3] = check_conda_channels 50 | """ 51 | } 52 | } 53 | 54 | then { 55 | expect { 56 | with(workflow) { 57 | assert success 58 | assert "nextflow_workflow v9.9.9" in stdout 59 | } 60 | } 61 | } 62 | } 63 | 64 | test("Should dump params") { 65 | 66 | when { 67 | workflow { 68 | """ 69 | print_version = false 70 | dump_parameters = true 71 | outdir = 'results' 72 | check_conda_channels = false 73 | 74 | input[0] = false 75 | input[1] = true 76 | input[2] = outdir 77 | input[3] = false 78 | """ 79 | } 80 | } 81 | 82 | then { 83 | assertAll( 84 | { assert workflow.success } 85 | ) 86 | } 87 | } 88 | 89 | test("Should not create params JSON if no output directory") { 90 | 91 | when { 92 | workflow { 93 | """ 94 | print_version = false 95 | dump_parameters = true 96 | outdir = null 97 | check_conda_channels = false 98 | 99 | input[0] = false 100 | input[1] = true 101 | input[2] = outdir 102 | input[3] = false 103 | """ 104 | } 105 | } 106 | 107 | then { 108 | assertAll( 109 | { assert workflow.success } 110 | ) 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/merge/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_merge 2 | description: Merge BAM or CRAM file 3 | keywords: 4 | - merge 5 | - bam 6 | - sam 7 | - cram 8 | tools: 9 | - samtools: 10 | description: | 11 | SAMtools is a set of utilities for interacting with and post-processing 12 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 13 | These files are generated as output by short read aligners like BWA. 14 | homepage: http://www.htslib.org/ 15 | documentation: http://www.htslib.org/doc/samtools.html 16 | doi: 10.1093/bioinformatics/btp352 17 | licence: ["MIT"] 18 | identifier: biotools:samtools 19 | input: 20 | - - meta: 21 | type: map 22 | description: | 23 | Groovy Map containing sample information 24 | e.g. [ id:'test', single_end:false ] 25 | - input_files: 26 | type: file 27 | description: BAM/CRAM file 28 | pattern: "*.{bam,cram,sam}" 29 | - - meta2: 30 | type: map 31 | description: | 32 | Groovy Map containing reference information 33 | e.g. [ id:'genome' ] 34 | - fasta: 35 | type: file 36 | description: Reference file the CRAM was created with (optional) 37 | pattern: "*.{fasta,fa}" 38 | - - meta3: 39 | type: map 40 | description: | 41 | Groovy Map containing reference information 42 | e.g. [ id:'genome' ] 43 | - fai: 44 | type: file 45 | description: Index of the reference file the CRAM was created with (optional) 46 | pattern: "*.fai" 47 | output: 48 | - bam: 49 | - meta: 50 | type: map 51 | description: | 52 | Groovy Map containing sample information 53 | e.g. [ id:'test', single_end:false ] 54 | - ${prefix}.bam: 55 | type: file 56 | description: BAM file 57 | pattern: "*.{bam}" 58 | - cram: 59 | - meta: 60 | type: map 61 | description: | 62 | Groovy Map containing sample information 63 | e.g. [ id:'test', single_end:false ] 64 | - ${prefix}.cram: 65 | type: file 66 | description: CRAM file 67 | pattern: "*.{cram}" 68 | - csi: 69 | - meta: 70 | type: map 71 | description: | 72 | Groovy Map containing sample information 73 | e.g. [ id:'test', single_end:false ] 74 | - "*.csi": 75 | type: file 76 | description: BAM index file (optional) 77 | pattern: "*.csi" 78 | - crai: 79 | - meta: 80 | type: map 81 | description: | 82 | Groovy Map containing sample information 83 | e.g. [ id:'test', single_end:false ] 84 | - "*.crai": 85 | type: file 86 | description: CRAM index file (optional) 87 | pattern: "*.crai" 88 | - versions: 89 | - versions.yml: 90 | type: file 91 | description: File containing software versions 92 | pattern: "versions.yml" 93 | authors: 94 | - "@drpatelh" 95 | - "@yuukiiwa " 96 | - "@maxulysse" 97 | - "@FriederikeHanssen" 98 | - "@ramprasadn" 99 | maintainers: 100 | - "@drpatelh" 101 | - "@yuukiiwa " 102 | - "@maxulysse" 103 | - "@FriederikeHanssen" 104 | - "@ramprasadn" 105 | -------------------------------------------------------------------------------- /subworkflows/local/kraken2_classification/main.nf: -------------------------------------------------------------------------------- 1 | include { KRAKEN2_KRAKEN2 } from '../../../modules/nf-core/kraken2/kraken2/main' 2 | include { KRAKEN_PARSE } from '../../../modules/local/kraken/parse/main' 3 | include { KRAKEN_MERGE } from '../../../modules/local/kraken/merge/main' 4 | include { SOURCEPREDICT } from '../../../modules/nf-core/sourcepredict/main' 5 | include { UNTAR } from '../../../modules/nf-core/untar/main' 6 | include { XZ_DECOMPRESS } from '../../../modules/nf-core/xz/decompress/main' 7 | 8 | ch_sp_sources = file(params.sp_sources) 9 | ch_sp_labels = file(params.sp_labels) 10 | ch_sqlite_traverse = file(params.taxa_sqlite_traverse_pkl) 11 | 12 | workflow KRAKEN2_CLASSIFICATION { 13 | take: 14 | reads 15 | kraken2_db 16 | 17 | main: 18 | ch_versions = Channel.empty() 19 | 20 | if (kraken2_db.name.endsWith( ".tar.gz" )) { 21 | Channel 22 | .value(kraken2_db) 23 | .map { 24 | kraken2_db -> [ 25 | ['id' : 'kraken2_database'], 26 | kraken2_db 27 | ] 28 | } 29 | .set { archive } 30 | 31 | UNTAR ( archive ) 32 | 33 | database = UNTAR.out.untar.map{ it -> it[1] } 34 | ch_versions = ch_versions.mix(UNTAR.out.versions.first()) 35 | 36 | } else { 37 | database = kraken2_db 38 | } 39 | 40 | KRAKEN2_KRAKEN2( 41 | reads, 42 | database, 43 | false, 44 | false 45 | ) 46 | ch_versions = ch_versions.mix(KRAKEN2_KRAKEN2.out.versions.first()) 47 | 48 | KRAKEN_PARSE(KRAKEN2_KRAKEN2.out.report) 49 | KRAKEN_PARSE.out.kraken_read_count.map { 50 | it -> it[1] 51 | }.collect() 52 | .set { kraken_read_count } 53 | 54 | KRAKEN_MERGE(kraken_read_count) 55 | 56 | ch_versions = ch_versions.mix(KRAKEN_MERGE.out.versions.first()) 57 | ch_versions = ch_versions.mix(KRAKEN_PARSE.out.versions.first()) 58 | 59 | KRAKEN_MERGE.out.kraken_merged_report 60 | .map { 61 | kraken_merged_report -> 62 | [ 63 | [ 64 | 'id' : 'samples_combined' 65 | ], 66 | kraken_merged_report 67 | ] 68 | } 69 | .set { ch_kraken_merged } 70 | 71 | if (file(params.taxa_sqlite).name.endsWith( ".xz" )) { 72 | 73 | XZ_DECOMPRESS ( [ 74 | [], 75 | file(params.taxa_sqlite) ] 76 | ) 77 | sqlite = XZ_DECOMPRESS.out.file.map{ it[1] } 78 | ch_versions = ch_versions.mix(XZ_DECOMPRESS.out.versions.first()) 79 | 80 | } else { 81 | sqlite = file(params.taxa_sqlite) 82 | } 83 | 84 | // 85 | // MODULE: Run sourcepredict 86 | // 87 | SOURCEPREDICT ( 88 | ch_kraken_merged, 89 | ch_sp_sources, 90 | ch_sp_labels, 91 | sqlite, 92 | ch_sqlite_traverse, 93 | true 94 | ) 95 | ch_versions = ch_versions.mix(SOURCEPREDICT.out.versions.first()) 96 | 97 | emit: 98 | sp_report = SOURCEPREDICT.out.report 99 | sp_embedding = SOURCEPREDICT.out.embedding 100 | kraken_merged_report = KRAKEN_MERGE.out.kraken_merged_report 101 | kraken_report = KRAKEN2_KRAKEN2.out.report 102 | versions = ch_versions 103 | } 104 | -------------------------------------------------------------------------------- /modules/nf-core/kraken2/kraken2/meta.yml: -------------------------------------------------------------------------------- 1 | name: kraken2_kraken2 2 | description: Classifies metagenomic sequence data 3 | keywords: 4 | - classify 5 | - metagenomics 6 | - fastq 7 | - db 8 | tools: 9 | - kraken2: 10 | description: | 11 | Kraken2 is a taxonomic sequence classifier that assigns taxonomic labels to sequence reads 12 | homepage: https://ccb.jhu.edu/software/kraken2/ 13 | documentation: https://github.com/DerrickWood/kraken2/wiki/Manual 14 | doi: 10.1186/s13059-019-1891-0 15 | licence: ["MIT"] 16 | identifier: biotools:kraken2 17 | input: 18 | - - meta: 19 | type: map 20 | description: | 21 | Groovy Map containing sample information 22 | e.g. [ id:'test', single_end:false ] 23 | - reads: 24 | type: file 25 | description: | 26 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 27 | respectively. 28 | - - db: 29 | type: directory 30 | description: Kraken2 database 31 | - - save_output_fastqs: 32 | type: string 33 | description: | 34 | If true, optional commands are added to save classified and unclassified reads 35 | as fastq files 36 | - - save_reads_assignment: 37 | type: string 38 | description: | 39 | If true, an optional command is added to save a file reporting the taxonomic 40 | classification of each input read 41 | output: 42 | - classified_reads_fastq: 43 | - meta: 44 | type: map 45 | description: | 46 | Groovy Map containing sample information 47 | e.g. [ id:'test', single_end:false ] 48 | - "*.classified{.,_}*": 49 | type: file 50 | description: | 51 | Reads classified as belonging to any of the taxa 52 | on the Kraken2 database. 53 | pattern: "*{fastq.gz}" 54 | - unclassified_reads_fastq: 55 | - meta: 56 | type: map 57 | description: | 58 | Groovy Map containing sample information 59 | e.g. [ id:'test', single_end:false ] 60 | - "*.unclassified{.,_}*": 61 | type: file 62 | description: | 63 | Reads not classified to any of the taxa 64 | on the Kraken2 database. 65 | pattern: "*{fastq.gz}" 66 | - classified_reads_assignment: 67 | - meta: 68 | type: map 69 | description: | 70 | Groovy Map containing sample information 71 | e.g. [ id:'test', single_end:false ] 72 | - "*classifiedreads.txt": 73 | type: file 74 | description: | 75 | Kraken2 output file indicating the taxonomic assignment of 76 | each input read 77 | - report: 78 | - meta: 79 | type: map 80 | description: | 81 | Groovy Map containing sample information 82 | e.g. [ id:'test', single_end:false ] 83 | - "*report.txt": 84 | type: file 85 | description: | 86 | Kraken2 report containing stats about classified 87 | and not classified reads. 88 | pattern: "*.{report.txt}" 89 | - versions: 90 | - versions.yml: 91 | type: file 92 | description: File containing software versions 93 | pattern: "versions.yml" 94 | authors: 95 | - "@joseespinosa" 96 | - "@drpatelh" 97 | maintainers: 98 | - "@joseespinosa" 99 | - "@drpatelh" 100 | --------------------------------------------------------------------------------