Skip to main content

NetworkX for genotype-phenotype maps.

Project description


Genotype-phenotype maps in NetworkX

Port a GenotypePhenotypeMap to a NetworkX Digraph.

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_gpgraph, suited for genotype-phenotype graphs.

from gpmap.simulate import MountFujiSimulation
from gpgraph import GenotypePhenotypeGraph
from gpgraph.pyplot import draw_gpgraph, draw_edges

# Simulate a genotype-phenotype map
sim = MountFujiSimulation.from_length(4, roughness_width=1)

# Turn the genotype-phenotype map into a networkx object
G = GenotypePhenotypeGraph(sim)

# Draw the graph
figure = draw_gpgraph(G,
                      edge_colors = 'gray', 


Clone this repo and install with pip:

pip install -e .

To develop

Clone this repo and run as follows

python develop --user

This way, if only python scripts are being changed nothing has to be reinstalled.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gpgraph, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size gpgraph-0.2.0-py3-none-any.whl (19.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gpgraph-0.2.0.tar.gz (131.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page