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}}

def vcf_file_to_dict_of_vars(infile, reference_seqs):
    '''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}}'''
    variants = {}
    _, vcf_records = vcf_file_to_dict(infile, sort=False, remove_asterisk_alts=True, remove_useless_start_nucleotides=True)

    for ref_name, variant_list in vcf_records.items():
        for record in variant_list:
            if record.POS < 0:
                logging.warning(f'VCF record with negative POS in file {infile}. Ignoring: {record}')
                continue
            elif record.CHROM not in reference_seqs:
                logging.warning(f'CHROM not recognised in VCF record in file {infile}. Ignoring: {record}')
                continue
            elif reference_seqs[record.CHROM][record.POS:record.POS + len(record.REF)] != record.REF:
                logging.warning(f'REF string does not match reference seq in file {infile}. Ignoring: {record}')
                continue

            if ref_name not in variants:
                variants[ref_name] = {}

            if record.POS not in variants[ref_name]:
                variants[ref_name][record.POS] = {}

            if record.REF not in variants[ref_name][record.POS]:
                variants[ref_name][record.POS][record.REF] = set()

            variants[ref_name][record.POS][record.REF].update(record.ALT)

    return variants