SampleDB is an open-source Python/Django web application for recording the physical location of pseudo-anonymised samples, in line with the Human Tissue Act (HTA).
Developed by Imperial College London.
Apache 2 licence.
- Each project lead/PI a Group with allowed users.
- Each Group contains Projects, and each Project contains Samples.
- Each Sample contains the fields necessary for recording the sample type, storage location, consent form information and tissue bank reference.
The fields recorded by the system are fixed/hard-coded, and are:
- Study title - Project collections can be subdivided into Studies.
- Sample ID - The sample identifier - must be unique by study_title.
- Species - Human or ?
- Sample Matrix - Sample type - ie 'Serum'.
- Collection Protocol - How the sample has been processed - ie 'Filtered'.
- Campus - Which campus is the sample stored in?
- Building - Which building is the sample stored in?
- Room - Which room is the sample stored in?
- Freezer ID - Which freezer is the sample stored in?
- Shelf ID - Which freezer shelf is the sample stored in?
- Box ID - Which box is the sample stored in?
- Consent Form Information - Record where the consent forms are stored, or the REC number.
- Tissue Bank Reference - The Tissue Bank Collection ID.
- Parent ID - May be used for pseudo-anonymised subject identifiers.
- Parent Type - What kind of pseudo-anonymised identifier?
- Create Groups.
- Assign Users to Groups.
- Create Projects.
- Upload Samples from XLS file.
- Export Samples to XLS file.
- Edit Samples.
- Delete Samples.
- Move Samples to another Project.
- Auditing.
- Presubmission data validation.
- Authorised locations.
- Freezer custodians.
- Offline/asynchronous processing.
- Historical records for auditing/security. (Requires django-simple-history package).
-
Python3.6
-
SQLite3/PostgreSQL/MySQL
-
Nginx/Apache
-
uWSGI/Gunicorn
-
Redis
-
pip requirements.txt
- Clone/download this repository
git clone https://github.com/csmsoftware/SampleDB.git
- Install Python3.6, create new Virtualenv and activate it
virtualenv -p /path/to/python3.6/bin /path/to/virtualenv
source /path/to/virtualenv/bin/activate
-
Install and configure DB backend (SQLite3/PostgreSQL/MySQL)
-
Install Redis and run Redis
sudo yum install redis
sudo systemctl start redis.service
sudo systemctl enable redis.service
- Install the pip requirements
pip3.6 install -r requirements.txt
- Install Redis and run Redis
sudo yum install redis
sudo systemctl start redis.service
sudo systemctl enable redis.service
- Install Nginx and configure
sudo yum install nginx
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
-
Configure Gunicorn for WSGI
-
Edit the settings.py file for your own configuration - see the Django docs for more information
-
Migrate the database
/path/to/virtualenv/bin/python3.6 SampleDB/manage.py makemigrations
/path/to/virtualenv/bin/python3.6 SampleDB/manage.py migrate
- Create a superuser - for logging into /admin
/path/to/virtualenv/bin/python3.6 SampleDB/manage.py createsuperuser
- Collect the static content
/path/to/virtualenv/bin/python3.6 SampleDB/manage.py collectstatic
- Configure crontab for the queue failure processing
crontab -e
# Process the RQ worker failure queue - every 5 mins.
*/5 * * * * /path/to/virtualenv/bin/python3.6 /path/to/sampledb/manage.py processjobfailures
# Clear the RQ worker failure queue - every night at 3.02am
2 3 * * * /path/to/virtualenv/bin/python3.6 /path/to/sampledb/manage.py clearfailurequeue
- Configure service to run the rqworker queue (runs the offline job queue)
/path/to/virtualenv/bin/python3.6 manage.py rqworker default
That's it. Please report any issues using the Github Issue Tracker.
Logo adapted from here: https://www.freevector.com/chemistry-vector FreeVector.com
© - Imperial College London, 2018 - All rights reserved.