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

RSEM: nf add file_id var in single-end like for paired-end

parent 9496c2db
No related branches found
No related tags found
No related merge requests found
...@@ -96,7 +96,7 @@ rsem-calculate-expression --bowtie2 \ ...@@ -96,7 +96,7 @@ rsem-calculate-expression --bowtie2 \
params.fastq = "$baseDir/data/fastq/*.fastq" params.fastq = "$baseDir/data/fastq/*.fastq"
params.index = "$baseDir/data/index/*.index*" params.index = "$baseDir/data/index/*.index*"
params.mean = 300 params.mean = 125
params.sd = 100 params.sd = 100
log.info "fastq files : ${params.fastq}" log.info "fastq files : ${params.fastq}"
...@@ -107,6 +107,7 @@ log.info "sd read size: ${params.sd}" ...@@ -107,6 +107,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 )
...@@ -114,12 +115,12 @@ Channel ...@@ -114,12 +115,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:
...@@ -133,7 +134,7 @@ rsem-calculate-expression --bowtie2 \ ...@@ -133,7 +134,7 @@ rsem-calculate-expression --bowtie2 \
--bowtie2-sensitivity-level "very_sensitive" \ --bowtie2-sensitivity-level "very_sensitive" \
--fragment-length-mean ${params.mean} --fragment-length-sd ${params.sd} \ --fragment-length-mean ${params.mean} --fragment-length-sd ${params.sd} \
--output-genome-bam -p ${task.cpus} \ --output-genome-bam -p ${task.cpus} \
${reads} ${index_name} ${tagname} > ${tagname}_rsem_bowtie2_report.txt ${reads} ${index_name} ${file_id} \
> ${reads.baseName}_rsem_bowtie2_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:
...@@ -37,7 +38,7 @@ rsem-calculate-expression --bowtie2 \ ...@@ -37,7 +38,7 @@ rsem-calculate-expression --bowtie2 \
--bowtie2-sensitivity-level "very_sensitive" \ --bowtie2-sensitivity-level "very_sensitive" \
--fragment-length-mean ${params.mean} --fragment-length-sd ${params.sd} \ --fragment-length-mean ${params.mean} --fragment-length-sd ${params.sd} \
--output-genome-bam -p ${task.cpus} \ --output-genome-bam -p ${task.cpus} \
${reads} ${index_name} ${reads.baseName} \ ${reads} ${index_name} ${file_id} \
> ${reads.baseName}_rsem_bowtie2_report.txt > ${reads.baseName}_rsem_bowtie2_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