Skip to content

Commit

Permalink
Merge pull request #405 from JoseEspinosa/updates
Browse files Browse the repository at this point in the history
Add read group tag to bowtie2 bams
  • Loading branch information
JoseEspinosa authored Jul 23, 2024
2 parents 9fe5767 + bcb876b commit 1c2b3d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [[PR #392](https://github.com/nf-core/chipseq/pull/392)] - Adding line numbers to warnings/errors messages in `bin/check_samplesheet.py`.
- [[#396](https://github.com/nf-core/chipseq/issues/396)] - Check that samplesheet samples IDs do only have alphanumeric characters, dots, dashes or underscores.
- [[#378](https://github.com/nf-core/chipseq/issues/378)] - Switch from macs2 to macs3.
- [[#347](https://github.com/nf-core/chipseq/issues/347)] - Add read group tag to bam files processed by bowtie2.

### Software dependencies

Expand Down
7 changes: 6 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ if (params.aligner == 'bwa') {
if (params.aligner == 'bowtie2') {
process {
withName: 'BOWTIE2_ALIGN' {
ext.args = ''
ext.args = {
[
meta.read_group ? "--rg-id ${meta.id} --rg SM:${meta.id - ~/_T\d+$/} --rg PL:ILLUMINA --rg LB:${meta.id} --rg PU:1" : '',
params.seq_center ? "--rg CN:${params.seq_center}" : ''
].join(' ').trim()
}
ext.prefix = { "${meta.id}.Lb" }
publishDir = [
[
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/input_check.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def create_fastq_channel(LinkedHashMap row, String seq_center) {
meta.antibody = row.antibody
meta.control = row.control

def read_group = "\'@RG\\tID:${meta.id}\\tSM:${meta.id.split('_')[0..-2].join('_')}\\tPL:ILLUMINA\\tLB:${meta.id}\\tPU:1\'"
def read_group = "\'@RG\\tID:${meta.id}\\tSM:${meta.id - ~/_T\d+$/}\\tPL:ILLUMINA\\tLB:${meta.id}\\tPU:1\'"
if (seq_center) {
read_group = "\'@RG\\tID:${meta.id}\\tSM:${meta.id.split('_')[0..-2].join('_')}\\tPL:ILLUMINA\\tLB:${meta.id}\\tPU:1\\tCN:${seq_center}\'"
read_group = "\'@RG\\tID:${meta.id}\\tSM:${meta.id - ~/_T\d+$/}\\tPL:ILLUMINA\\tLB:${meta.id}\\tPU:1\\tCN:${seq_center}\'"
}
meta.read_group = read_group

Expand Down

0 comments on commit 1c2b3d7

Please sign in to comment.