Skip to content

Commit

Permalink
ChronQC 1.0.2 version changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nilesh-tawari committed Jul 31, 2017
1 parent 95820f2 commit 78e1f10
Show file tree
Hide file tree
Showing 57 changed files with 2,974 additions and 1,780 deletions.
7 changes: 6 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
History
-------
1.0.2: Changes

Features
* Added stacked bar plot and bar and line plot
* Bug fixes
* Error handling

1.0.1: Features

* Designed for quality control based on historical data
* Generates interactive time-series plots for various metrics, allowing comparison of the current run to historical runs
Expand Down
42 changes: 22 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. image:: https://github.com/nilesh-tawari/ChronQC/blob/master/docs/_static/ChronQC_logo.png
.. image:: https://github.com/nilesh-tawari/test/blob/master/docs/_static/ChronQC_logo.png
:target: https://github.com/nilesh-tawari/ChronQC

.. image:: https://img.shields.io/pypi/v/chronqc.svg
Expand All @@ -7,37 +7,37 @@
.. image:: https://readthedocs.org/projects/chronqc/badge/?version=latest
:target: http://chronqc.readthedocs.io/en/latest/?badge=latest

An Open-source Quality Control Monitoring System for Clinical NGS
=================================================================
A Quality Control Monitoring System for Clinical Next Generation Sequencing
===========================================================================

* Free software: MIT license
* Documentation: http://chronqc.readthedocs.io/en/latest/.

ChronQC is a quality control (QC) tracking system for clinical implementation of next-generation sequencing (NGS). ChronQC generates time series plots for various QC metrics, which allows comparison of the current run to historical runs. ChronQC has multiple features for tracking QC data including Westgard rules for clinical validity, laboratory-defined thresholds, and historical observations within a specified period. Users can record their notes and corrective actions directly onto the plots for long-term recordkeeping.

Features
--------

* Designed for quality control based on historical data
* Generates interactive time-series plots for various metrics, allowing comparison of the current run to historical runs
* Record users' notes and corrective actions directly onto the graphs for long-term record-keeping
* Provides highly customizable different chart types
* Supports customized database for plotting
* Works with output of MultiQC


ChronQC is an open-source, interactive, record-keeping QC system. ChronQC captures QC data from `MultiQC <https://github.com/ewels/MultiQC>`__ output and stores the metrics in a database. ChronQC then automatically generates interactive time-series plots for various metrics, allowing comparison of the current run to historical runs. In QC meetings, users can record their notes and corrective actions directly onto the graphs for long-term record-keeping.
* Suited for different assays in a clinical laboratory
* Generates interactive time series plots for various metrics
* Records users' notes and corrective actions onto the graphs to facilitate long-term recordkeeping
* Provides high level of customization: works with local databases and generates different chart types
* Leverages existing standard tools such as `MultiQC <https://github.com/ewels/MultiQC>`__

Live report:
=============
Example live ChronQC report
===========================
`https://nilesh-tawari.github.io/chronqc <https://nilesh-tawari.github.io/chronqc>`_


ChronQC workflow
================
.. image:: https://github.com/nilesh-tawari/ChronQC/blob/master/docs/_static/ChronQC_workflow.png
ChronQC has two components: a command line interface compatible with NGS sequencing machines and a graphical user interface compatible with the clinical environment. HTML plots display metrics for each run or sample. Annotations are displayed on the right side of the plot and are stored in the chronqc.annotations.sqlite database for long-term recordkeeping.

.. image:: https://github.com/nilesh-tawari/test/blob/master/docs/_static/ChronQC_workflow.png
:target: https://github.com/nilesh-tawari/ChronQC

Examples:
=========
Examples
========

ChronQC plots can be generated from,

Expand All @@ -54,7 +54,7 @@ For details of chart types see the `documentation. <http://chronqc.readthedocs.i

Requirement
===========
Generating database and creating interactive charts is performed with code written for Python.
ChronQC is implemented in Python (tested with v2.7 / v3.5 / v3.6) and runs on all common operating systems (Windows, Linux and Mac OS X).

Installation
============
Expand Down Expand Up @@ -93,9 +93,11 @@ If you would like the development version instead, the command is::
Citation
========

An Open-source Quality Control Monitoring System for Clinical NGS (Manuscript under construction)
ChronQC: A Quality Control Monitoring System for Clinical Next Generation Sequencing
Nilesh R. Tawari, Justine Jia Wen Seow, Dharuman Perumal, Jack L. Ow, Shimin Ang, Arun G. Devasia, Pauline C. Ng
(Manuscript under construction)

License
=======

This project is licensed under the MIT License - see the `LICENSE.md <https://github.com/nilesh-tawari/ChronQC/blob/master/LICENSE>`_ file for details
This project is licensed under the MIT License - see the `LICENSE.md <https://github.com/nilesh-tawari/test/blob/master/LICENSE>`_ file for details
79 changes: 79 additions & 0 deletions README_pypi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.. image:: https://img.shields.io/pypi/v/chronqc.svg
:target: https://pypi.python.org/pypi/chronqc

.. image:: https://readthedocs.org/projects/chronqc/badge/?version=latest
:target: http://chronqc.readthedocs.io/en/latest/?badge=latest

ChronQC: A Quality Control Monitoring System for Clinical Next Generation Sequencing
====================================================================================

* Free software: MIT license
* Documentation: http://chronqc.readthedocs.io/en/latest/.

