These are chat archives for nextflow-io/nextflow

12th
Mar 2018
Shellfishgene
@Shellfishgene
Mar 12 2018 09:41
I got it worked out, thanks
chdem
@chdem
Mar 12 2018 13:16
Hi everybody ! I would like use NextFlow HTTP files
but I'm behind an http proxy
usually, the languages I use check the system variables $http_proxy OR $HTTP_PROXY
Does anyone know how to do it?
chdem
@chdem
Mar 12 2018 13:21
groovy> url = 'http://mygene.info/v3/query?species=human&fields=symbol&q=refseq:NM_001082' 
groovy> test = file(url) 
groovy> println test.text 

Exception thrown

java.net.ConnectException: Connexion terminée par expiration du délai d'attente (Connection timed out)
    at nextflow.file.http.XFileSystemProvider.readHttpAttributes(XFileSystemProvider.groovy:385)
    at nextflow.file.http.XFileSystemProvider.readAttributes(XFileSystemProvider.groovy:361)
    at nextflow.file.FileHelper.visitFiles(FileHelper.groovy:723)
    at nextflow.file.FileHelper$visitFiles$1.call(Unknown Source)
    at nextflow.Nextflow.fileNamePattern(Nextflow.groovy:117)
    at nextflow.Nextflow.file(Nextflow.groovy:163)
    at nextflow.Nextflow.file(Nextflow.groovy)
    at nextflow.Nextflow$file.callStatic(Unknown Source)
    at ConsoleScript0.run(ConsoleScript0:2)
(this is from the nextflow console)
Paolo Di Tommaso
@pditommaso
Mar 12 2018 13:59
@chdem should be the same here. NF use the HTTP/S_PROXY env variables
chdem
@chdem
Mar 12 2018 14:01
OK, I've seen tests that go in that direction on the nextflow github but I wasn't sure
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:03
this the first time I see a java error stack trace in french :joy:
chdem
@chdem
Mar 12 2018 14:03
What's strange is that ithe following code works in my NextFlow script :
def mygene_info_query_url = 'http://mygene.info/v3/query?species=human&fields=symbol&q=refseq:NM_001082'
def jsonSlurper = new JsonSlurper()
def url = new URL(mygene_info_query_url)
def jsonDoc = jsonSlurper.parseText(url.text)
It always feels weird the first time! :smile:
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:03
groovy> url = 'http://mygene.info/v3/query?species=human&fields=symbol&q=refseq:NM_001082'
groovy> test = file(url)
groovy> println test.text
but the above is not NF
it's the groovy shell right ?
chdem
@chdem
Mar 12 2018 14:04
ok
the nextflow console
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:04
ah
if it could be possible that the nextflow console is not fetching properly that proxy variable
chdem
@chdem
Mar 12 2018 14:05
ah ok
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:05
but when using the run command it works, right?
chdem
@chdem
Mar 12 2018 14:07
nope, got this error :
ERROR ~ Unable to access path: /v3
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:08
this looks a different problem
chdem
@chdem
Mar 12 2018 14:08
as much for me, nothing to do with the proxy at all.
my apologies, nothing to do with the proxy at all.
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:08
ok
with the console neither ?
chdem
@chdem
Mar 12 2018 14:09
nextflow console misled me.
no, proxy problem in the console
other problem in the run command
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:09
ok, could you please open an issue on github for that ?
chdem
@chdem
Mar 12 2018 14:09
of course
Paolo Di Tommaso
@pditommaso
Mar 12 2018 14:10
thanks a lot
chdem
@chdem
Mar 12 2018 14:10
you're welcome!
chdem
@chdem
Mar 12 2018 14:22
There you go!
Vladimir Kiselev
@wikiselev
Mar 12 2018 18:28
@pditommaso , what’s the easiest way to create a channel from lines of a file?
Vladimir Kiselev
@wikiselev
Mar 12 2018 18:35
ok, thanks, found this example:
Channel
     .fromPath('test.txt')
     .splitText()
     .subscribe { print it }
Fredrik Boulund
@boulund
Mar 12 2018 20:00
Hi! Is it possible to conditionally input a file to a process?
I want to input a file to a process based on a user-configurable setting, but if the user doesn't specify any file, I don't want to stage a file at all.
Something like
process filter {
    input:
    set pair_id, file(fastq) from input_fastq

    script:
    filter_argument  = ""
    if (params.filter_seqs) { 
         filter_argument = "--filter ${params.filter_seqs}"
    }
    """
    filter --input $fastq $filter_argument
    """
}
Fredrik Boulund
@boulund
Mar 12 2018 20:10
I wonder if that shows what I mean. I want it so that if the user doesn't specify params.filter_seqs (a FASTA file in this example), the command is run without the --filter argument. But now, for the tricky part, if the user does specify params.filter_seqs, can I make Nextflow stage the file properly in the process execution context, as if there was a second line in the input:declaration? ...