Пример #1
0
    def Start(self):

        # self.queue.put(lambda: self.top.top.root.withdraw())
        cmd.window('hide')
        cmd.refresh_wizard()
        cmd.orient()
        cmd.window('show')
        # self.queue.put(lambda: cmd.window('show'))
        self.ErrorCode = 1

        try:
            self.State = cmd.get_state()
            self.config_mouse = General_cmd.get_config_mouse()
            cmd.config_mouse('three_button_editing')
        
            self.exc = [ self.SphereDisplay ]
            General_cmd.mask_Objects(self.exc)

            # success
            self.ErrorCode = 0

        except:
            self.queue.put(lambda: self.App.DisplayMessage("  ERROR: Could not start the Sphere wizard", 1))
            self.queue.put(lambda: self.App.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return
            
        if self.DisplaySphere():
            self.queue.put(lambda: self.App.DisplayMessage("  ERROR: Could not display the Sphere", 1))
            self.queue.put(lambda: self.App.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return
Пример #2
0
    def Start(self):

        self.queue.put(lambda: self.FlexAID.root.withdraw())
        cmd.window('hide')
        cmd.window('show')
        # self.queue.put(lambda: cmd.window('show'))
        cmd.refresh_wizard()

        self.ErrorCode = 1

        try:
            self.selection_mode = cmd.get("mouse_selection_mode")
            cmd.set("mouse_selection_mode", 0) # set selection mode to atomic

            # Mask objects
            self.exc = [self.LigDisplay]
            General_cmd.mask_Objects(self.exc)

            self.ErrorCode = 0
            
        except:
            self.queue.put(lambda: self.FlexAID.DisplayMessage("  ERROR: Could not start the Anchor Atom wizard", 1))
            self.queue.put(lambda: self.FlexAID.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return

        # Display the ligand from the PDB file
        if self.DisplayLigand() or self.RefreshDisplay():
            self.queue.put(lambda: self.FlexAID.DisplayMessage("  ERROR: Could not display the ligand", 1))
            self.queue.put(lambda: self.FlexAID.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return
        
        # remove any possible selection before selecting atoms
        cmd.deselect()
Пример #3
0
    def Start(self):
        
        self.queue.put(lambda: self.FlexAID.root.withdraw())
        cmd.window('hide')
        self.queue.put(lambda: cmd.window('show'))
        cmd.refresh_wizard()

        # Display the ligand from the PDB file
        if self.DisplayLigand():
            self.FlexAID.DisplayMessage("Error while trying to display the ligand from PDB file", 1)
            self.Quit_Wizard(self.ErrorCode)
            return
                    
        # Color the Atoms based on their type
        if self.ColorByType():
            self.FlexAID.DisplayMessage("Error while coloring the ligand atoms by type", 1)
            self.Quit_Wizard(self.ErrorCode)
            return            

        # Mask everythign except modifyable object (ligand)
        self.exc = [self.LigDisplay]
        General.mask_Objects(self.exc)        

        self.selection_mode = cmd.get("mouse_selection_mode")
        cmd.set("mouse_selection_mode", 0) # set selection mode to atomic

        # remove any possible selection before selecting atoms
        cmd.deselect()

        self.ErrorCode += 1
Пример #4
0
    def automate(self):

        # Hide the PyMOL viewer window
        # This not only increases the search speed, sometimes significantly,
        # but also may prevent the user from accidentally interfering with
        # automatic selections
        cmd.window('hide')

        # Text file to contain information about generated motifs, i.e., motif definition,
        # backbone and tolerance parameters. The report indicates if the motif was not saved.
        # An example of the report file entry (the ">" header lines: pdb [1jms], tolerance [1.2],
        # number of chains on which the motif was found [1], ec code [2.7.7.31];
        # subsequent lines: residue name, chain, residue number, and whether the bbn was on or off):
        # >	1jms	1.2	1	2.7.7.31
        # NA	A	702	Off
        # MG	A	701	Off
        # ASP	A	434	On
        reportfile = open(
            glb.pathmaker(('report', '.txt'), root=glb.AUTOMOTIFSFOLDER), 'w')

        # List of PDB IDs for which the program will attempt to generate auto motifs:
        pdblist = lib.getPDBlist()

        # Auto generate the motifs for for the pdb id list
        self.autoGenerate(pdblist, reportfile)
        reportfile.close()

        cmd.window('show')
        print ' ...done :)'
Пример #5
0
    def Start(self):

        self.queue.put(lambda: self.FlexAID.root.withdraw())
        cmd.window('hide')
        cmd.window('show')
        # self.queue.put(lambda: cmd.window('show'))
        cmd.refresh_wizard()

        self.ErrorCode = 1        

        try:
            #self.selection_mode = cmd.get_setting_legacy("mouse_selection_mode")
            self.selection_mode = cmd.get("mouse_selection_mode")
            cmd.set("mouse_selection_mode", 0) # set selection mode to atomic

            # Mask objects
            self.exc = [self.LigDisplay, self.PossFlexDisplay, self.SelFlexDisplay]
            General_cmd.mask_Objects(self.exc)

            self.ErrorCode = 0

        except:
            self.queue.put(lambda: self.top.DisplayMessage("  ERROR: Could not start the Flexible Bonds wizard", 1))
            self.queue.put(lambda: self.top.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return

        # Display the ligand from the PDB file
        if self.DisplayLigand():
            self.queue.put(lambda: self.top.DisplayMessage("  ERROR: Could not display the ligand", 1))
            self.queue.put(lambda: self.top.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return

        # Display all Possible Flexible Bonds
        if self.show_FlexibleBonds():
            self.queue.put(lambda: self.top.DisplayMessage("  ERROR: Could not display the flexible bonds", 1))
            self.queue.put(lambda: self.top.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return

        # Display all Selected Flexible Bonds
        if self.show_SelectedBonds():
            self.queue.put(lambda: self.top.DisplayMessage("  ERROR: Could not display the selected flexible bonds", 1))
            self.queue.put(lambda: self.top.DisplayMessage("         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return
        
        # remove any possible selection before selecting atoms
        cmd.deselect()
        cmd.unpick()
Пример #6
0
    def Start(self):

        self.queue.put(lambda: self.FlexAID.root.withdraw())
        cmd.window('hide')
        cmd.window('show')
        # self.queue.put(lambda: cmd.window('show'))
        cmd.refresh_wizard()

        self.ErrorCode = 1

        try:
            self.selection_mode = cmd.get("mouse_selection_mode")
            cmd.set("mouse_selection_mode", 0)  # set selection mode to atomic

            # Mask objects
            self.exc = [self.LigDisplay]
            General_cmd.mask_Objects(self.exc)

            self.ErrorCode = 0

        except:
            self.queue.put(lambda: self.FlexAID.DisplayMessage(
                "  ERROR: Could not start the Anchor Atom wizard", 1))
            self.queue.put(lambda: self.FlexAID.DisplayMessage(
                "         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return

        # Display the ligand from the PDB file
        if self.DisplayLigand() or self.RefreshDisplay():
            self.queue.put(lambda: self.FlexAID.DisplayMessage(
                "  ERROR: Could not display the ligand", 1))
            self.queue.put(lambda: self.FlexAID.DisplayMessage(
                "         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return

        # remove any possible selection before selecting atoms
        cmd.deselect()
Пример #7
0
    def Start(self):

        # self.queue.put(lambda: self.top.top.root.withdraw())
        cmd.window('hide')
        cmd.refresh_wizard()
        cmd.orient()
        cmd.window('show')
        # self.queue.put(lambda: cmd.window('show'))
        self.ErrorCode = 1

        try:
            self.State = cmd.get_state()
            self.config_mouse = General_cmd.get_config_mouse()
            cmd.config_mouse('three_button_editing')

            self.exc = [self.SphereDisplay]
            General_cmd.mask_Objects(self.exc)

            # success
            self.ErrorCode = 0

        except:
            self.queue.put(lambda: self.App.DisplayMessage(
                "  ERROR: Could not start the Sphere wizard", 1))
            self.queue.put(lambda: self.App.DisplayMessage(
                "         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return

        if self.DisplaySphere():
            self.queue.put(lambda: self.App.DisplayMessage(
                "  ERROR: Could not display the Sphere", 1))
            self.queue.put(lambda: self.App.DisplayMessage(
                "         The wizard will abort prematurely", 1))
            self.Quit_Wizard()
            return
Пример #8
0
    def Start(self):
        
        self.queue.put(lambda: self.FlexAID.root.withdraw())
        cmd.window('hide')
        cmd.window('show')
        # self.queue.put(lambda: cmd.window('show'))
        cmd.refresh_wizard()

        # Display all Selected Flexible Bonds
        if self.show_SelectedSC():
            self.queue.put(lambda: self.FlexAID.DisplayMessage("  ERROR: Could not display selected flexible side-chains", 1))
            self.Quit_Wizard()
            return

        #self.selection_mode = cmd.get_setting_legacy("mouse_selection_mode")
        self.selection_mode = cmd.get("mouse_selection_mode")
        cmd.set("mouse_selection_mode", 1) # set selection mode to residue

        # Mask objects
        self.exc = [ self.TargetName ]
        General_cmd.mask_Objects(self.exc)
        
        if General_cmd.object_Exists(self.FlexAID.Config1.BindingSiteDisplay):
            cmd.zoom(self.FlexAID.Config1.BindingSiteDisplay)
        else:
            cmd.zoom(self.TargetName)


        # remove any possible selection before selecting atoms
        cmd.deselect()
              
        self.ErrorCode += 1
        
        
    #=======================================================================
        ''' update_SelectedSC : updates the view of selected flexible sc. '''