When an illogical or invalid HGVS string is provided to Variant, this function returns None. (Tune into
the “metavariant” logger at INFO level for information.)

Variant will also accept a SequenceVariant object as its argument, returning the same variant (identity).

VariantLVG: Lexical Variant Generation

VariantLVG takes an hgvs.SequenceVariant object or a plain HGVS string and uses the Universal Transcript
Archive (UTA) to find as many related transcripts and sequence variants as possible that could be used as
“synonyms” of the provided variant.

This class raises CriticalHgvsError upon instantiation if the supplied HGVS string fails to create a
valid SequenceVariant object.

Enrichment

VariantLVG provides for “enrichment” of lexical variant generation by allowing
more transcripts and variations to be supplied at instantiation. Just use the
appropriate keyword for the type of information, remembering that the “enrichment”
keyword arguments are all lists.

A VariantComponents object provides access to the following attributes and properties:

seqtype: the sequence type of this seqvar (one of 'c', 'g', 'g', 'n')
edittype: the type of mutation represented by this variant ('SUB', 'DEL', 'FS', etc)
pos: position of the edit
ref: reference sequence at given position (aka "wildtype")
alt: alternate (or "mutant") at given position
posedit: returns the HGVS "official" construction of this seqvar's position + edit information.
posedit_slang: returns a list of algorithmically generated "slang" for given seqvar's posedit.

Exceptions

All exceptions can be found and imported from metavariant.exceptions.

CriticalHgvsError: raised when input HGVS string fails to instantiate a SequenceVariant object within the VariantLVG object.

RejectedSeqVar: raised inside VariantComponents when input sequence components fail certain tests of completeness. For example, a protein seqvar will throw this Exception if the protein effect string is only a “?” (i.e. unknown protein effect). A “SUB” (substitution) will fail the completeness test if an “alt” is not provided in the instantiated components.

Setting UTA Server

When you find yourself outgrowing the public UTA server, you may want to install your own UTA server.
The instructions can be found on the [biocommons/uta repository README](https://bitbucket.org/biocommons/uta). Both “installing from database dumps”
and installing from docker have been tested working with metavariant.

How to Set UTA Host Variables

metavariant connects to a UTA server as soon as it is imported, so reconfiguring which UTA server is used
happens at the environment variable level. The relevant variables: