These are chat archives for nextflow-io/nextflow

18th
Nov 2016
Félix C. Morency
@fmorency
Nov 18 2016 14:28
fodf_for_wm_tracking
    .phase(interface_mask_for_wm_tracking)
    .map{ch1, ch2 -> [*ch1, ch2[1]]}
    .into{fodf_interface_for_wm_tracking}
fodf_interface_for_wm_tracking
    .phase(wm_mask_for_wm_tracking)
    .map{ch1, ch2 -> [*ch1, ch2[1]]}
    .into{in_for_wm_tracking}
can we simplify ^?
Mike Smoot
@mes5k
Nov 18 2016 17:14
I don't think you need the intermediate into so you can have:
fodf_for_wm_tracking
    .phase(interface_mask_for_wm_tracking)
    .map{ch1, ch2 -> [*ch1, ch2[1]]}
    .phase(wm_mask_for_wm_tracking)
    .map{ch1, ch2 -> [*ch1, ch2[1]]}
    .into{in_for_wm_tracking}
Trevor Tanner
@tantrev
Nov 18 2016 23:31
Is there any way to use operators on a "set", while ignoring the "set" key itself?
Mike Smoot
@mes5k
Nov 18 2016 23:35
Can you clarify what you mean with an example?
Trevor Tanner
@tantrev
Nov 18 2016 23:37
Sure thing. So my goal is to just get a list of all the output files I have so I can tar them all. My output is currently organized in a set with a structure like: set(datasetID), file(datasetFile1), file(datasetFile2)
I'm currently trying to start the parsing using a command from the faq:
output
.collectFile () { file -> ['output.txt', file.name + '\n' ] }
.set { parsed_output }
'''
'''
output
.collectFile () { file -> ['output.txt', file.name + '\n' ] }
.set { parsed_output }
'''
Sorry, trying to figure out the markdown...
Mike Smoot
@mes5k
Nov 18 2016 23:52
Just to make sure I'm following, you're not talking about taring just the two files datasetFile1 and datasetFile2 from one single tuple, but all the files from all the tuples in the channel, right?
Assuming yes, do you want all the datasetFile1 and datasetFile2 in the same tar file?
Trevor Tanner
@tantrev
Nov 18 2016 23:57
Correct. Just throw 'em all in one tar file. When I don't have a "set" key to deal with, I just do a simple toList() after a collectFile() operation.
Mike Smoot
@mes5k
Nov 18 2016 23:59
How about this:
output
    .flatMap{ id, file1, file2 -> [file1, file2] }
    .toList()
    .set{ all_files }

process tarStuff {

    input:
    file(all_files) from all_files

    output:
    file("all.tgz") into tarball

    script:
    """
    tar czf all.tgz ${all_files}
    """
}