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

sambamba: add nf files

parent 6a540919
No related branches found
No related tags found
No related merge requests found
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$index_bam {
container = "sambamba:0.6.7"
}
}
}
sge {
process{
$index_bam {
beforeScript = "module purge; module load sambamba/0.6.7"
}
}
}
}
params.bam = "$baseDir/data/bam/*.bam"
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 }
process index_bam {
tag "$file_id"
cpus 4
input:
set file_id, file(bam) from bam_files
output:
set file_id, "*.bam*" into indexed_bam_file
script:
"""
sambamba index -t ${task.cpus} ${bam}
"""
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$sort_bam {
container = "sambamba:0.6.7"
}
}
}
sge {
process{
$sort_bam {
beforeScript = "module purge; module load sambamba/0.6.7"
}
}
}
}
params.bam = "$baseDir/data/bam/*.bam"
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 }
process sort_bam {
tag "$file_id"
cpus 4
input:
set file_id, file(bam) from bam_files
output:
set file_id, "*_sorted.bam" into sorted_bam_files
script:
"""
sambamba sort -t ${task.cpus} -o ${file_id}_sorted.bam ${bam}
"""
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$split_bam {
container = "sambamba:0.6.7"
}
}
}
sge {
process{
$split_bam {
beforeScript = "module purge; module load sambamba/0.6.7"
}
}
}
}
params.bam = "$baseDir/data/bam/*.bam"
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 }
process split_bam {
tag "$file_id"
cpus 4
input:
set file_id, file(bam) from bam_files
output:
set file_id, "*_forward.bam*" into forward_bam_files
set file_id, "*_reverse.bam*" into reverse_bam_files
script:
"""
sambamba view -t ${task.cpus} -h -F "strand == '+'" ${bam} > ${file_id}_forward.bam
sambamba view -t ${task.cpus} -h -F "strand == '-'" ${bam} > ${file_id}_reverse.bam
"""
}
./nextflow src/nf_modules/sambamba/sort_bams.nf \
-c src/nf_modules/sambamba/sort_bams.config \
-profile docker \
--bam "data/tiny_dataset/map/tiny_v2.bam"
./nextflow src/nf_modules/sambamba/index_bams.nf \
-c src/nf_modules/sambamba/index_bams.config \
-profile docker \
--bam "data/tiny_dataset/map/tiny_v2.sort.bam"
./nextflow src/nf_modules/sambamba/split_bams.nf \
-c src/nf_modules/sambamba/split_bams.config \
-profile docker \
--bam "data/tiny_dataset/map/tiny_v2.bam"
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