Skip to content
forked from harmslab/gpgraph

NetworkX for genotype-phenotype maps

License

Notifications You must be signed in to change notification settings

Zsailer/gpgraph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPGraph

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_flattened, suited for genotype-phenotype maps.

from gpmap.simulate import MountFujiSimulation
from gpgraph import GenotypePhenotypeGraph, draw_flattened

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

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

# Draw the graph
draw_flattened(G, with_labels=False, node_size=100)

Install

Clone this repo and install with pip:

pip install -e .

About

NetworkX for genotype-phenotype maps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%