Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LBMC
Bernard
quantitative nucleosome analysis
Commits
a6ae64ae
Verified
Commit
a6ae64ae
authored
Aug 02, 2018
by
Laurent Modolo
Browse files
cutadapt: nf file add file_id var for single-end like for paired
parent
f9a6c22f
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/nf_modules/cutadapt/cutadapt.nf
View file @
a6ae64ae
...
...
@@ -41,33 +41,32 @@ process adaptor_removal {
* for single-end data
*/
params.fastq = "$baseDir/data/fastq/*.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files }
process adaptor_removal {
tag "$reads.baseName"
publishDir "results/fastq/adaptor_removal/", mode: 'copy'
tag "$file_id"
input:
file
reads from fastq_files
set file_id, file(
reads
)
from fastq_files
output:
file
"*_cut.fastq.gz" into fastq_files_cut
set file_id,
"*_cut.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT\
-o ${
reads.baseName
}_cut.fastq.gz \
${reads} > ${
reads.baseName
}_report.txt
-o ${
file_id
}_cut.fastq.gz \
${reads} > ${
file_id
}_report.txt
"""
}
/* quality trimming */
/*
...
...
@@ -105,30 +104,28 @@ process trimming {
* for single-end data
*/
params.fastq = "$baseDir/data/fastq/*.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files }
process trimming {
tag "$reads.baseName"
publishDir "results/fastq/trimming/", mode: 'copy'
tag "$file_id"
input:
file
reads from fastq_files
set file_id, file(
reads
)
from fastq_files
output:
file
"*_trim.fastq.gz" into fastq_files_
trim
set file_id,
"*_trim.fastq.gz" into fastq_files_
cut
script:
"""
cutadapt -q 20,20 \
-o ${
reads.baseName
}_trim.fastq.gz \
${reads} > ${
reads.baseName
}_report.txt
-o ${
file_id
}_trim.fastq.gz \
${reads} > ${
file_id
}_report.txt
"""
}
src/nf_modules/cutadapt/tests/adaptor_removal_single.nf
View file @
a6ae64ae
...
...
@@ -3,22 +3,23 @@ log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files }
process adaptor_removal {
tag "$
reads.baseName
"
tag "$
file_id
"
input:
file
reads from fastq_files
set file_id, file(
reads
)
from fastq_files
output:
file
"*_cut.fastq.gz" into fastq_files_cut
set file_id,
"*_cut.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT\
-o ${
reads.baseName
}_cut.fastq.gz \
${reads} > ${
reads.baseName
}_report.txt
-o ${
file_id
}_cut.fastq.gz \
${reads} > ${
file_id
}_report.txt
"""
}
src/nf_modules/cutadapt/tests/tests.sh
View file @
a6ae64ae
...
...
@@ -6,7 +6,7 @@ nextflow src/nf_modules/cutadapt/tests/adaptor_removal_paired.nf \
nextflow src/nf_modules/cutadapt/tests/adaptor_removal_single.nf
\
-c
src/nf_modules/cutadapt/cutadapt.config
\
-profile
docker
\
--fastq
"data/tiny_dataset/fastq/tiny
_R{1,2}
.fastq"
--fastq
"data/tiny_dataset/fastq/tiny
*_S
.fastq"
nextflow src/nf_modules/cutadapt/tests/trimming_paired.nf
\
-c
src/nf_modules/cutadapt/cutadapt.config
\
...
...
@@ -16,4 +16,4 @@ nextflow src/nf_modules/cutadapt/tests/trimming_paired.nf \
nextflow src/nf_modules/cutadapt/tests/trimming_single.nf
\
-c
src/nf_modules/cutadapt/cutadapt.config
\
-profile
docker
\
--fastq
"data/tiny_dataset/fastq/tiny
_R{1,2}
.fastq"
--fastq
"data/tiny_dataset/fastq/tiny
*_S
.fastq"
src/nf_modules/cutadapt/tests/trimming_single.nf
View file @
a6ae64ae
...
...
@@ -3,22 +3,23 @@ log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files }
process trimming {
tag "$
reads.baseName
"
tag "$
file_id
"
input:
file
reads from fastq_files
set file_id, file(
reads
)
from fastq_files
output:
file
"*_trim.fastq.gz" into fastq_files_cut
set file_id,
"*_trim.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -q 20,20 \
-o ${
reads.baseName
}_trim.fastq.gz \
${reads} > ${
reads.baseName
}_report.txt
-o ${
file_id
}_trim.fastq.gz \
${reads} > ${
file_id
}_report.txt
"""
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment