NetworkX for genotype-phenotype maps.
Project description
# GPGraph
**Genotype-phenotype maps in NetworkX**
Port a `GenotypePhenotypeMap` to a [NetworkX Digraph](https://networkx.github.io/).
## Basic Example
GPGraph follows NetworkX syntax. Initialize a graph, add the
genotype-phenotype map object, and draw the graph. This library even
comes with a draw method, `draw_flattened`, suited for genotype-phenotype maps.
```python
from gpmap.simulate import MountFujiSimulation
from gpgraph import GenotypePhenotypeGraph, draw_flattened
# Simulate a genotype-phenotype map
sim = MountFujiSimulation.from_length(4)
sim.set_roughness((-1,1))
# Turn the genotype-phenotype map into a networkx object
G = GenotypePhenotypeGraph()
G.add_gpm(gpm)
# Draw the graph
draw_flattened(G, with_labels=False, node_size=100)
```
<img src="docs/_img/readme-fig.png" width="350">
## Install
Clone this repo and install with `pip`:
```
pip install -e .
```
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
gpgraph-0.1.1.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file gpgraph-0.1.1.tar.gz
.
File metadata
- Download URL: gpgraph-0.1.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d796ffe5be148a35b579f8b1d70bd9762d3846cf9154298bc82facb80b4b85e9 |
|
MD5 | a3dc9d3666b201756636a04ead8e7c6b |
|
BLAKE2b-256 | 1f277aa604cf4267a39f44f8b1ff9698912032a367746062fb6ce3249f2eb27f |
File details
Details for the file gpgraph-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: gpgraph-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 520a6ac2d26a0cb8bbad446626977f8a0f12c27ad5b9d2796f4412f42f8f2efc |
|
MD5 | 8faad23ee4504e7a7463a19da7c84328 |
|
BLAKE2b-256 | f5eb2efed3675aaebdb755a525d21a48142ff565b20fdfd5d1120471c5ab58f6 |