These are chat archives for nextflow-io/nextflow

6th
Nov 2017
Tim Diels
@timdiels
Nov 06 2017 11:26
When I call error('msg'), the pipeline does not eventually exit. Is there some other function to abort?
Paolo Di Tommaso
@pditommaso
Nov 06 2017 11:27
it should, how are you using it ?
Tim Diels
@timdiels
Nov 06 2017 11:30
// Parse species.txt
Channel
    .fromPath("$params.input/species.txt")
    .splitCsv(sep: "\t", header: true)
    .map {
        def specie = [
            name: it.name,
            id: it.id,
            proteome: Paths.get(it.proteome),
            longName: it.long_name,
            orthofinder: it.orthofinder.toBoolean(),
            phyml: it.phyml.toBoolean(),
            interproscan: it.interproscan.toBoolean(),
            blast2go: it.blast2go.toBoolean(),
            clime: it.clime.toBoolean(),
        ]

        // Assert proteome is an absolute path
        if (!specie.proteome.isAbsolute()) {
            error(
                "$specie.name's proteome must be an absolute path, got: $specie.proteome"
            )
        }

        // Assert OrthoFinder is set when PhyML is set
        if (!specie.orthofinder && specie.phyml) {
            error(
                "$specie.name has PhyML set, but not OrthoFinder. PhyML requires " +
                "OrthoFinder. Please set OrthoFinder as well or unset PhyML."
            )
        }

        // Assert PhyML is set when CLIME is set
        if (!specie.phyml && specie.clime) {
            error(
                "$specie.name has CLIME set, but not PhyML. CLIME requires " +
                "PhyML. Please set PhyML as well or unset CLIME."
            )
        }

        //
        return specie
    }
    .set { species }
Paolo Di Tommaso
@pditommaso
Nov 06 2017 11:31
yes, it should stop
any error message or something in the .nextflow.log file ?
Tim Diels
@timdiels
Nov 06 2017 11:47

Hmm, the case I'm referring to doesn't even reach the error actually,

$ ./run.sh 
Picked up JAVA_TOOL_OPTIONS: -XX:ParallelGCThreads=1
N E X T F L O W  ~  version 0.24.2
Launching `/home/tidie/projects/cedalion/main.nf` [trusting_hypatia] - revision: ba99cac2c0
ERROR ~ Cannot invoke method toBoolean() on null object

 -- Check script 'main.nf' at line: 115 or see '.nextflow.log' file for more details
[warm up] executor > local
[warm up] executor > sge
<hangs>

Perhaps that's intended?

Paolo Di Tommaso
@pditommaso
Nov 06 2017 11:47
ah
use the safe field navigator e.g. it?.orthofinder?.toBoolean()
however it should not hang
could you check in the .nextflow.log file the error stack trace and open an issue for that ?
Tim Diels
@timdiels
Nov 06 2017 11:56
done nextflow-io/nextflow#506
input:
val value from manyValues
file f from oneFile
This only runs on the first value + f, doesn't it?
If I change val to each, it should repeat oneFile for each value, right?
Paolo Di Tommaso
@pditommaso
Nov 06 2017 12:19
no, it can be executed as many times as manyValues provided oneFile is a value channel
the easiest way is to use oneFile.first()