Skip to content

oakvar.lib.util.util

get_df_from_db

get_df_from_db(db_path, table_name='variant', sql=None, num_cores=1, conn=None, library='polars')

Gets a Polars DataFrame of a table in an OakVar result database.

PARAMETER DESCRIPTION
db_path

Path to the OakVar result database file from which a Polars DataFrame will be extracted.

TYPE: str

table_name

Table name to dump to the DataFrame

TYPE: str DEFAULT: 'variant'

sql

Custom SQL to apply before dumping to the DataFrame. For example, "select base__uid, base__chrom, base__pos from variant where clinvar__sig='Pathogenic'".

TYPE: Optional[str] DEFAULT: None

num_cores

Number of CPU cores to use

TYPE: int DEFAULT: 1

RETURNS DESCRIPTION
Optional[DataFrame]

DataFrame of the given or default table of the OakVar result database