# BeeDeeM configuration

## *BeeDeeM* installation directory

Whatever the installation used, BeeDeeM is located within a directory, hereafter calle *${installDir}*.

The *BeeDeeM* directory *${installDir}* is organised as follows (Linux/OSX defaults):

<table><thead><tr><th width="207.33333333333331">Directory</th><th width="288">Content</th><th>Default value</th></tr></thead><tbody><tr><td><em>${installDir}</em></td><td>Home directory of <em>BeeDeeM</em></td><td>/opt/beedeem  (1)</td></tr><tr><td><em>${installDir}/bin</em></td><td>Java libraries for <em>BeeDeeM</em> and its dependencies</td><td><em>${installDir}</em>/bin</td></tr><tr><td><em>${installDir}/external</em></td><td>Native binaries (such as makeblastdb) for Linux, MacOSX or Windows</td><td><em>${installDir}</em>/external</td></tr><tr><td><em>${descriptors}</em></td><td>Directory containing particular files called: <strong>databank descriptor files</strong>. These files instruct the software how to install databanks. </td><td><em>${installDir}</em>/conf/descriptors</td></tr><tr><td>${scripts)</td><td>Databank descriptors additional pre- and post-processing tasks</td><td><em>${installDir}</em>/conf/scripts</td></tr></tbody></table>

(1) Default values for Legacy, Docker or Singularity installation ; Conda may use a different path.

## BeeDeeM additional directories

| Directory           | Description                                                                                                  | Default value                          |
| ------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------- |
| ${*biobaseRootDir}* | The place where all banks are installed. Inside that directory, BeeDeeM creates and manages sub-directories. | See "Master configuration file", below |
| ${*workingDir*}     | Used by BeeDeeM to create log files, temporary files, *etc.*                                                 | See "Working directory", below         |

## Master configuration file

By default, *BeeDeeM* is configured by a master configuration file located in *${installDir}/conf:* **dbms.config**. Content of this file is setup during software installation. This text file contents a set of key/value pairs and is documented, so quite easy to understand.

Actually, there is a single very important key/value to look at : `mirror.path`. That key defines the path to ${*biobaseRootDir}. +*

You have three options to (re)define the value associated to that key:

* by editing dbms.config; suitable for legacy installation, it is more difficult to use that solution for any other installations of BeeDeeM, i.e. Conda, Docker or Singularity;
* by setting JRE argument `KL_mirror.path`(1); \
  &#x20;e.g. by editing `bdm` master command-line script and setting: \
  `java .../... -DKL_mirror.path=/a/new/path/to/bank/repository`
* by setting `KL_mirror__path` (2) environment variable; \
  e.g. for bash shell: `export KL_mirror__path=/a/new/path/to/bank/repository`

&#x20;    *(1) variable names are case sensitive;*\
&#x20;    *(2) there are indeed two underscore characters between "mirror" and "path", this is NOT a typo.*

The latter solution is realy the most recommended one to use with Conda, Docker or Singularity installation of BeeDeeM.

It is worth noting that environment variable declaration takes priority over JRE -D declaration that takes priority over dbms.config file declaration.

## Working directory

*BeeDeeM* relies on a dedicated directory to store all its working files: log files, temporary files, etc. By default, that directory is set within `bdm` master command script file (located in *${installDir}*) by variable: `KL_WORKING_DIR`.

You can change the location of that directory at any time using the following declaration (bash shell) before starting BeeDeeM:

&#x20;    `export KL_WORKING_DIR=/a/new/path/to/workdir`.

## Additional configuration controls

Additional `KL_` prefixed variable names exist to easity setup BeeDeeM. As for `KL_mirror__path` and `KL_WORKING_DIR`, these additional `KL_` variables can be setup using one of:

* `export KL_XXX=a_value`
* `java .../... -DKL_XXX=a_value`

And again, shell variable declaration takes priority over JRE -D declaration.

### Log file

The following variables control the creation of BeeDeeM log files:

| Variable      | Role                          | Default                                                       |
| ------------- | ----------------------------- | ------------------------------------------------------------- |
| KL\_LOG\_TYPE | one of: none, console or file | file                                                          |
| KL\_LOG\_FILE | name of log file              | If not set, BeeDeeM creates a log file using sub-command name |
| KL\_DEBUG     | one of: true or false         | false                                                         |

### Configuration directory

By default, BeeDeeM locates bank descriptors in *${descriptors} (see above).* In case you would like to use your own configuration directory (e.g. containing new bank descriptors), you can tell BeeDeeM to use that directory as follows:

`KL_CONF_DIR=/path/to/new/conf_dir`&#x20;

Such a path must target all expected configuration sub-directories: system, scripts, descriptors. The very easy way to achieve that consists in copying the standard BeeDeeM "conf" directory, then update that copy to meet your needs.
