Skip to content
Snippets Groups Projects

1. Installation procedure

  1. delete any dd_venv folder
    rm -rf dd_venv
  2. create dd_venv
    python3 -m venv dd_venv
  3. change to dd_venv virtual environment
    source dd_venv/bin/activate
  4. 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

  1. Follow the wiki.js instructions from https://docs.requarks.io/install/linux
  2. Currently, we run the wiki service in screen.
  3. Add 3000 port number in config.yml
    port: 3000
    db:
     type: sqlite
  4. Add a port number of 3000 in the firewall
    sudo firewall-cmd --zone=public --add-port=3000/tcp --permanent
    sudo firewall-cmd --reload
  5. 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 } })
   }
})