From f96f8634160a08bab393c82458c42f8f17083958 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 1 Feb 2024 14:27:05 +0000 Subject: [PATCH] Update modules, fix parameter schema defaults --- modules.json | 6 +++--- modules/nf-core/angsd/contamination/environment.yml | 7 +++++++ modules/nf-core/angsd/contamination/main.nf | 4 ++-- modules/nf-core/angsd/contamination/meta.yml | 7 +++---- modules/nf-core/angsd/docounts/environment.yml | 7 +++++++ modules/nf-core/angsd/docounts/main.nf | 2 +- modules/nf-core/angsd/docounts/meta.yml | 5 ++--- nextflow.config | 6 +++--- nextflow_schema.json | 12 +++--------- .../bam_docounts_contamination_angsd/meta.yml | 4 +++- 10 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 modules/nf-core/angsd/contamination/environment.yml create mode 100644 modules/nf-core/angsd/docounts/environment.yml diff --git a/modules.json b/modules.json index 8f20a5b33..e031be9cd 100644 --- a/modules.json +++ b/modules.json @@ -12,12 +12,12 @@ }, "angsd/contamination": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "3c77ca9aac783e76c3614a06db3bfe4fef619bde", "installed_by": ["bam_docounts_contamination_angsd"] }, "angsd/docounts": { "branch": "master", - "git_sha": "bd9e43646a9435d2f62ce4a777ae88ef10ec922d", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["bam_docounts_contamination_angsd"] }, "bamutil/trimbam": { @@ -221,7 +221,7 @@ "nf-core": { "bam_docounts_contamination_angsd": { "branch": "master", - "git_sha": "a9784afdd5dcda23b84e64db75dc591065d64653", + "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", "installed_by": ["subworkflows"] }, "bam_split_by_region": { diff --git a/modules/nf-core/angsd/contamination/environment.yml b/modules/nf-core/angsd/contamination/environment.yml new file mode 100644 index 000000000..57a572761 --- /dev/null +++ b/modules/nf-core/angsd/contamination/environment.yml @@ -0,0 +1,7 @@ +name: angsd_contamination +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::angsd=0.940 diff --git a/modules/nf-core/angsd/contamination/main.nf b/modules/nf-core/angsd/contamination/main.nf index 354076999..b33171b31 100644 --- a/modules/nf-core/angsd/contamination/main.nf +++ b/modules/nf-core/angsd/contamination/main.nf @@ -2,7 +2,7 @@ process ANGSD_CONTAMINATION { tag "$meta.id" label 'process_low' - conda "bioconda::angsd=0.940" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/angsd:0.939--h468462d_0': 'biocontainers/angsd:0.939--h468462d_0' }" @@ -27,7 +27,7 @@ process ANGSD_CONTAMINATION { -a ${icounts} \ -h ${hapmap_file} \ -p ${task.cpus} \ - 2> ${prefix}.txt + 2> >(tee ${prefix}.txt >&2) cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/angsd/contamination/meta.yml b/modules/nf-core/angsd/contamination/meta.yml index e0c6bec87..dc01c90c0 100644 --- a/modules/nf-core/angsd/contamination/meta.yml +++ b/modules/nf-core/angsd/contamination/meta.yml @@ -11,8 +11,7 @@ tools: documentation: "http://www.popgen.dk/angsd/" tool_dev_url: "https://github.com/ANGSD/angsd" doi: "10.1186/s12859-014-0356-4" - licence: "['GPL v3, MIT']" - + licence: ["GPL v3", "MIT"] input: - meta: type: map @@ -26,7 +25,6 @@ input: - hapmap_file: type: file description: A list of variable sites to look for heterozygosity. - output: - meta: type: map @@ -41,6 +39,7 @@ output: type: file description: Contamination estimation output. pattern: "*.txt" - authors: - "@jbv2" +maintainers: + - "@jbv2" diff --git a/modules/nf-core/angsd/docounts/environment.yml b/modules/nf-core/angsd/docounts/environment.yml new file mode 100644 index 000000000..ebaa9ed2c --- /dev/null +++ b/modules/nf-core/angsd/docounts/environment.yml @@ -0,0 +1,7 @@ +name: angsd_docounts +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::angsd=0.939 diff --git a/modules/nf-core/angsd/docounts/main.nf b/modules/nf-core/angsd/docounts/main.nf index 0c6543101..33cc40425 100644 --- a/modules/nf-core/angsd/docounts/main.nf +++ b/modules/nf-core/angsd/docounts/main.nf @@ -2,7 +2,7 @@ process ANGSD_DOCOUNTS { tag "$meta.id" label 'process_low' - conda "bioconda::angsd=0.939" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/angsd:0.939--h468462d_0': 'biocontainers/angsd:0.939--h468462d_0' }" diff --git a/modules/nf-core/angsd/docounts/meta.yml b/modules/nf-core/angsd/docounts/meta.yml index 658b9edc8..8381091f9 100644 --- a/modules/nf-core/angsd/docounts/meta.yml +++ b/modules/nf-core/angsd/docounts/meta.yml @@ -13,7 +13,6 @@ tools: tool_dev_url: "https://github.com/ANGSD/angsd" doi: "10.1186/s12859-014-0356-4" licence: "['GPL v3, MIT']" - input: - meta: type: map @@ -32,7 +31,6 @@ input: type: file description: File with individual quality score thresholds pattern: "*" - output: - meta: type: map @@ -67,6 +65,7 @@ output: type: file description: Internal format for dumping binary single chrs. Useful for ANGSD contamination pattern: "*.icnts.gz" - authors: - "@jfy133" +maintainers: + - "@jfy133" diff --git a/nextflow.config b/nextflow.config index 66e69e3fb..d1c7a992c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -155,7 +155,7 @@ params { contamination_estimation_angsd_range_to = 154900000 contamination_estimation_angsd_mapq = 30 contamination_estimation_angsd_minq = 30 - contamination_estimation_angsd_hapmap = "${baseDir}/assets/angsd_resources/HapMapChrX.gz" + contamination_estimation_angsd_hapmap = "${projectDir}/assets/angsd_resources/HapMapChrX.gz" // MtNucRatio run_mtnucratio = false @@ -215,9 +215,9 @@ try { // Load nf-core/eager custom profiles from different institutions. // Warning: Uncomment only if a pipeline-specific institutional config already exists on nf-core/configs! try { - includeConfig "${params.custom_config_base}/pipeline/eager.config" + includeConfig "${params.custom_config_base}/pipeline/eager.config" } catch (Exception e) { - System.err.println("WARNING: Could not load nf-core/config/eager profiles: ${params.custom_config_base}/pipeline/eager.config") + System.err.println("WARNING: Could not load nf-core/config/eager profiles: ${params.custom_config_base}/pipeline/eager.config") } // Additional configs for subworkflows diff --git a/nextflow_schema.json b/nextflow_schema.json index 38abbccf9..e5d457165 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -60,21 +60,18 @@ }, "fasta_fai": { "type": "string", - "default": "None", "description": "Path to samtools FASTA index (typically ending in '.fai'). If not supplied will be made for you.", "help_text": "If you want to use a pre-existing `samtools faidx` index, use this to specify the required FASTA index file for the selected reference genome. This should be generated by samtools faidx and has a file suffix of `.fai`.", "fa_icon": "fas fa-address-book" }, "fasta_dict": { "type": "string", - "default": "None", "description": "Path to picard sequence dictionary file (typically ending in '.dict'). If not supplied will be made for you.", "help_text": "If you want to use a pre-existing `picard CreateSequenceDictionary` dictionary file, use this to specify the required `.dict` file for the selected reference genome.", "fa_icon": "fas fa-address-book" }, "fasta_mapperindexdir": { "type": "string", - "default": "None", "description": "Path to directory containing index files of the FASTA for a given mapper.", "help_text": "For most people this will likely be the same directory that contains the file you provided to `--fasta`.\n\nIf you want to use pre-existing `bwa index` indices, the directory should contain files ending in '.amb' '.ann' '.bwt'. If you want to use pre-existing `bowtie2 build` indices, the directory should contain files ending in'.1.bt2', '.2.bt2', '.rev.1.bt2'. \n\nIn any case do not include the files themselves in the path. nf-core/eager will automagically detect the index files by searching for the FASTA filename with the corresponding `bwa index`/`bowtie2 build` file suffixes. If not supplied, the indices will be generated for you.\n\n" }, @@ -95,7 +92,7 @@ "type": "string", "format": "directory-path", "description": "Directory / URL base for iGenomes references.", - "default": "s3://ngi-igenomes/igenomes", + "default": "s3://ngi-igenomes/igenomes/", "fa_icon": "fas fa-cloud-download-alt", "hidden": true }, @@ -356,21 +353,18 @@ }, "preprocessing_adapter1": { "type": "string", - "default": "None", "description": "Specify the nucleotide sequence for the forward read/R1.", "fa_icon": "fas fa-grip-lines", "help_text": "Specify a nucleotide sequence for the forward read/R1.\n\nIf not modified by the user, the default for the particular preprocessing tool will be used. Therefore, to turn off adapter trimming use `--preprocessing_skipadaptertrim`.\n\n> Modifies AdapterRemoval parameter: `--adapter1`\n> Modifies fastp parameter: `--adapter_sequence`" }, "preprocessing_adapter2": { "type": "string", - "default": "None", "description": "Specify the nucleotide sequence for the forward read/R2.", "fa_icon": "fas fa-grip-lines", "help_text": "Specify a nucleotide sequence for the forward read/R2.\n\nIf not modified by the user, the default for the particular preprocessing tool will be used. To turn off adapter trimming use `--preprocessing_skipadaptertrim`.\n\n> Modifies AdapterRemoval parameter: `--adapter2`\n> Modifies fastp parameter: `--adapter_sequence_r2`" }, "preprocessing_adapterlist": { "type": "string", - "default": "None", "description": "Specify a list of all possible adapters to trim. Overrides --preprocessing_adapter1/2. Formats: .txt (AdapterRemoval) or .fasta. (fastp).", "help_text": "Allows to supply a file with a list of adapter (combinations) to remove from all files. \n\nOverrides the `--preprocessing_adapter1`/`--preprocessing_adapter2` parameters . \n\nNote that the two tools have slightly different behaviours.\n\nFor AdapterRemoval this consists of a two column table with a `.txt` extension: first column represents forward strand, second column for reverse strand. You must supply all possibly combinations, one per line, and this list is applied to all files. Only Adapters in this list will be screened for and removed. See AdapterRemoval documentation for more information.\n\nFor fastp this consists of a standard FASTA format with a `.fasta`/`.fa`/`.fna`/`.fas` extension. The adapter sequence in this file should be at least 6bp long, otherwise it will be skipped. fastp first will perform auto-detection of reads and will be removed , and then _additionally_ adapters present in the FASTA file one by one will be removed.\n\n> Modifies AdapterRemoval parameter: `--adapter-list`\n> Modifies fastp parameter: `--adapter_fasta`", "fa_icon": "fas fa-list" @@ -478,7 +472,7 @@ }, "mapping_tool": { "type": "string", - "default": "bowtie2", + "default": "bwaaln", "enum": ["bwaaln", "bwamem", "bowtie2", "circularmapper"], "description": "Specify which mapper to use.", "help_text": "Specify which mapping tool to use. Options are BWA aln ('`bwaaln`'), BWA mem ('`bwamem`'), circularmapper ('`circularmapper`'), or bowtie2 ('`bowtie2`'). BWA aln is the default and highly suited for short-read ancient DNA. BWA mem can be quite useful for modern DNA, but is rarely used in projects for ancient DNA. CircularMapper enhances the mapping procedure to circular references, using the BWA algorithm but utilizing a extend-remap procedure (see Peltzer et al 2016, Genome Biology for details). Bowtie2 is similar to BWA aln, and has recently been suggested to provide slightly better results under certain conditions ([Poullet and Orlando 2020](https://doi.org/10.3389/fevo.2020.00105)), as well as providing extra functionality (such as FASTQ trimming).\n\nMore documentation can be seen for each tool under:\n\n- [BWA aln](http://bio-bwa.sourceforge.net/bwa.shtml#3)\n- [BWA mem](http://bio-bwa.sourceforge.net/bwa.shtml#3)\n- [CircularMapper](https://circularmapper.readthedocs.io/en/latest/contents/userguide.html)\n- [Bowtie2](http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml#command-line)", @@ -1108,7 +1102,7 @@ }, "contamination_estimation_angsd_hapmap": { "type": "string", - "default": "${baseDir}/assets/angsd_resources/HapMapChrX.gz", + "default": "${projectDir}/assets/angsd_resources/HapMapChrX.gz", "description": "Path to HapMap file of chromosome for contamination estimation..", "help_text": "The haplotype map, or \"HapMap\", records the location of haplotype blocks and their tag SNPs.", "fa_icon": "fas fa-map" diff --git a/subworkflows/nf-core/bam_docounts_contamination_angsd/meta.yml b/subworkflows/nf-core/bam_docounts_contamination_angsd/meta.yml index 360372b3f..07a913060 100644 --- a/subworkflows/nf-core/bam_docounts_contamination_angsd/meta.yml +++ b/subworkflows/nf-core/bam_docounts_contamination_angsd/meta.yml @@ -6,7 +6,7 @@ keywords: - bam - contamination - docounts -modules: +components: - angsd/docounts - angsd/contamination input: @@ -40,3 +40,5 @@ output: pattern: "versions.yml" authors: - "@scarlhoff" +maintainers: + - "@scarlhoff"