当前位置: 首页>>代码示例>>Python>>正文


Python Model.load_saved_labels_log方法代码示例

本文整理汇总了Python中Model.Model.load_saved_labels_log方法的典型用法代码示例。如果您正苦于以下问题:Python Model.load_saved_labels_log方法的具体用法?Python Model.load_saved_labels_log怎么用?Python Model.load_saved_labels_log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model.Model的用法示例。


在下文中一共展示了Model.load_saved_labels_log方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import load_saved_labels_log [as 别名]

#.........这里部分代码省略.........
        self.homeDir = homeDir
        self.log = Logger(self.homeDir,configDict=self.configDict) 
        self.model.initialize(self.homeDir)
        self.fileNameList = get_fcs_file_names(self.homeDir)
        
        ## this needs to be tested or modified for very large projects
        self.eventsList = [self.model.get_events_from_file(fn) for fn in self.fileNameList]
        
        if len(self.fileNameList) > 0:
            self.fileChannels = self.model.get_file_channel_list(self.fileNameList[0])
        else:
            self.fileChannels = None

        if self.channelDict == None:
            self.channelDict = self.model.load_channel_dict()

    def _labels_load(self,labelsID):
        '''
        load the labels from a given labelsID
        Often the model run id is the labelsID
        '''

        if labelsID == None:
            return

        if self.labelsList.has_key(labelsID) == True:
            return None

        _labelsList = []
        _logsList = []

        for fileName in self.fileNameList:
            _labels = self.model.load_saved_labels(fileName,labelsID)
            modelLog = self.model.load_saved_labels_log(fileName,labelsID)
            _labelsList.append(_labels)
            _logsList.append(modelLog)
        self.labelsList[labelsID] = _labelsList
        self.labelsLogList[labelsID] = _logsList
        
    def get_events(self,selectedFileName,subsample='original',filterName=None):
        '''
            input:
                selectedFileName - string representing the file without the full path and without a file extension
                subsample - any numeric string, int or float that specifies an already processed subsample
                subsample - may also be a filterID such as 'filter1'
        '''
  
        ## error checking
        if selectedFileName not in self.fileNameList:
            print "ERROR: Controller.get_events - Invalid selectedFile specified", selectedFileName
            return None
        
        ## check to see if orig events are in memory otherwise load them from pickle
        if len(self.eventsList) > 0:
            origEvents =  self.eventsList[self.fileNameList.index(selectedFileName)]
        else:
            origEvents =  self.model.get_events_from_file(selectedFileName)

        if subsample == 'original':
            return origEvents
        elif filterName != None:
            if self.subsampleDict.has_key(filterName) == False:
                print "WARNING: Controller.get_events -- invalid filterName"
            return origEvents[self.subsampleDict[key],:]
        else:
            self.handle_subsampling(subsample)
开发者ID:ajrichards,项目名称:cytostream,代码行数:70,代码来源:Controller.py


注:本文中的Model.Model.load_saved_labels_log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。