From 572e5b054e34c0128e4215c564aaf96632047c06 Mon Sep 17 00:00:00 2001 From: hpolvech <helene.polveche@ens-lyon.fr> Date: Wed, 6 Jun 2018 13:58:13 +0000 Subject: [PATCH] RNASeq.nf:Cutadapt --- src/RNASeq.nf | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/RNASeq.nf diff --git a/src/RNASeq.nf b/src/RNASeq.nf new file mode 100644 index 0000000..354f00e --- /dev/null +++ b/src/RNASeq.nf @@ -0,0 +1,31 @@ +/* +* Cutadapt +* for paired-end data +*/ + +params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq" + +log.info "fastq files : ${params.fastq}" + +Channel + .fromFilePairs( params.fastq ) + .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } + .set { fastq_files } + +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 + + script: + """ + cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT -A AGATCGGAAGAG -G CTCTTCCGATCT \ + -o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \ + ${reads[0]} ${reads[1]} > ${pair_id}_report.txt + """ +} -- GitLab