Skip to main content

Taxonomic Distance and Phylogenetic Lineage Computation

Project description

taxodist

PyPI version Python Tests Coverage

Taxonomic distance and phylogenetic lineage computation for any taxon on Earth.

taxodist retrieves full hierarchical lineages from The Taxonomicon and computes a tree metric distance between any two taxa: a pair of dinosaurs, a dinosaur and a fungus, two species of fly, or an oak tree and a human.

Installation

pip install taxodist
pip install git+https://github.com/rodrigosqrt3/taxodist-py.git

Basic usage

from taxodist import (
    get_lineage, taxo_distance, mrca, distance_matrix, 
    filter_clade, taxo_path, save_cache, load_cache
)

# Get a full lineage
get_lineage("Tyrannosaurus")

# Distance between two taxa
taxo_distance("Tyrannosaurus", "Velociraptor")

# Most recent common ancestor
mrca("Tyrannosaurus", "Triceratops")   # "Dinosauria"
mrca("Tyrannosaurus", "Homo")          # "Amniota"

# Pairwise distance matrix
theropods = ["Tyrannosaurus", "Velociraptor", "Spinosaurus", "Allosaurus"]
distance_matrix(theropods)

# Filter taxa by clade
taxa =["Tyrannosaurus", "Triceratops", "Homo", "Quercus"]
filter_clade(taxa, "Dinosauria")

# Get the path between two taxa
taxo_path("Tyrannosaurus", "Velociraptor")

# Save and restore the lineage cache across sessions
save_cache("my_cache.pkl")
load_cache("my_cache.pkl")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taxodist-0.5.0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taxodist-0.5.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file taxodist-0.5.0.tar.gz.

File metadata

  • Download URL: taxodist-0.5.0.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.4

File hashes

Hashes for taxodist-0.5.0.tar.gz
Algorithm Hash digest
SHA256 54a1c5d617fe723c86ad3dfa55cf4ce86a9fcd946b6c2a122b4b8cf7bd940407
MD5 c2a76a912a3050169b07fdb363925885
BLAKE2b-256 71bad4b366d223216534381a5d2a343f4e2a4c6854db48085c8583e347f411ac

See more details on using hashes here.

File details

Details for the file taxodist-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: taxodist-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.4

File hashes

Hashes for taxodist-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcf7b64302d1c94140bcb48a5d2a729ad63cc3770464820b85184c114c51b921
MD5 9e21f9c8ab5319fe163a752095b01785
BLAKE2b-256 bcc398666289c38ba342a609f1910cda597783cda9d9605bb3d9cb69a1a2e6fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page