These are chat archives for nextflow-io/nextflow

26th
Nov 2018
Maxime HEBRARD
@mhebrard
Nov 26 2018 06:38
hello. I have a channel containing lists of items. I wish to get the list of lists as one unique input [[a,b], [c,d],[e,f]]. I try to use collect() but that flatten all my items...
#!/usr/bin/env nextflow
Channel.from(['a', 'b'], ['c', 'd'], ['e', 'f']).into{chArrays; chCollect}

process procFirst {
input: val arr from chArrays
output: stdout into chFirstOut
"""
printf "F_${arr}_"
"""
}

process procSecond {
input: val col from chCollect.collect()
output: stdout into chSecondOut
"""
printf "S_${col}_"
"""
}

chFirstOut.subscribe{ println it }
chSecondOut.subscribe( println it }
Johan Viklund
@viklund
Nov 26 2018 08:15
I get an Access Denied response from https://get.nextflow.io
Both locally and on travis.
Paolo Di Tommaso
@pditommaso
Nov 26 2018 08:35
oops, should be fine now
Johan Viklund
@viklund
Nov 26 2018 09:39
Thanks
Paolo Di Tommaso
@pditommaso
Nov 26 2018 10:08
@viklund thanks for reporting it!
Tobias Neumann
@t-neumann
Nov 26 2018 11:33
hi guys. so I'm collaboration with industry on a nextflow workflow we would like to publish which enables pulling pipelines from git. for this to run for them in-house, they however would need a private config file which ought not to be published to run the workflow on their infrastructure. is there an elegant way to solve this or this impossible?
micans
@micans
Nov 26 2018 11:38
@mhebrard does toList() do what you need? I think it does. Both these work for me: input: val col from chCollect.collect{ [ it ] } and input: val col from chCollect.toList(). There may be subtleties I miss.
Rad Suchecki
@rsuchecki
Nov 26 2018 11:42
@t-neumann this could potentially be controlled by adding/overwriting settings via -params-file pointing to a local JSON/YAML
Tobias Neumann
@t-neumann
Nov 26 2018 11:44
@rsuchecki ok but this would require a separate local config file that is not versioned within the same repo right
Rad Suchecki
@rsuchecki
Nov 26 2018 11:45
yes, thought that is the point?
Tobias Neumann
@t-neumann
Nov 26 2018 11:46
yes. one would have to keep the config minimal though so to have most of the options in a general config and only overwrite the few environment specific ones
Paolo Di Tommaso
@pditommaso
Nov 26 2018 11:47
the private git credentials should be kept in the local scm file, what's wrong with that?
Tobias Neumann
@t-neumann
Nov 26 2018 11:48
no we don't want to have a private git repository, only the company-specific profile settings from the config should not be public
Paolo Di Tommaso
@pditommaso
Nov 26 2018 11:52
keep that profile in local config file eventually in the $HOME/.nextflow/config, we discussed about this right?
Tobias Neumann
@t-neumann
Nov 26 2018 11:53
yes. and this one needs to stay out of the nextflow git repo right
Paolo Di Tommaso
@pditommaso
Nov 26 2018 11:54
the $HOME/.nextflow/config is meant for that
Tobias Neumann
@t-neumann
Nov 26 2018 11:55
ok thanks. that's what I thought
Paolo Di Tommaso
@pditommaso
Nov 26 2018 11:55
:ok_hand:
Daniel E Cook
@danielecook
Nov 26 2018 14:46
Does anyone know an easy way to get the basename of a file in groovy? I am trying to import commons-io (apache library). Despite having it on my CLASSPATH I cannot import into nextflow
Paolo Di Tommaso
@pditommaso
Nov 26 2018 14:49
Despite having it on my CLASSPATH I cannot import into nextflo
You are supposed to use NXF_CLASSPATH to extend NF classpath
note, it also support maven style coordinates
Lukas Jelonek
@lukasjelonek
Nov 26 2018 15:01

or use the groovy grape mechanism by adding this annotation to your import statement:

@Grab(group='commons-io', module='commons-io', version='2.6')

This will automatically download the dependency from maven central and put it on your classpath

Paolo Di Tommaso
@pditommaso
Nov 26 2018 15:01
+1, I tend to forget
Daniel E Cook
@danielecook
Nov 26 2018 15:08
@lukasjelonek very slick thanks! Thanks @pditommaso also!
Paolo Di Tommaso
@pditommaso
Nov 26 2018 15:12
:v:
Tobias "Tobi" Schraink
@tobsecret
Nov 26 2018 21:10
This message was deleted
Tobias "Tobi" Schraink
@tobsecret
Nov 26 2018 21:16
@danielecook in case you need to use it sometime down the line, the base name of a file object is given through the .baseName property:
refs = Channel.from( file('reference.fa'))

process index_ref {
    input:
    reference from refs
   output:
   set file(reference), file("${reference.baseName}.*") into indexed_refs

    script:
   """bwa index $reference"""