Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ChIPster
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Xavier Grand
ChIPster
Commits
fd494cd5
Verified
Commit
fd494cd5
authored
4 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
bowtie2: update to match contributing.md
parent
8afe54bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nf_modules/bowtie2/main.nf
+47
-108
47 additions, 108 deletions
src/nf_modules/bowtie2/main.nf
with
47 additions
and
108 deletions
src/nf_modules/bowtie2/main.nf
+
47
−
108
View file @
fd494cd5
...
...
@@ -2,17 +2,21 @@ version = "2.3.4.1"
container_url
=
"lbmc/bowtie2:${version}"
params
.
index_fasta
=
""
params
.
index_fasta_out
=
""
process
index_fasta
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$fasta.baseName"
tag
"$file_id"
if
(
params
.
index_fasta_out
!=
""
)
{
publishDir
"results/${params.index_fasta_out}"
,
mode:
'copy'
}
input:
path
fasta
tuple
val
(
file_id
),
path
(
fasta
)
output:
path
"*.index*"
,
emit:
index
path
"*_report.txt"
,
emit:
report
tuple
val
(
file_id
),
path
(
"*.index*"
)
,
emit:
index
tuple
val
(
file_id
),
path
(
"*_report.txt"
)
,
emit:
report
script:
"""
...
...
@@ -28,64 +32,14 @@ fi
}
params
.
mapping_fastq
=
"--very-sensitive"
params
.
mapping_fastq_out
=
""
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
]
}
tag
"$file_id"
if
(
params
.
mapping_fastq_out
!=
""
)
{
publishDir
"results/${params.mapping_fastq_out}"
,
mode:
'copy'
}
if
(
reads
instanceof
List
)
"""
bowtie2 ${params.mapping_fastq} \
-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 ${params.mapping_fastq} \
-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
"""
}
params
.
mapping_fastq_pairedend
=
"--very-sensitive"
process
mapping_fastq_pairedend
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$pair_id"
input:
path
index
...
...
@@ -102,56 +56,41 @@ process mapping_fastq_pairedend {
index_id
=
(
index_file
=~
/(.*)\.1\.bt2/
)[
0
][
1
]
}
}
"""
bowtie2 ${params.mapping_fastq_pairedend} \
-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
"""
}
params
.
mapping_fastq_singleend
=
"--very-sensitive"
process
mapping_fastq_singleend
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$file_id"
input:
path
index
tuple
val
(
file_id
),
path
(
reads
)
output:
tuple
val
(
file_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
(
file_id
instanceof
List
){
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
bowtie2 ${params.mapping_fastq_singleend} \
-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
"""
if
(
reads
.
size
()
==
2
)
"""
bowtie2 ${params.mapping_fastq} \
-p ${task.cpus} \
-x ${index_id} \
-1 ${reads[0]} \
-2 ${reads[1]} 2> \
${file_prefix}_bowtie2_mapping_report_tmp.txt | \
samtools view -Sb - > ${file_prefix}.bam
if grep -q "Error" ${file_prefix}_bowtie2_mapping_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_prefix}_bowtie2_mapping_report_tmp.txt > \
${file_prefix}_bowtie2_mapping_report.txt
"""
else
if
(
reads
.
size
()
==
1
)
"""
bowtie2 ${params.mapping_fastq} \
-p ${task.cpus} \
-x ${index_id} \
-U ${reads} 2> \
${file_prefix}_bowtie2_mapping_report_tmp.txt | \
samtools view -Sb - > ${file_prefix}.bam
if grep -q "Error" ${file_prefix}_bowtie2_mapping_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_prefix}_bowtie2_mapping_report_tmp.txt > \
${file_prefix}_bowtie2_mapping_report.txt
"""
}
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