Import parameters from another file (or other variables)

觀看次數:843 次
跳至第一則未讀訊息

Z

未讀,
2018年11月15日 上午6:58:2415/11/2018
收件者︰ Nextflow
Hello Paolo,

I hope you're doing good !

I tried to search if someone asked this question previously but I couldn't find anything. Let's say I have a main.nf that contains the parameters defined at the top along other variables and a nextflow.config. I tried to create a params.config and put them inside the file. Then I edited nextflow.config to includeConfig "params.config".  Is there a way to tell Nextflow that the parameters given at the terminal are for params.config and not for main.nf ?

Thanks !

Z

未讀,
2018年11月15日 上午8:50:2915/11/2018
收件者︰ Nextflow
Oh and I have another question please. As you know, I am using SLURM to run my jobs. When I use publishDir, the outputs are copied/moved to the local path given. How can I tell Nextflow to pass the path of publishDir to SLURM and outputs the results in the directory of the compute node instead of a local directory. if it is not possible, then I guess it must be a shared directory too ?

Paolo Di Tommaso

未讀,
2018年11月15日 上午9:02:2015/11/2018
收件者︰ next...@googlegroups.com
> Is there a way to tell Nextflow that the parameters given at the terminal are for params.config and not for main.nf ?

Quick answer: no. 

p
 

--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.

Paolo Di Tommaso

未讀,
2018年11月15日 上午9:03:4215/11/2018
收件者︰ next...@googlegroups.com
> How can I tell Nextflow to pass the path of publishDir to SLURM and outputs the results in the directory of the compute node instead of a local directory

This does not make much sense for what publishDir is designed for. 


p

--

Z

未讀,
2018年11月15日 上午11:08:5215/11/2018
收件者︰ Nextflow
Hey Paolo,

Sorry could you please explain me what do you mean by that ? Maybe I didn't explain myself better. I am using publishDir to output my results in a particular directory. When using SLURM, he publishes the results in a path on the controller node (local) instead of the computing nodes directory (remote).

Thanks !

Paolo Di Tommaso

未讀,
2018年11月19日 上午2:00:2819/11/2018
收件者︰ next...@googlegroups.com
The publishDir is not aware if the path is local or remote. Therefore if you want that files in a remote directory, you need to provide a shared file system path (accessible from the computing node) that allows you to write that files remotely. 


p

Steve

未讀,
2018年11月28日 上午11:46:3528/11/2018
收件者︰ Nextflow
In regards to "importing parameters from another file", I have found it useful to import from a JSON file instead. Example usage here:

The basic code would look something like this:


import groovy.json.JsonSlurper
def jsonSlurper = new JsonSlurper()


// new File object from your JSON file

def ConfigFile = new File("config.json")


// load the text from the JSON

String ConfigJSON = ConfigFile.text


// create a dictionary object from the JSON text

def myConfig = jsonSlurper.parseText(ConfigJSON)


// access values in the dict
log
.info "Some val: ${myConfig.some_val}"

Paolo Di Tommaso

未讀,
2018年11月29日 上午3:30:3229/11/2018
收件者︰ next...@googlegroups.com
This is a good candidate for the patterns page 



p

--
回覆所有人
回覆作者
轉寄
0 則新訊息