Skip to main content

Competing Risk Analysis Genome-wide

Project description

Coverage Status Join the chat at DOI

What can CRAG do for you?

Survival analysis is the study of "time-to-event" (TTE) outcomes, taking the focus off if an event will occur and instead looking at when an event will occur. Often, the when question is answered by a combination of factors, such as age or sex, survival analysis tests whether these associations are clear from data collected. So, if I'm asking when will I respond to a medication?, survival analysis can help to answer this question. Further information can be found on this great page by Cam Davidson-Pilon (author of lifelines) here.

A genome-wide association study (GWAS), is a study of a genetic variants across the genome. Whether we are faced with a when or if, GWAS allows us to consider whether genetic factors are part of the combination of factors that answer these questions.

CRAG is a novel software that performs survival analysis genome-wide and goes one step further: handling a particular type of TTE outcomes that occur for different reasons, such as drug withdrawal occuring due to either the drug not working or causing a bad reaction, appropriately modelling via “competing risks”.

CRAG is an easy to use software implemented using Python, and is compatible with Linux, Mac OS X & Windows operating systems. CRAG can handle large-scale genome-wide data including imputed genotypes. Analyses can be undertaken with a cause-specific or sub-distribution model. The software can adjust for multiple covariates and incorporate SNP-covariate interaction effects.

The main use of CRAG is expected to be in pharmacogenetic studies to identify genetic biomarkers of patient response to treatment, with the ultimate goal of personalising therapeutic intervention for an array of diseases.



Please install the following Python packages prior to use of CRAG (some may be installed with Python): subprocess, sys, math, lifelines, csv, numpy, pandas, gzip, time, argparse and warnings.


Type the following command in the terminal/command line to intall CRAG

   pip install --upgrade --no-deps git+

from the command line.

Testing CRAG

CRAG guide

If you are new to survival analysis, wondering why it is useful, or are interested in lifelines examples and syntax, please check out the Documentation and Tutorials page


Please chat with author Ben Francis @ Gitter. Email is also possible but likely to not be as timely!

CRAG citation

If you find CRAG useful, the best way to show your appreciation is through citing, click the badge below to generate a DOI that can be put into most citation managers. A manuscript for CRAG is currently in production...


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crag-1.0.4.tar.gz (41.2 kB view hashes)

Uploaded source

Built Distribution

crag-1.0.4-py3-none-any.whl (40.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page