ChronQC is a quality control (QC) tracking system for clinical implementation of next-generation sequencing (NGS). ChronQC generates time series plots for various QC metrics, which allows comparison of the current run to historical runs. ChronQC has multiple features for tracking QC data including Westgard rules for clinical validity, laboratory-defined thresholds, and historical observations within a specified period. Users can record their notes and corrective actions directly onto the plots for long-term recordkeeping.

Features
--------

* Suited for different assays in a clinical laboratory
* Generates interactive time series plots for various metrics
* Records users' notes and corrective actions onto the graphs to facilitate long-term recordkeeping
* Provides high level of customization: works with local databases and generates different chart types
* Leverages existing standard tools such as `MultiQC <https://github.com/ewels/MultiQC>`__

Example live ChronQC report
===========================
`https://nilesh-tawari.github.io/chronqc <https://nilesh-tawari.github.io/chronqc>`_


Examples
========

ChronQC plots can be generated from,

1. A custom SQLite database.
* For example see, `examples/custom_db_example <https://github.com/nilesh-tawari/ChronQC/tree/master/examples/custom_db_example>`_.

2. The output of `MultiQC <https://github.com/ewels/MultiQC>`__.
* For example on creating the ChronQC database and plots see, `examples/multiqc_example_1 <https://github.com/nilesh-tawari/ChronQC/tree/master/examples/multiqc_example_1>`_.
* For example on creating, updating the ChronQC database and plots see, `examples/multiqc_example_2 <https://github.com/nilesh-tawari/ChronQC/tree/master/examples/multiqc_example_2>`_.

For complete command line reference see the `documentation. <http://chronqc.readthedocs.io/en/latest/>`__

For details of chart types see the `documentation. <http://chronqc.readthedocs.io/en/latest/>`__

Requirement
===========
ChronQC is implemented in Python (tested with v2.7 / v3.5 / v3.6) and runs on all common operating systems (Windows, Linux and Mac OS X).

Installation
============

You can install ChronQC from PyPI using pip as follows::

pip install chronqc

Alternatively, you can install from GitHub::

git clone https://github.com/nilesh-tawari/ChronQC.git
cd ChronQC
pip install -r requirements.txt
pip install --editable .


If you would like the development version instead, the command is::

pip install --upgrade --force-reinstall git+https://github.com/nilesh-tawari/ChronQC.git


Citation
========

ChronQC: A Quality Control Monitoring System for Clinical Next Generation Sequencing
Nilesh R. Tawari, Justine Jia Wen Seow, Dharuman Perumal, Jack L. Ow, Shimin Ang, Arun G. Devasia, Pauline C. Ng
(Manuscript under construction)

License
=======

This project is licensed under the MIT License - see the `LICENSE.md <https://github.com/nilesh-tawari/ChronQC/blob/master/LICENSE>`_ file for details
15 changes: 9 additions & 6 deletions chronqc/chronqc.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals
import click
from . import chronqc_db
from . import chronqc_plot
import argparse
import sys
from . import chronqc_annotation

try:
from . import chronqc_db
from . import chronqc_plot
from . import chronqc_annotation
except (ValueError, SystemError):
import chronqc_db
import chronqc_plot
import chronqc_annotation

def run_plot(args):
"""
Expand All @@ -29,7 +32,7 @@ def run_annotation(args):
"""
runs main function from chronqc_annotation.py
"""
print("running chronqc_annotation")
#print("running chronqc_annotation")
chronqc_annotation.main()

# @click.command()
Expand Down
19 changes: 15 additions & 4 deletions chronqc/chronqc_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
@author: tawarinr
"""
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals
from . import utils
import os
import os.path as op
import sys
Expand All @@ -14,6 +13,11 @@
import numpy as np
import pandas as pd
import sqlite3
try:
from . import utils
except (ValueError, SystemError):
import utils

try:
import configparser
Config = configparser.ConfigParser() # ver. < 3.0
Expand Down Expand Up @@ -49,7 +53,7 @@ def creation_date(path_to_file):
try:
file_time = op.getmtime(path_to_file)
return time.strftime("%m/%d/%Y", time.localtime(file_time))
except FileNotFoundError:
except:
return np.nan


Expand All @@ -62,11 +66,11 @@ def main(args):
takes number of arguments and produces ChronQC SQLite database
"""
if args.mode == 'update' and not args.db:
parser.error("can't update database {} without a -db argument".format(args.mode))
print("can't update database {} without a -db argument".format(args.mode))
elif args.mode == 'update' and args.prefix:
print("can't use prefix in update mode so ignoring it")
elif args.mode == 'create' and not args.output:
parser.error("provide output directory --output argument for creating db".format(args.mode))
print("provide output directory --output argument for creating db".format(args.mode))

# output dir and file
# Get output directory 1. user defined 2. db dir 3. multiqc_stats dir
Expand Down Expand Up @@ -189,6 +193,13 @@ def main(args):
# remove blank spaces in column names
df.columns = [x.strip().replace(' ', '_') for x in df.columns]
logger.info("Kept {0} records after merging run, date and stats for ChronQC SQLite db".format(len(df)))
# convert boolean types This method will not work for obect type column
# booleandf = df.select_dtypes(include=[bool])
# booleanDictionary = {True: 'TRUE', False: 'FALSE'}
# for column in booleandf:
# df[column] = df[column].map(booleanDictionary)
df.replace(to_replace=True, value='TRUE', inplace=True)
df.replace(to_replace=False, value='FALSE', inplace=True)
# write db
cnx = sqlite3.connect(out_file)
if args.mode == 'create':
Expand Down
Loading

0 comments on commit 78e1f10

Please sign in to comment.