oggmap.ncbitax module

Author: Kristian K Ullrich date: February 2025 email: ullrich@evolbio.mpg.de License: GPL-3

oggmap.ncbitax.add_argparse_args(parser: ArgumentParser)

This function attaches individual argument specifications to the parser.

Parameters:

parser (argparse.ArgumentParser) – An argparse.ArgumentParser.

oggmap.ncbitax.define_parser()

A helper function for using ncbitax.py via the terminal.

Returns:

An argparse.ArgumentParser.

Return type:

argparse.ArgumentParser

oggmap.ncbitax.main()

The main function that is being called when ncbitax.py is used via the terminal.

oggmap.ncbitax.update_ncbi(args)

This function updates or downloads the NCBI taxonomy database using the package taxadb2. A parsed version of it will be stored at a given directory: taxadb.sqlite.

Parameters:

args (argparse.Namespace) – Command-line arguments.

Example

>>> import sys
>>> from oggmap import ncbitax
>>> outdir = 'taxadb'
>>> dbname = 'taxadb.sqlite'
>>> sys.argv = ['ncbitax', '-u', '-outdir', outdir, '-t', 'taxa', '-dbname', dbname]
>>> update_parser = ncbitax.define_parser()
>>> update_args = update_parser.parse_args()
>>> ncbitax.update_ncbi(update_args)