Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rnaseq_nextflow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
David Trudgian
rnaseq_nextflow
Commits
3861d9ad
Commit
3861d9ad
authored
8 years ago
by
David Trudgian
Browse files
Options
Downloads
Patches
Plain Diff
Fix routing for PE/SE channels
parent
0a261ff0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
workflow/main.nf
+27
-11
27 additions, 11 deletions
workflow/main.nf
with
27 additions
and
11 deletions
workflow/main.nf
+
27
−
11
View file @
3861d9ad
...
...
@@ -21,6 +21,9 @@ index_name = "genome"
// which is covered by the GNU General Public License v3
// https://github.com/nextflow-io/rnatoy/blob/master/main.nf
read_pe = Channel.empty()
read_se = Channel.empty()
if (params.pairs == 'pe') {
Channel
.fromPath( fastqs )
...
...
@@ -31,20 +34,21 @@ Channel
}
.groupTuple(sort: true)
.map { id, files -> tuple(id, files[0],files[1])}
.set { read_pe }
}
.into { read_pe }
}
if (params.pairs == 'se') {
Channel
.fromPath( fastqs )
.ifEmpty { error "Cannot find any files matching: ${fastqs}" }
.map { path ->
def prefix = readPrefix(path, '*
{1,2}
.{fastq,fq}{,.gz}')
def prefix = readPrefix(path, '*.{fastq,fq}{,.gz}')
tuple(prefix, path)
}
.groupTuple(sort: true)
.map { id, files -> tuple(id, files[0])}
.
set
{ read_se }
}
.
into
{ read_se }
}
/*
* Helper function, given a file Path
...
...
@@ -133,9 +137,8 @@ process alignpe {
input:
set pair_id, file(fq1), file(fq2) from trimpe
output:
set pair_id, file("${pair_id}.bam") into aligned
set pair_id, file("${pair_id}.bam") into aligned2
file("${pair_id}.flagstat.txt") into alignstats
set pair_id, file("${pair_id}.bam") into aligned_pe
file("${pair_id}.flagstat.txt") into alignstats_pe
"""
module load hisat2/2.0.1-beta-intel samtools/intel/1.3 fastqc/0.11.2 picard/1.127
hisat2 -p 4 --no-unal --dta -x ${index_path}/${index_name} -1 ${fq1} -2 ${fq2} -S out.sam 2> ${pair_id}.hisatout.txt
...
...
@@ -155,9 +158,8 @@ process alignse {
input:
set pair_id, file(fq1) from trimse
output:
set pair_id, file("${pair_id}.bam") into aligned
set pair_id, file("${pair_id}.bam") into aligned2
file("${pair_id}.flagstat.txt") into alignstats
set pair_id, file("${pair_id}.bam") into aligned_se
file("${pair_id}.flagstat.txt") into alignstats_se
"""
module load hisat2/2.0.1-beta-intel samtools/intel/1.3 fastqc/0.11.2 picard/1.127
hisat2 -p 4 --no-unal --dta -x ${index_path}/${index_name} -U ${fq1} -S out.sam 2> ${pair_id}.hisatout.txt
...
...
@@ -170,6 +172,20 @@ process alignse {
"""
}
// From here on we are the same for PE and SE, so merge channels and carry on
Channel
.empty()
.mix(aligned_se, aligned_pe)
.tap { aligned2 }
.set { aligned }
Channel
.empty()
.mix(alignstats_se, alignstats_pe)
.set { alignstats }
//
// Summarize all flagstat output
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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