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

Kallisto: nf add file_id var for single-end like for paired-end

parent 1fbc5ef8
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,7 @@ 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 )
......@@ -98,12 +99,12 @@ Channel
.set { index_files }
process mapping_fastq {
tag "$reads.baseName"
tag "$file_id"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
input:
file reads from fastq_files
set file_id, file(reads) from fastq_files
file index from index_files.collect()
output:
......@@ -111,11 +112,12 @@ process mapping_fastq {
script:
"""
mkdir ${reads.baseName}
kallisto quant -i ${index} -t ${task.cpus} --single
--bias --bootstrap-samples 100 -o ${reads.baseName} \
-l ${params.mean} -s ${params.sd} -o ./ \
${reads} > ${reads.baseName}_kallisto_report.txt
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
"""
}
......@@ -11,6 +11,7 @@ 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 )
......@@ -18,12 +19,12 @@ Channel
.set { index_files }
process mapping_fastq {
tag "$reads.baseName"
tag "$file_id"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
input:
file reads from fastq_files
set file_id, file(reads) from fastq_files
file index from index_files.collect()
output:
......@@ -31,11 +32,11 @@ process mapping_fastq {
script:
"""
mkdir ${reads.baseName}
mkdir ${file_id}
kallisto quant -i ${index} -t ${task.cpus} --single \
--bias --bootstrap-samples 100 -o ${reads.baseName} \
--bias --bootstrap-samples 100 -o ${file_id} \
-l ${params.mean} -s ${params.sd} \
${reads} > ${reads.baseName}_kallisto_report.txt
${reads} > ${file_id}_kallisto_report.txt
"""
}
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