grouping

Module for handling performing Agglomerative Hierarchical Clustering Algorithm.

Based on ‘Detection of Intensity Change Points in Time-Resolved Single-Molecule Measurements’ from Watkins nad Yang, J. Phys. Chem. B 2005, 109, 617-628 (http://pubs.acs.org/doi/abs/10.1021/jp0467548)

Joshua Botha University of Pretoria 2018

Module Contents

Classes

Group

ClusteringStep

AHCA

Class for executing Agglomerative Hierarchical Clustering Algorithm and storing the results.

GlobalLevel

Functions

max_jm(array)

Finds the j and m index for the max value.

Attributes

logger

grouping.logger[source]
grouping.max_jm(array: numpy.ndarray)[source]

Finds the j and m index for the max value.

class grouping.Group(lvls_inds: List[int_p_s] = None, particle: smsh5.Particle = None, group_ind: int = None)[source]
property num_photons: int_p_s[source]
property dwell_time_s: float[source]
property int_p_s: float[source]
property group_times_ns[source]
property group_microtimes[source]
class grouping.ClusteringStep(particle: smsh5.Particle, first: bool = False, seed_groups: List[Group] = None, single_level: bool = False)[source]
property group_ints: List[float][source]
property group_level_dwelltimes[source]
property group_total_dwelltime[source]
property group_num_levels[source]
property group_level_ints[source]
calc_int_bounds(order: str = 'descending') List[Tuple[float, float]][source]

Calculates the bounds between the groups.

Parameters:

order (str) – Option are ‘descending’ and ‘ascending’

ahc()[source]

Agglomerative Hierarchical Clustering

emc()[source]

Expectation Maximisation clustering

calc_bic()[source]
group_2_levels()[source]
setup_next_step() ClusteringStep[source]
class grouping.AHCA(particle)[source]

Class for executing Agglomerative Hierarchical Clustering Algorithm and storing the results.

property selected_step: ClusteringStep[source]
property best_step: ClusteringStep[source]
property steps_num_groups: List[int][source]
clear_and_backup_results() None[source]
restore_and_delete_backup() None[source]
run_grouping(feedback_queue: multiprocessing.JoinableQueue = None)[source]

Run grouping

set_selected_step(step_ind: int)[source]
reset_selected_step()[source]
class grouping.GlobalLevel(global_particle: smsh5.Particle | smsh5.GlobalParticle, parent_particle_dataset_ind: int, particle_levels: List[change_point.Level | GlobalLevel], int_p_s: float, group_ind: int, start_time_offset_ns: int, dwell_time_ns: float, num_photons: int)[source]
property times_s[source]
property dwell_time_s[source]