Skip to content

csmsoftware/SampleDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to SampleDB

alt text

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.

Data model

  1. Each project lead/PI a Group with allowed users.
  2. Each Group contains Projects, and each Project contains Samples.
  3. Each Sample contains the fields necessary for recording the sample type, storage location, consent form information and tissue bank reference.

Data model

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?

Usage/Features

  • 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).

Requirements

  • Python3.6

  • SQLite3/PostgreSQL/MySQL

  • Nginx/Apache

  • uWSGI/Gunicorn

  • Redis

  • pip requirements.txt

Installation - Centos 7/RHEL

  1. Clone/download this repository
git clone https://github.com/csmsoftware/SampleDB.git
  1. 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
  1. Install and configure DB backend (SQLite3/PostgreSQL/MySQL)

  2. Install Redis and run Redis

sudo yum install redis
sudo systemctl start redis.service
sudo systemctl enable redis.service
  1. Install the pip requirements
pip3.6 install -r requirements.txt
  1. Install Redis and run Redis
sudo yum install redis
sudo systemctl start redis.service
sudo systemctl enable redis.service
  1. Install Nginx and configure
sudo yum install nginx
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
  1. Configure Gunicorn for WSGI

  2. Edit the settings.py file for your own configuration - see the Django docs for more information

  3. Migrate the database

/path/to/virtualenv/bin/python3.6 SampleDB/manage.py makemigrations
/path/to/virtualenv/bin/python3.6 SampleDB/manage.py migrate
  1. Create a superuser - for logging into /admin
/path/to/virtualenv/bin/python3.6 SampleDB/manage.py createsuperuser
  1. Collect the static content
/path/to/virtualenv/bin/python3.6 SampleDB/manage.py collectstatic
  1. 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
  1. 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.