Skip to content

Python API for piqtree2 #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions piqtree2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import typing
import cogent3
from cogent3.composable import define_app

from enum import Enum

class TreeMode(Enum):
UNIFORM = "UNIFORM",
UNKNOWN = "UNKNOWN"

@define_app
def robinson_foulds(*trees: cogent3.PhyloNode) -> tuple[int,...]:
# call libiqtree to calculate the Robinson-Foulds distance between trees
pass

@define_app
def random_tree(num_taxa: int, tree_mode: TreeMode, num_trees: int, rand_seed: typing.Optional[int]=None) -> tuple[cogent3.PhyloNode]:
# call libiqtree to generate random trees
pass

@define_app
def build_tree(aln: cogent3.Alignment, *arguments) -> cogent3.PhyloNode:
# call libiqtree to build a tree
return cogent3.PhyloNode()

@define_app
def fit_tree(aln: cogent3.Alignment, tree: cogent3.PhyloNode, *params) -> cogent3.PhyloNode:
# call libiqtree to fit a tree
return tree