https://github.com/harmslab/gpmap
A Python API for managing genotype-phenotype map data
https://github.com/harmslab/gpmap
evolution genetics genotype-phenotype-maps networkx
Last synced: about 1 month ago
JSON representation
A Python API for managing genotype-phenotype map data
- Host: GitHub
- URL: https://github.com/harmslab/gpmap
- Owner: harmslab
- Created: 2015-07-24T20:21:38.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T18:26:41.000Z (over 2 years ago)
- Last Synced: 2025-12-26T23:58:26.479Z (3 months ago)
- Topics: evolution, genetics, genotype-phenotype-maps, networkx
- Language: Python
- Homepage:
- Size: 1.42 MB
- Stars: 12
- Watchers: 9
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GPMap
[](https://badge.fury.io/py/gpmap)
[](https://gitter.im/harmslab/gpmap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](http://gpmap.readthedocs.io/en/latest/?badge=latest)
[](https://travis-ci.org/harmslab/gpmap)
[](https://nbviewer.jupyter.org/github/harmslab/gpmap/blob/master/examples/Introduction%20to%20Genotype-Phenotype%20Map%20Module.ipynb#)
[](https://mybinder.org/v2/gh/harmslab/gpmap/master?filepath=examples%2FIntroduction%20to%20Genotype-Phenotype%20Map%20Module.ipynb)
*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 ecosystem.
To visualize genotype-phenotype objects created by GPMap, checkout [GPGraph](https://github.com/Zsailer/gpgraph).

## Basic example
Import the package's base object.
```python
from gpmap import GenotypePhenotypeMap
```
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
```

Or load a dataset from disk.
```python
gpm = GenotypePhenotypeMap.read_json("data.json")
```
## Installation
**Users**
This simplest way to install this package is using pip:
```
pip install gpmap
```
**Developers**
The recommended way to install this package for development is using `pipenv`.
1. Clone this repository:
```
git clone https://github.com/harmslab/gpmap
```
2. Install the package using pipenv.
```
cd gpmap
pipenv install --dev -e .
```
3. Run tests using pytest
```
pytest
```
## Dependencies
The following modules are required. Also, the examples/tutorials are written in Jupyter notebooks and require IPython to be installed.
* [Numpy](http://www.numpy.org/)
* [Pandas](https://pandas.pydata.org/)