예제 #1
0
def test_x2g_more():
    """
    Do some c. to g. conversion checking for the gene on the forward
    strand.
    """
    rna = [5002, 5125, 27745, 27939, 58661, 58762, 74680, 74767, 103409,
           103528, 119465, 119537, 144687, 144810, 148418, 149215]
    cds = [27925, 74736]
    cm = Crossmap(rna, cds, 1)
    assert cm.x2g(-304, -1) == 5001
    assert cm.x2g(-182, 0) == 5124
    assert cm.x2g(-181, 1) == 5126
    assert cm.x2g(-1, 0) == 27924
    assert cm.x2g(1, 0) == 27925
    assert cm.x2g(16, -1) == 58660
    assert cm.x2g(174, 0) == 74736
    assert cm.x2g(cm.main2int('*1'), 0) == 74737
    assert cm.x2g(cm.main2int('*32'), -1) == 103408
    assert cm.x2g(cm.main2int('*33'), 0) == 103410
    assert cm.x2g(cm.main2int('*1146'), 1) == 149216
예제 #2
0
def test_x2g_more_reverse():
    """
    Do some c. to g. conversion checking for the gene on the reverse
    strand.
    """
    rna = [2000, 2797, 6405, 6528, 31678, 31750, 47687, 47806, 76448,
           76535, 92453, 92554, 123276, 123470, 146090, 146213]
    cds = [76479, 123290]
    cm = Crossmap(rna, cds, -1)
    assert cm.x2g(-304, -1) == 146214
    assert cm.x2g(-182, 0) == 146091
    assert cm.x2g(-181, 1) == 146089
    assert cm.x2g(-1, 0) == 123291
    assert cm.x2g(1, 0) == 123290
    assert cm.x2g(16, -1) == 92555
    assert cm.x2g(174, 0) == 76479
    assert cm.x2g(cm.main2int('*1'), 0) == 76478
    assert cm.x2g(cm.main2int('*32'), -1) == 47807
    assert cm.x2g(cm.main2int('*33'), 0) == 47805
    assert cm.x2g(cm.main2int('*1146'), 1) == 1999