diff --git a/CHANGELOG.md b/CHANGELOG.md index dfdd796be..37c3c9bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ 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 (♥ to @aidaanva for fixing) @@ -15,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed edge case of DamageProfiler occasionally requiring FASTA index (♥ to @asmaa-a-abdelwahab for reporting) - [#834](https://github.com/nf-core/eager/issues/834) Increased significance values in general stats table for Qualimap mean/median coverages (♥ to @neija2611 for reporting) - 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` 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/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..fb2395200 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 @@ -414,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 diff --git a/nextflow_schema.json b/nextflow_schema.json index 2a823c4fc..edfe32bbd 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -877,20 +877,27 @@ "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-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." + "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. 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, - "fa_icon": "fas fa-balance-scale-left", - "description": "Length of read for mapDamage2 to rescale from 3p end.", - "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." - } + "type": "integer", + "default": 0, + "fa_icon": "fas fa-balance-scale-left", + "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." + } }, "fa_icon": "fas fa-chart-line", "help_text": "More documentation can be seen in the follow links for:\n\n- [DamageProfiler](https://github.com/Integrative-Transcriptomics/DamageProfiler)\n- [PMDTools documentation](https://github.com/pontussk/PMDtools)\n\nIf using TSV input, DamageProfiler is performed per library, i.e. after lane\nmerging. PMDtools and BAM Trimming is run after library merging of same-named\nlibrary BAMs that have the same type of UDG treatment. BAM Trimming is only\nperformed on non-UDG and half-UDG treated data.\n"