Skip to content

Final targets: BedBaseConf, get_bedbase_cfg

Package bbconf Documentation

Class BedBaseConf

This class standardizes reporting of bedstat and bedbuncher results. It formalizes a way for these pipelines and downstream tools to communicate -- the produced results can easily and reliably become an input for the server. The object exposes API for interacting with the results and is backed by a PostgreSQL database.

def __init__(self, config_path=None, database_only=False)

Initialize the object

Parameters:

  • config_path (str): path to the bedbase configuration file
  • database_only (bool): whether the database managers should notkeep an in-memory copy of the data in the database
def bed(self)

PipestatManager of the bedfiles table

Returns:

  • pipestat.PipestatManager: manager of the bedfiles table
def bedset(self)

PipestatManager of the bedsets table

Returns:

  • pipestat.PipestatManager: manager of the bedsets table
def config(self)

Config used to initialize the object

Returns:

  • yacman.YacAttMap: bedbase configuration file contents
def get_bedbuncher_output_path(self, remote=False)

Get path to the output of the bedbuncher pipeline

Parameters:

  • remote (bool): whether to use remote url base

Returns:

  • str: path to the bedbuncher pipeline output
def get_bedstat_output_path(self, remote=False)

Get path to the output of the bedstat pipeline

Parameters:

  • remote (bool): whether to use remote url base

Returns:

  • str: path to the bedstat pipeline output
def remove_relationship(self, bedset_id, bedfile_ids=None)

Remove entries from the relationships table

Parameters:

  • bedset_id (str): id of the bedset to remove
  • bedfile_ids (list[str]): ids of the bedfiles to remove for theselected bedset. If none provided, all the relationsips for the selected bedset will be removed.
def report_relationship(self, bedset_id, bedfile_id)

Report a bedfile for bedset.

Inserts the ID pair into the relationship table, which allows to manage many to many bedfile bedset relationships

Parameters:

  • bedset_id (int): id of the bedset to report bedfile for
  • bedfile_id (int): id of the bedfile to report
def select_bedfiles_for_bedset(self, condition=None, condition_val=None, bedfile_col=None)

Select bedfiles that are part of a bedset that matches the query

Parameters:

  • condition (str): bedsets table query to restrict the results with,for instance "id=%s"
  • condition_val (list[str]): values to populate the condition stringwith
  • bedfile_col (list[str] | str): bedfile columns to include in theresult, if none specified all columns will be included

Returns:

  • list[psycopg2.extras.DictRow]: matched bedfiles table contents
def get_bedbase_cfg(cfg=None)

Determine path to the bedbase configuration file

The path can be either explicitly provided or read from a $BEDBASE environment variable

Parameters:

  • cfg (str): path to the config file.Optional, the $BEDBASE config env var will be used if not provided

Returns:

  • str: configuration file path

Version Information: bbconf v0.1.0, generated by lucidoc v0.4.3