Skip to content
Snippets Groups Projects
Unverified Commit a095fa9d authored by Laurent Modolo's avatar Laurent Modolo
Browse files

deepTools: bam_to_bigwig working

parent 543e35a0
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,9 @@ profiles {
docker.temp = 'auto'
docker.enabled = true
process {
withName: index_bam {
container = "sambamba:0.6.7"
}
withName: bam_to_bigwig {
container = "deeptools:3.0.2"
}
......@@ -10,6 +13,16 @@ profiles {
}
psmn {
process{
withName: index_bam {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "sambamba/0.6.7"
executor = "sge"
clusterOptions = "-m e -cwd -V"
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
withName: bam_to_bigwig {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "deepTools/3.0.2"
......
params.bam = "$baseDir/data/bam/*.bam"
params.bamidx = "$baseDir/data/bam/*.idx"
log.info "bams files : ${params.bam}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { bam_files }
bam_files.into{
bam_files_index;
bam_files_bigwig
}
process index_bam {
tag "$file_id"
cpus 4
input:
set file_id, file(bam) from bam_files_index
output:
set file_id, "*.bam*" into indexed_bam_file
script:
"""
sambamba index -t ${task.cpus} ${bam}
"""
}
bam_files_indexed = bam_files_bigwig.join(indexed_bam_file, by: 0)
process bam_to_bigwig {
tag "$file_id"
cpus 4
publishDir "results/mapping/bigwig/", mode: 'copy'
input:
set file_id, file(bam), file(idx) from bam_files_indexed
output:
set file_id, "*.bw" into sorted_bam_files
script:
"""
bamCoverage -p ${task.cpus} --ignoreDuplicates -b ${bam} -o ${file_id}.bw
"""
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment