Snakemake conda env path and Homer annotatePeaks.pl

Viewed 72

I would like to use HOMER annotatePeaks.pl (http://homer.ucsd.edu/homer/ngs/annotation.html) from my own defined yaml env. I need to get this Perl script:

perl /home/rj/miniconda3/envs/metylace/share/homer/.//configureHomer.pl -install hg19

where my miniconda3 path will be conda env path. Is it possible? Is there way to match current rule and conda env hash?

Long story: There is a wrapper for that but I am curious about other way. The wrapper uses the option to specify the fasta file, but HOMER has the ability to download the reference itself. However, prior to that I have call a perl script and download it. But this Perl script is somewhere in the conda env path and conda doesnt use names, but hashes. How to do it?

1 Answers

Since Snakemake will activate the environment, one should be able to use the CONDA_PREFIX environment variable to locate the directory. The other issue is that the share/homer/ directory appears to be version specific. For example, I see share/homer-4.11-0. As long as there is only one - which I think is a fair assumption - you should be able to get away with:

perl $CONDA_PREFIX/share/homer*/configureHomer.pl -install hg19
Related