ailist.AIList.intersect_from_ailist#
- AIList.intersect_from_ailist(self, AIList ail_query)#
Find interval indices overlapping given ranges
- Parameters:
- ail_query : AIList
Intervals to query
- Returns:
- ref_indexnp.ndarray{int}
Overlapping interval indices from AIList
- query_indexnp.ndarray{int}
Overlapping interval indices from query AIList
.. warning:: – This requires
construct()
and will run it if not already run. This will re-sort intervals inplace.
See also
AIList.construct
Construct AIList, required to call AIList.intersect
AIList.add
Add interval to AIList
AIList.intersect
Find intervals overlapping given range
AIList.intersect_index
Find interval indices overlapping given range
AIList.intersect_from_array
Find interval indices overlapping given range
Examples
>>> from ailist import AIList >>> ail1 = AIList() >>> ail1.add(1, 2) >>> ail1.add(3, 4) >>> ail1.add(2, 6) >>> ail1 AIList range: (1-6) (1-2, 0) (3-4, 1) (2-6, 2) >>> ail2 = AIList() >>> ail2.add(1, 2) >>> ail2.add(3, 6) >>> ail2 AIList range: (1-6) (1-2, 0) (3-6, 1) >>> q = ail1.intersect_from_ailist(ail2) >>> q (array([0, 1, 1]), array([0, 2, 1]))