Code Monkey home page Code Monkey logo

ngs's Introduction

CuffBase

A Django-based frontend for the persistent storage, analysis and visualization of the output of tophat/cufflinks pipeline. CuffBase takes the output of the tophat/cufflinks pipeline, builds an SQL database (by default MySQL) in much the same way cummeRbund does and makes it available through the Web interface. Unlike cummeRbund, multiple pipeline runs can be stored in the same database.

The primary goal of CuffBase is to make the results of cuffdiff pipeline accessible to a bench scientist.

Provides (so far) very limited plotting facilities via matplotlib.

Dependencies

It's probably a good idea to manage these by setting up a virtual environment

Deployment

The recommended way to deploy CuffBase is to setup mod_wsgi in Apache2 or Gunicorn behind Nginx server. See ngs/settings.py file for the settings that need to be configured.

Quick start

You need to set up your database and specify relevant information (backend, username, and password) in the ngs/settings.py file before trying to import cuffdiff output results. For example, if using MySQL:

mysql> create database <database-name> default charset utf8 collate utf8_general_ci;
mysql> grant all on <database-name>.* to <user>@localhost identified by <password>;

and then the databases section of your ngs/settings.py file should read:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': '<database-name>',
        'USER': '<user>',
        'PASSWORD': '<password>',
        'HOST': '',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
        'PORT': '',                      # Set to empty string for default.
    }
}

The live demo is up at http://ngs.nudlerlab.info/demo/. The site has a link to the mysql dump of the example data if you want to download and play with it locally.

to load the example database from the provided sql dump:

$ gunzip -c ngs-dump-1.gz | mysql -u<user> -p<password> <database-name>

to import the cuffdiff output run this from the cuffbase directory:

$ ./manage.py import_exp <path-to-cuffdiff-output>

to see available options for the import_exp command:

$ ./manage.py import_exp --help

to start development server locally run this from the cuffbase directory:

$ ./manage.py runserver --insecure

and cuffbase should be accessible in your browser at http://localhost:8080/cuff

Caveats and limitations

I did my best trying to stick as close to the original cummeRbund database schema as possible. I had, however, to use integer pks instead of string pks in cummeRbund to make it play nicely with Django ORM. In addition, PhenoData, Feature, and Attribute tables are basically placeholders. Not sure what to make of them.

  • no tests -- the project was concieved as an ad-hoc solution with little consideration for future maintenance (I wasn't sure it'd work at all!)
  • tests are sorely needed -- will be the first priority in moving forward
  • no docs -- same as the tests
  • not tested with anything but MySQL 5.5
  • it was only tested on full cuffdiff output
  • you will probably need a machine (or VPS) instance with at least 2 GB RAM. On a 4 GB, 4-core AMD desktop, importing the example dataset takes close to 5 min. This is slower than cummeRbund, but not by a large margin.
  • because objects are created in bulk during the initial import, foreign key check fails when using InnoDB storage engine with MySQL database. The workaround is to either use MyISAM storage engine (include default-storage-engine = MyISAM in your /etc/mysql/my.cnf file prior to creating the databse) or turn off foreign key check for InnoDB engine on per-session basis.
  • make sure to increase the maximum_packet_size parameter in /etc/mysql/my.cnf to somewhere around 64M, otherwise mysql will choke on importing big(ish) datasets.

Future plans

  • refactor import_exp management command to use pandas.
  • interactive plotting with Bokeh
  • tests
  • docs (mostly on deployment)
  • port to Python 3 (should be easy for anything but MySQL?)
  • IPython notebook integration?

ngs's People

Contributors

eco32i avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.