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}" ...@@ -91,6 +91,7 @@ log.info "sd read size: ${params.sd}"
Channel Channel
.fromPath( params.fastq ) .fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files } .set { fastq_files }
Channel Channel
.fromPath( params.index ) .fromPath( params.index )
...@@ -98,12 +99,12 @@ Channel ...@@ -98,12 +99,12 @@ Channel
.set { index_files } .set { index_files }
process mapping_fastq { process mapping_fastq {
tag "$reads.baseName" tag "$file_id"
cpus 4 cpus 4
publishDir "results/mapping/quantification/", mode: 'copy' publishDir "results/mapping/quantification/", mode: 'copy'
input: input:
file reads from fastq_files set file_id, file(reads) from fastq_files
file index from index_files.collect() file index from index_files.collect()
output: output:
...@@ -111,11 +112,12 @@ process mapping_fastq { ...@@ -111,11 +112,12 @@ process mapping_fastq {
script: script:
""" """
mkdir ${reads.baseName} mkdir ${file_id}
kallisto quant -i ${index} -t ${task.cpus} --single 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} -o ./ \ -l ${params.mean} -s ${params.sd} \
${reads} > ${reads.baseName}_kallisto_report.txt ${reads} > ${file_id}_kallisto_report.txt
""" """
} }
...@@ -11,6 +11,7 @@ log.info "sd read size: ${params.sd}" ...@@ -11,6 +11,7 @@ log.info "sd read size: ${params.sd}"
Channel Channel
.fromPath( params.fastq ) .fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files } .set { fastq_files }
Channel Channel
.fromPath( params.index ) .fromPath( params.index )
...@@ -18,12 +19,12 @@ Channel ...@@ -18,12 +19,12 @@ Channel
.set { index_files } .set { index_files }
process mapping_fastq { process mapping_fastq {
tag "$reads.baseName" tag "$file_id"
cpus 4 cpus 4
publishDir "results/mapping/quantification/", mode: 'copy' publishDir "results/mapping/quantification/", mode: 'copy'
input: input:
file reads from fastq_files set file_id, file(reads) from fastq_files
file index from index_files.collect() file index from index_files.collect()
output: output:
...@@ -31,11 +32,11 @@ process mapping_fastq { ...@@ -31,11 +32,11 @@ process mapping_fastq {
script: script:
""" """
mkdir ${reads.baseName} mkdir ${file_id}
kallisto quant -i ${index} -t ${task.cpus} --single \ 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} \ -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