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 = "'grouping'"[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]
lvls_inds = 'None'[source]
group_ind = 'None'[source]
lvls = 'None'[source]
histogram = 'None'[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]
_particle: smsh5.Particle[source]
first = 'False'[source]
single_level = 'False'[source]
last = 'False'[source]
_log_l_em = 'None'[source]
_em_p_mj = 'None'[source]
_em_log_l = 'None'[source]
_ahc_p_mj = 'None'[source]
_ahc_groups = 'None'[source]
groups = 'None'[source]
bic = 'None'[source]
num_groups = 'None'[source]
level_group_ind = 'None'[source]
group_levels = 'None'[source]
_num_prev_groups[source]
groups_have_hists = 'False'[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]
backup = 'None'[source]
has_groups = 'False'[source]
_particle[source]
uuid[source]
steps = 'None'[source]
best_step_ind = 'None'[source]
bics = 'None'[source]
selected_step_ind = 'None'[source]
num_steps = 'None'[source]
plots_need_to_be_updated = 'False'[source]
use_roi_for_grouping = 'True'[source]
grouped_with_roi = 'False'[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]
is_global_level = 'True'[source]
particle[source]
parent_particle_dataset_ind[source]
start_time_offset_ns[source]
times_ns[source]
int_p_s[source]
group_ind[source]
dwell_time_ns[source]
num_photons[source]
microtimes_particle_inds_pairs = '()'[source]