def test_compare(allele1, allele2, allele3, allele4, allele5, allele6): assert allele1 == Allele('contig1776', 2468, 2469, 'A', refrseq='G') assert allele3 < allele4 for _ in range(5): alleles = [allele2, allele4, allele3, allele1, allele6, allele5] shuffle(alleles) sa = sorted(alleles) print([a.slug for a in sa]) assert sa == [allele6, allele1, allele2, allele5, allele3, allele4]
def test_bad_coord(): with pytest.raises(InvalidGenomicCoordinateError) as e: a = Allele('scaffold1492', 3000, 2999, 'C') assert 'allele end cannot be before allele start' in str(e)
def test_indel(allele2): assert allele2.refrlength == 1 assert len(allele2) == 3 assert allele2.refr == 'G' assert allele2 < Allele('contig1776', 2468, 2500, 'ATG')
def allele6(): return Allele('chr17', 1944, 1945, 'GATTACA')
def allele5(): return Allele('contig1776', 123456788, 123456789, 'T')
def allele4(): return Allele('contig1812', 13579, 13580, 'G', refrseq='T')
def allele2(): return Allele('contig1776', 2468, 2469, 'CAT', refrseq='G')
def allele1(): return Allele('contig1776', 2468, 2469, 'A')