These are chat archives for nextflow-io/nextflow

4th
Jul 2017
Michael Milton
@TMiguelT
Jul 04 2017 06:34
Hi @pditommaso, I realise you're intending on deprecating the DNAnexus executor, but can you explain how to get the dxfs protocol working? I'm getting java.lang.IllegalArgumentException: Cannot a find a file system provider for scheme: dxfs within DNAnexus
Paolo Di Tommaso
@pditommaso
Jul 04 2017 16:16
Phil Ewels
@ewels
Jul 04 2017 16:18
Star / RT? That's a rubbish way of voting... why not use a twitter poll?
Paolo Di Tommaso
@pditommaso
Jul 04 2017 16:19
you are right, you can comment that
Maxime Garcia
@MaxUlysse
Jul 04 2017 16:23
I did complain about it ;-)
Paolo Di Tommaso
@pditommaso
Jul 04 2017 16:28
@TMiguelT Did you follow the instruction here, ./gradlew dnanexus, etc.?
@MaxUlysse anyhow what's the context? is JOBIM2017 a French conference ?
Maxime Garcia
@MaxUlysse
Jul 04 2017 17:20
Yes sorry, that's it, it the yearly french conference organized by the French Society of Bioinformatics
Paolo Di Tommaso
@pditommaso
Jul 04 2017 17:23
I didn't know it, nice
Maxime Garcia
@MaxUlysse
Jul 04 2017 17:27
A few years ago they did organized an ECCB/JOBIM in France
Maxime Garcia
@MaxUlysse
Jul 04 2017 17:35
Back to the "contest" it was indeed willingly badly designed by design for trolling purpose
Paolo Di Tommaso
@pditommaso
Jul 04 2017 17:36
Who cares .. :)
Screen Shot 2017-07-04 at 19.14.42.png
Félix C. Morency
@fmorency
Jul 04 2017 17:37
:sunglasses:
Kevin Sayers
@KevinSayers
Jul 04 2017 17:37
:clap:
Maxime Garcia
@MaxUlysse
Jul 04 2017 17:37
Indeed, no one ;-) and I do believe that is good to be able to choose a tool
Paolo Di Tommaso
@pditommaso
Jul 04 2017 17:38
I agree
Brian Reichholf
@breichholf
Jul 04 2017 18:30
Hi @pditommaso, I had that question re sourcing an R file within the nextflow file
Paolo Di Tommaso
@pditommaso
Jul 04 2017 18:31
not sure to have understood exactly the problem
Phil Ewels
@ewels
Jul 04 2017 18:32
bin/rscript.r question on twitter?
Brian Reichholf
@breichholf
Jul 04 2017 18:32
yes, phil
Phil Ewels
@ewels
Jul 04 2017 18:33
So basically anything in the bin directory of a Nextflow pipeline is automatically on the PATH
for a process
Brian Reichholf
@breichholf
Jul 04 2017 18:33
So essentially I'd like to keep some R functions in an external file, in the same gh-repository as the nextflow script. Then have something like:
functions = file('bin/rscript.R')

process doSomething {
  script:
  """
  #!/usr/bin/env Rscript

  source($functions)

  extRfunction()
  """
Phil Ewels
@ewels
Jul 04 2017 18:34
ah ok, bin is better suited for having executable scripts.
Brian Reichholf
@breichholf
Jul 04 2017 18:34
Ah, any ideas how I could solve the above?
Phil Ewels
@ewels
Jul 04 2017 18:35
In this case I'd probably put your file in any arbitrary folder and then reference it using $baseDir/myscripts/rscript.R
pretty much exactly as you have above, but define it as an input channel: input: file func from functions
(arbitrary folder inside your pipeline)
Paolo Di Tommaso
@pditommaso
Jul 04 2017 18:36
still not understanding why you need to source $functions in that way
Brian Reichholf
@breichholf
Jul 04 2017 18:36
and functions I have defined above as functions = file('$baseDir/myscript/rscript.R')?
Phil Ewels
@ewels
Jul 04 2017 18:36
I have a feeling that there's something more clever you can do with lib, but I can't remember the details
yes exactly :+1:
functions = file('$baseDir/myscript/rscript.R')

process doSomething {
  input:
  file myfunc from functions

  script:
  """
  #!/usr/bin/env Rscript

  source($myfunc)

  extRfunction()
  """
}
Brian Reichholf
@breichholf
Jul 04 2017 18:37
@pditommaso: No must have, but just want to keep the script portion cleaner if I can.
Phil Ewels
@ewels
Jul 04 2017 18:38
Any reason not to just put the whole script into bin and call it using command line variables?
That's what we usually do. Cleanest pipeline script then, and has the added bonus of having reusable scripts outside of the pipeline
Brian Reichholf
@breichholf
Jul 04 2017 18:38
I want to pass variables from process to the Rscript.
Phil Ewels
@ewels
Jul 04 2017 18:39
sure
example here
Brian Reichholf
@breichholf
Jul 04 2017 18:39
Was considering doing that through R optparse, to pass the file names in, I guess?
Phil Ewels
@ewels
Jul 04 2017 18:39
yes exactly
Paolo Di Tommaso
@pditommaso
Jul 04 2017 18:39
yes, you could pass arguments as command line options
Phil Ewels
@ewels
Jul 04 2017 18:39
we just use very basic parsing using commandArgs here
Paolo Di Tommaso
@pditommaso
Jul 04 2017 18:40
Phil Ewels
@ewels
Jul 04 2017 18:41
:+1: I suspect that we copied this very example @pditommaso ;)
Paolo Di Tommaso
@pditommaso
Jul 04 2017 18:41
ahaha, very likely
Brian Reichholf
@breichholf
Jul 04 2017 18:45
Nice. I guess after years of python argparse I'm hesitant with simple positional arguments.
The bin approach sounds best though.
Paolo Di Tommaso
@pditommaso
Jul 04 2017 18:47
If so, see optparse :)
Brian Reichholf
@breichholf
Jul 04 2017 18:48
Haven't used it yet, but am looking in to it :)
Phil Ewels
@ewels
Jul 04 2017 18:55
I had the same feeling! But as it's being called by a script I figure that positional arguments are probably ok in this situation ;)
Brian Reichholf
@breichholf
Jul 04 2017 18:56
:+1: