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
b867bf9a
Verified
Commit
b867bf9a
authored
3 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
bowtie: update to match CONTRIBUTING.md
parent
1f72b2c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nf_modules/bowtie/main.nf
+51
-38
51 additions, 38 deletions
src/nf_modules/bowtie/main.nf
with
51 additions
and
38 deletions
src/nf_modules/bowtie/main.nf
+
51
−
38
View file @
b867bf9a
...
@@ -2,17 +2,21 @@ version = "1.2.2"
...
@@ -2,17 +2,21 @@ version = "1.2.2"
container_url = "lbmc/bowtie:${version}"
container_url = "lbmc/bowtie:${version}"
params.index_fasta = ""
params.index_fasta = ""
params.index_fasta_out = ""
process index_fasta {
process index_fasta {
container = "${container_url}"
container = "${container_url}"
label "big_mem_multi_cpus"
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:
input:
path
fasta
tuple val(file_id),
path
(
fasta
)
output:
output:
path
"*.index*", emit: index
tuple val(file_id),
path
(
"*.index*"
)
, emit: index
path
"*_report.txt", emit: report
tuple val(file_id),
path
(
"*_report.txt"
)
, emit: report
script:
script:
"""
"""
...
@@ -27,57 +31,66 @@ fi
...
@@ -27,57 +31,66 @@ fi
"""
"""
}
}
params.mapping_fastq = ""
params.mapping_fastq = "--very-sensitive"
params.mapping_fastq_out = ""
process mapping_fastq {
process mapping_fastq {
container = "${container_url}"
container = "${container_url}"
label "big_mem_multi_cpus"
label "big_mem_multi_cpus"
tag "$pair_id"
tag "$pair_id"
if (params.mapping_fastq_out != "") {
publishDir "results/${params.mapping_fastq_out}", mode: 'copy'
}
input:
input:
path
index
tuple val(index_id),
path
(
index
)
tuple val(
pair
_id), path(reads)
tuple val(
file
_id), path(reads)
output:
output:
tuple val(
pair
_id), path("*.bam"), emit: bam
tuple val(
file
_id), path("*.bam"), emit: bam
path "*_report.txt", emit: report
path "*_report.txt", emit: report
script:
script:
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
}
index_id = index[0]
index_id = index[0]
for (index_file in index) {
for (index_file in index) {
if (index_file =~ /.*\.1\.bt2/ && !(index_file =~ /.*\.rev\.1\.bt2/)) {
if (index_file =~ /.*\.1\.bt2/ && !(index_file =~ /.*\.rev\.1\.bt2/)) {
index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1]
index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1]
}
}
}
}
if (reads
instanceof List
)
if (reads
.size() == 2
)
"""
"""
# -v specify the max number of missmatch, -k the number of match reported per
# -v specify the max number of missmatch, -k the number of match reported per
# reads
# reads
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
${params.mapping_fastq} \
${params.mapping_fastq} \
-1 ${reads[0]} -2 ${reads[1]} 2> \
-1 ${reads[0]} -2 ${reads[1]} 2> \
${
pair
_id}_bowtie_report_tmp.txt | \
${
file
_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${
pair
_id}.bam
samtools view -Sb - > ${
file
_id}.bam
if grep -q "Error" ${
pair
_id}_bowtie_report_tmp.txt; then
if grep -q "Error" ${
file
_id}_bowtie_report_tmp.txt; then
exit 1
exit 1
fi
fi
tail -n 19 ${
pair
_id}_bowtie_report_tmp.txt > \
tail -n 19 ${
file
_id}_bowtie_report_tmp.txt > \
${
pair
_id}_bowtie_mapping_report.txt
${
file
_id}_bowtie_mapping_report.txt
"""
"""
else
else
if (reads.size() == 1)
"""
"""
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
${params.mapping_fastq}
${params.mapping_fastq}
-q ${reads} 2> \
-q ${reads} 2> \
${file_id}_bowtie_report_tmp.txt | \
${file_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${file_id}.bam
samtools view -Sb - > ${file_id}.bam
if grep -q "Error" ${file_id}_bowtie_report_tmp.txt; then
if grep -q "Error" ${file_id}_bowtie_report_tmp.txt; then
exit 1
exit 1
fi
fi
tail -n 19 ${file_id}_bowtie_report_tmp.txt > \
tail -n 19 ${file_id}_bowtie_report_tmp.txt > \
${file_id}_bowtie_mapping_report.txt
${file_id}_bowtie_mapping_report.txt
"""
"""
}
}
params.mapping_fastq_pairedend = ""
params.mapping_fastq_pairedend = ""
...
...
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