Skip to content

Commit ebe2432

Browse files
moved KHMER_UNIQUEKMERS in PREPARE_GENOME subworkflow
1 parent f62ad6a commit ebe2432

3 files changed

Lines changed: 31 additions & 22 deletions

File tree

main.nf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ workflow NFCORE_CHIPSEQ {
6565
params.bowtie2_index,
6666
params.chromap_index,
6767
params.star_index,
68+
params.macs_gsize,
69+
params.read_length
6870
)
6971

7072
//
@@ -84,7 +86,8 @@ workflow NFCORE_CHIPSEQ {
8486
PREPARE_GENOME.out.bwa_index,
8587
PREPARE_GENOME.out.bowtie2_index,
8688
PREPARE_GENOME.out.chromap_index,
87-
PREPARE_GENOME.out.star_index
89+
PREPARE_GENOME.out.star_index,
90+
PREPARE_GENOME.out.macs_gsize
8891
)
8992

9093
emit:

subworkflows/local/prepare_genome/main.nf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ include { CHROMAP_INDEX } from '../../../modules/nf-core/chromap/
2222
include { GTF2BED } from '../../../modules/local/gtf2bed'
2323
include { GENOME_BLACKLIST_REGIONS } from '../../../modules/local/genome_blacklist_regions'
2424
include { STAR_GENOMEGENERATE } from '../../../modules/local/star_genomegenerate'
25+
include { KHMER_UNIQUEKMERS } from '../../../modules/nf-core/khmer/uniquekmers'
2526

2627
workflow PREPARE_GENOME {
2728
take:
@@ -37,6 +38,8 @@ workflow PREPARE_GENOME {
3738
bowtie2_index // file: /path/to/bowtie2/index/
3839
chromap_index // file: /path/to/chromap/index/
3940
star_index // file: /path/to/star/index/
41+
macs_gsize // integer: effective_genome_size
42+
read_length // integer: read length
4043

4144
main:
4245

@@ -195,6 +198,22 @@ workflow PREPARE_GENOME {
195198
}
196199
}
197200

201+
//
202+
// Calculate genome size with khmer
203+
//
204+
ch_macs_gsize = channel.empty()
205+
ch_macs_gsize = macs_gsize
206+
207+
if (!macs_gsize) {
208+
KHMER_UNIQUEKMERS (
209+
ch_fasta.map { item -> [ [:], item]},
210+
read_length
211+
)
212+
ch_macs_gsize = KHMER_UNIQUEKMERS.out.kmers.map { meta, file ->
213+
file.text.trim() }
214+
}
215+
216+
198217
emit:
199218
fasta = ch_fasta // path: genome.fasta
200219
fai = ch_fai // path: genome.fai
@@ -206,4 +225,5 @@ workflow PREPARE_GENOME {
206225
bowtie2_index = ch_bowtie2_index // path: bowtie2/index/
207226
chromap_index = ch_chromap_index // path: genome.index
208227
star_index = ch_star_index // path: star/index/
228+
macs_gsize = ch_macs_gsize // integer: macs_gsize
209229
}

workflows/chipseq.nf

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ include { DEEPTOOLS_COMPUTEMATRIX } from '../modules/nf-core/deeptools/com
4343
include { DEEPTOOLS_PLOTPROFILE } from '../modules/nf-core/deeptools/plotprofile'
4444
include { DEEPTOOLS_PLOTHEATMAP } from '../modules/nf-core/deeptools/plotheatmap'
4545
include { DEEPTOOLS_PLOTFINGERPRINT } from '../modules/nf-core/deeptools/plotfingerprint'
46-
include { KHMER_UNIQUEKMERS } from '../modules/nf-core/khmer/uniquekmers'
4746

4847
//
4948
// SUBWORKFLOW: Consisting entirely of nf-core/modules
@@ -77,6 +76,7 @@ workflow CHIPSEQ {
7776
ch_bowtie2_index // channel: path(bowtie2/index)
7877
ch_chromap_index // channel: path(chromap.index)
7978
ch_star_index // channel: path(star/index/)
79+
ch_macs_gsize // channel: integer(macs_gsize)
8080

8181
main:
8282

@@ -422,22 +422,6 @@ workflow CHIPSEQ {
422422
ch_deeptoolsplotfingerprint_multiqc = DEEPTOOLS_PLOTFINGERPRINT.out.matrix
423423
}
424424

425-
//
426-
// MODULE: Calculute genome size with khmer
427-
//
428-
ch_macs_gsize = channel.empty()
429-
ch_subreadfeaturecounts_multiqc = channel.empty()
430-
ch_macs_gsize = params.macs_gsize
431-
432-
if (!params.macs_gsize) {
433-
KHMER_UNIQUEKMERS (
434-
ch_fasta.map { item -> [ [:], item]},
435-
params.read_length
436-
)
437-
ch_macs_gsize = KHMER_UNIQUEKMERS.out.kmers.map { meta, file ->
438-
file.text.trim() }
439-
}
440-
441425
// Create channels: [ meta, ip_bam, control_bam ]
442426
ch_ip_control_bam_bai
443427
.map {
@@ -466,10 +450,12 @@ workflow CHIPSEQ {
466450
//
467451
// Consensus peaks analysis
468452
//
469-
ch_macs3_consensus_bed_lib = channel.empty()
470-
ch_macs3_consensus_txt_lib = channel.empty()
471-
ch_deseq2_pca_multiqc = channel.empty()
472-
ch_deseq2_clustering_multiqc = channel.empty()
453+
ch_macs3_consensus_bed_lib = channel.empty()
454+
ch_macs3_consensus_txt_lib = channel.empty()
455+
ch_deseq2_pca_multiqc = channel.empty()
456+
ch_deseq2_clustering_multiqc = channel.empty()
457+
ch_subreadfeaturecounts_multiqc = channel.empty()
458+
473459
if (!params.skip_consensus_peaks) {
474460
// Create channels: [ antibody, [ ip_bams ], single_end_map ]
475461
ch_ip_control_bam

0 commit comments

Comments
 (0)