Пример #1
0
    def setupMV(self):
        self.mv.browseCommands('fileCommands', package="Pmv", topCommand=0)
        self.mv.browseCommands('bondsCommands', package='Pmv', topCommand=0)
        self.mv.browseCommands('deleteCommands', package='Pmv', topCommand=0)
        self.mv.browseCommands('displayCommands',
                               commands=[
                                   'displaySticksAndBalls',
                                   'undisplaySticksAndBalls', 'displayCPK',
                                   'undisplayCPK', 'displayLines',
                                   'undisplayLines', 'displayBackboneTrace',
                                   'undisplayBackboneTrace', 'DisplayBoundGeom'
                               ],
                               package='Pmv',
                               topCommand=0)
        self.mv.browseCommands('editCommands', package='Pmv', topCommand=0)
        self.mv.browseCommands("secondaryStructureCommands",
                               package="Pmv",
                               topCommand=0)
        self.mv.browseCommands('beadedRibbonsCommands',
                               package="ePMV",
                               topCommand=0)
        self.mv.browseCommands("splineCommands", package="Pmv", topCommand=0)
        self.mv.browseCommands("coarseMolSurfaceCommands",
                               package="Pmv",
                               topCommand=0)
        self.mv.browseCommands('msmsCommands',
                               commands=[
                                   'computeMSMS',
                                   'displayMSMS',
                                   'undisplayMSMS',
                                   'readMSMS',
                                   'saveMSMS',
                                   'computeSESAndSASArea',
                               ],
                               package='Pmv',
                               topCommand=0)
        self.mv.browseCommands('selectionCommands',
                               commands=[
                                   'select', 'deselect', 'clearSelection',
                                   'saveSet', 'invertSelection', 'selectSet',
                                   'selectFromString', 'directSelect',
                                   'selectHeteroAtoms'
                               ],
                               package='Pmv',
                               topCommand=0)
        self.mv.browseCommands('APBSCommands_2x',
                               package='ePMV.pmv_dev',
                               topCommand=0)
        self.mv.browseCommands('colorCommands',
                               package='ePMV.pmv_dev',
                               topCommand=0)
        self.mv.browseCommands('buildDNACommands',
                               package='ePMV.pmv_dev',
                               topCommand=0)  #commands=['buildDNA']
        self.mv.browseCommands('repairCommands', package='Pmv', topCommand=0)
        self.mv.browseCommands("dejaVuCommands",
                               package="ViewerFramework",
                               topCommand=0)
        self.mv.browseCommands('displayCommands',
                               commands=['showMolecules'],
                               package='Pmv',
                               topCommand=0)
        self.mv.browseCommands('helpCommands', package='Pmv', topCommand=0)

        self.mv.browseCommands('superimposeCommandsNew',
                               package='Pmv',
                               topCommand=0)
        self.mv.browseCommands('setangleCommands', package='Pmv', topCommand=0)
        self.mv.setUserPreference(('Transformation Logging', 'final'),
                                  topCommand=0)
        self.mv.setUserPreference(('Show Progress Bar', 'show'), topCommand=0)
        self.mv.setUserPreference(('Sharp Color Boundaries for MSMS', 'blur'),
                                  topCommand=0)
        self.mv.browseCommands('serverCommands',
                               commands=[
                                   'startServer', 'connectToServer',
                                   'StartWebControlServer'
                               ],
                               package='ViewerFramework',
                               topCommand=0)
        self.mv.addCommand(BindGeomToMolecularFragment(),
                           'bindGeomToMolecularFragment', None)
        self.mv.browseCommands('trajectoryCommands',
                               commands=['openTrajectory'],
                               log=0,
                               package='Pmv')
        self.mv.addCommand(PlayTrajectoryCommand(), 'playTrajectory', None)
        self.mv.addCommand(addGridCommand(), 'addGrid', None)
        self.mv.addCommand(readAnyGrid(), 'readAny', None)
        self.mv.addCommand(IsocontourCommand(), 'isoC', None)
        #define the listener
        if self.host is not None:
            self.mv.registerListener(DeleteGeomsEvent, self.updateGeom)
            self.mv.registerListener(AddGeomsEvent, self.updateGeom)
            self.mv.registerListener(EditGeomsEvent, self.updateGeom)
            self.mv.registerListener(AfterDeleteAtomsEvent, self.updateModel)
            self.mv.registerListener(BeforeDeleteMoleculesEvent,
                                     self.updateModel)
            self.mv.addCommand(epmvAdaptor.loadMoleculeInHost(self),
                               '_loadMol', None)
            #self.mv.embedInto(self.host,debug=0)
            self.mv.embeded = True
        #compatibility with PMV
        self.mv.Grid3DReadAny = self.mv.readAny
        #mv.browseCommands('superimposeCommandsNew', package='Pmv', topCommand=0)
        self.mv.userpref['Read molecules as']['value'] = 'conformations'
        self.mv.setUserPreference((
            'Read molecules as',
            'conformations',
        ),
                                  log=0)
        self.mv.setUserPreference((
            'Number of Undo',
            '0',
        ), redraw=0, log=1)
        self.mv.setUserPreference((
            'Save Perspective on Exit',
            'no',
        ), log=0)
        self.mv.setUserPreference((
            'Transformation Logging',
            'no',
        ), log=0)
        #should add some user preferece and be able to save it
        #recentFiles Folder
        rcFile = self.mv.rcFolder
        if rcFile:
            rcFile += os.sep + 'Pmv' + os.sep + "recent.pkl"
            self.mv.recentFiles = RecentFiles(self.mv,
                                              None,
                                              filePath=rcFile,
                                              index=0)
        else:
            print("no rcFolder??")

        #this  create mv.hostapp which handle server/client and log event system
        #NOTE : need to test it in the latest version
