tmd.Topology.analysis

TMD Topology analysis algorithms implementation.

Functions

barcode_bin_centers(ph[, num_bins, min_bin, ...])

Calculate how many barcode lines are found in each bin.

closest_ph(ph_list, target_extent[, method])

Get index of the persistent homology in the ph_list closest to a target extent.

collapse(ph_list)

Collapses a list of ph diagrams into a single instance for plotting.

distance_horizontal(ph1, ph2[, normalized, bins])

Calculate distance between two ph diagrams.

distance_horizontal_unnormed(ph1, ph2[, ...])

Calculate unnormed distance between two ph diagrams.

distance_stepped(ph1, ph2[, order])

Calculate step distance difference between two ph.

find_apical_point_distance(ph)

Finds the apical distance (measured from the soma) based on the variation of the barcode.

find_apical_point_distance_smoothed(ph[, ...])

Finds the apical distance (measured from the soma) based on the variation of the barcode.

get_average_persistence_image(ph_list[, ...])

Plot the gaussian kernel of a population as an average of the ph diagrams that are given.

get_image_add_data(Z1, Z2[, normalized])

Get the sum of two images from the gaussian kernel plotting function.

histogram_horizontal(ph[, num_bins, ...])

Calculate how many barcode lines are found in each bin.

histogram_stepped(ph1)

Calculate step distance of ph data.

load_file(filename[, delimiter])

Load PH file in a np.array.

matching_munkress_modified(p1, p2[, use_diag])

Find matching components and the corresponding distance between the two input diagrams.

sort_ph(ph)

Sorts barcode according to decreasing length of bars.

tmd.Topology.analysis.barcode_bin_centers(ph, num_bins=100, min_bin=None, max_bin=None)

Calculate how many barcode lines are found in each bin.

Returns the bin centers and the number of bars that fall within a bin.

tmd.Topology.analysis.closest_ph(ph_list, target_extent, method='from_above')

Get index of the persistent homology in the ph_list closest to a target extent.

For each ph the maximum extent is computed and compared to the target_extent according to the selected method:

  • from_above: smallest maximum extent that is greater or equal than target_extent.

  • from_below: biggest maximum extent that is smaller or equal than target_extent.

  • nearest: closest by absolute value.

tmd.Topology.analysis.collapse(ph_list)

Collapses a list of ph diagrams into a single instance for plotting.

tmd.Topology.analysis.distance_horizontal(ph1, ph2, normalized=True, bins=100)

Calculate distance between two ph diagrams.

Distance definition: TODO

tmd.Topology.analysis.distance_horizontal_unnormed(ph1, ph2, normalized=True, bins=100)

Calculate unnormed distance between two ph diagrams.

tmd.Topology.analysis.distance_stepped(ph1, ph2, order=1)

Calculate step distance difference between two ph.

tmd.Topology.analysis.find_apical_point_distance(ph)

Finds the apical distance (measured from the soma) based on the variation of the barcode.

tmd.Topology.analysis.find_apical_point_distance_smoothed(ph, threshold=0.1)

Finds the apical distance (measured from the soma) based on the variation of the barcode.

This algorithm always computes a distance, even if there is no obvious apical point. The threshold corresponds to percent of minimum derivative variation that is used to select the minima.

tmd.Topology.analysis.get_average_persistence_image(ph_list, xlim=None, ylim=None, norm_factor=None, weighted=False)

Plot the gaussian kernel of a population as an average of the ph diagrams that are given.

tmd.Topology.analysis.get_image_add_data(Z1, Z2, normalized=True)

Get the sum of two images from the gaussian kernel plotting function.

tmd.Topology.analysis.histogram_horizontal(ph, num_bins=100, min_bin=None, max_bin=None)

Calculate how many barcode lines are found in each bin.

tmd.Topology.analysis.histogram_stepped(ph1)

Calculate step distance of ph data.

tmd.Topology.analysis.load_file(filename, delimiter=' ')

Load PH file in a np.array.

tmd.Topology.analysis.matching_munkress_modified(p1, p2, use_diag=True)

Find matching components and the corresponding distance between the two input diagrams.

tmd.Topology.analysis.sort_ph(ph)

Sorts barcode according to decreasing length of bars.