Skip to content

Commit f0c4a7a

Browse files
authored
Merge pull request #935 from nf-core/patch-mapdamage
Fix mapdamage and add parameter
2 parents 8bc8c00 + 745b63e commit f0c4a7a

6 files changed

Lines changed: 31 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
### `Added`
99

10+
- [#933](https://github.com/nf-core/eager/issues/933) Added support for customising --seq-length in mapDamage rescaling (♥ to @ashildv for requesting)
11+
1012
### `Fixed`
1113

1214
- 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.
1517
- Fixed edge case of DamageProfiler occasionally requiring FASTA index (♥ to @asmaa-a-abdelwahab for reporting)
1618
- [#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)
1719
- 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)
20+
- [#934](https://github.com/nf-core/eager/issues/934) Fixed broken parameter setting in mapDamage2 rescale length (♥ to @ashildv for reporting)
1821

1922
### `Dependencies`
2023

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY environment.yml /
77
RUN conda env create --quiet -f /environment.yml && conda clean -a
88

99
# Add conda installation dir to PATH (instead of doing 'conda activate')
10-
ENV PATH /opt/conda/envs/nf-core-eager-2.4.5dev/bin:$PATH
10+
ENV PATH /opt/conda/envs/nf-core-eager-2.4.6dev/bin:$PATH
1111

1212
# Dump the details of the installed packages to a file for posterity
13-
RUN conda env export --name nf-core-eager-2.4.5dev > nf-core-eager-2.4.5dev.yml
13+
RUN conda env export --name nf-core-eager-2.4.6dev > nf-core-eager-2.4.6dev.yml

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# You can use this file to create a conda environment for this pipeline:
22
# conda env create -f environment.yml
3-
name: nf-core-eager-2.4.5dev
3+
name: nf-core-eager-2.4.6dev
44
channels:
55
- conda-forge
66
- bioconda
@@ -50,4 +50,4 @@ dependencies:
5050
- bioconda::eigenstratdatabasetools=1.0.2
5151
- bioconda::mapdamage2=2.2.1
5252
- bioconda::bbmap=38.92
53-
- bioconda::bcftools=1.12
53+
- bioconda::bcftools=1.12

main.nf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,8 +2129,10 @@ process mapdamage_rescaling {
21292129
def base = "${bam.baseName}"
21302130
def singlestranded = strandedness == "single" ? '--single-stranded' : ''
21312131
def size = params.large_ref ? '-c' : ''
2132+
def rescale_length_3p = params.rescale_length_3p != 0 ? "--rescale-length-3p=${params.rescale_length_3p}" : ""
2133+
def rescale_length_5p = params.rescale_length_5p != 0 ? "--rescale-length-5p=${params.rescale_length_5p}" : ""
21322134
"""
2133-
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}
2135+
mapDamage -i ${bam} -r ${fasta} --rescale --rescale-out="${base}_rescaled.bam" --seq-length=${params.rescale_seqlength} ${rescale_length_5p} ${rescale_length_3p} ${singlestranded}
21342136
samtools index ${base}_rescaled.bam ${size}
21352137
"""
21362138

nextflow.config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ params {
135135

136136
// mapDamage
137137
run_mapdamage_rescaling = false
138-
rescale_length_5p = 12
139-
rescale_length_3p = 12
138+
rescale_length_5p = 0
139+
rescale_length_3p = 0
140+
rescale_seqlength = 12
140141

141142
//Bedtools settings
142143
run_bedtools_coverage = false
@@ -414,7 +415,7 @@ manifest {
414415
description = 'A fully reproducible and state-of-the-art ancient DNA analysis pipeline'
415416
mainScript = 'main.nf'
416417
nextflowVersion = '>=20.07.1'
417-
version = '2.4.5dev'
418+
version = '2.4.6dev'
418419
}
419420

420421
// Function to ensure that resource requirements don't go beyond

nextflow_schema.json

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -877,20 +877,27 @@
877877
"description": "Turn on damage rescaling of BAM files using mapDamage2 to probabilistically remove damage.",
878878
"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"
879879
},
880-
"rescale_length_5p": {
880+
"rescale_seqlength": {
881881
"type": "integer",
882882
"default": 12,
883-
"fa_icon": "fas fa-balance-scale-right",
884-
"description": "Length of read for mapDamage2 to rescale from 5p end.",
885-
"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."
883+
"fa_icon": "fas fa-ruler-horizontal",
884+
"description": "Length of read sequence to use from each side for rescaling. Can be overridden by --rescale_length_*p.",
885+
"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."
886+
},
887+
"rescale_length_5p": {
888+
"type": "integer",
889+
"default": 0,
890+
"fa_icon": "fas fa-balance-scale-right",
891+
"description": "Length of read for mapDamage2 to rescale from 5p end. Only used if not 0 otherwise --rescale_seqlength used.",
892+
"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."
886893
},
887894
"rescale_length_3p": {
888-
"type": "integer",
889-
"default": 12,
890-
"fa_icon": "fas fa-balance-scale-left",
891-
"description": "Length of read for mapDamage2 to rescale from 3p end.",
892-
"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."
893-
}
895+
"type": "integer",
896+
"default": 0,
897+
"fa_icon": "fas fa-balance-scale-left",
898+
"description": "Length of read for mapDamage2 to rescale from 3p end. Only used if not 0 otherwise --rescale_seqlength used..",
899+
"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."
900+
}
894901
},
895902
"fa_icon": "fas fa-chart-line",
896903
"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"

0 commit comments

Comments
 (0)