Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nextflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
nextflow
Commits
e4d5b19b
Verified
Commit
e4d5b19b
authored
4 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
add paired_end and single_end switch version to all implementations
parent
720b1977
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/nf_modules/bowtie/main.nf
+49
-0
49 additions, 0 deletions
src/nf_modules/bowtie/main.nf
src/nf_modules/bowtie2/main.nf
+53
-0
53 additions, 0 deletions
src/nf_modules/bowtie2/main.nf
src/nf_modules/cutadapt/main.nf
+54
-0
54 additions, 0 deletions
src/nf_modules/cutadapt/main.nf
with
156 additions
and
0 deletions
src/nf_modules/bowtie/main.nf
+
49
−
0
View file @
e4d5b19b
...
...
@@ -25,6 +25,55 @@ fi
"""
}
process
mapping_fastq
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$pair_id"
input:
path
index
tuple
val
(
pair_id
),
path
(
reads
)
output:
tuple
val
(
pair_id
),
path
(
"*.bam"
),
emit:
bam
path
"*_report.txt"
,
emit:
report
script:
index_id
=
index
[
0
]
for
(
index_file
in
index
)
{
if
(
index_file
=~
/.*\.1\.bt2/
&&
!(
index_file
=~
/.*\.rev\.1\.bt2/
))
{
index_id
=
(
index_file
=~
/(.*)\.1\.bt2/
)[
0
][
1
]
}
}
if
(
reads
instanceof
List
)
"""
# -v specify the max number of missmatch, -k the number of match reported per
# reads
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
-1 ${reads[0]} -2 ${reads[1]} 2> \
${pair_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${pair_id}.bam
if grep -q "Error" ${pair_id}_bowtie_report_tmp.txt; then
exit 1
fi
tail -n 19 ${pair_id}_bowtie_report_tmp.txt > \
${pair_id}_bowtie_mapping_report.txt
"""
else
"""
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
-q ${reads} 2> \
${file_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${file_id}.bam
if grep -q "Error" ${file_id}_bowtie_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_id}_bowtie_report_tmp.txt > \
${file_id}_bowtie_mapping_report.txt
"""
}
process
mapping_fastq_pairedend
{
container
=
"${container_url}"
...
...
This diff is collapsed.
Click to expand it.
src/nf_modules/bowtie2/main.nf
+
53
−
0
View file @
e4d5b19b
...
...
@@ -27,6 +27,59 @@ fi
}
process
mapping_fastq
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$pair_id"
input:
path
index
tuple
val
(
pair_id
),
path
(
reads
)
output:
tuple
val
(
pair_id
),
path
(
"*.bam"
),
emit:
bam
path
"*_report.txt"
,
emit:
report
script:
index_id
=
index
[
0
]
for
(
index_file
in
index
)
{
if
(
index_file
=~
/.*\.1\.bt2/
&&
!(
index_file
=~
/.*\.rev\.1\.bt2/
))
{
index_id
=
(
index_file
=~
/(.*)\.1\.bt2/
)[
0
][
1
]
}
}
if
(
reads
instanceof
List
)
"""
bowtie2 --very-sensitive \
-p ${task.cpus} \
-x ${index_id} \
-1 ${reads[0]} \
-2 ${reads[1]} 2> \
${pair_id}_bowtie2_mapping_report_tmp.txt | \
samtools view -Sb - > ${pair_id}.bam
if grep -q "Error" ${pair_id}_bowtie2_mapping_report_tmp.txt; then
exit 1
fi
tail -n 19 ${pair_id}_bowtie2_mapping_report_tmp.txt > \
${pair_id}_bowtie2_mapping_report.txt
"""
else
"""
bowtie2 --very-sensitive \
-p ${task.cpus} \
-x ${index_id} \
-U ${reads} 2> \
${reads.baseName}_bowtie2_mapping_report_tmp.txt | \
samtools view -Sb - > ${reads.baseName}.bam
if grep -q "Error" ${reads.baseName}_bowtie2_mapping_report_tmp.txt; then
exit 1
fi
tail -n 19 ${reads.baseName}_bowtie2_mapping_report_tmp.txt > \
${reads.baseName}_bowtie2_mapping_report.txt
"""
}
process
mapping_fastq_pairedend
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
...
...
This diff is collapsed.
Click to expand it.
src/nf_modules/cutadapt/main.nf
+
54
−
0
View file @
e4d5b19b
...
...
@@ -6,6 +6,33 @@ adapter_5_prim = "CTCTTCCGATCT"
trim_quality
=
"20"
process
adaptor_removal
{
container
=
"${container_url}"
label
"big_mem_mono_cpus"
tag
"$pair_id"
input:
tuple
val
(
pair_id
),
path
(
reads
)
output:
tuple
val
(
pair_id
),
path
(
"*_cut_R{1,2}.fastq.gz"
),
emit:
fastq
path
"*_report.txt"
,
emit:
report
script:
if
(
reads
instanceof
List
)
"""
cutadapt -a ${adapter_3_prim} -g ${adapter_5_prim} -A ${adapter_3_prim} -G ${adapter_5_prim} \
-o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
else:
"""
cutadapt -a ${adapter_3_prim} -g ${adapter_5_prim} \
-o ${file_id}_cut.fastq.gz \
${reads} > ${file_id}_report.txt
"""
}
process
adaptor_removal_pairedend
{
container
=
"${container_url}"
label
"big_mem_mono_cpus"
...
...
@@ -46,6 +73,33 @@ process adaptor_removal_singleend {
"""
}
process
trimming_pairedend
{
container
=
"${container_url}"
label
"big_mem_mono_cpus"
tag
"$pair_id"
input:
tuple
val
(
pair_id
),
path
(
reads
)
output:
tuple
val
(
pair_id
),
path
(
"*_trim_R{1,2}.fastq.gz"
),
emit:
fastq
path
"*_report.txt"
,
emit:
report
script:
if
(
reads
instanceof
List
)
"""
cutadapt -q ${trim_quality},${trim_quality} \
-o ${pair_id}_trim_R1.fastq.gz -p ${pair_id}_trim_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
else
"""
cutadapt -q ${trim_quality},${trim_quality} \
-o ${file_id}_trim.fastq.gz \
${reads} > ${file_id}_report.txt
"""
}
process
trimming_pairedend
{
container
=
"${container_url}"
label
"big_mem_mono_cpus"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment