DRAM icon indicating copy to clipboard operation
DRAM copied to clipboard

DRAM database config should be accessible / configurable by users

Open gregvonkuster opened this issue 3 years ago • 2 comments

The DRAM database config file is restricted from users - it is written and maintained fully within the DRAM code (e.g., https://github.com/WrightonLabCSU/DRAM/blob/a5f225718c5ff312ec8ccaefbb61daaa12452705/mag_annotator/database_handler.py#L28-L33).

Storing / maintaining the config file in the DRAM installation directory (e.g., ~/_conda/envs/[email protected]/lib/python3.10/site-packages/...) does not work for all installations, and is most difficult when installed on HPC cluster environments.

More difficulties arise because the DRAM-setup.py set_database_locations script requires the database to be actually located in the "new" location prior to the script being run.

Making the config file a simple text file (e.g., xml, yaml, etc) that the user can edit would make DRAM installations much easier to maintain. It would also likely eliminate many of the open issues related to the config file (e.g., https://github.com/WrightonLabCSU/DRAM/issues/196, https://github.com/WrightonLabCSU/DRAM/issues/171, https://github.com/WrightonLabCSU/DRAM/issues/157, https://github.com/WrightonLabCSU/DRAM/issues/152, etc).

gregvonkuster avatar Sep 05 '22 15:09 gregvonkuster

An option to specify a config file at run time is already in dram1.4 and will be available in the coming weeks.

rmFlynn avatar Sep 07 '22 20:09 rmFlynn

Awesome! Thanks!

gregvonkuster avatar Sep 07 '22 20:09 gregvonkuster

Are we now able to specify a config file?

Aiswarya-prasad avatar Nov 07 '22 06:11 Aiswarya-prasad

@Aiswarya-prasad if you have upgraded to DRAM1.4 then yes use --help to see all options but to check version use DRAM-setup.py version to specify the config use --config_loc with DRAM.py or DRAM-v.py or set the environment variable DRAM_CONFIG_LOCATION.

rmFlynn avatar Nov 07 '22 15:11 rmFlynn

Great. Where will I find the documentation detailing how the config file must be formatted? I see the following warning using this option (v1.4.0)

/scratch/aprasad/built-envs/358e2aba62b05c15419547f98620f6d9/lib/python3.10/site-packages/mag_annotator/database_handler.py:74: UserWarning: The DRAM version in your config is empty. This may not be a problem, but if this import fails then you should check that the origin of the file is valid.
  warnings.warn("The DRAM version in your config is empty."
/scratch/aprasad/built-envs/358e2aba62b05c15419547f98620f6d9/lib/python3.10/site-packages/mag_annotator/database_handler.py:136: UserWarning: Database does not exist at path None
  warnings.warn('Database does not exist at path %s' % self.config.get('description_db'))

Aiswarya-prasad avatar Nov 08 '22 14:11 Aiswarya-prasad

Well, you can get the empty config here: https://github.com/WrightonLabCSU/DRAM/blob/master/mag_annotator/CONFIG

That said, most people would probably be making new configs with dram1.4 and exporting them. The warnings seem to be clipped, but if you are using a config from a past version of dram, then that error should tell you that it is older and everything should be fine. The description db is a problem, this could be an incomplete setup run. In any case, DRAM-setup.py --update_descriptiondb will fix that, it may be a slightly different command I am pulling that from memory.

rmFlynn avatar Nov 08 '22 15:11 rmFlynn