genotoul-bioinfo / dgenies

Dotplot large Genomes in an Interactive, Efficient and Simple way
http://dgenies.toulouse.inrae.fr
GNU General Public License v3.0
99 stars 13 forks source link

Conda and config path #12

Open abretaud opened 4 years ago

abretaud commented 4 years ago

Hello, I've made a conda package for dgenies (https://github.com/bioconda/bioconda-recipes/pull/21621). I have one problem with it: the configuration directory gets installed in $PATH_TO_CONDA_ENV/lib/python3.6/site-packages/etc/dgenies/ And it seems like there is not way to tell dgenies to look into this directory Would it be possible to make it more flexible, like using a DGENIES_CONF_DIR env variable if present?

chklopp commented 4 years ago

Hi,

The configuration path can be set in the application.properties file : https://github.com/genotoul-bioinfo/dgenies/blob/master/application.properties

entry => config_dir = ###USER###/.dgenies

Can you use this to set the directory?

abretaud commented 4 years ago

Hum, chicken and egg problem: if it doesn't find the conf file, it can't read this config_dir conf value :/

chklopp commented 4 years ago

Yes you're right.

You could try adding the location ($PATH_TO_CONDA_ENV/lib/python3.6/site-packages/etc/dgenies/) in the config_file_search array which is located at line 23 of src/dgenies/config_reader.py using os.environ["PATH_TO_CONDA_ENV"]+"/lib/python3.6/site-packages/etc/dgenies/application.properties".

florealcab commented 4 years ago

You can also copy the config file into a .dgenies folder created on top of your home directory. The script will search at this location. If you want to use the conda location, the solution given by @chklopp should work