Python API

OakVar functionality is available through Python API. For example, OakVar's annotation pipeline can be started with the following:

>>> import oakvar as ov
>>>["input.vcf"], annotators=["clinvar"], report_types=["vcf"])

There is 1 to 1 correspondence between command-line interface commands and Python API functions. The table below shows such correspondence.

CLI Python API Functionality
ov config system oakvar.api.config.system Gets or sets system configuration.
ov config user oakvar.api.config.user Gets user configuration.
ov issue oakvar.api.report_issues Opens a webpage to report OakVar issues.
ov license oakvar.api.license Gets the OakVar license information.
ov module info Gets information on a module.
ov module install oakvar.api.module.install Installs modules.
ov module installbase oakvar.api.module.installbase Installs system modules.
ov module ls Lists modules.
ov module pack oakvar.api.module.pack Packs a module for registration at OakVar store.
ov module uninstall oakvar.api.module.uninstall Uninstalls modules.
ov module update oakvar.api.module.update Updates modules.
ov new exampleinput Creates an example input file.
ov new module Creates a template for a new module.
ov report Generates report files from OakVar result databases.
ov run Runs the OakVar annotation pipeline.
ov store delete Deletes a module from the OakVar store.
ov store fetch Fetches the OakVar store cache.
ov store login Logs in to the OakVar store.
ov store logout Logs out from the OakVar store.
ov store register Register a module at the OakVar store.
ov store url Gets the URL of the OakVar store.
ov store account change Changes the password of an OakVar store account.
ov store account check Checks if logged in at the OakVar store.
ov store account create Creats an OakVar store account.
ov store account delete Deletes an OakVar store account.
ov store account reset Invokes a password change email for an OakVar store account.
ov system account check oakvar.api.system.check Checks OakVar installation on the system.
ov system md Gets or sets the OakVar modules directory.
ov system setup oakvar.api.system.setup Sets up OakVar in the system.
ov update oakvar.api.update Gets OakVar version.
ov version oakvar.api.version Gets OakVar version.

OakVar Python API has a utility function to help data science with genomic data. If an OakVar analysis produced ov_result.sqlite result database file, the following will produce a Polars DataFrame from variant level data of the result database.

>>> import oakvar as ov
>>> df = ov.get_df_from_db("ov_result.sqlite", table="variant")