Skip to main content

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.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

gpgraph-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file gpgraph-0.1.0.tar.gz.

File metadata

  • Download URL: gpgraph-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gpgraph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f2ab14aaad45fcc70751a2e9bb599ef1cd3f66f2c831575af9bf7704ae9a31d
MD5 f5d06b523fbc4214aec9cc4b0aa0c8c4
BLAKE2b-256 280404b790a27042dae8b9f8c45d738aa3826391239dbdd145bca226994d3a55

See more details on using hashes here.

File details

Details for the file gpgraph-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gpgraph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bbdd66aad23c7d580f336babf3ec6327329a9b18c512fba056d49c65de26645
MD5 5fc2d27635a9a2e5018bb4f346638dff
BLAKE2b-256 cdabd2bb11c227b04fc9068bcf7b7650be7b5bef20f9ac200ba57414ba8274d4

See more details on using hashes here.

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