Can someone explain to me why doing this: ```ch_ma...
# nostupidquestions
n
Can someone explain to me why doing this:
Copy code
ch_main_assembled
        .branch {
            it ->
            polish:     ["pilon","medaka","medaka+pilon","dorado","dorado+pilon"].contains(it.meta.polish)
            no_polish: !["pilon","medaka","medaka+pilon","dorado","dorado+pilon"].contains(it.meta.polish)
        }
        .set { ch_main_assembled }

    ch_main_assembled.polish.view {"ch_main_assembled.polish: $it"}
    ch_main_assembled.no_polish.view {"ch_main_assembled.no_polish: $it"}
gives me this item in
no_polish
:
Copy code
ch_main_assembled.no_polish: [meta:[id:test_flye_hifiasm, group:null, strategy:scaffold, assembler:flye_hifiasm, assembler_ont:flye, assembler_hifi:hifiasm, assembly_scaffolding_order:ont_on_hifi, assembler_ont_args:, assembler_hifi_args:, polish:"medaka+pilon" <extra items removed>]]
The reason was:
polish='"medaka+pilon"' (type: java.lang.String)
... there were quotes in my samplesheet
a
That's annoying, how did you read in the samplesheet? I think lots of programs will normally output cells in quotes to stop data being incorrectly split if using csv. But I thought most readers will handle the quotes?
n
I read the samplesheet with
channel.fromPath.splitCsv()
. I think the behaviour is actually fine, but it is not immediately obvious that
[polish:"medaka+pilon"]
is not contained in
["pilon","medaka","medaka+pilon","dorado","dorado+pilon"]
, I could have noticed the quotes though..