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
829ff319
Unverified
Commit
829ff319
authored
4 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
nf_modules: add bowtie to DSL2
parent
629de1ab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nf_modules/bowtie/main.nf
+101
-0
101 additions, 0 deletions
src/nf_modules/bowtie/main.nf
with
101 additions
and
0 deletions
src/nf_modules/bowtie/main.nf
0 → 100644
+
101
−
0
View file @
829ff319
version
=
"1.2.2"
container_url
=
"lbmc/bowtie:${version}"
process
index_fasta
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$fasta.baseName"
publishDir
"results/mapping/index/"
,
mode:
'copy'
input:
path
fasta
output:
path
"*.index*"
,
emit:
index
path
"*_report.txt"
,
emit:
report
script:
"""
bowtie-build --threads ${task.cpus} \
-f ${fasta} ${fasta.baseName}.index &> \
${fasta.baseName}_bowtie_index_report.txt
if grep -q "Error" ${fasta.baseName}_bowtie_index_report.txt; then
exit 1
fi
"""
}
process
mapping_fastq_pairedend
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$pair_id"
publishDir
"results/mapping/bams/"
,
mode:
'copy'
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
]
}
}
"""
# -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
"""
}
process
mapping_fastq_singleend
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
tag
"$file_id"
publishDir
"results/mapping/bams/"
,
mode:
'copy'
input:
path
index
tuple
val
(
file_id
),
path
(
reads
)
output:
set
file_id
,
"*.bam"
,
emit:
bam
file
"*_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
]
}
}
"""
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
"""
}
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