boaz85 / pymuller

Muller plot generation in Python
5 stars 4 forks source link

PyMuller

Muller plot generation in Python.

Installation

pip install pymuller

Usage

from pymuller import muller

muller(populations_df, adjacency_df)

example_muller

The muller function takes two mandatory arguments:

populations_df: A Pandas dataframe with the following structure:

population_df

adjacency_df: A Pandas dataframe containing the population adjacency information. Every strain except the ancestral one must have a row.

adjacency_df

Optional arguments:

smoothing_std - To smooth things up, a rolling average with a gaussian kernel is applied to each strain frequencies variable. This parameter can be used to control the degree of smoothness.

ax - an existing Matplotlib axis to plot on.

normalize - Normalize population sizes per generation.

color_by - a Pandas series object, that maps identities (index) to colors (values). Colors are represented by numbers in some arbitrary range. The colormap argument determines the actual color of each identity.