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.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.3.0.tar.gz (22.0 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.3.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for taxodist-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2dcd318b46c62e6d4ba42ae94aa3ecd771cdcbc5d28a189939dd9864e45560f5
MD5 e28f600eaeaa93e833a5c06e08840a41
BLAKE2b-256 28d476aae4548540e4f4b6ce24979334aeb0bdd24cd6ae0caa49f8391ced7648

See more details on using hashes here.

File details

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

File metadata

  • Download URL: taxodist-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b9c0ea9ab9831dda13dd61011b40210c47bf3ce37cc632922fcf56ef24c5c00
MD5 a9dd9fde60bafbf253703f514273eafd
BLAKE2b-256 98e8f30e0730fa9900c12ced1720cbb0e768827b9c518c217e0a0aa3844370e0

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