# Path: deepcpg/data/annotations.py
# def read_bed(filename, sort=False, usecols=[0, 1, 2], *args, **kwargs):
# def in_which(x, ys, ye):
# def is_in(pos, start, end):
# def distance(pos, start, end):
# def join_overlapping(s, e):
# def join_overlapping_frame(d):
# def group_overlapping(s, e):
# def extend_len(start, end, min_len, min_pos=1):
# def extend_len_frame(d, min_len):


import numpy as np
import numpy.testing as npt
import pandas as pd
from deepcpg.data import annotations as annos
    npt.assert_array_equal(actual, expect)

    pos = [1, 6, 7, 9]
    expect = [2, 0, 1, 1]
    start = np.asarray(start)
    end = np.asarray(end)
    pos = np.asarray(pos)
    actual = annos.distance(pos, start, end)
    npt.assert_array_equal(actual, expect)


def test_extend_frame():
    d = pd.DataFrame({
        'chromo': '1',
        'start': [2, 3, 3, 1, 1],
        'end':   [3, 3, 8, 2, 1]
    })
    d = d.loc[:, ['chromo', 'start', 'end']]
    expect = pd.DataFrame({
        'chromo': '1',
        'start':  [1, 2, 3, 1, 1],
        'end':    [4, 5, 8, 4, 4]
    })
    expect = expect.loc[:, ['chromo', 'start', 'end']]
    actual = annos.extend_len_frame(d, 4)
    npt.assert_array_equal(actual.values, expect.values)


def test_group_overlapping():
    npt.assert_array_equal(annos.group_overlapping([], []), [])

# Path: deepcpg/data/annotations.py
# def read_bed(filename, sort=False, usecols=[0, 1, 2], *args, **kwargs):
# def in_which(x, ys, ye):
# def is_in(pos, start, end):
# def distance(pos, start, end):
# def join_overlapping(s, e):
# def join_overlapping_frame(d):
# def group_overlapping(s, e):
# def extend_len(start, end, min_len, min_pos=1):
# def extend_len_frame(d, min_len):


# Path: tests/deepcpg/data/test_annos.py
import numpy as np
import numpy.testing as npt
import pandas as pd
from deepcpg.data import annotations as annos

    npt.assert_array_equal(actual, expect)

    pos = [1, 6, 7, 9]
    expect = [2, 0, 1, 1]
    start = np.asarray(start)
    end = np.asarray(end)
    pos = np.asarray(pos)
    actual = annos.distance(pos, start, end)
    npt.assert_array_equal(actual, expect)


def test_extend_frame():
    d = pd.DataFrame({
        'chromo': '1',
        'start': [2, 3, 3, 1, 1],
        'end':   [3, 3, 8, 2, 1]
    })
    d = d.loc[:, ['chromo', 'start', 'end']]
    expect = pd.DataFrame({
        'chromo': '1',
        'start':  [1, 2, 3, 1, 1],
        'end':    [4, 5, 8, 4, 4]
    })
    expect = expect.loc[:, ['chromo', 'start', 'end']]
    actual = annos.extend_len_frame(d, 4)
    npt.assert_array_equal(actual.values, expect.values)


def test_group_overlapping():
    npt.assert_array_equal(annos.group_overlapping([], []), [])

    npt.assert_array_equal(annos.group_overlapping([1], [2]), [0])