Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes #339

Merged
merged 24 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b4ad530
Add back skip_spp parameter
JoseEspinosa Apr 17, 2023
77907aa
Install fastq_fastqc_umitools_trimgalore subworkflow
JoseEspinosa Apr 17, 2023
d67a0fd
Install fastq_align_bwa subworkflow
JoseEspinosa Apr 17, 2023
8b93ec2
Install fastq_align_bowtie2 subworkflow
JoseEspinosa Apr 17, 2023
356ccd2
Install fastq_align_chromap subworkflow
JoseEspinosa Apr 17, 2023
c8739ed
use the FASTQ_FASTQC_UMITOOLS_TRIMGALORE subworkflow insead of fastq…
JoseEspinosa Apr 17, 2023
8af9cb2
Use FASTQ_ALIGN_BWA subworkflow
JoseEspinosa Apr 17, 2023
d7f074a
Use FASTQ_ALIGN_BOWTIE2 subworkflow
JoseEspinosa Apr 18, 2023
28de291
Install custom/getchromsizes and picard/collectmultiplemetrics
JoseEspinosa Apr 18, 2023
4c462b3
Remove substituted modules and subworkflows
JoseEspinosa Apr 18, 2023
3a33ed9
Rename bamtools/filter
JoseEspinosa Apr 18, 2023
0f70b6d
add align_star local subworkflow
JoseEspinosa Apr 18, 2023
ccbc71c
Refactor and rename bam_filter_bamtools
JoseEspinosa Apr 18, 2023
0230090
Refactor code to use nf-core official subworkflows
JoseEspinosa Apr 18, 2023
3165a73
Simplify code
JoseEspinosa Apr 18, 2023
30312c3
changelog
JoseEspinosa Apr 18, 2023
603db63
Resolved arguments for bamtools_filteer
JoseEspinosa Apr 18, 2023
2637d88
Update bowtie2/align to fix the container download
JoseEspinosa Apr 18, 2023
6a75945
Remove code used for view
JoseEspinosa Apr 18, 2023
b00897d
Feed missing arguments to star subworkflow
JoseEspinosa Apr 18, 2023
be423bf
Update chromap/chromap
JoseEspinosa Apr 18, 2023
7cc3041
Update star_align
JoseEspinosa Apr 18, 2023
403a8e5
Update changelog
JoseEspinosa Apr 18, 2023
aece0fb
Update bowtie2/build
JoseEspinosa Apr 18, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated pipeline template to [nf-core/tools 2.7.2](https://github.com/nf-core/tools/releases/tag/2.7.2)
- [[#317](https://github.com/nf-core/chipseq/issues/317)] Added metro map
- [[#288](https://github.com/nf-core/chipseq/issues/291)] Bump `chromap` version 2 and enable all the steps below chromap again when paired-end data is processed.
- [[#311](https://github.com/nf-core/chipseq/issues/311)] Add back `--skip_spp` parameter which was unintentionally removed from the code.
- Install available nf-core subworkflows and refactor code accordingly

## [[2.0.0](https://github.com/nf-core/chipseq/releases/tag/2.0.0)] - 2022-10-03

Expand Down
53 changes: 34 additions & 19 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ process {

if (!(params.skip_fastqc || params.skip_qc)) {
process {
withName: '.*:FASTQC_TRIMGALORE:FASTQC' {
withName: 'FASTQC' {
ext.args = '--quiet'
publishDir = [
[
Expand All @@ -142,11 +142,17 @@ if (!(params.skip_fastqc || params.skip_qc)) {

if (!params.skip_trimming) {
process {
withName: '.*:FASTQC_TRIMGALORE:TRIMGALORE' {
ext.args = [
'--fastqc',
params.trim_nextseq > 0 ? "--nextseq ${params.trim_nextseq}" : ''
].join(' ').trim()
withName: 'TRIMGALORE' {
ext.args = {
[
'--fastqc',
params.trim_nextseq > 0 ? "--nextseq ${params.trim_nextseq}" : '',
params.clip_r1 > 0 ? "--clip_r1 ${params.clip_r1}" : '',
params.clip_r2 > 0 ? "--clip_r2 ${params.clip_r2}" : '',
params.three_prime_clip_r1 > 0 ? "--three_prime_clip_r1 ${params.three_prime_clip_r1}" : '',
params.three_prime_clip_r2 > 0 ? "--three_prime_clip_r2 ${params.three_prime_clip_r2}" : ''
].join(' ').trim()
}
publishDir = [
[
path: { "${params.outdir}/trimgalore/fastqc" },
Expand Down Expand Up @@ -175,7 +181,7 @@ if (!params.skip_trimming) {
}

process {
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:ALIGN_.*:BAM_SORT_SAMTOOLS:SAMTOOLS_SORT' {
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT' {
ext.prefix = { "${meta.id}.Lb.sorted" }
publishDir = [
path: { "${params.outdir}/${params.aligner}/library" },
Expand All @@ -185,7 +191,7 @@ process {
]
}

withName: 'NFCORE_CHIPSEQ:CHIPSEQ:ALIGN_.*:BAM_SORT_SAMTOOLS:SAMTOOLS_INDEX' {
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX' {
publishDir = [
path: { "${params.outdir}/${params.aligner}/library" },
mode: params.publish_dir_mode,
Expand All @@ -194,7 +200,7 @@ process {
]
}

withName: 'NFCORE_CHIPSEQ:CHIPSEQ:ALIGN_.*:BAM_SORT_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_.*' {
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_.*' {
ext.prefix = { "${meta.id}.Lb.sorted.bam" }
publishDir = [
path: { "${params.outdir}/${params.aligner}/library/samtools_stats/" },
Expand All @@ -208,11 +214,13 @@ process {
if (params.aligner == 'bwa') {
process {
withName: 'BWA_MEM' {
ext.args = { [
'-M',
params.bwa_min_score ? " -T ${params.bwa_min_score}" : '',
meta.read_group ? "-R ${meta.read_group}": ''
].join(' ').trim() }
ext.args = {
[
'-M',
params.bwa_min_score ? " -T ${params.bwa_min_score}" : '',
meta.read_group ? "-R ${meta.read_group}": ''
].join(' ').trim()
}
ext.args2 = '-bhS -F 0x0100 -O BAM'
ext.prefix = { "${meta.id}.Lb" }
publishDir = [
Expand Down Expand Up @@ -351,8 +359,15 @@ process {
}

// Should only be published when paired end data is used and save_align_intermeds is true
withName: 'BAM_FILTER' {
ext.prefix = { meta.single_end ? "${meta.id}.mLb.noPublish" : "${meta.id}.mLb.flT.sorted" }
withName: 'BAMTOOLS_FILTER' {
ext.args = {
[
meta.single_end ? '-F 0x004' : '-F 0x004 -F 0x0008 -f 0x001',
params.keep_dups ? '' : '-F 0x0400',
params.keep_multi_map ? '' : '-q 1'
].join(' ').trim()
}
ext.prefix = { meta.single_end ? "${meta.id}.mLb.noPublish" : "${meta.id}.mLb.flT.sorted" } //TODO check with atacseq
publishDir = [
path: { "${params.outdir}/${params.aligner}/mergedLibrary" },
mode: params.publish_dir_mode,
Expand All @@ -367,7 +382,7 @@ process {
publishDir = [ enabled: false ]
}

withName: 'NFCORE_CHIPSEQ:CHIPSEQ:FILTER_BAM_BAMTOOLS:BAM_SORT_SAMTOOLS:SAMTOOLS_SORT' {
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:BAM_FILTER_BAMTOOLS:SAMTOOLS_SORT' {
ext.prefix = { "${meta.id}.mLb.clN.sorted" }
publishDir = [
path: { "${params.outdir}/${params.aligner}/mergedLibrary" },
Expand All @@ -376,7 +391,7 @@ process {
]
}

withName: 'NFCORE_CHIPSEQ:CHIPSEQ:FILTER_BAM_BAMTOOLS:BAM_SORT_SAMTOOLS:SAMTOOLS_INDEX' {
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:BAM_FILTER_BAMTOOLS:SAMTOOLS_INDEX' {
ext.prefix = { "${meta.id}.mLb.clN.sorted" }
publishDir = [
path: { "${params.outdir}/${params.aligner}/mergedLibrary" },
Expand All @@ -385,7 +400,7 @@ process {
]
}

withName: 'NFCORE_CHIPSEQ:CHIPSEQ:FILTER_BAM_BAMTOOLS:BAM_SORT_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' {
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:BAM_FILTER_BAMTOOLS:BAM_STATS_SAMTOOLS:.*' {
ext.prefix = { "${meta.id}.mLb.clN.sorted.bam" }
publishDir = [
path: { "${params.outdir}/${params.aligner}/mergedLibrary/samtools_stats" },
Expand Down
68 changes: 53 additions & 15 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"nf-core": {
"bowtie2/align": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
"installed_by": ["fastq_align_bowtie2", "modules"]
},
"bowtie2/build": {
"branch": "master",
Expand All @@ -23,12 +23,12 @@
"bwa/mem": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"installed_by": ["fastq_align_bwa", "modules"]
},
"chromap/chromap": {
"branch": "master",
"git_sha": "d6b7b1f108dab88b0269a4331767c36a1a8da960",
"installed_by": ["modules"]
"installed_by": ["fastq_align_chromap", "modules"]
},
"chromap/index": {
"branch": "master",
Expand All @@ -42,9 +42,8 @@
},
"custom/getchromsizes": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"],
"patch": "modules/nf-core/custom/getchromsizes/custom-getchromsizes.diff"
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
"installed_by": ["modules"]
},
"deeptools/computematrix": {
"branch": "master",
Expand All @@ -69,7 +68,7 @@
"fastqc": {
"branch": "master",
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
"installed_by": ["modules"]
"installed_by": ["modules", "fastq_fastqc_umitools_trimgalore"]
},
"gffread": {
"branch": "master",
Expand Down Expand Up @@ -108,7 +107,7 @@
},
"picard/collectmultiplemetrics": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "75027bf77472b1f4fd2cdd7e46f83119dfb0f2c6",
"installed_by": ["modules"]
},
"picard/markduplicates": {
Expand All @@ -129,27 +128,27 @@
"samtools/flagstat": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"installed_by": ["bam_stats_samtools", "modules"]
},
"samtools/idxstats": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"installed_by": ["bam_stats_samtools", "modules"]
},
"samtools/index": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"installed_by": ["bam_sort_stats_samtools", "modules"]
},
"samtools/sort": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"installed_by": ["bam_sort_stats_samtools", "modules"]
},
"samtools/stats": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"installed_by": ["bam_stats_samtools", "modules"]
},
"subread/featurecounts": {
"branch": "master",
Expand All @@ -159,19 +158,58 @@
"trimgalore": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
"installed_by": ["modules", "fastq_fastqc_umitools_trimgalore"]
},
"ucsc/bedgraphtobigwig": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
},
"umitools/extract": {
"branch": "master",
"git_sha": "ffe2f5865f608848e440a52b73c304ea79aaf818",
"installed_by": ["fastq_fastqc_umitools_trimgalore"]
},
"untar": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
}
}
},
"subworkflows": {
"nf-core": {
"bam_sort_stats_samtools": {
"branch": "master",
"git_sha": "3911652a6b24249358f79e8b8466338d63efb2a2",
"installed_by": ["fastq_align_bowtie2", "fastq_align_chromap", "fastq_align_bwa"]
},
"bam_stats_samtools": {
"branch": "master",
"git_sha": "b4b7f89e7fd6d2293f0c176213f710e0bcdaf19e",
"installed_by": ["bam_sort_stats_samtools"]
},
"fastq_align_bowtie2": {
"branch": "master",
"git_sha": "ac75f79157ecc64283a2b3a559f1ba90bc0f2259",
"installed_by": ["subworkflows"]
},
"fastq_align_bwa": {
"branch": "master",
"git_sha": "901fab507683647b43e7032f3ae9e4c234eb68eb",
"installed_by": ["subworkflows"]
},
"fastq_align_chromap": {
"branch": "master",
"git_sha": "ac75f79157ecc64283a2b3a559f1ba90bc0f2259",
"installed_by": ["subworkflows"]
},
"fastq_fastqc_umitools_trimgalore": {
"branch": "master",
"git_sha": "100caf3506850ffcc04953f724a97f422940c377",
"installed_by": ["subworkflows"]
}
}
}
}
}
Expand Down
24 changes: 10 additions & 14 deletions modules/local/bam_filter.nf → modules/local/bamtools_filter.nf
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*
* Filter BAM file
*/
process BAM_FILTER {
process BAMTOOLS_FILTER {
tag "$meta.id"
label 'process_medium'

Expand All @@ -20,19 +17,18 @@ process BAM_FILTER {
tuple val(meta), path("*.bam"), emit: bam
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def prefix = task.ext.prefix ?: "${meta.id}"
def filter_params = meta.single_end ? '-F 0x004' : '-F 0x004 -F 0x0008 -f 0x001'
def dup_params = params.keep_dups ? '' : '-F 0x0400'
def multimap_params = params.keep_multi_map ? '' : '-q 1'
def blacklist_params = params.blacklist ? "-L $bed" : ''
def config = meta.single_end ? bamtools_filter_se_config : bamtools_filter_pe_config
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def blacklist = bed ? "-L $bed" : ''
def config = meta.single_end ? bamtools_filter_se_config : bamtools_filter_pe_config
"""
samtools view \\
$filter_params \\
$dup_params \\
$multimap_params \\
$blacklist_params \\
$args \\
$blacklist \\
-b $bam \\
| bamtools filter \\
-out ${prefix}.bam \\
Expand Down
16 changes: 8 additions & 8 deletions modules/nf-core/bowtie2/align/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions modules/nf-core/bowtie2/align/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions modules/nf-core/custom/getchromsizes/custom-getchromsizes.diff

This file was deleted.

Loading