Skip to content

Commit 9e6cb22

Browse files
committed
Fix mapDamage command and add support for --seq-length parameter
1 parent 49550f4 commit 9e6cb22

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ 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 (by @aidaanva)
1315
- Removed erroneous R2 in single-end example in input TSV of usage docs (by @aidaanva)
1416
- [#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)
1517
- Fixed edge case of DamageProfiler occasionally requiring FASTA index (♥ to @asmaa-a-abdelwahab for reporting)
18+
- [#934](https://github.com/nf-core/eager/issues/934) Fixed broken parameter setting in mapDamage2 rescale length (♥ to @ashildv for reporting)
1619

1720
### `Dependencies`
1821

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: 3 additions & 2 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

nextflow_schema.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,18 +914,25 @@
914914
"description": "Turn on damage rescaling of BAM files using mapDamage2 to probabilistically remove damage.",
915915
"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"
916916
},
917-
"rescale_length_5p": {
917+
"rescale_seqlength": {
918918
"type": "integer",
919919
"default": 12,
920+
"fa_icon": "fas fa-ruler-horizontal",
921+
"description": "Length of read sequence to use from each side for rescaling. Can be overridden by --rescale_length_*p.",
922+
"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."
923+
},
924+
"rescale_length_5p": {
925+
"type": "integer",
926+
"default": 0,
920927
"fa_icon": "fas fa-balance-scale-right",
921-
"description": "Length of read for mapDamage2 to rescale from 5p end.",
922-
"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."
928+
"description": "Length of read for mapDamage2 to rescale from 5p end. Only used if not 0 otherwise --rescale_seqlength used.",
929+
"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."
923930
},
924931
"rescale_length_3p": {
925932
"type": "integer",
926-
"default": 12,
933+
"default": 0,
927934
"fa_icon": "fas fa-balance-scale-left",
928-
"description": "Length of read for mapDamage2 to rescale from 3p end.",
935+
"description": "Length of read for mapDamage2 to rescale from 3p end. Only used if not 0 otherwise --rescale_seqlength used..",
929936
"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."
930937
}
931938
},

0 commit comments

Comments
 (0)