# 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:
```{bash}
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:
```{bash}
$ 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.
```{text}
Sphenodon_punctatus,Hatteria_punctata
Gonyosoma_prasinus,Coluber_prasinus,Elaphe_prasina,Rhadinophis_prasinus,Rhadinophis_prasina
```
Usage:
```{bash}
$ 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:
```{bash}
$ 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.
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Lswhiteh/phylomatcher",
"name": "phylomatcher",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "population genetics,phylogenetics,taxonomy",
"author": "Logan Whitehouse",
"author_email": "lswhiteh@unc.edu",
"download_url": "https://files.pythonhosted.org/packages/d5/57/4d7e45ded83cab8ebae66131aa767e21ba3a605de28c8794dfa4404650d8/phylomatcher-0.3.2.tar.gz",
"platform": null,
"description": "# PhyloMatcher\n\nPython modules to query the GFIB or NCBI Taxonomy databases for synonym names of target species.\n\n## Installation\n\nRequired packages:\n\n- Biopython\n- pygbif\n- pandas\n- tqdm\n\nEasiest installation using a conda environment and pip:\n\n```{bash}\nconda create -n tm-env -c conda-forge python\nconda activate tm-env\npip install PhyloMatcher\n```\n\n---\n\n## Modes\n\n### GBIF\n\nCSV 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\". \n\nE.g.\n```\nSphenodon_punctatus\nGonyosoma_prasinus\n```\n\nUsage:\n\n```{bash}\n$ PhyloMatcher gbif -h\nusage: PhyloMatcher gbif [-h] -i INPUT_CSV -o OUTFILE [-t THREADS]\n\noptions:\n -h, --help show this help message and exit\n -i INPUT_CSV, --csv INPUT_CSV\n CSV where first column is a list of target species names to look up.\n -o OUTFILE, --outfile OUTFILE\n Path to output.\n -t THREADS, --threads THREADS\n```\n\n### NCBI\n\nDue 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.\n\nNote: 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.\n\nE.g.\n\n```{text}\nSphenodon_punctatus,Hatteria_punctata\nGonyosoma_prasinus,Coluber_prasinus,Elaphe_prasina,Rhadinophis_prasinus,Rhadinophis_prasina\n```\n\nUsage:\n\n```{bash}\n$ PhyloMatcher ncbi -h\nusage: PhyloMatcher ncbi [-h] -i INPUT_CSV -o OUTFILE -e EMAIL\n\noptions:\n -h, --help show this help message and exit\n -i INPUT_CSV, --csv INPUT_CSV\n CSV where first column is a list of target species names to look up.\n -o OUTFILE, --outfile OUTFILE\n Path to output.\n -e EMAIL, --email EMAIL\n```\n\n### Matching trait files to PhyloMatcher output\n\nOnce 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.)\n\nUsage:\n\n```{bash}\n$ PhyloMatcher trait -h\nusage: PhyloMatcher trait [-h] -t TRAITFILE -s SPECIESFILE -o OUTFILE\n\noptions:\n -h, --help show this help message and exit\n -t TRAITFILE, --traitfile TRAITFILE\n CSV of trait values, first column must be species names.\n -s SPECIESFILE, --speciesfile SPECIESFILE\n CSV of species synonyms output by the gbif or ncbi modules.\n -o OUTFILE, --outfile OUTFILE\n Path to output.\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool for parsing and extracting taxon synonyms.",
"version": "0.3.2",
"project_urls": {
"GitHub": "https://github.com/Lswhiteh/phylomatcher",
"Homepage": "https://github.com/Lswhiteh/phylomatcher",
"Issues": "https://github.com/Lswhiteh/phylomatcher/issues"
},
"split_keywords": [
"population genetics",
"phylogenetics",
"taxonomy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d5574d7e45ded83cab8ebae66131aa767e21ba3a605de28c8794dfa4404650d8",
"md5": "4a06902f4b5d915a25c79240f47f0fc0",
"sha256": "e3a227504b6ab29eca09796679b237b38fae7bdb7c97d56e9716d1824b52c3fa"
},
"downloads": -1,
"filename": "phylomatcher-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "4a06902f4b5d915a25c79240f47f0fc0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11781,
"upload_time": "2023-05-12T18:25:51",
"upload_time_iso_8601": "2023-05-12T18:25:51.727916Z",
"url": "https://files.pythonhosted.org/packages/d5/57/4d7e45ded83cab8ebae66131aa767e21ba3a605de28c8794dfa4404650d8/phylomatcher-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-12 18:25:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Lswhiteh",
"github_project": "phylomatcher",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "phylomatcher"
}