Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### `Added`

- [#805](https://github.com/nf-core/eager/issues/805) Changes to bam_trim options to allow flexible trimming by library strandedness (in addition to UDG treatment).

### `Fixed`

### `Dependencies`
Expand Down Expand Up @@ -178,7 +180,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### `Deprecated`

## [2.3.0] - Aalen - 2021-01-11
## [2.3.0] - Aalen - 2021-01-11

### `Added`

Expand Down
7 changes: 5 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2204,8 +2204,11 @@ process bam_trim {
script:
def softclip = params.bamutils_softclip ? '-c' : ''
def size = params.large_ref ? '-c' : ''
def left_clipping = udg == "half" ? "${params.bamutils_clip_half_udg_left}" : "${params.bamutils_clip_none_udg_left}"
def right_clipping = udg == "half" ? "${params.bamutils_clip_half_udg_right}" : "${params.bamutils_clip_none_udg_right}"
def left_clipping = strandedness == "double" ? (udg == "half" ? "${params.bamutils_clip_double_stranded_half_udg_left}" : "${params.bamutils_clip_double_stranded_none_udg_left}") : (udg == "half" ? "${params.bamutils_clip_single_stranded_half_udg_left}" : "${params.bamutils_clip_single_stranded_none_udg_left}")
def right_clipping = strandedness == "double" ? (udg == "half" ? "${params.bamutils_clip_double_stranded_half_udg_right}" : "${params.bamutils_clip_double_stranded_none_udg_right}") : (udg == "half" ? "${params.bamutils_clip_single_stranded_half_udg_right}" : "${params.bamutils_clip_single_stranded_none_udg_right}")

// def left_clipping = udg == "half" ? "${params.bamutils_clip_half_udg_left}" : "${params.bamutils_clip_none_udg_left}"
// def right_clipping = udg == "half" ? "${params.bamutils_clip_half_udg_right}" : "${params.bamutils_clip_none_udg_right}"
"""
bam trimBam $bam tmp.bam -L ${left_clipping} -R ${right_clipping} ${softclip}
samtools sort -@ ${task.cpus} tmp.bam -o ${libraryid}.trimmed.bam
Expand Down
12 changes: 8 additions & 4 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ params {

//bamUtils trimbam settings
run_trim_bam = false
bamutils_clip_half_udg_left = 0
bamutils_clip_half_udg_right = 0
bamutils_clip_none_udg_left = 0
bamutils_clip_none_udg_right = 0
bamutils_clip_double_stranded_half_udg_left = 0
bamutils_clip_double_stranded_half_udg_right = 0
bamutils_clip_double_stranded_none_udg_left = 0
bamutils_clip_double_stranded_none_udg_right = 0
bamutils_clip_single_stranded_half_udg_left = 0
bamutils_clip_single_stranded_half_udg_right = 0
bamutils_clip_single_stranded_none_udg_left = 0
bamutils_clip_single_stranded_none_udg_right = 0
bamutils_softclip = false

//Genotyping options
Expand Down
54 changes: 41 additions & 13 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -964,33 +964,61 @@
"fa_icon": "fas fa-power-off",
"help_text": "Turns on the BAM trimming method. Trims off `[n]` bases from reads in the deduplicated BAM file. Damage assessment in PMDTools or DamageProfiler remains untouched, as data is routed through this independently. BAM trimming is typically performed to reduce errors during genotyping that can be caused by aDNA damage.\n\nBAM trimming will only be performed on libraries indicated as `--udg_type 'none'` or `--udg_type 'half'`. Complete UDG treatment ('full') should have removed all damage. The amount of bases that will be trimmed off can be set separately for libraries with `--udg_type` `'none'` and `'half'` (see `--bamutils_clip_half_udg_left` / `--bamutils_clip_half_udg_right` / `--bamutils_clip_none_udg_left` / `--bamutils_clip_none_udg_right`).\n\n> Note: additional artefacts such as bar-codes or adapters that could potentially also be trimmed should be removed prior mapping."
},
"bamutils_clip_half_udg_left": {
"bamutils_clip_double_stranded_half_udg_left": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler-combined",
"description": "Specify the number of bases to clip off reads from 'left' end of read for half-UDG libraries.",
"help_text": "Default set to `1` and clips off one base of the left or right side of reads from libraries whose UDG treatment is set to `half`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
"description": "Specify the number of bases to clip off reads from 'left' end of read for double-stranded half-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from double_stranded libraries whose UDG treatment is set to `half`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_clip_half_udg_right": {
"bamutils_clip_double_stranded_half_udg_right": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler",
"description": "Specify the number of bases to clip off reads from 'right' end of read for half-UDG libraries.",
"help_text": "Default set to `1` and clips off one base of the left or right side of reads from libraries whose UDG treatment is set to `half`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
"description": "Specify the number of bases to clip off reads from 'right' end of read for double-stranded half-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from double_stranded libraries whose UDG treatment is set to `half`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_clip_none_udg_left": {
"bamutils_clip_double_stranded_none_udg_left": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler-combined",
"description": "Specify the number of bases to clip off reads from 'left' end of read for non-UDG libraries.",
"help_text": "Default set to `1` and clips off one base of the left or right side of reads from libraries whose UDG treatment is set to `none`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
"description": "Specify the number of bases to clip off reads from 'left' end of read for double-stranded non-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from double_stranded libraries whose UDG treatment is set to `none`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_clip_none_udg_right": {
"bamutils_clip_double_stranded_none_udg_right": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler",
"description": "Specify the number of bases to clip off reads from 'right' end of read for non-UDG libraries.",
"help_text": "Default set to `1` and clips off one base of the left or right side of reads from libraries whose UDG treatment is set to `none`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
"description": "Specify the number of bases to clip off reads from 'right' end of read for double-stranded non-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from double_stranded libraries whose UDG treatment is set to `none`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_clip_single_stranded_half_udg_left": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler-combined",
"description": "Specify the number of bases to clip off reads from 'left' end of read for single-stranded half-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from single-stranded libraries whose UDG treatment is set to `half`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_clip_single_stranded_half_udg_right": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler",
"description": "Specify the number of bases to clip off reads from 'right' end of read for single-stranded half-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from single-stranded libraries whose UDG treatment is set to `half`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_clip_single_stranded_none_udg_left": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler-combined",
"description": "Specify the number of bases to clip off reads from 'left' end of read for single-stranded non-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from single-stranded libraries whose UDG treatment is set to `none`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_clip_single_stranded_none_udg_right": {
"type": "integer",
"default": 0,
"fa_icon": "fas fa-ruler",
"description": "Specify the number of bases to clip off reads from 'right' end of read for single-stranded non-UDG libraries.",
"help_text": "Default set to `0` and clips off no bases on the left or right side of reads from single-stranded libraries whose UDG treatment is set to `none`. Note that reverse reads will automatically be clipped off at the reverse side with this (automatically reverses left and right for the reverse read).\n\n> Modifies bamUtil's trimBam parameter: `-L -R`"
},
"bamutils_softclip": {
"type": "boolean",
Expand Down Expand Up @@ -1736,4 +1764,4 @@
"$ref": "#/definitions/metagenomic_authentication"
}
]
}
}