Skip to content

Commit

Permalink
Merge pull request #10 from Zsailer/datamodel
Browse files Browse the repository at this point in the history
Clean up core logic
  • Loading branch information
Zsailer authored Dec 7, 2017
2 parents 581abaa + 84b936d commit 37b25c9
Show file tree
Hide file tree
Showing 11 changed files with 656 additions and 511 deletions.
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@

# Python API for analyzing and manipulating genotype-phenotype maps

# GPMap

[![Join the chat at https://gitter.im/harmslab/gpmap](https://badges.gitter.im/harmslab/gpmap.svg)](https://gitter.im/harmslab/gpmap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Documentation Status](https://readthedocs.org/projects/gpmap/badge/?version=latest)](http://gpmap.readthedocs.io/en/latest/?badge=latest)

This package defines a standard data-structure for genotype-phenotype (GP) map data.
Subset, manipulate, extend, etc. GP maps. Calculate statistics, model evolutionary
trajectories, predict phenotypes (in combination with the epistasis package). Efficient memory usage,
using numpy arrays to store in memory.
*A Python API for managing genotype-phenotype map data*

GPMap defines a flexible object for managing genotype-phenotype (GP) map data. At it's core,
it stores all data in Pandas DataFrames and thus, interacts seamlessly with the
PyData egosystem.

To visualize genotype-phenotype objects created by GPMap, checkout [GPGraph](https://github.com/Zsailer/gpgraph).

<img src="docs/_img/gpm.png" align="middle">
<img src="docs/_img/gpm.png"> <img src="docs/_img/dataframe.png" width="400">

## Basic example

Expand All @@ -19,7 +21,28 @@ Import the package's base object.
from gpmap import GenotypePhenotypeMap
```

Load a dataset from disk.
Pass your data to the object.
```python

# Data
wildtype = "AAA"
genotypes = ["AAA", "AAT", "ATA", "TAA", "ATT", "TAT", "TTA", "TTT"]
phenotypes = [0.1, 0.2, 0.2, 0.6, 0.4, 0.6, 1.0, 1.1]
stdeviations = [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]

# Initialize the object
gpm = GenotypePhenotypeMap(wildtype,
genotypes,
phenotypes,
stdeviations=stdeviations)

# Check out the data.
gpm.data
```
<img src="docs/_img/dataframe.png" width="350">


Or load a dataset from disk.
```python
gpm = GenotypePhenotypeMap.read_json("data.json")
```
Expand All @@ -38,3 +61,4 @@ pip install -e .
The following modules are required. Also, the examples/tutorials are written in Jupyter notebooks and require IPython to be install.

* [Numpy](http://www.numpy.org/)
* [Pandas](https://pandas.pydata.org/)
Binary file added docs/_img/dataframe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 37b25c9

Please sign in to comment.