These are chat archives for nextflow-io/nextflow

24th
Oct 2017
Simone Baffelli
@baffelli
Oct 24 2017 06:46
Good morning. Anyone has a suggestion how to use a shared R file together with nextflow? It is so easy with python....
I want to use source(myfunctions.R) from each script that nextflow uses, but I cannot find an easy way to do it.
Simone Baffelli
@baffelli
Oct 24 2017 06:59
Ok that is really ugly but works. From a script located in a certain workdir, I use source("../../../src/bin/utils.R", chdir=T). R is cool for statistics but still has a long way to go concering general purpose programming
Paolo Di Tommaso
@pditommaso
Oct 24 2017 07:26
yes a bit ugly
where the R script is supposed to be located ?
Simone Baffelli
@baffelli
Oct 24 2017 07:44
in the bin folder together with all scripts needed in the pipeline
Paolo Di Tommaso
@pditommaso
Oct 24 2017 07:45
if so you can do
source("$baseDir/bin/utils.R", chdir=T)
not sure about the chdir option in R
Simone Baffelli
@baffelli
Oct 24 2017 07:45
form whitin a script?
Paolo Di Tommaso
@pditommaso
Oct 24 2017 07:46
ahhh
Simone Baffelli
@baffelli
Oct 24 2017 07:46
it is not a stand alone command
I'm trying to modularize
Paolo Di Tommaso
@pditommaso
Oct 24 2017 07:46
not a R expert, there isn't a way to find out the path where the script is located ?
Simone Baffelli
@baffelli
Oct 24 2017 07:47
apparently not
I wish there was
Paolo Di Tommaso
@pditommaso
Oct 24 2017 07:47
an alternative is to pass baseDir as a parameter to that script
Simone Baffelli
@baffelli
Oct 24 2017 07:48
indeed
Alexander Peltzer
@apeltzer
Oct 24 2017 11:25
Hi Paolo! #489 is unfortunately still not fine :-(
At least, it doesn't work the way it should - send you the logfiles as an attachment to the Github Issue
Paolo Di Tommaso
@pditommaso
Oct 24 2017 11:57
I've replied on the issue
Bo
@wenbostar
Oct 24 2017 15:56
Is there a way to make the output message from a program print to the console immediately?
Paolo Di Tommaso
@pditommaso
Oct 24 2017 15:57
yes add echo to a specific process
or -process.echo true on the run command line for all pipeline processes
Bo
@wenbostar
Oct 24 2017 15:59
I have added the "echo true" in the process, but the output message from the program (for example, gatk) are not printed out immediately. All the messages are printed out after the program is finished.
Paolo Di Tommaso
@pditommaso
Oct 24 2017 15:59
yes, that is how it works
jobs are supposed to be executed in remote cluster/cloud nodes in a production environment
therefore the output is collected and printed when the task complete
this is just a debugging feature
Bo
@wenbostar
Oct 24 2017 16:02
OK, got it. Thanks a lot. @pditommaso
Paolo Di Tommaso
@pditommaso
Oct 24 2017 16:02
:+1:
Bo
@wenbostar
Oct 24 2017 16:28
@pditommaso , I have a process like this:https://gist.github.com/wenbostar/65935eb216c1af5ff7ef48e65e4ad4f2.
The output files of this process will be copied to finalDir, right?
Mike Smoot
@mes5k
Oct 24 2017 16:43
@baffelli we call all of our R scripts from within a container. Easy to control things that way.
Paolo Di Tommaso
@pditommaso
Oct 24 2017 17:04
@wenbostar yes
sorry @mes5k I've mistyped your name in the mail .. :)
Félix C. Morency
@fmorency
Oct 24 2017 17:05
\o/
Gratz
Paolo Di Tommaso
@pditommaso
Oct 24 2017 17:05
Tx!
Bo
@wenbostar
Oct 24 2017 17:08
@pditommaso I need to add "output:
file {"${pair_id}-platypus-annovar*"} into platypusVCFanno". If not, it doesn't work.
Paolo Di Tommaso
@pditommaso
Oct 24 2017 17:33
it's how is supposed to work, publishDir store the outputs in a directory of your choice
therefore they must be declared in the output: section
Mike Smoot
@mes5k
Oct 24 2017 17:39
You're not the first to make that mistake! :)
Paolo Di Tommaso
@pditommaso
Oct 24 2017 17:39
:)
Simone Baffelli
@baffelli
Oct 24 2017 17:47
@mes5k That makes sense, but I'm not using containers
Bo
@wenbostar
Oct 24 2017 17:57
@pditommaso , got it. Thanks a lot.
Paolo Di Tommaso
@pditommaso
Oct 24 2017 17:58
:+1: