Conda env installation path

905 views
Skip to first unread message

Harshil Patel

unread,
Jul 25, 2018, 12:40:37 PM7/25/18
to Nextflow
Hi Paolo,

I have created an "environment.yml" file for use with my nextflow pipeline. I have also created a separate conda profile for this as recommended. By default, nextflow installs the conda environment in "work/conda/ENV_NAME-HASH/". I need to access the path to this directory from within my "main.nf" script. Is this possible?

The installation of the environment and usage with slurm is working really well by the way. Great addition.

Any help would be really appreciated.

Cheers,

Harshil

Paolo Di Tommaso

unread,
Jul 25, 2018, 12:44:58 PM7/25/18
to nextflow
No, that's not possible b designed. Allowing the code to access the conda installation path would break the portability of the pipeline. 

What's your use case? 


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

Harshil Patel

unread,
Jul 25, 2018, 12:59:32 PM7/25/18
to Nextflow

Thanks for the quick response!

In a conda environment Picard is executed with e.g. 'picard MarkDuplicates'. However, on our cluster it is loaded as an environment module whereby it is executed with e.g. 'java -jar <PATH>/picard.jar MarkDuplicates'. I am trying to unify the execution of Picard on both platforms, and the only way I can think of doing this is to find the "picard.jar" file in the anaconda installation directory and use that in the command. The problem basically stems from the different ways in which Picard can be installed and executed.

Hope that makes sense.

Any suggestions are more than welcome.

Paolo Di Tommaso

unread,
Jul 26, 2018, 3:08:24 AM7/26/18
to nextflow
Latest version of Picard are distributed with the `picard` launcher as you are reporting. I would advice to make it also available in your cluster environment. 

Alternatively, you can create a `picard` bash wrapper in your pipeline `bin` directory and use it in your pipeline script. Your picard wrapper will need to infer the target picard installation (and execution command) by inspecting the current environment. 


Hope it helps. 


p

Harshil Patel

unread,
Jul 30, 2018, 3:08:40 PM7/30/18
to Nextflow

Hi Paolo,

Thank you! I found the 'picard' launcer command in the conda environment and as you suggested, it is just a wrapper script to run 'java -jar picard.jar'. It seems you can also pass java memory parameters to the script which is quite helpful. I am going to customise the script to become available in the PATH when the relevant picard module is loaded on our cluster. I have attached it here just in case anyone else comes across the same problem.

Cheers,

Harshil

On Thursday, 26 July 2018 08:08:24 UTC+1, Paolo Di Tommaso wrote:
Latest version of Picard are distributed with the `picard` launcher as you are reporting. I would advice to make it also available in your cluster environment. 

Alternatively, you can create a `picard` bash wrapper in your pipeline `bin` directory and use it in your pipeline script. Your picard wrapper will need to infer the target picard installation (and execution command) by inspecting the current environment. 


Hope it helps. 


p
On Wed, Jul 25, 2018 at 6:59 PM, Harshil Patel <drhp...@gmail.com> wrote:

Thanks for the quick response!

In a conda environment Picard is executed with e.g. 'picard MarkDuplicates'. However, on our cluster it is loaded as an environment module whereby it is executed with e.g. 'java -jar <PATH>/picard.jar MarkDuplicates'. I am trying to unify the execution of Picard on both platforms, and the only way I can think of doing this is to find the "picard.jar" file in the anaconda installation directory and use that in the command. The problem basically stems from the different ways in which Picard can be installed and executed.

Hope that makes sense.

Any suggestions are more than welcome.

--
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.
picard
Reply all
Reply to author
Forward
0 new messages