Пример #1
0
 def __init__(self, splitter, channel_meta=None):
     """Calculate a standard set of metrics."""
     self.register_event_metric('median_current', apply_to_field(np.median, 'mean'))
     self.register_event_metric('median_sd', apply_to_field(np.median, 'stdv'))
     self.register_event_metric('median_dwell', apply_to_field(np.median, 'length'))
     self.register_event_metric('num_events', len)
     self.register_event_metric('start_time', read_start_time)
     self.register_event_metric('duration', duration)
     self.register_event_metric('range_current', apply_to_field(range_data, 'mean'))
     super(StandardMetrics, self).__init__(splitter, channel_meta=channel_meta)
Пример #2
0
    def __init__(self, splitter, channel_meta=None):
        """Calculate metrics of interest for solid state runs (but potentially useful elsewhere"""

        self.register_event_metric('max_current', apply_to_field(np.max, 'mean'))  # as estimate of abasic peak
        self.register_event_metric('stdev_current', apply_to_field(np.std, 'mean'))

        # copy read meta from AdaptiveSplitter as metrics
        copy_meta = ('pore_level', 'capture_level', 'threshold')
        for name in copy_meta:
            self.register_read_meta_metric(name)
        #TODO: add metric for strand level (excluding abasic), for whole read, and up to start of abasic peak.
        super(SolidStateMetrics, self).__init__(splitter, channel_meta=channel_meta)
Пример #3
0
    def __init__(self,
                 splitter,
                 channel_meta=None,
                 window_bounds=(0, 1, 3, 500, 900)):
        """Calculate a standard set of metrics including Minion state data."""
        copy_meta = (
            'start_event',
            'end_event',
            'initial_classification',
            'initial_n_reads',
        )
        for name in copy_meta:
            self.register_read_meta_metric(name)
        self.register_event_metric('entropy_current',
                                   apply_to_field(entropy, 'mean'))

        self.register_event_multi_metric(
            ('stall_duration', 'stall_median_current', 'stall_range'),
            locate_stall)

        # register mean current calculated in several windows
        for start, end in window(window_bounds, 2):
            self.register_event_metric(
                'median_current_{}_to_{}_s'.format(start, end),
                partial(windowed_metric,
                        feature='mean',
                        window_start=start,
                        window_length=end - start,
                        func_to_apply=np.median))
        super(BlockingMetrics, self).__init__(splitter,
                                              channel_meta=channel_meta)
Пример #4
0
 def __init__(self, splitter):
     """Example of registering functions to calculate metrics."""
     self.register_event_metric('mean', apply_to_field(np.mean, 'mean'))
     self.register_event_metric('stdv', apply_to_field(np.std, 'mean'))
     super(SimpleMetrics, self).__init__(splitter)