ailist.AIList.from_array#
- AIList.from_array(self, const long[::1] starts, const long[::1] ends, const long[::1] ids)#
Add intervals from arrays to AIList inplace
- Parameters:
- starts : ndarray{long}
Start positions of intervals
- ends : numpy.ndarray{long}
End positions of intervals
- ids : numpy.ndarray{long}
ID of intervals
- Returns:
None
See also
AIList.add
Add interval to AIList
AIList.construct
Construct AIList, required to call AIList.intersect
AIList.intersect
Find intervals overlapping given range
Examples
>>> from ailist import AIList >>> import numpy as np >>> starts = np.arange(100) >>> ends = starts + 10 >>> index = np.arange(len(starts)) >>> ail = AIList() >>> ail.from_array(starts, ends, index) >>> ail. AIList range: (0-109) (0-10, 0) (1-11, 1) (2-12, 2) (3-13, 3) (4-14, 4) ... (95-105, 95) (96-106, 96) (97-107, 97) (98-108, 98)