PAUPΒΆ

The paup module provides functions to estimate a tree given a data matrix, or a substitution model given a tree and a data model.

Trees can be estimated using likelihood:

#! /usr/bin/env python
# -*- coding: utf-8 -*-

import dendropy
from dendropy.interop import paup

data = dendropy.DnaCharacterMatrix.get(
    path="pythonidae.nex",
    schema="nexus")
tree = paup.estimate_tree(data,
        tree_est_criterion='likelihood',
        num_states=2,
        unequal_base_freqs=True,
        gamma_rates=False,
        prop_invar=False)
print tree.as_string(schema="newick")

Or neighbor-joining:

#! /usr/bin/env python
# -*- coding: utf-8 -*-

import dendropy
from dendropy.interop import paup

data = dendropy.DnaCharacterMatrix.get(
    path="pythonidae.nex",
    schema="nexus")
tree = paup.estimate_tree(data,
        tree_est_criterion='nj')
print tree.as_string(schema="newick")

Estimating a substitution model parameters requires both a tree and a data matrix:

#! /usr/bin/env python
# -*- coding: utf-8 -*-

import dendropy
from dendropy.interop import paup

data = dendropy.DnaCharacterMatrix.get(
    path="pythonidae.nex",
    schema="nexus")
tree = paup.estimate_tree(data,
        tree_est_criterion='nj')
est_tree, est_model = paup.estimate_model(data,
        tree,
        num_states=2,
        unequal_base_freqs=True,
        gamma_rates=False,
        prop_invar=False)
for k, v in est_model.items():
    print("{}: {}".format(k, v))

Previous topic

Seq-Gen

Next topic

RAxML

Documentation

Obtaining

DiscussionGoogle Groups

Join the " DendroPy Users" group to follow and participate in discussion, troubleshooting, help, information, suggestions, etc. on the usage and development of the DendroPy phylogenetic computing library.

Enter your e-mail address in the box above and click the "subscribe" button to subscribe to the "dendropy-users" group, or click here to visit this group page directly.

AnnouncementsGoogle Groups

Join the " DendroPy Announcements" group to receive announcements of new releases, updates, changes and other news of interest to DendroPy users and developers.

Enter your e-mail address in the box above and click the "subscribe" button to subscribe to the " dendropy-announce" group, or click here to visit this group page directly.

DevelopmentGitHub

  • Issues - Report bugs or request features
  •  Watch - Follow development activity
  •   Fork - Contribute and collaborate
  •   Star - Throw some glitter, add some glamour