agglovar.merge.config.strategy

Intersect strategy definitions.

The intersect strategy contains a full intersect specification including the strategy type and list of stages.

Classes

IntersectStrategy

A configured intersect strategy.

Module Contents

class agglovar.merge.config.strategy.IntersectStrategy(intersect_strategy: str | None)

Bases: object

A configured intersect strategy.

Takes the AST output from the parser and generates a configuration object.

Variables:
  • strategy_type – Intersect strategy type. If None, then the configuration object is in an undefined or uninitialized state and must not be used until initialized.

  • stage_list – List of intersect stages.

  • default_match_stage – Default match stage object applied to all stages (if there are none).

__repr__() str

Get a string representation.

__str__() str

Get a string representation formatted for display.

clear() None

Clear all merge stages and global options.

set_config_string(config_string: str, clear: bool = True) None

Configure this intersect strategy using a configuration string.

The string is parsed according to an intersect definition grammar and used to configure this object.

Parameters:
  • config_string – Configuration string. Must not be Null or empty.

  • clear – If true, clear any existing configuration. If false and an existing configuration exists, then global options are overridden and new intersect stages are added to existing ones already in this configuration object.

Raises:

ValueError – If configuration fails for any reason. This may or may not leave the configuration object in an undefined state. If the “strategy” attribute is None after calling this method, then the configuration object is in an undefined state and must not be used; otherwise, a failure occurred before the object was altered and the object state is unchanged by this method call.

set_strategy_type(strategy_type: str) None

Set the strategy type.

Parameters:

strategy_type – A string strategy type to use, such as “nr” (for non-redundant strategy). Must not be missing or empty, must contain only alphanumeric characters and underscores, and may not start with a digit.

Raises:

ValueError – If strategy type is missing or empty, if the strategy string is not alphanumeric, or if the strategy string starts with a digit.

default_match_stage: agglovar.merge.config.stage.IntersectStageMatch | None
property has_vcf_temp: bool

Determine if any merge stage uses a VCF temporary file.

property is_any_match: bool

Determine if any match stages are present.

stage_list: list[agglovar.merge.config.stage.IntersectStage]
strategy_type: str | None