tmd.Topology.analysis¶
TMD Topology analysis algorithms implementation.
Functions
|
Calculate how many barcode lines are found in each bin. |
|
Get index of the persistent homology in the ph_list closest to a target extent. |
|
Collapses a list of ph diagrams into a single instance for plotting. |
|
Calculate distance between two ph diagrams. |
|
Calculate unnormed distance between two ph diagrams. |
|
Calculate step distance difference between two ph. |
Finds the apical distance (measured from the soma) based on the variation of the barcode. |
|
|
Finds the apical distance (measured from the soma) based on the variation of the barcode. |
|
Plot the gaussian kernel of a population as an average of the ph diagrams that are given. |
|
Get the sum of two images from the gaussian kernel plotting function. |
|
Calculate how many barcode lines are found in each bin. |
|
Calculate step distance of ph data. |
|
Load PH file in a np.array. |
|
Find matching components and the corresponding distance between the two input diagrams. |
|
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.