def vcf_file_to_dict_of_vars(infile, reference_seqs):
variants = {}<EOL>_, vcf_records = vcf_file_to_dict(infile, sort=False, remove_asterisk_alts=True, remove_useless_start_nucleotides=True)<EOL>for ref_name, variant_list in vcf_records.items():<EOL><INDENT>for record in variant_list:<EOL><INDENT>if record.POS < <NUM_LIT:0>:<EOL><INDENT>logging.warning(f'<STR_LIT>')<EOL>continue<EOL><DEDENT>elif record.CHROM not in reference_seqs:<EOL><INDENT>logging.warning(f'<STR_LIT>')<EOL>continue<EOL><DEDENT>elif reference_seqs[record.CHROM][record.POS:record.POS + len(record.REF)] != record.REF:<EOL><INDENT>logging.warning(f'<STR_LIT>')<EOL>continue<EOL><DEDENT>if ref_name not in variants:<EOL><INDENT>variants[ref_name] = {}<EOL><DEDENT>if record.POS not in variants[ref_name]:<EOL><INDENT>variants[ref_name][record.POS] = {}<EOL><DEDENT>if record.REF not in variants[ref_name][record.POS]:<EOL><INDENT>variants[ref_name][record.POS][record.REF] = set()<EOL><DEDENT>variants[ref_name][record.POS][record.REF].update(record.ALT)<EOL><DEDENT><DEDENT>return variants<EOL>
Loads just the variant info from input VCF file.
    If reference_seqs is given, should be a dict of seq name -> pyfastaq Fastaq sequence,
    and will be used to sanity check variants in input file. Any where CHROM
    is not in the dict, or REF string does not match the ref sequence, are ignored
    Output is a dictionary of:
    ref name -> position -> {ref string -> {set of alt strings}}