Verified Commit 5236de95 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

paired.nf files : pass the pair_id information in output

parent 39257434
/*
* bedtools :
* Imputs : fastq files
* Output : fastq files
* Imputs : fasta files
* Imputs : bed files
* Output : fasta files
*/
/* fasta extraction */
......
......@@ -66,7 +66,7 @@ process mapping_fastq {
file index from index_files.toList()
output:
file "*.bam" into bam_files
set pair_id, "*.bam" into bam_files
script:
"""
......
......@@ -23,7 +23,7 @@ process mapping_fastq {
file index from index_files.toList()
output:
file "*.bam" into bam_files
set pair_id, "*.bam" into bam_files
script:
"""
......@@ -37,3 +37,4 @@ if grep -q "Error" ${pair_id}_bowtie2_report.txt; then
fi
"""
}
......@@ -58,7 +58,7 @@ process mapping_fastq {
publishDir "results/mapping/quantification/", mode: 'copy'
input:
file reads from fastq_files
set pair_id, file(reads) from fastq_files
file index from index_files.toList()
output:
......@@ -68,8 +68,8 @@ process mapping_fastq {
"""
mkdir ${reads[0].baseName}
kallisto quant -i ${index} -t ${task.cpus} \
--bias --bootstrap-samples 100 -o ${reads[0].baseName} \
${reads[0]} ${reads[1]} &> ${reads[0].baseName}_kallisto_report.txt
--bias --bootstrap-samples 100 -o ${pair_id} \
${reads[0]} ${reads[1]} &> ${pair_id}_kallisto_report.txt
"""
}
......
......@@ -14,7 +14,7 @@ Channel
.set { index_files }
process mapping_fastq {
tag "$pair_id"
tag "$reads"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
......@@ -27,7 +27,7 @@ process mapping_fastq {
script:
"""
mkdir ${pair_id}
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
......
......@@ -6,14 +6,15 @@ Channel
.set { fastq_files }
process trimming {
tag "$pair_id"
tag "${reads}"
cpus 4
publishDir "results/fastq/trimming/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_cut
set pair_id, "*_trim_R{1,2}.fastq.gz" into fastq_files_trim
script:
"""
......@@ -23,3 +24,4 @@ UrQt --t 20 --m ${task.cpus} --gz \
> ${pair_id}_trimming_report.txt
"""
}
......@@ -24,17 +24,17 @@ process trimming {
publishDir "results/fastq/trimming/", mode: 'copy'
input:
file reads from fastq_files
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_trim
set pair_id, "*_trim_R{1,2}.fastq.gz" into fastq_files_trim
script:
"""
UrQt --t 20 --m ${task.cpus} --gz \
--in ${reads[0]} --inpair ${reads[1]} \
--out ${reads[0].baseName}_trim_R1.fastq.gz --outpair ${reads[1].baseName}_trim_R2.fastq.gz \
> ${reads[0].baseName}_trimming_report.txt
--out ${pair_id}_trim_R1.fastq.gz --outpair ${pair_id}_trim_R2.fastq.gz \
> ${pair_id}_trimming_report.txt
"""
}
......
......@@ -27,7 +27,7 @@ process adaptor_removal {
set pair_id, file(reads) from fastq_files
output:
file "*_cut_R{1,2}.fastq.gz" into fastq_files_cut
set pair_id, "*_cut_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
......@@ -91,7 +91,7 @@ process trimming {
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_trim
set pair_id, "*_trim_R{1,2}.fastq.gz" into fastq_files_trim
script:
"""
......
......@@ -7,12 +7,13 @@ Channel
process adaptor_removal {
tag "$pair_id"
publishDir "results/fastq/adaptor_removal/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
output:
file "*_cut_R{1,2}.fastq.gz" into fastq_files_cut
set pair_id, "*_cut_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
......@@ -21,4 +22,3 @@ process adaptor_removal {
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
......@@ -7,12 +7,13 @@ Channel
process trimming {
tag "$pair_id"
publishDir "results/fastq/trimming/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_cut
set pair_id, "*_trim_R{1,2}.fastq.gz" into fastq_files_trim
script:
"""
......@@ -21,4 +22,3 @@ process trimming {
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment