Verified Commit 2c488dbf authored by Laurent Modolo's avatar Laurent Modolo
Browse files

cutadapt: add tests and config

parent ae7f6a84
FROM ubuntu:18.04
MAINTAINER Laurent Modolo
ENV CUTADAPT_VERSION=1.14
ENV PACKAGES build-essential=12.4* \
python3-pip=9.0.1* \
python3-setuptools=39.0.1* \
python3-dev=3.6.5* \
python3-wheel=0.30.0*
RUN apt-get update && \
apt-get install -y --no-install-recommends ${PACKAGES} && \
apt-get clean
RUN pip3 install cutadapt==${CUTADAPT_VERSION}
#!/bin/sh
docker build src/nf_modules/cutadapt/1.14 -t 'cutadapt:1.14'
profiles {
docker {
docker {
temp = 'auto'
enabled = true
}
process {
$adaptor_removal {
container = "cutadapt:1.14"
}
}
}
sge {
process{
$adaptor_removal {
beforeScript = "module purge; module load cutadapt/1.14"
}
}
}
}
profiles {
docker {
process {
$trimming {
container = "cutadapt:1.14"
}
}
}
sge {
process{
$trimming {
beforeScript = "module purge; module load cutadapt/1.14"
}
}
}
}
......@@ -67,10 +67,6 @@ process adaptor_removal {
/* quality trimming */
${this.params.cutadapt} -q ${this.params.quality_threshold},${this.params.quality_threshold} -o ${tagname}_trim_R1.fastq.gz -p ${tagname}_trim_R2.fastq.gz ${file[0]} ${file[1]} > ${tagname}_cutadapt_report.txt"
${this.params.cutadapt} -q ${this.params.quality_threshold},${this.params.quality_threshold} -o ${tagname}_trim.fastq.gz ${file} > ${tagname}_cutadapt_report.txt
/*
* for paired-end data
*/
......
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"
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
"""
}
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process adaptor_removal {
tag "$reads.baseName"
input:
file reads from fastq_files
output:
file "*_cut.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT\
-o ${reads.baseName}_cut.fastq.gz \
${reads} > ${reads.baseName}_report.txt
"""
}
nextflow src/nf_modules/cutadapt/test/adaptor_removal_paired.nf \
-c src/nf_modules/cutadapt/cutadapt.config \
-profile docker \
--fastq "data/tiny_dataset/fastq/tiny_R{1,2}.fastq"
nextflow src/nf_modules/cutadapt/test/adaptor_removal_single.nf \
-c src/nf_modules/cutadapt/cutadapt.config \
-profile docker \
--fastq "data/tiny_dataset/fastq/tiny_R{1,2}.fastq"
nextflow src/nf_modules/cutadapt/test/trimming_paired.nf \
-c src/nf_modules/cutadapt/cutadapt.config \
-profile docker \
--fastq "data/tiny_dataset/fastq/tiny_R{1,2}.fastq"
nextflow src/nf_modules/cutadapt/test/trimming_single.nf \
-c src/nf_modules/cutadapt/cutadapt.config \
-profile docker \
--fastq "data/tiny_dataset/fastq/tiny_R{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 trimming {
tag "$pair_id"
input:
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -q 20,20 \
-o ${pair_id}_trim_R1.fastq.gz -p ${pair_id}_trim_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process trimming {
tag "$reads.baseName"
input:
file reads from fastq_files
output:
file "*_trim.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -q 20,20 \
-o ${reads.baseName}_trim.fastq.gz \
${reads} > ${reads.baseName}_report.txt
"""
}
Supports Markdown
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