Utilities for analyzing mutations and neoepitopes in patient cohorts
Project description
[![Build Status](https://travis-ci.org/hammerlab/cohorts.svg?branch=master)](https://travis-ci.org/hammerlab/cohorts) [![Coverage Status](https://coveralls.io/repos/hammerlab/cohorts/badge.svg?branch=master&service=github)](https://coveralls.io/github/hammerlab/cohorts?branch=master)
Cohorts
=======
Cohorts is a library for analyzing and plotting clinical data, mutations and neoepitopes in patient cohorts.
It calls out to external libraries like [topiary](https://github.com/hammerlab/topiary) and caches the results for easy manipulation.
Installation
------------
You can install Cohorts using [pip](https://pip.pypa.io/en/latest/quickstart.html):
```bash
pip install cohorts
```
Usage Examples
--------------
```python
cohort = Cohort(
data_dir="/my/input/data",
cache_dir="/where/cohorts/results/get/saved",
sample_ids=["sample_1", "sample_2"],
clinical_dataframe=pandas_dataframe_with_clinical_data,
clinical_dataframe_id_col="sample_id_in_dataframe",
os_col="Overall Survival",
pfs_col="Progression-Free Survival",
deceased_col="deceased",
progressed_or_deceased_col="progressed_or_deceased"
)
cohort.plot_survival(how="os")
```
```python
def mutect_snv_file_format_func(sample_id, normal_bam_id, tumor_bam_id):
return "Mutect-%d-normal=%s.bam-tumor=%s.bam-merged.vcf" % (
sample_id, normal_bam_id, tumor_bam_id)
def strelka_snv_file_format_func(...):
...
cohort = Cohort(
...
benefit_col="patient_durable_benefit",
snv_file_format_funcs=[
mutect_snv_file_format_func,
strelka_snv_file_format_func
]
)
# Comparison plot of missense mutation counts between benefit and no-benefit patients
cohort.plot_benefit(on=missense_snv_count)
# Raw missense mutations counts
missense_snv_col, updated_dataframe = missense_snv_count(cohort)
```
Cohorts
=======
Cohorts is a library for analyzing and plotting clinical data, mutations and neoepitopes in patient cohorts.
It calls out to external libraries like [topiary](https://github.com/hammerlab/topiary) and caches the results for easy manipulation.
Installation
------------
You can install Cohorts using [pip](https://pip.pypa.io/en/latest/quickstart.html):
```bash
pip install cohorts
```
Usage Examples
--------------
```python
cohort = Cohort(
data_dir="/my/input/data",
cache_dir="/where/cohorts/results/get/saved",
sample_ids=["sample_1", "sample_2"],
clinical_dataframe=pandas_dataframe_with_clinical_data,
clinical_dataframe_id_col="sample_id_in_dataframe",
os_col="Overall Survival",
pfs_col="Progression-Free Survival",
deceased_col="deceased",
progressed_or_deceased_col="progressed_or_deceased"
)
cohort.plot_survival(how="os")
```
```python
def mutect_snv_file_format_func(sample_id, normal_bam_id, tumor_bam_id):
return "Mutect-%d-normal=%s.bam-tumor=%s.bam-merged.vcf" % (
sample_id, normal_bam_id, tumor_bam_id)
def strelka_snv_file_format_func(...):
...
cohort = Cohort(
...
benefit_col="patient_durable_benefit",
snv_file_format_funcs=[
mutect_snv_file_format_func,
strelka_snv_file_format_func
]
)
# Comparison plot of missense mutation counts between benefit and no-benefit patients
cohort.plot_benefit(on=missense_snv_count)
# Raw missense mutations counts
missense_snv_col, updated_dataframe = missense_snv_count(cohort)
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cohorts-0.0.4.tar.gz
(9.4 kB
view details)
File details
Details for the file cohorts-0.0.4.tar.gz
.
File metadata
- Download URL: cohorts-0.0.4.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b83dba7380717a21d181e98e114dd65ac0f2dc6e5638daa351d4724ac680c67c |
|
MD5 | 21dc95324433742c44bf31e4be1f84af |
|
BLAKE2b-256 | 2322fc62f4fe12018b785c964d263fd681f6591fd790dc1caedb68e90469e122 |