Skip to content

Commit

Permalink
refactor: always call fromPath with checkIfExists: true
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Sep 19, 2023
1 parent c3f487b commit f4ad2d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
16 changes: 9 additions & 7 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ workflow {
INPUT_CHECK.out.reads.set { raw_fastqs }
raw_fastqs | TRIM_SE
TRIM_SE.out.set{ trimmed_fastqs }
blacklist_files = Channel
.fromPath(params.genomes[ params.genome ].blacklist_files)
.collect()

Channel.fromPath(params.genomes[ params.genome ].blacklist_files, checkIfExists: true)
.collect()
.set{ blacklist_files }
ALIGN_BLACKLIST(trimmed_fastqs, blacklist_files)
reference_files = Channel
.fromPath(params.genomes[ params.genome ].reference_files)
.collect()
Channel.fromPath(params.genomes[ params.genome ].reference_files, checkIfExists: true)
.collect()
.set{ reference_files }
ALIGN_GENOME(ALIGN_BLACKLIST.out.reads, reference_files)
ALIGN_GENOME.out.bam.set{ aligned_bam }

chrom_sizes = Channel.fromPath(params.genomes[ params.genome ].chrom_sizes)
Channel.fromPath(params.genomes[ params.genome ].chrom_sizes, checkIfExists: true)
.set{ chrom_sizes }
aligned_bam.combine(chrom_sizes) | DEDUPLICATE
DEDUPLICATE.out.bam.set{ deduped_bam }
DEDUPLICATE.out.tag_align.set{ deduped_tagalign }
Expand Down
6 changes: 2 additions & 4 deletions subworkflows/local/peaks.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ workflow CALL_PEAKS {
meta1, tag1, meta2, tag2 ->
meta1.control == meta2.id ? [ meta1, tag1, tag2 ]: null
}
.combine(Channel.fromPath(params.gem_read_dists))
.combine(Channel.fromPath(params.gem_read_dists, checkIfExists: true))
.combine(chrom_sizes)
.set { ch_gem }
println "chr dir ${params.genomes[ params.genome ].chromosomes_dir}"
Channel.fromPath("${params.genomes[ params.genome ].chromosomes_dir}", type: 'dir')
Channel.fromPath("${params.genomes[ params.genome ].chromosomes_dir}", type: 'dir', checkIfExists: true)
.set{ chrom_files }
chrom_files.view()

ch_tagalign | MACS_BROAD
ch_tagalign | MACS_NARROW
Expand Down
7 changes: 4 additions & 3 deletions subworkflows/local/qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ workflow QC {
meta1.control == meta2.id ? [ meta1, [ bam1, bam2 ], [ bai1, bai2 ] ] : null
}
.set { ch_ip_ctrl_bam_bai }
PLOT_FINGERPRINT(ch_ip_ctrl_bam_bai)
BED_PROTEIN_CODING(Channel.fromPath(params.genomes[ params.genome ].gene_info))
ch_ip_ctrl_bam_bai | PLOT_FINGERPRINT
Channel.fromPath(params.genomes[ params.genome ].gene_info,
checkIfExists: true) | BED_PROTEIN_CODING
COMPUTE_MATRIX(bigwig_list,
BED_PROTEIN_CODING.out.bed.combine(Channel.from('metagene','TSS'))
)
Expand All @@ -101,7 +102,7 @@ workflow QC {
.set { ch_ip_ctrl_bigwig }

MULTIQC(
Channel.fromPath(params.multiqc_config),
Channel.fromPath(params.multiqc_config, checkIfExists: true),
FASTQC_RAW.out.zip.collect(),
FASTQC_TRIMMED.out.zip.collect(),
FASTQ_SCREEN.out.screen.collect(),
Expand Down

0 comments on commit f4ad2d0

Please sign in to comment.