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
rseraphi
nextflow
Commits
a2f71be3
Unverified
Commit
a2f71be3
authored
6 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
SNP_calling.nf: QC and mapping
parent
0d2b6e6c
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/SNP_calling.nf
+94
-0
94 additions, 0 deletions
src/SNP_calling.nf
with
94 additions
and
0 deletions
src/SNP_calling.nf
0 → 100644
+
94
−
0
View file @
a2f71be3
params
.
fastq
=
"$baseDir/data/*.fastq"
params
.
fasta
=
"$baseDir/data/*.fasta"
log
.
info
"fastq files : ${params.fastq}"
log
.
info
"fasta files : ${params.fasta}"
Channel
.
fromPath
(
params
.
fasta
)
.
ifEmpty
{
error
"Cannot find any bam files matching: ${params.fasta}"
}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}
.
set
{
fasta_file
}
Channel
.
fromFilePairs
(
params
.
fastq
)
.
ifEmpty
{
error
"Cannot find any fastq files matching: ${params.fastq}"
}
.
set
{
fastq_files
}
process
adaptor_removal
{
tag
"$pair_id"
publishDir
"results/fastq/adaptor_removal/"
,
mode:
'copy'
input:
set
pair_id
,
file
(
reads
)
from
fastq_files
output:
set
pair_id
,
"*_cut_R{1,2}.fastq.gz"
into
fastq_files_cut
script:
"""
cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT -A AGATCGGAAGAG -G CTCTTCCGATCT \
-o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
process
trimming
{
tag
"${reads}"
cpus
4
publishDir
"results/fastq/trimming/"
,
mode:
'copy'
input:
set
pair_id
,
file
(
reads
)
from
fastq_files_cut
output:
set
pair_id
,
"*_trim_R{1,2}.fastq.gz"
into
fastq_files_trim
script:
"""
UrQt --t 20 --m ${task.cpus} --gz \
--in ${reads[0]} --inpair ${reads[1]} \
--out ${pair_id}_trim_R1.fastq.gz --outpair ${pair_id}_trim_R2.fastq.gz \
> ${pair_id}_trimming_report.txt
"""
}
process
index_fasta
{
tag
"$fasta_id"
cpus
4
publishDir
"results/mapping/index/"
,
mode:
'copy'
input:
set
fasta_id
,
file
(
fasta
)
from
fasta_file
output:
set
fasta_id
,
"${fasta.baseName}.*"
into
index_files
file
"*_bwa_report.txt"
into
index_files_report
script:
"""
bwa index -p ${fasta.baseName} ${fasta} \
&> ${fasta.baseName}_bwa_report.txt
"""
}
process
mapping_fastq
{
tag
"$reads"
cpus
4
publishDir
"results/mapping/sam/"
,
mode:
'copy'
input:
set
pair_id
,
file
(
reads
)
from
fastq_files_trim
set
index_id
,
file
(
index
)
from
index_files
.
collect
()
output:
file
"${pair_id}.sam"
into
sam_files
file
"${pair_id}_bwa_report.txt"
into
mapping_repport_files
script:
"""
bwa mem -t ${task.cpus} \
${index_id} ${reads[0]} ${reads[1]} \
-o ${pair_id}.sam &> ${pair_id}_bwa_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