Skip to content
Snippets Groups Projects
Commit 3340f1de authored by elabaron's avatar elabaron
Browse files

add nextflow scripts for ribotish

parent f70a43f9
Branches
No related tags found
No related merge requests found
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: ribotish_quality {
container = "lbmc/ribotish:0.2.4"
cpus = 4
}
withName: ribotish_pred {
container = "lbmc/ribotish:0.2.4"
cpus = 4
}
}
}
psmn{
process{
withName: ribotish_quality {
beforeScript = "source .conda_psmn.sh"
conda = "src/.conda_envs/ribotish_0.2.4"
executor = "sge"
clusterOptions = "-cwd -V"
cpus = 8
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
withName: ribotish_pred {
beforeScript = "source .conda_psmn.sh"
conda = "src/.conda_envs/ribotish_0.2.4"
executor = "sge"
clusterOptions = "-cwd -V"
cpus = 8
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
params.bam = "data/*{Harr,CHX}*.bam"
params.bai = "data/*{Harr,CHX}*.bam.bai"
params.gff = "data/*.gtf"
params.genome = "data/*.fa"
params.quality = "results/quality/*"
log.info "bam files : ${params.bam}"
Channel
.fromFilePairs( params.bam )
.ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
.set { bam_files }
Channel
.fromFilePairs( params.bai )
.ifEmpty { error "Cannot find any bai files matching: ${params.bai}" }
.set { bai_files }
Channel
.fromPath( params.gff )
.ifEmpty { error "Cannot find any gff files matching: ${params.gff}" }
.set { gff_files }
Channel
.fromPath( params.genome )
.ifEmpty { error "Cannot find any fasta files matching: ${params.genome}" }
.set { genome_files }
Channel
.fromPath( params.files )
.ifEmpty { error "Cannot find any files matching: ${params.quality}" }
.set { quality_files }
process ribotish_pred {
tag "$file_id"
publishDir "results/pred/", mode: 'copy'
input:
set file_id, file(bam) from bam_files
set bai_id, file(bai) from bai_files
file gff from gff_files.collect()
file genome from genome_files.collect()
file quality from quality_files.collect()
output:
set file_id, "*" into pred
script:
"""
ribotish predict -t ${bam[0]} -b ${bam[1]} -g ${gff} -f ${genome} \
-o ${file_id}_pred.txt --harr -p ${task.cpus} --alt
"""
}
params.bam = "data/*{.bam,.bam.bai}"
params.gff = "data/*.gtf"
params.length = "25,35"
params.th = "0.5"
log.info "bam files : ${params.bam}"
Channel
.fromFilePairs( params.bam )
.ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
.set { bam_files }
Channel
.fromPath( params.gff )
.ifEmpty { error "Cannot find any gff files matching: ${params.gff}" }
.set { gff_files }
process ribotish_quality {
tag "$file_id"
publishDir "results/quality/", mode: 'copy'
input:
set file_id, file(bam) from bam_files
file gff from gff_files.collect()
output:
set file_id, "*" into quality
script:
tis_parameters = ""
if (bam =~ /Harr/) {
tis_parameters = "-t"
}
"""
ribotish quality -b ${bam[0]} \
-g ${gff} \
-p ${task.cpus} \
-l ${params.length} \
--th ${params.th} \
${tis_parameters}
"""
}
./nextflow src/nf_modules/ribotish/ribotish_quality.nf \
-c src/nf_modules/ribotish/ribotish.config \
-profile docker \
--bam "data/tiny_dataset/map/tiny_v2.bam" \
--gff "data/tiny_dataset/annot/tiny.gtf" \
-resume
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment