cluster module¶
-
class
mavis.cluster.cluster.
IntervalPair
(start, end, **kwargs)[source]¶ Bases:
object
Parameters: -
static
center_dist
(other)[source]¶ computes the distance between IntervalPairs by averaging the distance between the first Interval centers of each and the second Interval centers of each
Returns: the distance between interval pairs Return type: int
-
classmethod
cluster
(pairs, r, k)[source]¶ clusters a list of IntervalPair objects
Parameters: - pairs (
list
ofIntervalPair
) – list of IntervalPair objects - r (int) – the distance for grouping clusters
- k (int) – the clique size to look for
Returns: a list of sets of interval pairs representing their clusters/groupings
Return type: list
ofset
ofIntervalPair
- pairs (
-
classmethod
merge
(*interval_pairs)[source]¶ returns a new IntervalPair where the start interval is the weighted mean of the starts of all the input interval pairs, similar for the end
Parameters: interval_pairs (IntervalPair) – interval pairs Returns: the new IntervalPair Return type: IntervalPair
-
static
-
mavis.cluster.cluster.
is_complete
(G, N)[source]¶ for a given input graph and a set of nodes N in G checks if N is a complete subgraph of G
Parameters: - G (networkx.Graph) – the input supergraph
- N (list) – a list of nodes in G
Returns: True if N as a subgraph of G is complete False otherwise
Return type:
-
mavis.cluster.cluster.
merge_integer_intervals
(*intervals)[source]¶ Merges a set of integer intervals into a single interval where the center is the weighted mean of the input intervals. The weight is inversely proportional to the length of each interval. The length of the final interval is the average of the lengths of the input intervals capped in size so that it never extends beyond the union of the input intervals