Пример #1
0
def test_get_overlap_n4():
    print("tests condition when (+) newPeak doesn't overlap region")
    peak = neg_chr1_5_15()
    region = neg_chr1_0_5()
    expect_overlap = pd.Series(
        data=[0,0,0,0,0],
        index=range(5)
    )
    test_overlap = intervals.get_overlap(peak, region)
    print('test', test_overlap)
    print('expect', expect_overlap)
    assert_series_equal(test_overlap, expect_overlap)
Пример #2
0
def test_get_overlap_n7():
    print("tests condition when (-) newPeak completely overlaps region")
    peak = neg_chr1_5_15()
    region = neg_chr1_5_15()
    expect_overlap = pd.Series(
        data=[.1,.1,.1,.1,.1,.1,.1,.1,.1,.1],
        index=range(10)
    )
    test_overlap = intervals.get_overlap(peak, region, 'fraction_region')
    print('test', test_overlap)
    print('expect', expect_overlap)
    assert_series_equal(test_overlap, expect_overlap)
Пример #3
0
def test_get_overlap_p3():
    print("tests condition when (+) newPeak completely overlaps region")
    peak = pos_chr1_5_15()
    region = pos_chr1_5_15()
    expect_overlap = pd.Series(
        data=[1,1,1,1,1,1,1,1,1,1],
        index=range(10)
    )
    test_overlap = intervals.get_overlap(peak, region)
    print('test', test_overlap)
    print('expect', expect_overlap)
    assert_series_equal(test_overlap, expect_overlap)
Пример #4
0
def test_get_overlap_n2():
    print("tests condition when (+) newPeak partially overlaps region")
    peak = neg_chr1_5_15()
    region = neg_chr1_0_10()
    expect_overlap = pd.Series(
        data=[1,1,1,1,1,0,0,0,0,0],
        index=range(10)
    )
    test_overlap = intervals.get_overlap(peak, region)
    print('test', test_overlap)
    print('expect', expect_overlap)
    assert_series_equal(test_overlap, expect_overlap)
Пример #5
0
def test_get_overlap_n6():
    print("tests condition when (-) newPeak partially overlaps region"
          " but shares end coords using the region frac scoring method.")
    peak = neg_chr1_5_10()
    region = neg_chr1_0_10()
    expect_overlap = pd.Series(
        data=[.1,.1,.1,.1,.1,0,0,0,0,0],
        index=range(10)
    )
    test_overlap = intervals.get_overlap(peak, region, 'fraction_region')
    print('test', test_overlap)
    print('expect', expect_overlap)
    assert_series_equal(test_overlap, expect_overlap)
Пример #6
0
def test_get_overlap_p5():
    print("tests condition when (+) newPeak is completely "
          "contained within the region")
    peak = pos_chr1_3_5()
    region = pos_chr1_0_10()
    expect_overlap = pd.Series(
        data=[0,0,0,1,1,0,0,0,0,0],
        index=range(10)
    )
    test_overlap = intervals.get_overlap(peak, region)
    print('test', test_overlap)
    print('expect', expect_overlap)
    assert_series_equal(test_overlap, expect_overlap)
Пример #7
0
def test_get_overlap_p1():
    print("tests condition when (+) newPeak partially overlaps region"
          " but shares end coords")
    peak = pos_chr1_5_10()
    region = pos_chr1_0_10()
    expect_overlap = pd.Series(
        data=[0,0,0,0,0,1,1,1,1,1],
        index=range(10)
    )
    test_overlap = intervals.get_overlap(peak, region)
    print('test', test_overlap)
    print('expect', expect_overlap)
    assert_series_equal(test_overlap, expect_overlap)