def parse_variant(store, institute_obj, case_obj, variant_obj, update=False, genome_build='<STR_LIT>',<EOL>get_compounds = True):
has_changed = False<EOL>compounds = variant_obj.get('<STR_LIT>', [])<EOL>if compounds and get_compounds:<EOL><INDENT>if '<STR_LIT>' not in compounds[<NUM_LIT:0>]:<EOL><INDENT>new_compounds = store.update_variant_compounds(variant_obj)<EOL>variant_obj['<STR_LIT>'] = new_compounds<EOL>has_changed = True<EOL><DEDENT>variant_obj['<STR_LIT>'] = sorted(variant_obj['<STR_LIT>'],<EOL>key=lambda compound: -compound['<STR_LIT>'])<EOL><DEDENT>variant_genes = variant_obj.get('<STR_LIT>')<EOL>if variant_genes is not None:<EOL><INDENT>for gene_obj in variant_genes:<EOL><INDENT>if not gene_obj['<STR_LIT>']:<EOL><INDENT>continue<EOL><DEDENT>if gene_obj.get('<STR_LIT>') is None:<EOL><INDENT>hgnc_gene = store.hgnc_gene(gene_obj['<STR_LIT>'], build=genome_build)<EOL>if not hgnc_gene:<EOL><INDENT>continue<EOL><DEDENT>has_changed = True<EOL>gene_obj['<STR_LIT>'] = hgnc_gene['<STR_LIT>']<EOL><DEDENT><DEDENT><DEDENT>if update and has_changed:<EOL><INDENT>variant_obj = store.update_variant(variant_obj)<EOL><DEDENT>variant_obj['<STR_LIT>'] = store.events(institute_obj, case=case_obj,<EOL>variant_id=variant_obj['<STR_LIT>'], comments=True)<EOL>if variant_genes:<EOL><INDENT>variant_obj.update(get_predictions(variant_genes))<EOL>if variant_obj.get('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>variant_obj.update(get_variant_info(variant_genes))<EOL><DEDENT><DEDENT>for compound_obj in compounds:<EOL><INDENT>compound_obj.update(get_predictions(compound_obj.get('<STR_LIT>', [])))<EOL><DEDENT>if isinstance(variant_obj.get('<STR_LIT>'), int):<EOL><INDENT>acmg_code = ACMG_MAP[variant_obj['<STR_LIT>']]<EOL>variant_obj['<STR_LIT>'] = ACMG_COMPLETE_MAP[acmg_code]<EOL><DEDENT>variant_length = variant_obj.get('<STR_LIT>')<EOL>variant_obj['<STR_LIT>'] = {<NUM_LIT>: '<STR_LIT>', -<NUM_LIT:1>: '<STR_LIT>'}.get(variant_length, variant_length)<EOL>if not '<STR_LIT>' in variant_obj:<EOL><INDENT>variant_obj['<STR_LIT>'] = variant_obj['<STR_LIT>']<EOL><DEDENT>return variant_obj<EOL>
Parse information about variants.

    - Adds information about compounds
    - Updates the information about compounds if necessary and 'update=True'

    Args:
        store(scout.adapter.MongoAdapter)
        institute_obj(scout.models.Institute)
        case_obj(scout.models.Case)
        variant_obj(scout.models.Variant)
        update(bool): If variant should be updated in database
        genome_build(str)