:py:mod:`grouping` ================== .. py:module:: grouping .. autoapi-nested-parse:: 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 ~~~~~~~ .. autoapisummary:: grouping.Group grouping.ClusteringStep grouping.AHCA grouping.GlobalLevel Functions ~~~~~~~~~ .. autoapisummary:: grouping.max_jm Attributes ~~~~~~~~~~ .. autoapisummary:: grouping.logger .. py:data:: logger :value: "'grouping'" .. py:function:: max_jm(array: numpy.ndarray) Finds the j and m index for the max value. .. py:class:: Group(lvls_inds: List[int_p_s] = None, particle: smsh5.Particle = None, group_ind: int = None) .. py:property:: num_photons :type: int_p_s .. py:property:: dwell_time_s :type: float .. py:property:: int_p_s :type: float .. py:property:: group_times_ns .. py:property:: group_microtimes .. py:attribute:: lvls_inds :value: 'None' .. py:attribute:: group_ind :value: 'None' .. py:attribute:: lvls :value: 'None' .. py:attribute:: histogram :value: 'None' .. py:class:: ClusteringStep(particle: smsh5.Particle, first: bool = False, seed_groups: List[Group] = None, single_level: bool = False) .. py:property:: group_ints :type: List[float] .. py:property:: group_level_dwelltimes .. py:property:: group_total_dwelltime .. py:property:: group_num_levels .. py:property:: group_level_ints .. py:attribute:: _particle :type: smsh5.Particle .. py:attribute:: first :value: 'False' .. py:attribute:: single_level :value: 'False' .. py:attribute:: last :value: 'False' .. py:attribute:: _log_l_em :value: 'None' .. py:attribute:: _em_p_mj :value: 'None' .. py:attribute:: _em_log_l :value: 'None' .. py:attribute:: _ahc_p_mj :value: 'None' .. py:attribute:: _ahc_groups :value: 'None' .. py:attribute:: groups :value: 'None' .. py:attribute:: bic :value: 'None' .. py:attribute:: num_groups :value: 'None' .. py:attribute:: level_group_ind :value: 'None' .. py:attribute:: group_levels :value: 'None' .. py:attribute:: _num_prev_groups .. py:attribute:: groups_have_hists :value: 'False' .. py:method:: calc_int_bounds(order: str = 'descending') -> List[Tuple[float, float]] Calculates the bounds between the groups. :param order: Option are 'descending' and 'ascending' :type order: str .. py:method:: ahc() Agglomerative Hierarchical Clustering .. py:method:: emc() Expectation Maximisation clustering .. py:method:: calc_bic() .. py:method:: group_2_levels() .. py:method:: setup_next_step() -> ClusteringStep .. py:class:: AHCA(particle) Class for executing Agglomerative Hierarchical Clustering Algorithm and storing the results. .. py:property:: selected_step :type: ClusteringStep .. py:property:: best_step :type: ClusteringStep .. py:property:: steps_num_groups :type: List[int] .. py:attribute:: backup :value: 'None' .. py:attribute:: has_groups :value: 'False' .. py:attribute:: _particle .. py:attribute:: uuid .. py:attribute:: steps :value: 'None' .. py:attribute:: best_step_ind :value: 'None' .. py:attribute:: bics :value: 'None' .. py:attribute:: selected_step_ind :value: 'None' .. py:attribute:: num_steps :value: 'None' .. py:attribute:: plots_need_to_be_updated :value: 'False' .. py:attribute:: use_roi_for_grouping :value: 'True' .. py:attribute:: grouped_with_roi :value: 'False' .. py:method:: clear_and_backup_results() -> None .. py:method:: restore_and_delete_backup() -> None .. py:method:: run_grouping(feedback_queue: multiprocessing.JoinableQueue = None) Run grouping .. py:method:: set_selected_step(step_ind: int) .. py:method:: reset_selected_step() .. py:class:: GlobalLevel(global_particle: Union[smsh5.Particle, smsh5.GlobalParticle], parent_particle_dataset_ind: int, particle_levels: List[Union[change_point.Level, GlobalLevel]], int_p_s: float, group_ind: int, start_time_offset_ns: int, dwell_time_ns: float, num_photons: int) .. py:property:: times_s .. py:property:: dwell_time_s .. py:attribute:: is_global_level :value: 'True' .. py:attribute:: particle .. py:attribute:: parent_particle_dataset_ind .. py:attribute:: start_time_offset_ns .. py:attribute:: times_ns .. py:attribute:: int_p_s .. py:attribute:: group_ind .. py:attribute:: dwell_time_ns .. py:attribute:: num_photons .. py:attribute:: microtimes_particle_inds_pairs :value: '()'