ailist.IntervalArray#

class ailist.IntervalArray[source]#

IntervalArray stores a list of intervals

Attributes

ends

End values

is_closed

Whether object is still in memory

is_constructed

Whether IntervalArray is constructed or not

is_frozen

Whether object is immutable

range

Ranges(start, end) for each label

size

Number of intervals in IntervalArray

starts

Start values

Methods

add(start, end)

Add an interval to IntervalArray inplace

append(other_ail)

Add intervals from arrays to IntervalArray inplace

bin_nhits([bin_size, min_length, max_length])

Find number of intervals overlapping binned positions

close()

Close object and clear memory

construct([min_length])

Construct labeled_aiarray_t *Required to call intersect

copy()

Copy IntervalArray

coverage([min_length, max_length])

Calculate coverage for each position in IntervalArray range

create_bin(bin_range[, bin_size])

downsample(proportion[, return_intervals, ...])

Randomly downsample IntervalArray

filter([min_length, max_length])

Filter out intervals outside of a length range

filter_exact_match(other_aiarray)

Determine which intervals are present

freeze()

Make IntervalArray immutable

has_exact_match(other_aiarray)

Determine which intervals are present

has_hit(start, end)

Find interval indices overlapping given ranges

index_with_aiarray(other_aiarray)

intersect(start, end[, return_intervals, ...])

Find intervals overlapping given range

intersect_from_IntervalArray(ail_query[, ...])

Find interval indices overlapping given ranges

iter_intersect(query_laia[, ...])

iter_sorted()

Iterate over an IntervalArray in sorted way

length_dist()

Calculate length distribution of intervals

merge([gap])

Merge intervals within a gap

nhits(start, end[, min_length, max_length])

Find number of intervals overlapping given positions

nhits_from_IntervalArray(query_laia[, ...])

Find number of intervals overlapping

simulate()

sort()

sorted_index()

unfreeze()

Make IntervalArray mutable

validate_construction()

wps([protection, min_length, max_length])

Calculate Window Protection Score for each position in IntervalArray range