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

Kallisto: update nf structure

parent 6ff0f7e2
No related branches found
No related tags found
No related merge requests found
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$index_fasta {
container = "kallisto:0.44.0"
}
}
}
sge {
process{
$index_fasta {
beforeScript = "module purge; module load Kallisto/0.44.0"
executor = "sge"
cpus = 1
memory = "5GB"
time = "6h"
queueSize = 1000
pollInterval = '60sec'
queue = 'h6-E5-2667v4deb128'
penv = 'openmp8'
}
}
}
}
...@@ -17,11 +17,12 @@ process index_fasta { ...@@ -17,11 +17,12 @@ process index_fasta {
output: output:
file "*.index*" into index_files file "*.index*" into index_files
file "*_kallisto_report.txt" into index_files_report
script: script:
""" """
kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \ kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \
> ${fasta.baseName}_kallisto_report.txt 2> ${fasta.baseName}_kallisto_report.txt
""" """
} }
/*
* Kallisto :
* Imputs : fastq files
* Imputs : fasta files
* Output : bam files
*/
/* fasta indexing */
params.fasta = "$baseDir/data/bam/*.fasta"
log.info "fasta files : ${params.fasta}"
Channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
.set { fasta_file }
process index_fasta {
tag "$fasta.baseName"
publishDir "results/mapping/index/", mode: 'copy'
input:
file fasta from fasta_file
output:
file "*.index*" into index_files
script:
"""
kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \
> ${fasta.baseName}_kallisto_report.txt
"""
}
/*
* for paired-end data
*/
params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
params.index = "$baseDir/data/index/*.index.*"
log.info "fastq files : ${params.fastq}"
log.info "index files : ${params.index}"
Channel
.fromFilePairs( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
Channel
.fromPath( params.index )
.ifEmpty { error "Cannot find any index files matching: ${params.index}" }
.set { index_files }
process mapping_fastq {
tag "$reads"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
file index from index_files.collect()
output:
file "*" into counts_files
script:
"""
mkdir ${reads[0].baseName}
kallisto quant -i ${index} -t ${task.cpus} \
--bias --bootstrap-samples 100 -o ${pair_id} \
${reads[0]} ${reads[1]} &> ${pair_id}_kallisto_report.txt
"""
}
/*
* for single-end data
*/
params.fastq = "$baseDir/data/fastq/*.fastq"
params.index = "$baseDir/data/index/*.index*"
params.mean = 200
params.sd = 100
log.info "fastq files : ${params.fastq}"
log.info "index files : ${params.index}"
log.info "mean read size: ${params.mean}"
log.info "sd read size: ${params.sd}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files }
Channel
.fromPath( params.index )
.ifEmpty { error "Cannot find any index files matching: ${params.index}" }
.set { index_files }
process mapping_fastq {
tag "$file_id"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
input:
set file_id, file(reads) from fastq_files
file index from index_files.collect()
output:
file "*" into count_files
script:
"""
mkdir ${file_id}
kallisto quant -i ${index} -t ${task.cpus} --single \
--bias --bootstrap-samples 100 -o ${file_id} \
-l ${params.mean} -s ${params.sd} \
${reads} > ${file_id}_kallisto_report.txt
"""
}
...@@ -3,9 +3,6 @@ profiles { ...@@ -3,9 +3,6 @@ profiles {
docker.temp = 'auto' docker.temp = 'auto'
docker.enabled = true docker.enabled = true
process { process {
$index_fasta {
container = "kallisto:0.44.0"
}
$mapping_fastq { $mapping_fastq {
container = "kallisto:0.44.0" container = "kallisto:0.44.0"
} }
...@@ -13,17 +10,6 @@ profiles { ...@@ -13,17 +10,6 @@ profiles {
} }
sge { sge {
process{ process{
$index_fasta {
beforeScript = "module purge; module load Kallisto/0.44.0"
executor = "sge"
cpus = 1
memory = "5GB"
time = "6h"
queueSize = 1000
pollInterval = '60sec'
queue = 'h6-E5-2667v4deb128'
penv = 'openmp8'
}
$mapping_fastq { $mapping_fastq {
beforeScript = "module purge; module load Kallisto/0.44.0" beforeScript = "module purge; module load Kallisto/0.44.0"
executor = "sge" executor = "sge"
......
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$mapping_fastq {
container = "kallisto:0.44.0"
}
}
}
sge {
process{
$mapping_fastq {
beforeScript = "module purge; module load Kallisto/0.44.0"
executor = "sge"
cpus = 4
memory = "5GB"
time = "6h"
queueSize = 1000
pollInterval = '60sec'
queue = 'h6-E5-2667v4deb128'
penv = 'openmp8'
}
}
}
}
nextflow src/nf_modules/Kallisto/tests/index.nf \ nextflow src/nf_modules/Kallisto/indexing.nf \
-c src/nf_modules/Kallisto/kallisto.config \ -c src/nf_modules/Kallisto/indexing.config \
-profile docker \ -profile docker \
--fasta "data/tiny_dataset/fasta/tiny_v2.fasta" --fasta "data/tiny_dataset/fasta/tiny_v2.fasta"
nextflow src/nf_modules/Kallisto/tests/mapping_single.nf \ nextflow src/nf_modules/Kallisto/mapping_single.nf \
-c src/nf_modules/Kallisto/kallisto.config \ -c src/nf_modules/Kallisto/mapping_single.config \
-profile docker \ -profile docker \
--index "results/mapping/index/tiny_v2.index" \ --index "results/mapping/index/tiny_v2.index" \
--fastq "data/tiny_dataset/fastq/tiny*_S.fastq" --fastq "data/tiny_dataset/fastq/tiny*_S.fastq"
nextflow src/nf_modules/Kallisto/tests/mapping_paired.nf \ nextflow src/nf_modules/Kallisto/mapping_paired.nf \
-c src/nf_modules/Kallisto/kallisto.config \ -c src/nf_modules/Kallisto/mapping_paired.config \
-profile docker \ -profile docker \
--index "results/mapping/index/tiny_v2.index" \ --index "results/mapping/index/tiny_v2.index" \
--fastq "data/tiny_dataset/fastq/tiny*_R{1,2}.fastq" --fastq "data/tiny_dataset/fastq/tiny*_R{1,2}.fastq"
......
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