コード例 #1
0
def test_GenCoor_relocate5():
    g1 = GenCoor(chrom="chr1", start=10, end=20, name="test", strand="-")
    r = g1.relocate(mode='center as center', width=2, inplace=False)
    assert r.start == 14
    assert r.end == 16
    r = g1.relocate(mode='5end as center', width=2, inplace=False)
    assert r.start == 19
    assert r.end == 21
    r = g1.relocate(mode='3end as center', width=2, inplace=False)
    assert r.start == 9
    assert r.end == 11
    r = g1.relocate(mode='5end as 5end', width=2, inplace=False)
    assert r.start == 18
    assert r.end == 20
    r = g1.relocate(mode='3end as 3end', width=2, inplace=False)
    assert r.start == 10
    assert r.end == 12
コード例 #2
0
def test_GenCoor_relocate3():
    g1 = GenCoor(chrom="chr1", start=10, end=20, name="test", strand="-")
    r = g1.relocate(mode='center as center', inplace=False)
    assert r.start == 10
    assert r.end == 20
    r = g1.relocate(mode='5end as center', inplace=False)
    assert r.start == 15
    assert r.end == 25
    r = g1.relocate(mode='3end as center', inplace=False)
    assert r.start == 5
    assert r.end == 15
    r = g1.relocate(mode='5end as 5end', inplace=False)
    assert r.start == 10
    assert r.end == 20
    r = g1.relocate(mode='3end as 3end', inplace=False)
    assert r.start == 10
    assert r.end == 20