#        if not self.useLog :
#            self.mv.hostApp.driver.useEvent = True
        self.mv.iTraj = {}

        self.funcColor = [
            self.mv.colorByAtomType, self.mv.colorAtomsUsingDG,
            self.mv.colorByResidueType, self.mv.colorResiduesUsingShapely,
            self.mv.colorBySecondaryStructure, self.mv.colorByChains,
            self.mv.colorByDomains, self.mv.color, self.mv.colorByProperty
        ]
        self.fTypeToFc = {
            "ByAtom": 0,
            "AtomsU": 1,
            "ByResi": 2,
            "Residu": 3,
            "BySeco": 4,
            "ByChai": 5,
            "ByDoma": 6,
            "": 7,
            "ByPropN": 8,
            "ByPropT": 9,
            "ByPropS": 10
        }
        self.mv.host = self.host
Пример #2
0
    def setupMV(self):
        self.mv.browseCommands('fileCommands', package="Pmv", topCommand=0)
        self.mv.browseCommands('bondsCommands',package='Pmv', topCommand=0)
        self.mv.browseCommands('deleteCommands',package='Pmv', topCommand=0)
        self.mv.browseCommands('displayCommands',
                    commands=['displaySticksAndBalls','undisplaySticksAndBalls',
                              'displayCPK', 'undisplayCPK',
                              'displayLines','undisplayLines',
                              'displayBackboneTrace','undisplayBackboneTrace',
                              'DisplayBoundGeom'], package='Pmv', topCommand=0)
        self.mv.browseCommands('editCommands',package='Pmv', topCommand=0)
        self.mv.browseCommands("secondaryStructureCommands", package="Pmv", topCommand=0)
        self.mv.browseCommands('beadedRibbonsCommands', package="ePMV", topCommand=0)
        self.mv.browseCommands("splineCommands", package="Pmv", topCommand=0)
        self.mv.browseCommands("coarseMolSurfaceCommands", package="Pmv", topCommand=0)
        self.mv.browseCommands('msmsCommands',
                               commands=['computeMSMS','displayMSMS', 'undisplayMSMS',
                                         'readMSMS', 'saveMSMS', 'computeSESAndSASArea',],
                               package='Pmv', topCommand=0)
        self.mv.browseCommands('selectionCommands', commands=['select', 'deselect',
                                                   'clearSelection', 'saveSet',
                                                   'invertSelection',
                                                   'selectSet',
                                                   'selectFromString',
                                                   'directSelect','selectHeteroAtoms'],
                                package='Pmv', topCommand=0)
        self.mv.browseCommands('APBSCommands_2x', package='ePMV.pmv_dev', topCommand=0)
        self.mv.browseCommands('colorCommands',package='ePMV.pmv_dev', topCommand=0)        
        self.mv.browseCommands('buildDNACommands',package='ePMV.pmv_dev', topCommand=0)#commands=['buildDNA']
        self.mv.browseCommands('repairCommands', package='Pmv', topCommand=0)
        self.mv.browseCommands("dejaVuCommands", package="ViewerFramework", topCommand=0)
        self.mv.browseCommands('displayCommands',
                    commands=['showMolecules'],
                    package='Pmv', topCommand=0)
        self.mv.browseCommands('helpCommands',package ='Pmv', topCommand =0)

        self.mv.browseCommands('superimposeCommandsNew', package='Pmv', topCommand=0)
        self.mv.browseCommands('setangleCommands', package='Pmv', topCommand=0)
        self.mv.setUserPreference(('Transformation Logging', 'final'), topCommand=0)
        self.mv.setUserPreference(('Show Progress Bar', 'show'), topCommand=0)
        self.mv.setUserPreference(('Sharp Color Boundaries for MSMS', 'blur'), topCommand=0)
        self.mv.browseCommands('serverCommands', commands=[
                    'startServer', 'connectToServer', 'StartWebControlServer'],
                    package='ViewerFramework', topCommand=0)
        self.mv.addCommand(BindGeomToMolecularFragment(), 'bindGeomToMolecularFragment', None)
        self.mv.browseCommands('trajectoryCommands',commands=['openTrajectory'],log=0,package='Pmv')
        self.mv.addCommand(PlayTrajectoryCommand(),'playTrajectory',None)
        self.mv.addCommand(addGridCommand(),'addGrid',None)
        self.mv.addCommand(readAnyGrid(),'readAny',None)
        self.mv.addCommand(IsocontourCommand(),'isoC',None)
        #define the listener
        if self.host is not None :
            self.mv.registerListener(DeleteGeomsEvent, self.updateGeom)
            self.mv.registerListener(AddGeomsEvent, self.updateGeom)
            self.mv.registerListener(EditGeomsEvent, self.updateGeom)
            self.mv.registerListener(AfterDeleteAtomsEvent, self.updateModel)
            self.mv.registerListener(BeforeDeleteMoleculesEvent,self.updateModel)
            self.mv.addCommand(epmvAdaptor.loadMoleculeInHost(self),'_loadMol',None)            
            #self.mv.embedInto(self.host,debug=0)
            self.mv.embeded = True
        #compatibility with PMV
        self.mv.Grid3DReadAny = self.mv.readAny
        #mv.browseCommands('superimposeCommandsNew', package='Pmv', topCommand=0)
        self.mv.userpref['Read molecules as']['value']='conformations'
        self.mv.setUserPreference(('Read molecules as', 'conformations',), log=0)
        self.mv.setUserPreference(('Number of Undo', '0',), redraw=0, log=1)
        self.mv.setUserPreference(('Save Perspective on Exit', 'no',), log=0)
        self.mv.setUserPreference(('Transformation Logging', 'no',), log=0) 
        #should add some user preferece and be able to save it       
        #recentFiles Folder
        rcFile = self.mv.rcFolder
        if rcFile:
            rcFile += os.sep + 'Pmv' + os.sep + "recent.pkl"
            self.mv.recentFiles = RecentFiles(self.mv, None, filePath=rcFile,index=0)
        else :
            print("no rcFolder??")
        
        #this  create mv.hostapp which handle server/client and log event system
        #NOTE : need to test it in the latest version
#        if not self.useLog : 
#            self.mv.hostApp.driver.useEvent = True
        self.mv.iTraj={}
        
        self.funcColor = [self.mv.colorByAtomType,
                          self.mv.colorAtomsUsingDG,
                          self.mv.colorByResidueType,
                          self.mv.colorResiduesUsingShapely,
                          self.mv.colorBySecondaryStructure,
                          self.mv.colorByChains,
                          self.mv.colorByDomains,
                          self.mv.color,
                          self.mv.colorByProperty]
        self.fTypeToFc = {"ByAtom":0,"AtomsU":1,"ByResi":2,"Residu":3,
                          "BySeco":4,"ByChai":5,"ByDoma":6,"":7,
                          "ByPropN":8,"ByPropT":9,"ByPropS":10}
        self.mv.host = self.host