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


Python Model.load_channel_dict方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import load_channel_dict [as 别名]
class Controller:
    def __init__(self,configDict=None,debug=False):
        """
        construct an instance of the controller class
        to use invoke the method initialize
        """

        ## basic application wide variables 
        self.appName = "cytostream"
        self.debug = debug

        if self.debug == True:
            self.verbose = True
            self.defaultDir = os.path.join(self.baseDir,'projects')
        else:
            self.verbose = False
            self.defaultDir = os.getenv("HOME")

        ## application variables
        self.configDict = configDict
        self.reset_workspace()

        # get base directory
        if hasattr(sys,'frozen'):
            self.baseDir = os.path.dirname(sys.executable)
            self.baseDir = re.sub("MacOS","Resources",self.baseDir)
        else:
            self.baseDir = os.path.dirname(__file__)

        if os.path.split(self.baseDir)[-1] != "cytostream":
            self.baseDir = os.path.join(self.baseDir,"cytostream")

        if os.path.isdir(os.path.join(self.baseDir,'cytostream')) == True:
            self.baseDir = os.path.join(self.baseDir,"cytostream")

    def reset_workspace(self):
        self.projectID = None
        self.homeDir = None
        self.model = Model(verbose=self.verbose)
        self.log = None
        self.subsampleIndices = None
        self.fileChannelPath = None
        self.baseDir = self.model.baseDir
        self.currentPlotView = None
        self.compensationFilePath= None
        self.eventsList = []
        self.fileNameList = None
        self.channelDict = None
        self.subsampleDict = {}
        self.uniqueLabels = {}
        self.labelsList = {}
        self.labelsLogList = {}
        self.pythonPath = self.model.pythonPath                           
        
    def save(self):
        self.log.write()

    def initialize_project(self,homeDir,loadExisting=False):
        ## clean
        #if clean == True:

        self.homeDir = os.path.realpath(homeDir)

        if loadExisting == False:
            print '...cleaning home directory'
            self.remove_project(self.homeDir)
            os.mkdir(self.homeDir)

        self.projectID = os.path.split(homeDir)[-1]
        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 = []

#.........这里部分代码省略.........
开发者ID:ajrichards,项目名称:cytostream,代码行数:103,代码来源:Controller.py


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