Verified Commit 192fef09 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

bowtie2: change file_id handling

parent 5a367584
......@@ -125,15 +125,22 @@ process fastp {
Here `file_id` can be anything from a simple identifier to a list of several variables.
In which case the first item of the List should be usable as a file prefix.
So you have to keep that in mind if you want to use it to define output file names (you can test for that with `file_id instanceof List`).
In some case, the `file_id` may be a Map to have a cleaner access to the `file_id` content by explicit keywords.
If you want to use information within the `file_id` to name outputs in your `script` section, you can use the following snipet:
```Groovy
script:
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
switch(file_id) {
case {it instanceof List}:
file_prefix = file_id[0]
break
case {it instanceof Map}:
file_prefix = file_id.values()[0]
break
default:
file_id
break
}
```
......
......@@ -56,10 +56,16 @@ process mapping_fastq {
index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1]
}
}
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
switch(file_id) {
case {it instanceof List}:
file_prefix = file_id[0]
break
case {it instanceof Map}:
file_prefix = file_id.values()[0]
break
default:
file_id
break
}
if (reads.size() == 2)
......
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