ModelDB is a computational neuroscience resource seeking to facilitate discovery of modeling work, analyses of the work, and meta-analyses of the relationship between models.
This is the development repository for the redesign of ModelDB intended to be launched in summer 2020.
Primary goals of this redesign include:
Pull requests are welcome. Please make an issue first so we understand the problem solved or feature being added by the pull request.
This repository is currently intended to be bootstrapped from the classic EAV/CR version of ModelDB. One approach to do so follows:
Download the bitnami django stack OVA
Import it into a virtual machine such as VirtualBox
Install the community edition of MongoDB following these directions
Create a MongoDB account with readwrite access to a specific database (for simplicity, you may want to call it modeldb
)
mongo
use modeldb
create the user:
db.createUser({ user: "username", pwd: "password", roles: [{role: "userAdmin", db:"modeldb"}]})
Install git so you can clone this repository, if it's not already installed sudo apt install git
Clone this repository
Install Python dependencies (sudo pip3 install -r requirements.txt
)
Create four directories for storing (1) the model zip files, (2) private model zip files, (3) unprocessed references, (4) modelview data.
Create a settings file in the exact path /home/bitnami/modeldb-settings.json
. It should have values for:
secret_key
(I'm unclear on if there are any rules on this, but I guess a random 50 character string should work)mongodb_user
mongodb_pw
db_name
-- set this to modeldb
or whatever you called the database you wish to use.modeldb_zip_dir
modeldb_private_zip_dir
unprocessed_refs_dir
modelview_dir
metadata-predictor-rules
(points to a file with predictor rules; you can use the one in resources
)smtp_server
(optional, but required for sending mail)smtp_user
(optional, but required for sending mail)smtp_password
(optional, but required for sending mail)news
(optional, but a file listed here will be used for filling out the news section of the homepage)Run the scripts in the extract_data
directory in this order:
init_db.py
extract_data.py
get-zips.py
setup_cell_links.py
setup_trees.py
get_icg_mapping.py
get_file_hashes.py
sync_neuron_dict.py
Apply the django migrations
python3 manage.py migrate
You will also want to use django admin to create a user with admin permissions from within the
shell you get via python3 manage.py shell
.
Example from: https://docs.djangoproject.com/en/3.0/topics/auth/default/#creating-users
from django.contrib.auth.models import User
user = User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')
Pull links to biosimulations: python3 pull_biosimulations.py
(in the extract_data
folder). The website will still work without this, you just won't get any links to biosimulations.org
Insert static links to Open Source Brain: python3 pull_opensourcebrain.py
(in the extract_data
folder)
You can run a development server via, e.g. python3 manage.py runserver 8888
sudo /opt/bitnami/ctlscript.sh restart apache
to restartProject
instead of modeldb2020
, you should
change modeldb2020.settings
to Project.settings
TEMPLATES["DIRS"]
The analysis
folder contains scripts for analyzing ModelDB in ways that may
or may not be supported in the web interface. It includes:
metadata_repeat_list.py
-- provides a list of all used metadata; combine with a free word-cloud generator to visualizeYou can gather a morphology suitable for frontpage display via
result = []
for sec in h.allsec():
xs = [sec.x3d(i) for i in range(sec.n3d())]
ys = [sec.y3d(i) for i in range(sec.n3d())]
zs = [sec.z3d(i) for i in range(sec.n3d())]
ds = [sec.diam3d(i) for i in range(sec.n3d())]
arcs = [sec.arc3d(i) for i in range(sec.n3d())]
result.append([xs, ys, zs, ds, arcs])
but note that in order to color by segment, you need each piece of result to correspond to a segment instead of to a section.
The ModelDB website is powered in part by a number of other technologies, including:
Did we miss something from this list? Submit a pull request!