Package: wormstools
WoRMStoolsFeatures:get up-to-date information fromWoRMS databaseTerminal-based scriptsSoftware requierements:Python 3InstallationBy usingpip:pipinstallwormstoolsUsinggit(Optional):gitclonehttps://github.com/Ulises-Rosas/WoRMStools.gitcdWoRMStools
python3setup.pyinstallAphiaIDWe 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 atspecies.txt:catspecies.txtConus roosevelti
Latirus hemphilli
Favartia peasei
Lolliguncula panameusis
Pholoides tuberculataWe can obtain their aphiaIDs by running:wormsspecies.txt-idBy defaultwormsuses its input to name all outputs, however this can be modified with--outoption. Since we did not specify any output name, by default the output name isspecies_worms_aphiaID.tsvand is contains the following:speciesaphiaIDsObs
Conusroosevelti429945Latirushemphilli447141Favartiapeasei738152LolligunculapanameusisRecordnotfoundinWoRMS
PholoidestuberculataRecordnotfoundinWoRMSValidate namesCurrently 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 namesandobs. If there were species that cannot be validated through WoRMS, it is stated on theobscolumn.Example:wormsspecies.txt-valBy default the output name isspecies_worms_val.tsvand 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 WoRMSSynonymsSynonyms 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,synonymsandobs. If there was a species that are not found in WoRMS its validated name is taken and stated on theobscolumn. Furthermore, if this species cannot be validated*, it is also stated in theobscolumn.Example:wormsspecies.txt-synBy default the output name isspecies_worms_syn.tsvand 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 howhere).Taxonomic rankDifferent 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--atoption (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 theobscolumn. Furthermore, if this species cannot be validated*, it is also stated in theobscolumn.Example:wormsspecies.txt--atClassFamilyBy default the output name isspecies_worms_ranks.tsvand 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 WoRMSFinally, 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 howhere).Usage within python3The wayWoRMStoolsis used inside python3 resemble pretty much as the usage in the terminal we have already seen:# import worms classfromwormstools.core_wormsimportWorms# get aphiaIDWorms(taxon='Conus roosevelti').aphiaID# validate nameWorms(taxon='Conus roosevelti').taxamatch()# get synonymsWorms(taxon='Favartia peasei').get_synonyms()# get an specific taxonomic rankWorms(taxon='Favartia peasei').get_rank(rank='Family')