@classmethod<EOL><INDENT>def _expand_alts_and_remove_duplicates_in_list(cls, vcf_records, ref_seq, indel_gap=<NUM_LIT:100>):<DEDENT>
expanded_vcf_records = VcfClusterer._expand_alts_in_vcf_record_list(vcf_records)<EOL>new_vcf_records = [x for x in expanded_vcf_records if not x.is_snp()]<EOL>for i in range(len(new_vcf_records) - <NUM_LIT:1>):<EOL><INDENT>j = i + <NUM_LIT:1><EOL>while j < len(new_vcf_records) and new_vcf_records[i].ref_end_pos() + indel_gap > new_vcf_records[j].POS:<EOL><INDENT>if new_vcf_records[i].is_the_same_indel(new_vcf_records[j], ref_seq):<EOL><INDENT>new_vcf_records.pop(j)<EOL><DEDENT>else:<EOL><INDENT>j += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>new_vcf_records.extend([x for x in expanded_vcf_records if x.is_snp()])<EOL>new_vcf_records.sort(key=operator.attrgetter('<STR_LIT>'))<EOL>return new_vcf_records<EOL>
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