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

subread nf: add nf config and test files

parent 44e1391d
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
if [ -x "$(command -v singularity)" ]; then
./nextflow src/nf_modules/htseq/htseq.nf \
-c src/nf_modules/htseq/htseq.config \
-profile docker \
-profile singularity \
--gtf "data/tiny_dataset/annot/tiny.gff" \
--bam "data/tiny_dataset/map/tiny_v2.bam" \
-resume
......
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: sort_bam {
container = "samtools:1.7"
cpus = 1
}
withName: counting {
container = "subread:1.6.4"
cpus = 1
}
}
}
singularity {
singularity.enabled = true
process {
withName: sort_bam {
container = "file://bin/samtools:1.7.img"
cpus = 1
}
withName: counting {
container = "file://bin/subread:1.6.4.img"
cpus = 1
}
}
}
psmn{
process{
withName: sort_bam {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "samtools/1.7"
executor = "sge"
clusterOptions = "-cwd -V"
cpus = 1
memory = "20GB"
time = "12h"
queue = 'monointeldeb128,monointeldeb48,h48-E5-2670deb128,h6-E5-2667v4deb128'
}
withName: counting {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "subread/1.6.4"
executor = "sge"
clusterOptions = "-cwd -V"
cpus = 1
memory = "20GB"
time = "12h"
queue = 'monointeldeb128,monointeldeb48,h48-E5-2670deb128,h6-E5-2667v4deb128'
}
}
}
ccin2p3_conda {
process{
withName: sort_bam {
beforeScript = "source /sps/lbmc/common/miniconda3/init.sh"
conda = "/sps/lbmc/common/miniconda3/envs/samtools_1.7"
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "sge"
clusterOptions = "-P P_lbmc -l os=cl7 -l sps=1 -r n\
"
cpus = 1
queue = 'huge'
}
withName: counting {
beforeScript = "source /sps/lbmc/common/miniconda3/init.sh"
conda = "/sps/lbmc/common/miniconda3/envs/subread_1.6.4"
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "sge"
clusterOptions = "-P P_lbmc -l os=cl7 -l sps=1 -r n\
"
cpus = 1
queue = 'huge'
}
}
}
ccin2p3 {
singularity.enabled = true
singularity.runOptions = "--bind /pbs,/sps,/scratch"
process{
withName: sort_bam {
container = "/sps/lbmc/common/singularity/samtools:1.7.img"
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "sge"
clusterOptions = "-P P_lbmc -l os=cl7 -l sps=1 -r n\
"
cpus = 1
queue = 'huge'
}
withName: counting {
container = "/sps/lbmc/common/singularity/subread:1.6.4.img"
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "sge"
clusterOptions = "-P P_lbmc -l os=cl7 -l sps=1 -r n\
"
cpus = 1
queue = 'huge'
}
}
}
}
params.bam = "$baseDir/data/bam/*.bam"
params.gtf = "$baseDir/data/annotation/*.gtf"
log.info "bam files : ${params.bam}"
log.info "gtf files : ${params.gtf}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any fastq files matching: ${params.bam}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { bam_files }
Channel
.fromPath( params.gtf )
.ifEmpty { error "Cannot find any gtf file matching: ${params.gtf}" }
.set { gtf_file }
process sort_bam {
tag "$file_id"
cpus 4
input:
set file_id, file(bam) from bam_files
output:
set file_id, "*_sorted.sam" into sorted_bam_files
script:
"""
# sort bam by name
samtools sort -@ ${task.cpus} -n -O SAM -o ${file_id}_sorted.sam ${bam}
"""
}
process counting {
tag "$file_id"
publishDir "results/quantification/", mode: 'copy'
input:
set file_id, file(bam) from sorted_bam_files
file gtf from gtf_file
output:
file "*.count" into count_files
script:
"""
featureCounts ${bam} -a ${gtf} -p \
-o ${file_id}.count \
-R BAM
"""
}
./nextflow src/nf_modules/subread/subread.nf \
-c src/nf_modules/subread/subread.config \
-profile docker \
--gtf "data/tiny_dataset/annot/tiny.gff" \
--bam "data/tiny_dataset/map/tiny_v2.bam" \
-resume
if [ -x "$(command -v singularity)" ]; then
./nextflow src/nf_modules/subread/subread.nf \
-c src/nf_modules/subread/subread.config \
-profile singularity \
--gtf "data/tiny_dataset/annot/tiny.gff" \
--bam "data/tiny_dataset/map/tiny_v2.bam" \
-resume
fi
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