Commit 0bf417d4 authored by David Trudgian's avatar David Trudgian

Try to fix freezes under valid and invalid design file conditions

parent 22c3f7cf
......@@ -23,14 +23,13 @@ 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()
def fileMap = [:]
fastqs.each {
final fileName = it.getFileName().toString()
prefix = fileName.lastIndexOf('/')
final fileName = it.fileName.toString()
int p = fileName.lastIndexOf('/')
if( p != -1 ) fileName = filePattern.substring(p+1)
fileMap[fileName] = it
}
def prefix = []
......@@ -51,23 +50,31 @@ new File(params.design).withReader { reader ->
}
}
if( ! prefix) { error "Didn't match any input files with entries in the design file" }
if (params.pairs == 'pe') {
Channel
.from(prefix)
.into { read_pe }
.set { read_pe }
Channel
.empty()
.set { read_se }
}
if (params.pairs == 'se') {
Channel
.from(prefix)
.into { read_se }
.set { read_se }
Channel
.empty()
.set { read_pe }
}
//
// Trim raw reads using trimgalore
//
process trimpe {
when:
params.pairs == 'pe'
input:
set pair_id, file(read1), file(read2) from read_pe
output:
......@@ -79,8 +86,6 @@ process trimpe {
"""
}
process trimse {
when:
params.pairs == 'se'
input:
set pair_id, file(read1) from read_se
output:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment