- 1. Installation procedure
- 2. Setup the mongodb configuration in .env file
- 3. Run the server
- 4. Leaving the virtual environment
- Installation Wiki.js
- Make static condensate fields in protein collection
1. Installation procedure
- delete any dd_venv folder
rm -rf dd_venv
- create dd_venv
python3 -m venv dd_venv
- change to dd_venv virtual environment
source dd_venv/bin/activate
- install the requirements
python3 -m pip install -r requirements.txt
2. Setup the mongodb configuration in .env file
export MONGO_HOST=localhost
export MONGO_PORT=27017
export MONGO_DBNAME=ddcode
export SRC_DIR="$PWD/src"
3. Run the server
source .env
flask run --host=0.0.0.0 --port=5001
4. Leaving the virtual environment
deactivate
Installation Wiki.js
- Follow the wiki.js instructions from https://docs.requarks.io/install/linux
- Currently, we run the wiki service in screen.
- Add 3000 port number in
config.yml
port: 3000 db: type: sqlite
- Add a port number of 3000 in the firewall
sudo firewall-cmd --zone=public --add-port=3000/tcp --permanent sudo firewall-cmd --reload
- 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.
Make static condensate fields in protein collection
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 } })
}
})