Configuration

hgvs.config

The hgvs package uses a single, package-wide configuration instance to control package behavior. The hgvs.config module provides that configuration instance, via the hgvs.global_config variable.

You should not import hgvs.config directly.

Config are read from an ini-format file. hgvs.config implements a thin wrapper on the ConfigParser instance in order to provide attribute based lookups (rather than key). It also returns heuristically typed values (e.g., “True” becomes True).

Although keys are settable, they are stringified on setting and type-inferred on getting, which means that round-tripping works only for str, int, and boolean.

>>> import hgvs.config
hgvs.config.global_config

Package-wide (“global”) configuration, initialized with package defaults. Setting configuration in this object will change global behavior of the hgvs package.

global_config, an instance of :ref:hgvs.config.Config, supports reading ini-like files that updates

class hgvs.config.Config(extended_interpolation=True)[source]

Bases: object

provides an attribute-based lookup of configparser sections and settings.

read_stream(flo)[source]

read configuration from ini-formatted file-like object

class hgvs.config.ConfigGroup(section)[source]

Bases: object

The defaults are:

[mapping]
alt_aln_method = splign
assembly = GRCh38
in_par_assume = X
inferred_p_is_uncertain = True
normalize = True
prevalidation_level = EXTRINSIC
replace_reference = True

# strict_bounds: require transcript variants to be within transcript sequence bounds
strict_bounds = True

# add gene symbol: add gene symbol on converted variants
add_gene_symbol = False


[formatting]
max_ref_length = 0
p_3_letter = True
p_term_asterisk = False
p_init_met = True

[validator]
strict = True


[normalizer]
cross_boundaries = False
shuffle_direction = 3
validate = True
window_size = 20


[lru_cache]
maxsize = 100


[uta]
pooling = False
pool_min = 1
pool_max = 10

prd_uta_version = uta_20180821
stg_uta_version = uta_20180821
dev_uta_version = uta_20180821
public_host = uta.biocommons.org
local_host = localhost
public_prd = postgresql://anonymous:anonymous@${public_host}/uta/${prd_uta_version}
public_stg = postgresql://anonymous:anonymous@${public_host}/uta/${stg_uta_version}
public_dev = postgresql://anonymous:anonymous@${public_host}/uta_dev/${dev_uta_version}
local_prd  = postgresql://anonymous:anonymous@${local_host}/uta/${prd_uta_version}
local_stg  = postgresql://anonymous:anonymous@${local_host}/uta/${stg_uta_version}
local_dev  = postgresql://anonymous:anonymous@${local_host}/uta_dev/${dev_uta_version}