from_str

from_str#

classmethod Variant.from_str(string, variant_format=VariantFormat.DEFAULT)[source]#

Creates a Variant from a string representation.

Parameters:
  • string (str) – The string representation.

  • variant_format (VariantFormat (default: <VariantFormat.DEFAULT: 'default'>)) – The format of the variant string. By default, this uses “chromosome:position:ref>alt” (for example, “chr1:1024:A>C”). See VariantFormat for alternate formatting options.

Return type:

Self

Returns:

A Variant object.