Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.72 KB

File metadata and controls

45 lines (33 loc) · 1.72 KB

SplitP

Coverage Status DOI

Python package which implements split- and rank-based tools for inferring phylogenies, such as flattenings and subflattenings.

Installation

The latest version of SplitP can be installed via the command pip install splitp

Example

The following computes 100 split scores from a 10000bp sequence generated from a balanced 10-taxon tree under the Jukes Cantor model.

# Imports
import splitp

# Set parameters
sequence_length = 10_000
num_taxa = 10
branch_length = 0.05
number_of_splits = 100

# Define model
model = splitp.model.GTR.JukesCantor(1/2)

# Generate tree, splits and alignment
tree = splitp.trees.balanced_newick_tree(num_taxa, branch_length)
splits = splitp.all_splits(tree)
alignment = splitp.generate_alignment(tree, model, sequence_length)

# Compute scores
for s in range(number_of_splits):
    split = next(splits)
    flattening = splitp.flattening(split, alignment, splitp.FlatFormat.reduced)
    score = splitp.split_score(flattening)
    print(split, score)

For more functionality please see the documentation at splitp.joshuastevenson.me.

Please see CONTRIBUTING.md for information on contributing to this project.