From 9e6cb227b039ec8ebf627bd59a438aafca5940c1 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Fri, 11 Nov 2022 14:36:05 +0100 Subject: [PATCH 1/3] Fix mapDamage command and add support for --seq-length parameter --- CHANGELOG.md | 3 +++ main.nf | 4 +++- nextflow.config | 5 +++-- nextflow_schema.json | 17 ++++++++++++----- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b6abec41..459a5b408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Added` +- [#933](https://github.com/nf-core/eager/issues/933) Added support for customising --seq-length in mapDamage rescaling (♥ to @ashildv for requesting) + ### `Fixed` - Changed endors.py license from GPL to MIT (by @aidaanva) - Removed erroneous R2 in single-end example in input TSV of usage docs (by @aidaanva) - [#928](https://github.com/nf-core/eager/issues/928) Fixed read group incompatibility by re-adding picard AddOrReplaceReadGroups for MultiVCFAnalyzer (♥ to @aidaanva, @meganemichel for reporting) - Fixed edge case of DamageProfiler occasionally requiring FASTA index (♥ to @asmaa-a-abdelwahab for reporting) +- [#934](https://github.com/nf-core/eager/issues/934) Fixed broken parameter setting in mapDamage2 rescale length (♥ to @ashildv for reporting) ### `Dependencies` diff --git a/main.nf b/main.nf index e690cc192..3d2470161 100644 --- a/main.nf +++ b/main.nf @@ -2129,8 +2129,10 @@ process mapdamage_rescaling { def base = "${bam.baseName}" def singlestranded = strandedness == "single" ? '--single-stranded' : '' def size = params.large_ref ? '-c' : '' + def rescale_length_3p = params.rescale_length_3p != 0 ? "--rescale-length-3p=${params.rescale_length_3p}" : "" + def rescale_length_5p = params.rescale_length_5p != 0 ? "--rescale-length-5p=${params.rescale_length_5p}" : "" """ - mapDamage -i ${bam} -r ${fasta} --rescale --rescale-out ${base}_rescaled.bam --rescale-length-5p ${params.rescale_length_5p} --rescale-length-3p=${params.rescale_length_3p} ${singlestranded} + mapDamage -i ${bam} -r ${fasta} --rescale --rescale-out="${base}_rescaled.bam" --seq-length=${params.rescale_seqlength} ${rescale_length_5p} ${rescale_length_3p} ${singlestranded} samtools index ${base}_rescaled.bam ${size} """ diff --git a/nextflow.config b/nextflow.config index 81a67d1ba..c4c1818b7 100644 --- a/nextflow.config +++ b/nextflow.config @@ -135,8 +135,9 @@ params { // mapDamage run_mapdamage_rescaling = false - rescale_length_5p = 12 - rescale_length_3p = 12 + rescale_length_5p = 0 + rescale_length_3p = 0 + rescale_seqlength = 12 //Bedtools settings run_bedtools_coverage = false diff --git a/nextflow_schema.json b/nextflow_schema.json index d93b38233..d698dbc49 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -914,18 +914,25 @@ "description": "Turn on damage rescaling of BAM files using mapDamage2 to probabilistically remove damage.", "help_text": "Turns on mapDamage2's BAM rescaling functionality. This probablistically replaces Ts back to Cs depending on the likelihood this reference-mismatch was originally caused by damage. If the library is specified to be single stranded, this will automatically use the `--single-stranded` mode.\n\nThis functionality does not have any MultiQC output.\n\n:warning: rescaled libraries will not be merged with non-scaled libraries of the same sample for downstream genotyping, as the model may be different for each library. If you wish to merge these, please do this manually and re-run nf-core/eager using the merged BAMs as input. \n\n> Modifies the `--rescale` parameter of mapDamage2" }, - "rescale_length_5p": { + "rescale_seqlength": { "type": "integer", "default": 12, + "fa_icon": "fas fa-ruler-horizontal", + "description": "Length of read sequence to use from each side for rescaling. Can be overridden by --rescale_length_*p.", + "help_text": "Specify the length from the end of the read that mapDamage should rescale at both ends.\n\n> Modifies the `--seq-length` parameter of mapDamage2." + }, + "rescale_length_5p": { + "type": "integer", + "default": 0, "fa_icon": "fas fa-balance-scale-right", - "description": "Length of read for mapDamage2 to rescale from 5p end.", - "help_text": "Specify the length from the end of the read that mapDamage should rescale.\n\n> Modifies the `--rescale-length-5p` parameter of mapDamage2." + "description": "Length of read for mapDamage2 to rescale from 5p end. Only used if not 0 otherwise --rescale_seqlength used.", + "help_text": "Specify the length from the end of the read that mapDamage should rescale. Overrides `--rescale_seqlength`.\n\n> Modifies the `--rescale-length-5p` parameter of mapDamage2." }, "rescale_length_3p": { "type": "integer", - "default": 12, + "default": 0, "fa_icon": "fas fa-balance-scale-left", - "description": "Length of read for mapDamage2 to rescale from 3p end.", + "description": "Length of read for mapDamage2 to rescale from 3p end. Only used if not 0 otherwise --rescale_seqlength used..", "help_text": "Specify the length from the end of the read that mapDamage should rescale.\n\n> Modifies the `--rescale-length-3p` parameter of mapDamage2." } }, From b90234182e95d423be968e95f691647f7d62d9c3 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Fri, 11 Nov 2022 14:39:34 +0100 Subject: [PATCH 2/3] Correctl bump version --- Dockerfile | 4 ++-- environment.yml | 4 ++-- nextflow.config | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b14d3177c..eead4a293 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY environment.yml / RUN conda env create --quiet -f /environment.yml && conda clean -a # Add conda installation dir to PATH (instead of doing 'conda activate') -ENV PATH /opt/conda/envs/nf-core-eager-2.4.5dev/bin:$PATH +ENV PATH /opt/conda/envs/nf-core-eager-2.4.6dev/bin:$PATH # Dump the details of the installed packages to a file for posterity -RUN conda env export --name nf-core-eager-2.4.5dev > nf-core-eager-2.4.5dev.yml \ No newline at end of file +RUN conda env export --name nf-core-eager-2.4.6dev > nf-core-eager-2.4.6dev.yml \ No newline at end of file diff --git a/environment.yml b/environment.yml index b385a972e..0f306ba0e 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,6 @@ # You can use this file to create a conda environment for this pipeline: # conda env create -f environment.yml -name: nf-core-eager-2.4.5dev +name: nf-core-eager-2.4.6dev channels: - conda-forge - bioconda @@ -50,4 +50,4 @@ dependencies: - bioconda::eigenstratdatabasetools=1.0.2 - bioconda::mapdamage2=2.2.1 - bioconda::bbmap=38.92 - - bioconda::bcftools=1.12 + - bioconda::bcftools=1.12 \ No newline at end of file diff --git a/nextflow.config b/nextflow.config index c4c1818b7..fb2395200 100644 --- a/nextflow.config +++ b/nextflow.config @@ -415,7 +415,7 @@ manifest { description = 'A fully reproducible and state-of-the-art ancient DNA analysis pipeline' mainScript = 'main.nf' nextflowVersion = '>=20.07.1' - version = '2.4.5dev' + version = '2.4.6dev' } // Function to ensure that resource requirements don't go beyond From 745b63eccb6b17d4879b4e633a9f54716f3af64b Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Fri, 11 Nov 2022 15:15:55 +0100 Subject: [PATCH 3/3] Linitng --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a9ed80e2..37c3c9bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed parameter documentation for `--snpcapture_bed` regarding on-target SNP stats to state these stats currently not displayed in MultiQC only in the Qualimap results (♥ to @meganemichel and @TCLamnidis for reporting) - [#934](https://github.com/nf-core/eager/issues/934) Fixed broken parameter setting in mapDamage2 rescale length (♥ to @ashildv for reporting) - ### `Dependencies` - Updated MultiQC to official 1.13 version (rather than alpha)