Skip to main content

PhyloMatcher

Python modules to query the GFIB or NCBI Taxonomy databases for synonym names of target species.

Installation

Required packages:

  • Biopython
  • pygbif
  • pandas
  • tqdm

Easiest installation using a conda environment and pip:

conda create -n tm-env -c conda-forge python
conda activate tm-env
pip install PhyloMatcher

Modes

GBIF

CSV input file should be a single column of target species to look up (other columns will be ignored). Names can be either space or underscore ("_") separated, i.e. "Sphenodon_punctatus" is equivalent to "Sphenodon punctatus".

E.g.

Sphenodon_punctatus
Gonyosoma_prasinus

Usage:

$ PhyloMatcher gbif -h
usage: PhyloMatcher gbif [-h] -i INPUT_CSV -o OUTFILE [-t THREADS]

options:
  -h, --help            show this help message and exit
  -i INPUT_CSV, --csv INPUT_CSV
                        CSV where first column is a list of target species names to look up.
  -o OUTFILE, --outfile OUTFILE
                        Path to output.
  -t THREADS, --threads THREADS

NCBI

Due to the specificity of Entrez results and the relative sparseness of taxonomy data a CSV intended for NCBI matching can have multiple columns, assuming the first column is the target species and the remaining columns are prior-known synonyms. All names will be flattened and searched to increase the chances of matches in the database. A single-column CSV file will also work, identically to the GBIF format.

Note: currently the multi-Entrez script assumes the final column in the CSV is for notes. If people decide this is worth fixing I will, but it seems like the GBIF approach is much better across the board.

E.g.

Sphenodon_punctatus,Hatteria_punctata
Gonyosoma_prasinus,Coluber_prasinus,Elaphe_prasina,Rhadinophis_prasinus,Rhadinophis_prasina

Usage:

$ PhyloMatcher ncbi -h
usage: PhyloMatcher ncbi [-h] -i INPUT_CSV -o OUTFILE -e EMAIL

options:
  -h, --help            show this help message and exit
  -i INPUT_CSV, --csv INPUT_CSV
                        CSV where first column is a list of target species names to look up.
  -o OUTFILE, --outfile OUTFILE
                        Path to output.
  -e EMAIL, --email EMAIL

Matching trait files to PhyloMatcher output

Once you have found synonyms from tree output you can match that to any phenotypic/trait data you have. Similar to the other inputs the first column must contain the species names you're targeting, and they should be formatted identically to how the PhyloMatcher output looks (case-sensitive and separated by underscores.)

Usage:

$ PhyloMatcher trait -h
usage: PhyloMatcher trait [-h] -t TRAITFILE -s SPECIESFILE -o OUTFILE

options:
  -h, --help            show this help message and exit
  -t TRAITFILE, --traitfile TRAITFILE
                        CSV of trait values, first column must be species names.
  -s SPECIESFILE, --speciesfile SPECIESFILE
                        CSV of species synonyms output by the gbif or ncbi modules.
  -o OUTFILE, --outfile OUTFILE
                        Path to output.

Metadata

Release files for phylomatcher 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phylomatcher 0.3.2
File Size Uploaded
phylomatcher-0.3.2.tar.gz 11.8 kB Details

Release files / phylomatcher-0.3.2.tar.gz

Download URL phylomatcher-0.3.2.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e3a227504b6ab29eca09796679b237b38fae7bdb7c97d56e9716d1824b52c3fa
BLAKE2b-256 checksum
How to use checksums
d5574d7e45ded83cab8ebae66131aa767e21ba3a605de28c8794dfa4404650d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.3.2 This release

1 release file

0.3.1

1 release file

0.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page