Load modules with PBS as executor in config file

368 views
Skip to first unread message

bruce moran

unread,
Oct 3, 2017, 11:57:26 AM10/3/17
to Nextflow
Hi,

I am porting some Nextflow scripts (which run fine locally) to use with PBS. I have Modules installed, and would like to use the nextflow.config file to specify what modules are loaded globally. I have tested loading in processes, e.g.

process java_required {

       input
:
               
set sampleID, file(read1), file(read2) from reads

       output
:
               
set sampleID, file('*.fastq.gz') into next_process

       
"""
       module load jdk/1.8.0_131

       sh ${params.requireJava} in1=$read1 in2=$read2 out=$sampleID"
.fastq.gz"
       """


}

NB that loading the module in this way works, as well as the way in the docs (e.g. module 'jdk/1.8.0_131' outside of script block).

I saw an issue on Github where the user specified syntax like

module = [ 'a', 'b' ]

in the config, but in my hands this does not work. I tried inside an env{} block also, but keep getting the error based on the script being run requiring Java, which is not found.

Can someone please show their nextflow.config with PBS as executor loading modules?

Many thanks, and I am really enjoying rewriting scripts into Nextflow, it's quite intuitive and obviously powerful!

Bruce.

Paolo Di Tommaso

unread,
Oct 3, 2017, 12:04:57 PM10/3/17
to nextflow
Hi, 

You should be able to use in the config file either: 

process.$yourProcessName.module = ['a','b']


or 

process.$yourProcessName.module = 'a:b'


That is, separating the module names with a colon character.


Hope it helps 


Cheers,
Paolo



--
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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.

bruce moran

unread,
Oct 3, 2017, 12:08:03 PM10/3/17
to Nextflow
Hi Paolo,

is there any way to just load all required modules so it is not specific to process? Is the answer to that ultimately "use a container"?!

Thanks,

Bruce.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.

Paolo Di Tommaso

unread,
Oct 3, 2017, 12:11:48 PM10/3/17
to nextflow
Yes, as before but without specifying the process name eg. 

process.module = ['a','b']


Note, those module will be available only to processes execute by NF, not to the NF process itself. 

p  

To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.

bruce moran

unread,
Oct 3, 2017, 12:15:11 PM10/3/17
to Nextflow
OK, that is great, many thanks again.
Reply all
Reply to author
Forward
0 new messages