These are chat archives for nextflow-io/nextflow

9th
May 2017
Shellfishgene
@Shellfishgene
May 09 2017 08:15
What is the scope of $baseDir? I have a .copyTo($baseDir) statement at the end of my pipeline, but it does not exist there.
Paolo Di Tommaso
@pditommaso
May 09 2017 08:48
baseDir is the folder where the main script is located
Phil Ewels
@ewels
May 09 2017 08:48
I came across the same thing the other day - I think that workflow.projectDir is equivalent and has wider scope..?
Paolo Di Tommaso
@pditommaso
May 09 2017 08:49
exactly
Use e a relative path if you want to copy a file in the current work dir
Shellfishgene
@Shellfishgene
May 09 2017 08:53
Thanks, that's what I needed.
Paolo Di Tommaso
@pditommaso
May 09 2017 08:53
note that you need $ only to interpolate variables in a string (like in BASH)
Shellfishgene
@Shellfishgene
May 09 2017 08:54
so workflow.projectDir is a string not a file object?
ah, it is, just saw the example in the docs
Paolo Di Tommaso
@pditommaso
May 09 2017 08:55
no, it's a file object
Shellfishgene
@Shellfishgene
May 09 2017 08:55
ok
Nicholas Sanderson
@nickdsanderson_twitter
May 09 2017 10:13
Hi, I'm having issues with watchPath and glob when using . For example .watchPath( '/home/nick/files//.txt' ) gives the error: WARN: Cannot watch a not existing path: /home/nick/files/* -- Make sure that path exists and it is a directory
Sorry, there was supposed to be two asterisks there
Paolo Di Tommaso
@pditommaso
May 09 2017 12:06
@nickdsanderson_twitter I'm not able to replicate it, can you provide the exact code snippet you are running ?
Nicholas Sanderson
@nickdsanderson_twitter
May 09 2017 12:11

`#!/usr/bin/env nextflow

txts=Channel
.watchPath( 'files/*/txt' )

process echoTest {

    input:
    val t from txts


    """
    echo ${t}
    """

}
`

Sorry, this isn't copying my code correctly. There are supposed to be two asterisks after files and one before txt
#!/usr/bin/env nextflow

txts=Channel
        .watchPath( 'files/**/*txt' )



process echoTest {

        input:
        val t from txts


        """
        echo ${t}
        """
}
Paolo Di Tommaso
@pditommaso
May 09 2017 12:19
I see, it looks a bug. Could you please open a issue on the project GH repository ?
Nicholas Sanderson
@nickdsanderson_twitter
May 09 2017 12:22
OK, have done, thanks for looking
Paolo Di Tommaso
@pditommaso
May 09 2017 12:22
Great thanks
flomock
@flomock
May 09 2017 13:18
Hey, if i run multiple docker container with nextflow, how do i get them to communicate with each other?
I started the containers with docker-compose up, so they are all together in one virtual network. But it seems that nextflow starts its own containers which doesn't provided a virtual network.
Paolo Di Tommaso
@pditommaso
May 09 2017 13:19
we don't manage this by design
each process execution is supposed to be stateless and can interact with other processes only by using in/out channels
flomock
@flomock
May 09 2017 13:20
hmm thats a pity, but thanks
Félix C. Morency
@fmorency
May 09 2017 14:03
is there a way to force NF to download the input files locally when using a scratch?
Paolo Di Tommaso
@pditommaso
May 09 2017 14:06
instead of creating a symlink ?
Félix C. Morency
@fmorency
May 09 2017 14:06
yes
Paolo Di Tommaso
@pditommaso
May 09 2017 14:06
yes
Félix C. Morency
@fmorency
May 09 2017 14:06
perfect! thanks!
what's the default for stageOut?
Paolo Di Tommaso
@pditommaso
May 09 2017 14:07
copy
Félix C. Morency
@fmorency
May 09 2017 14:08
awesome, thanks
Paolo Di Tommaso
@pditommaso
May 09 2017 14:10
:+1:
Maarten van Gompel
@proycon
May 09 2017 16:53
How do I get the baseName for a double extension like .tar.gz? Say I have input: file archive from ... and I want output: file "${archive.baseName}.txt" into .... .. (e.g. foo.tar.gz -> foo.txt ?
(instead of foo.tar.gxt which is what I would get now I reckon)
Paolo Di Tommaso
@pditommaso
May 09 2017 16:56
I can't check now
Try .getBaseName(2) instead of .baseName
Maarten van Gompel
@proycon
May 09 2017 16:59
thanks, gonna give it a try
yep, works
Bili Dong
@qobilidop
May 09 2017 20:20

Hi, I'm a new user of Nextflow. When I'm writing my first workflow, I get some errors that I don't know how to fix. Could someone help me? Here's my nf script:

#!/usr/bin/env nextflow

jobs = Channel.from(0..3)

process simple {
    publishDir 'results'

    input:
    val x from jobs

    output:
    file '${x}.txt' into results

    """
    echo ${x} > ${x}.txt
    """
}

Here's the traceback of the error:

N E X T F L O W  ~  version 0.24.3
Launching `main.nf` [ecstatic_mahavira] - revision: 314588ad90
[warm up] executor > local
[32/821d71] Submitted process > simple (2)
[be/8b45bd] Submitted process > simple (4)
[e6/4888c7] Submitted process > simple (3)
[70/0ffcfc] Submitted process > simple (1)
ERROR ~ Error executing process > 'simple (4)'

Caused by:
  Missing output file(s) `${x}.txt` expected by process `simple (4)`

Command executed:

  echo 3 > 3.txt

Command exit status:
  0

Command output:
  (empty)

Work dir:
  /Users/qobilidop/github/nextflow-on-tscc/work/be/8b45bdae537a47b81ea4511ddb0385

Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`

 -- Check '.nextflow.log' file for details
WARN: Killing pending tasks (1)
Mike Smoot
@mes5k
May 09 2017 20:22

Make the quotes double quotes instead of single quotes:

    output:
    file "${x}.txt" into results

This gets me all the time. I blame python.

Bili Dong
@qobilidop
May 09 2017 20:22
Thank you very much!
I'm also a Python user used to the single quotes.
Mike Smoot
@mes5k
May 09 2017 20:26
groovy shouldn't be too hard if you're familiar with python.
Bili Dong
@qobilidop
May 09 2017 20:28
I agree with you. I feel they are similar in many aspects.
Paolo Di Tommaso
@pditommaso
May 09 2017 20:29
except tabs :grin:
Bili Dong
@qobilidop
May 09 2017 20:29
haha
Paolo Di Tommaso
@pditommaso
May 09 2017 20:29
welcome in the community Bili
Bili Dong
@qobilidop
May 09 2017 20:30
:)
Paolo Di Tommaso
@pditommaso
May 09 2017 20:30
are in you in research or profit org if I can ask ?
Bili Dong
@qobilidop
May 09 2017 20:31
I'm a graduate student in UC San Diego
Paolo Di Tommaso
@pditommaso
May 09 2017 20:32
great, hope you will find NF useful
Bili Dong
@qobilidop
May 09 2017 20:33
so far it looks great, I feel it's the tool I'm looking for
Paolo Di Tommaso
@pditommaso
May 09 2017 20:33
:+1:
Bili Dong
@qobilidop
May 09 2017 20:36
I've watched your video on Nextflow. It's true you're here 24h! @pditommaso
Paolo Di Tommaso
@pditommaso
May 09 2017 20:38
not at all, I have some breaks from time to time for physiological needs :joy: