def _expand_alts_and_remove_duplicates_in_list(cls, vcf_records, ref_seq, indel_gap=100):
        '''Input: list of VCF records, all from the same CHROM. ref_seq = sequence
        of that CHROM. Expands any record in the list that has >ALT, into
        one record per ALT. Removes duplicated records, where REF and ALT
        are the same (at the same position!), or where there is the same
        indel more than once, but written in a different way (eg indel in
        homopolymer run can be put in >1 way in a VCF. Checks indels
        are the same within indel_gap nucleotides of each other'''
        expanded_vcf_records = VcfClusterer._expand_alts_in_vcf_record_list(vcf_records)
        new_vcf_records = [x for x in expanded_vcf_records if not x.is_snp()]


        for i in range(len(new_vcf_records) - 1):
            j = i + 1
            while j < len(new_vcf_records) and new_vcf_records[i].ref_end_pos() + indel_gap > new_vcf_records[j].POS:
                if new_vcf_records[i].is_the_same_indel(new_vcf_records[j], ref_seq):
                    new_vcf_records.pop(j)
                else:
                    j += 1

        new_vcf_records.extend([x for x in expanded_vcf_records if x.is_snp()])
        new_vcf_records.sort(key=operator.attrgetter('POS'))
        return new_vcf_records