Skip to content

Commit

Permalink
use subworkflows/local/bam_bedgraph_bigwig_bedtools_ucsc from nf-core…
Browse files Browse the repository at this point in the history
…/atacseq
  • Loading branch information
Bjorn Langer authored and Bjorn Langer committed Jul 4, 2024
1 parent 50915a7 commit f170418
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions subworkflows/local/bam_bedgraph_bigwig_bedtools_ucsc.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

//
// Convert BAM to normalised bigWig via bedGraph using BEDTools and UCSC
//

include { BEDTOOLS_GENOMECOV } from '../../modules/local/bedtools_genomecov'
include { UCSC_BEDGRAPHTOBIGWIG } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main'

workflow BAM_BEDGRAPH_BIGWIG_BEDTOOLS_UCSC {
take:
ch_bam_flagstat // channel: [ val(meta), [bam], [flagstat] ]
ch_chrom_sizes // channel: [ bed ]

main:

ch_versions = Channel.empty()

//
// Create bedGraph coverage track
//
BEDTOOLS_GENOMECOV (
ch_bam_flagstat
)
ch_versions = ch_versions.mix(BEDTOOLS_GENOMECOV.out.versions.first())

//
// Create bigWig coverage tracks
//
UCSC_BEDGRAPHTOBIGWIG (
BEDTOOLS_GENOMECOV.out.bedgraph,
ch_chrom_sizes
)
ch_versions = ch_versions.mix(UCSC_BEDGRAPHTOBIGWIG.out.versions.first())

emit:
bedgraph = BEDTOOLS_GENOMECOV.out.bedgraph // channel: [ val(meta), [ bedgraph ] ]
scale_factor = BEDTOOLS_GENOMECOV.out.scale_factor // channel: [ val(meta), [ txt ] ]

bigwig = UCSC_BEDGRAPHTOBIGWIG.out.bigwig // channel: [ val(meta), [ bigwig ] ]

versions = ch_versions // channel: [ versions.yml ]
}

0 comments on commit f170418

Please sign in to comment.