Skip to content

5. Managing, updating or moving a DRAM installation and databases

Rory M Flynn edited this page Nov 2, 2022 · 2 revisions

Here we outline the commands in DRAM-setup.py that can be use to manage your DRAM installation and DRAM databases. DRAM the tool and the DRAM databases can be managed separately. When you want to update DRAM because of a new release you do not want to have to regenerate the databases so we provide tools to save the DRAM CONFIG file and then use that file in the new installation. There are also methods to set database locations if you move them around on your server and to update the DRAM forms used in distillation only.

Understanding your DRAM installation

To see the version of DRAM you can use DRAM-setup.py version. To see where DRAM looks for your databases use DRAM-setup.py print_config.

Updating your DRAM installation

There is a new version of DRAM out! Isn't that exciting? Now you need to update your installation but you definitely do not want to have to rebuild your databases. That takes 12 hours and 512 GB of RAM! With DRAM-setup.py you don't need to. Here are the steps to save your DRAM configuration and then add it to the updated installation.

  1. Save your CONFIG file

The CONFIG file is how DRAM knows where the databases are. After initial database processing I recommend saving a copy of this somewhere so that if anything goes wrong with your DRAM installation you can just pop in your saved CONFIG.

DRAM-setup.py export_config --output_file ~/DRAM_CONFIG

You can replace ~/DRAM_CONFIG with the name and location to store this file of your choice.

  1. Update your DRAM installation

Here you will update your DRAM installation. How you do this will depend on how you installed DRAM and how you want to install DRAM now.

Install DRAM from pypi (pip)

pip will most likely have the most up to date stable release of DRAM.

pip install -U DRAM-bio

Install DRAM from conda

conda will manage the DRAM dependencies for you.

conda update DRAM

Install from GitHub

GitHub will always have the most up to date version of DRAM including unstable versions with bug fixes and new features.

# if already have a clone of the DRAM repository then replace with git pull from inside DRAM directory
git clone https://github.com/WrightonLabCSU/DRAM.git
cd DRAM
pip install .
  1. Replace the CONFIG from the new installation with your CONFIG

Now you can take your exported DRAM config and add it to the upgraded installation. This way you will have all the same databases you had before already full processed and will be ready to start annotating.

DRAM-setup.py import_config --config_loc ~/DRAM_CONFIG

If you saved your CONFIG somewhere else then you will need to swap out ~/DRAM_CONFIG with where you had saved the CONFIG file.

Updating the DRAM distillation forms

DRAM not only uses external databases but also uses forms with metabolism information that are an integral part to DRAM distillation. These are often updated in DRAM releases. So you may want to update these forms but not have to reprocess all the rest of your databases. DRAM-setup.py has a method to do this.

DRAM-setup.py update_dram_forms --output_dir ~/DRAM_dbs

Replace ~/DRAM_dbs with wherever your DRAM databases are stored or another location if desired.

Moving your DRAM databases

If you have to move the DRAM databases to a different server location or a different server then you will need to tell DRAM where to look for the databases. You will have to set the location of all databases and with this command they will be updated in the DRAM CONFIG file. If you want to update a single database you can also use this to set the location of the updated database after manual processing. Additionally if you do add a new version of a database then you need to also use the --update_description_db flag so that the database of descriptions is updated with any new entries.

To update the location of databases in the DRAM CONFIG file you use the DRAM-setup.py set_database_locations command. Here are all the database location you can set using this command.

usage: DRAM-setup.py set_database_locations [-h] [--kegg_db_loc KEGG_DB_LOC]
                                            [--kofam_hmm_loc KOFAM_HMM_LOC]
                                            [--kofam_ko_list_loc KOFAM_KO_LIST_LOC]
                                            [--uniref_db_loc UNIREF_DB_LOC]
                                            [--pfam_db_loc PFAM_DB_LOC]
                                            [--pfam_hmm_dat PFAM_HMM_DAT]
                                            [--dbcan_db_loc DBCAN_DB_LOC]
                                            [--dbcan_fam_activities DBCAN_FAM_ACTIVITIES]
                                            [--vogdb_db_loc VOGDB_DB_LOC]
                                            [--vog_annotations VOG_ANNOTATIONS]
                                            [--viral_db_loc VIRAL_DB_LOC]
                                            [--peptidase_db_loc PEPTIDASE_DB_LOC]
                                            [--description_db_loc DESCRIPTION_DB_LOC]
                                            [--genome_summary_form_loc GENOME_SUMMARY_FORM_LOC]
                                            [--module_step_form_loc MODULE_STEP_FORM_LOC]
                                            [--etc_module_database_loc ETC_MODULE_DATABASE_LOC]
                                            [--function_heatmap_form_loc FUNCTION_HEATMAP_FORM_LOC]
                                            [--amg_database_loc AMG_DATABASE_LOC]
                                            [--update_description_db]

optional arguments:
  -h, --help            show this help message and exit
  --kegg_db_loc KEGG_DB_LOC
                        mmseqs2 database file from kegg .pep file (default:
                        None)
  --kofam_hmm_loc KOFAM_HMM_LOC
                        hmm file for KOfam, already processed with hmmpress
                        (default: None)
  --kofam_ko_list_loc KOFAM_KO_LIST_LOC
                        KOfam ko list file (default: None)
  --uniref_db_loc UNIREF_DB_LOC
                        mmseqs2 database file from uniref .faa (default: None)
  --pfam_db_loc PFAM_DB_LOC
                        mmseqs2 database file from pfam .hmm (default: None)
  --pfam_hmm_dat PFAM_HMM_DAT
                        pfam hmm .dat file to get PF descriptions (default:
                        None)
  --dbcan_db_loc DBCAN_DB_LOC
                        hmm file for dbcan, already processed with hmmpress
                        (default: None)
  --dbcan_fam_activities DBCAN_FAM_ACTIVITIES
                        CAZY family activities file (default: None)
  --vogdb_db_loc VOGDB_DB_LOC
                        hmm file for vogdb, already processed with hmmpress
                        (default: None)
  --vog_annotations VOG_ANNOTATIONS
                        vog annotations file (default: None)
  --viral_db_loc VIRAL_DB_LOC
                        mmseqs2 database file from ref seq viral gene
                        collection (default: None)
  --peptidase_db_loc PEPTIDASE_DB_LOC
                        mmseqs2 database file from MEROPS database (default:
                        None)
  --description_db_loc DESCRIPTION_DB_LOC
                        Location to write description sqlite db (default:
                        None)
  --genome_summary_form_loc GENOME_SUMMARY_FORM_LOC
                        File path to genome summary form (default: None)
  --module_step_form_loc MODULE_STEP_FORM_LOC
                        File path to module step form (default: None)
  --etc_module_database_loc ETC_MODULE_DATABASE_LOC
                        File path to etc module database (default: None)
  --function_heatmap_form_loc FUNCTION_HEATMAP_FORM_LOC
                        File path to function heatmap form (default: None)
  --amg_database_loc AMG_DATABASE_LOC
                        File path to amg database (default: None)
  --update_description_db