1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/usr/bin/env python
import numpy as np
from ncls import NCLS
def test_all_overlaps_both():
starts = np.array([0], dtype=np.int64)
ends = np.array([5000], dtype=np.int64)
ids = np.array([0], dtype=np.int64)
ncls = NCLS(starts, ends, ids)
starts2 = np.arange(0, 2048, 2, dtype=np.int64)
ends2 = np.arange(1, 2048, 2, dtype=np.int64)
result = ncls.all_overlaps_both(starts2, ends2, starts2)
assert len(result[0]) == 1024
print(result[0])
starts2 = np.arange(0, 2 * 2048, 2, dtype=np.int64)
ends2 = np.arange(1, 2 * 2048, 2, dtype=np.int64)
# ncls2 = NCLS(starts2, ends2, starts2)
result = ncls.all_overlaps_both(starts2, ends2, starts2)
assert len(result[0]) == 2048
print(result[0])
|