Valid keys in combine by OPERATOR ?

7 views
Skip to first unread message

Carlos Urzua

unread,
Aug 15, 2018, 8:29:30 AM8/15/18
to Nextflow
Hello:

Disclaimer: I am not familiar with groovy.

I was using the combine operator to pair the results of two channels by id. Log 1,2 is a listener for each channel respectively:

Log 1: [h.all.v6.2.entrez.gmt, ../../PValues.txt]

Log 1: [h.all.v6.2.entrez.gmt, ../PValues.txt]

Log 1: [c2.cp.kegg.v6.2.entrez.gmt, ../../PValues.txt]

Log 1: [c2.cp.kegg.v6.2.entrez.gmt, ../../PValues.txt]


Log 2: [h.all.v6.2.entrez.gmt, /Users/gene_set.csv]

Log 2: [c2.cp.kegg.v6.2.entrez.gmt, /Users/gene_set.csv]


The process that uses the combined channel never ran and the pipeline ended. After looking into it it seems that the combine finds no match using the keys, if I remove the "by: 0" option I get all 8 combinations properly.


Is it that the keys are required to be in a specific format (are points forbidden)? Thank you for your feedback!


Carlos

Message has been deleted

Carlos Urzua

unread,
Aug 16, 2018, 4:51:06 AM8/16/18
to Nextflow
I solved my error, in case somebody gets into the same situation

It seems that the data types of those keys were different (despite being printed the same)
1.- one key I originated from a csv field and ended up in a tuple [key, ...]

...not shown

2.- the other key came from a file type and was also put on a tuple [key, ...]

process broad_to_long {
    echo true

    input:
    file gmt_formated_gene_set from Channel.fromPath('/*.gmt')

    output:
    gmt_formatted_gene_set file('gene_set.csv') into o_channel

    """
    parse_BROAD_GMT_MsigDB.py -g $gmt_formated_gene_set -o gene_set.csv
    """
}




To solve it I used the pattern described in the FAQ

How do I get a unique ID based on the file name?


datasets = Channel
                .fromPath(params.input)
                .map { file -> tuple(file.baseName, file) }
You create a tuple and access the name of the file using basename
After this both keys were able to match!
Carlos




Reply all
Reply to author
Forward
0 new messages