Source code for iocbio.kinetics.modules.sysbio.mechanics.mech_ufreqcasl_lowhigh

from iocbio.kinetics.calc.composer import AnalyzerCompose
from iocbio.kinetics.calc.mean_med_std import AnalyzerMeanMedStdDB
import numpy as np

### Module flag
IocbioKineticsModule = ['analyzer']

#####################################################################################
# Low calcium
[docs]class AnalyzerMechUFreqCaSL_Low(AnalyzerCompose): """Low calcium""" def __init__(self, database, data): AnalyzerCompose.__init__(self) AnalyzerCompose.add_analyzer(self, "SL", AnalyzerMeanMedStdDB(database, data, "mechanics_ufreqcasl_sl_calow", 'sarcomere length')) AnalyzerCompose.add_analyzer(self, "Ca Bound", AnalyzerMeanMedStdDB(database, data, "mechanics_ufreqcasl_ca_bound_calow", 'fluorescence side')) if 'fluorescence bottom' in data.keys(): AnalyzerCompose.add_analyzer(self, "Ca Free", AnalyzerMeanMedStdDB(database, data, "mechanics_ufreqcasl_ca_free_calow", 'fluorescence bottom')) self.data = data # used by event name reader self.data_id = data.data_id self.composer = True self.fit() @staticmethod def slice(data, x0, x1): sdata = data.slice(x0, x1) sdata.event_name = 'Low' sdata.event_value = None return sdata @staticmethod def auto_slicer(data): return []
##################################################################################### # High calcium
[docs]class AnalyzerMechUFreqCaSL_High(AnalyzerCompose): """High calcium""" def __init__(self, database, data): AnalyzerCompose.__init__(self) AnalyzerCompose.add_analyzer(self, "Ca Bound", AnalyzerMeanMedStdDB(database, data, "mechanics_ufreqcasl_ca_bound_cahigh", 'fluorescence side')) if 'fluorescence bottom' in data.keys(): AnalyzerCompose.add_analyzer(self, "Ca Free", AnalyzerMeanMedStdDB(database, data, "mechanics_ufreqcasl_ca_free_cahigh", 'fluorescence bottom')) self.data = data # used by event name reader self.data_id = data.data_id self.composer = True self.fit() @staticmethod def slice(data, x0, x1): sdata = data.slice(x0, x1) sdata.event_name = 'High' sdata.event_value = None return sdata @staticmethod def auto_slicer(data): return []
##################### #### ModuleAPI ######
[docs]def analyzer(database, data): """ModuleAPI""" Analyzer = {} if data.type == "SBMicroscope Mechanics Unloaded cardiomyocyte Ca and SL stimulation frequency response" or \ data.type == "SBMicroscope Mechanics Loaded cardiomyocyte Ca and SL stimulation frequency response": Analyzer['low'] = AnalyzerMechUFreqCaSL_Low Analyzer['high'] = AnalyzerMechUFreqCaSL_High return Analyzer, None, None