[[_TOC_]] ### 1. Installation procedure 1. delete any dd_venv folder ```rm -rf dd_venv``` 1. create dd_venv ```python3 -m venv dd_venv``` 1. change to dd_venv virtual environment ```source dd_venv/bin/activate``` 1. install the requirements ```python3 -m pip install -r requirements.txt``` ### 2. Setup the mongodb configuration in .env file ```shell export MONGO_HOST=localhost export MONGO_PORT=27017 export MONGO_DBNAME=ddcode export SRC_DIR="$PWD/src" ``` ### 3. Run the server ```shell source .env flask run --host=0.0.0.0 --port=5001 ``` ### 4. Leaving the virtual environment ```shell deactivate ``` ## Installation Wiki.js 1. Follow the wiki.js instructions from https://docs.requarks.io/install/linux 1. Currently, we run the wiki service in screen. 1. Add 3000 port number in ```config.yml``` ```yaml port: 3000 db: type: sqlite ``` 1. Add a port number of 3000 in the firewall ```bash sudo firewall-cmd --zone=public --add-port=3000/tcp --permanent sudo firewall-cmd --reload ``` 1. Run ```node server``` ### Backup Daily Backups should be enabled, and the backup data are located in ```/local/wiki/backup``` ### for Development To develop REST API accessed to wiki.js, use the graphql playground. * http://ddcode-srv1:3000/graphql ## Make static condensate fields in protein collection ```shell db.proteins.updateMany({}, { $set: { "condensates" : null } } ) db.proteins.aggregate( [ { $lookup: { from: 'condensates', localField: 'uniprot_id', foreignField: 'proteins', as: 'condensate' } }, { $unwind: '$condensate' }, { $group: { _id: '$_id', condensate: { $push: { data_sources: '$condensate.data_sources', name: '$condensate.name', uniquie_name: '$condensate.unique_name', species_name: '$condensate.species_name', species_tax_id: '$condensate.species_tax_id', proteins: '$condensate.proteins' } } } } ]).toArray().forEach(myDoc => { if(myDoc.condensate.length > 0) { db.proteins.updateMany({ _id: myDoc._id }, { $set: {"condensates": myDoc.condensate } }) } }) ```