Intervalls.py -

Author:Andreas Heger
Release:$Id$
Date:December 09, 2013
Tags:Python

Code

Intervalls.CombineIntervallsLarge(intervalls)

combine intervalls. Overlapping intervalls are concatenated into larger intervalls.

Intervalls.ComplementIntervalls(intervalls, first=None, last=None)

complement a list of intervalls with intervalls not in list.

Intervalls.AddComplementIntervalls(intervalls, first=None, last=None)

complement a list of intervalls with intervalls not in list and return both.

Intervalls.CombineIntervallsDistance(intervalls, min_distance)

combine a list of non-overlapping intervalls, and merge those that are less than a certain distance apart.

Intervalls.DeleteSmallIntervalls(intervalls, min_length)

combine a list of non-overlapping intervalls, and delete those that are too small.

Intervalls.CombineIntervallsOverlap(intervalls)

combine intervalls. Overlapping intervalls are reduced to their intersection.

first_from, last_to contain region of current maximum overlapping segment. max_right is maximum extension of any sequence overlapping with current overlapping segment.

Intervalls.RemoveIntervallsContained(intervalls)

remove intervalls that are fully contained in another.

[(10, 100), (20, 50), (70, 120), (130, 200), (10, 50), (140, 210), (150, 200)]

results:

[(10, 100), (70, 120), (130, 200), (140, 210)]

Intervalls.RemoveIntervallsSpanning(intervalls)

remove intervalls that are full covering another, i.e. always keep the smallest.

[(10, 100), (20, 50), (70, 120), (40,80), (130, 200), (10, 50), (140, 210), (150, 200)]

result:

[(20, 50), (40, 80), (70, 120), (150, 200)]

Intervalls.ShortenIntervallsOverlap(intervalls, to_remove)

shorten intervalls, so that there is no overlap with another set of intervalls.

assumption: intervalls are not overlapping

Intervalls.CalculateOverlap(intervalls1, intervalls2)

calculate overlap between intervalls.

Table Of Contents

Previous topic

Cluster.py - module for running a job in parallel on the cluster

Next topic

IntervallsWeigted.py - working with weigted intervals

This Page