Parsing#

Additional parsing utilities, require pandas to be installed.

class VariantSet(coordinates, alt_frequencies, preferred_ids, summary)#

Result of parsing with parse_dbsnp_variants().

alt_frequencies#

Frequencies of the alternative alleles.

coordinates#

Coordinates of the SNPs in the genome and consequence (e.g. intro_variant).

preferred_ids#

Preferred identifiers map (old → new); old != new for merged variants.

summary#

Data from DOCSUM field including GENE, HGVS, etc.

parse_dbsnp_variants(snps_result, verbose=False)#

Parse coordinates, frequencies and preferred IDs of dbSNP variants.

Parameters:
Return type:

VariantSet

xml_to_string(element, indent='    ')#

Convert provided XML element to pretty indented string.

Parameters:
  • element – the XML element to convert (data attribute of entrez result)

  • indent – the indentation to use, 4 spaces by default