Wrapper for WoRMS Rest API
Project description
WoRMStools
Features:
- get up-to-date information from WoRMS database
- Terminal-based scripts
Software requierements:
- Python 3
Installation
By using pip
:
pip install wormstools
Using git
(Optional):
git clone https://github.com/Ulises-Rosas/WoRMStools.git
cd WoRMStools
python3 setup.py install
AphiaID
We can obtain the species ID which WoRMS database identify a given species (i.e. aphiaID). If this ID is not known, then species cannot be validated or continue with downstream procedures. Therefore, to know species aphiaID is an important step towards getting metadata inside WoRMS database.
Let's suppose we have the following a list of species stored at species.txt:
cat species.txt
Conus roosevelti
Latirus hemphilli
Favartia peasei
Lolliguncula panameusis
Pholoides tuberculata
We can obtain their aphiaIDs by running:
worms species.txt -id
By default worms
uses its input to name all outputs, however this can be modified with --out
option. Since we did not specify any output name, by default the output name is species_worms_aphiaID.tsv
and is contains the following:
species aphiaIDs Obs
Conus roosevelti 429945
Latirus hemphilli 447141
Favartia peasei 738152
Lolliguncula panameusis Record not found in WoRMS
Pholoides tuberculata Record not found in WoRMS
Validate names
Currently accepted name according to WoRMS for each species can be obtained with the option -val
. The output, when using this option, has the following columns: species, validated names and obs. If there were species that cannot be validated through WoRMS, it is stated on the obs column.
Example:
worms species.txt -val
By default the output name is species_worms_val.tsv
and is contains the following:
species validated names Obs
Conus roosevelti Conus tiaratus
Latirus hemphilli Pustulatirus hemphilli
Favartia peasei Favartia peasei
Lolliguncula panameusis Lolliguncula (Lolliguncula) panamensis
Pholoides tuberculata Record not found in WoRMS
Synonyms
Synonyms of each species can be obtained with the option -syn
. This option is aphiaID-dependent, which means that it obtains synonyms if there is any available aphiaID for each given species, including non-accepted ones. The output, when using this option, has the following columns: species, synonyms and obs. If there was a species that are not found in WoRMS its validated name is taken and stated on the obs column. Furthermore, if this species cannot be validated*, it is also stated in the obs column.
Example:
worms species.txt -syn
By default the output name is species_worms_syn.tsv
and is contains the following:
species synonyms Obs
Conus roosevelti
Latirus hemphilli
Favartia peasei Murex foveolatus, Murex peasei
Lolliguncula (Lolliguncula) panamensis Lolliguncula panamensis, Lolliguncula tydeus Deprecated name: Lolliguncula panameusis
Pholoides tuberculata Record not found in WoRMS
*While species that does not have an aphiaID can be either validated in order to get an aphiaID or simply skipped, it is highly recomendable to introduce a list of validated species (see how here).
Taxonomic rank
Different taxonomical categories can obtained with the option --at
. This option is aphiaID-dependent, which means that it obtains taxonomical categories if there is any aphiaID available for each given species, including non-accepted ones. The output, when using this option, varies according to introduced values into --at
option (see example). The structure of column names, however, has the following structure: [Taxa] + species + obs. If there was a species that are not found in WoRMS its validated name is taken and stated on the obs column. Furthermore, if this species cannot be validated*, it is also stated in the obs column.
Example:
worms species.txt --at Class Family
By default the output name is species_worms_ranks.tsv
and is contains the following:
Class Family Species Obs
Gastropoda Conidae Conus roosevelti
Gastropoda Fasciolariidae Latirus hemphilli
Gastropoda Muricidae Favartia peasei
Cephalopoda Loliginidae Lolliguncula (Lolliguncula) panamensis deprecated name: Lolliguncula panameusis
Pholoides tuberculata Record not found in WoRMS
Finally, this option can be used together with all above options.
*While species that does not have an aphiaID can be either validated in order to get an aphiaID or simply skipped, it is highly recomendable to introduce a list of validated species (see how here).
Usage within python3
The way WoRMStools
is used inside python3 resemble pretty much as the usage in the terminal we have already seen:
# import worms class
from wormstools.core_worms import Worms
# get aphiaID
Worms(taxon = 'Conus roosevelti').aphiaID
# validate name
Worms(taxon = 'Conus roosevelti').taxamatch()
# get synonyms
Worms(taxon = 'Favartia peasei').get_synonyms()
# get an specific taxonomic rank
Worms(taxon = 'Favartia peasei').get_rank(rank = 'Family')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wormstools-1.3.7.tar.gz
.
File metadata
- Download URL: wormstools-1.3.7.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e4af56bcd09474e91812f2b7922874c783efb3f42608d1cb98ac51d5e2418ec |
|
MD5 | 066aa21d6b45f3e23747b0313ef9860f |
|
BLAKE2b-256 | 2a947802cb568a432bdec87bd77b161584cc5d7077f4927505e1a5c7f85e7d4f |
File details
Details for the file wormstools-1.3.7-py3-none-any.whl
.
File metadata
- Download URL: wormstools-1.3.7-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 157ebf67da461e7ded78fa96c46455e69be2399a00e2a4a5c2106d169c5fc3b7 |
|
MD5 | f59922c547f53cb25f341617c917989e |
|
BLAKE2b-256 | 17bd747ccbfa8dbf986401ed329c5853e5eb8f8e7bf1c14ff9b02bab89abd4fd |