Quick start¶
1. Build a file¶
This downloads the taxonomies (about 500 MB) and adds them to one SQLite file. The third spec gives NCBI the genomes of GTDB 232, so the two can be translated. See build.
2. Ask it things¶
export OMNITAX_DB=taxonomies.sqlite OMNITAX_TAXONOMY=ncbi
omnitax lookup 562 "Homo sapiens"
omnitax lineage --standard 9606
omnitax search --match fuzzy "bacilus subtilis"
omnitax list
See the query commands.
3. Use it from Python¶
import omnitax
tax = omnitax.open("taxonomies.sqlite", "ncbi")
t = tax["562"]
t.name, t.rank # 'Escherichia coli', 'species'
t.at("genus") # Taxon('561', 'Escherichia', 'genus')
tax.consensus(["562", "564", "999"]) # the node most of them share
omnitax.load("gtdb", "232") parses a taxonomy without a file of your own, into a temporary one. The API is in the Python guide. To translate between taxonomies, see Translation.
4. Serve it (optional)¶
omnitax serve taxonomies.sqlite # on $XDG_RUNTIME_DIR/omnitax.sock
omnitax lookup -t ncbi 562 # finds that socket by itself (without $OMNITAX_DB)
tax = omnitax.connect(taxonomy="ncbi") # $OMNITAX_DB, $OMNITAX_URL, $OMNITAX_SOCKET, the default socket
See serve.