Ejemplo n.º 1
0
    def __init__(self, hitfile, master=None):
        Tkinter.Toplevel.__init__(self, master)

        self.hitfile = hitfile
        self.hitNodeList = HitNodeList(self.hitfile.hits)
        self.maxScore = 0
        self.models = []

        basename = os.path.basename(hitfile.filename)
        (pdbid, ext) = os.path.splitext(basename)
        self.pdbid = pdbid


        # Find MaxScore for slider
        if self.hitfile.hits:
            self.maxScore = max(self.hitfile.hits).score

        # Open Molecule if it isn't already open
        self.mol = None
        if myvrml.getModelNo(pdbid.lower()) == None:
            self.mol = myvrml.openMolecule(pdbid)
            # highlight hetatms
            Midas.represent("sphere", "#%d:.het" % self.mol.id)
            Midas.represent("sphere", "#%d:ca" % self.mol.id)

        self._buildGui()
Ejemplo n.º 2
0
    def pdbSelect(self):
        # Identify selected pbid
        sels = self.pdbListBox.getcurselection()
        if not sels:
            return
        pdbid = sels[0]

        # Set pdbid
        self.pdbid = pdbid

        # clean up previous pdbid selection
        self.cleanupPdbSelect()

        # Open Molecule if it isn't already open
        if myvrml.getModelNo(pdbid.lower()) == None:
            self.mol = myvrml.openMolecule(pdbid)
            # highlight hetatms
            Midas.represent("sphere", "#%d:.het" % self.mol.id)
            Midas.represent("sphere", "#%d:ca" % self.mol.id)

        # Get sites for the pdbid
        self.sites = self.sitefile.getByPdbid(pdbid)

        # Update listbox
        siteStrings = [PrettySiteString(s) for s in self.sites]
        self.siteListBox.setlist(siteStrings)
        
        # Select all sites
        self.siteListBox._listbox.select_set(0,'end')
        self.siteSelect()
Ejemplo n.º 3
0
    def _clearModelColor(self):
        # obtain modelNo
        modelNo = myvrml.getModelNo(self.pdbid.lower())
        if modelNo == None:
            return

        # Reset model color
        Midas.uncolor(None, "#%d" % modelNo)
        Midas.unrescolor(None, "#%d" % modelNo)
Ejemplo n.º 4
0
    def __init__(self, pdbid, motifs, master=None):
        Tkinter.Toplevel.__init__(self, master)

        self.pdbid = pdbid
        self.motifs = motifs
        self.models = []
        self.motifs.sort()

        # Open Molecule if it isn't already open
        self.mol = None
        if myvrml.getModelNo(pdbid.lower()) == None:
            self.mol = myvrml.openMolecule(pdbid)
            # highlight hetatms
            Midas.represent("sphere", "#%d:.het" % self.mol.id)
            Midas.represent("sphere", "#%d:ca" % self.mol.id)

        self._displayGui()
Ejemplo n.º 5
0
    def _displayMotif(self, motif):
        # obtain modelNo
        modelNo = myvrml.getModelNo(motif.pdbid.lower())
        if modelNo == None:
            print "No Model"
            return

        group = myvrml.GroupNode()

        # obtain chain residue numbers
        chainRes = []
        mol = chimera.openModels.list(id=modelNo)[0]
        residues = mol.residues
        residues.sort(lambda a, b: cmp(a.id.position, b.id.position))
        for res in residues:
            if res.id.chainId.strip() == motif.chainid:
                chainRes.append(res)

        # Hilight motif
        motifSel = "#%d:%d-%d.%s" % (
            modelNo, chainRes[motif.start].id.position,
            chainRes[motif.end - 1].id.position, motif.chainid)
        if gVerbose:
            print "MOTIFSEL:", motifSel
            print "START RES:", chainRes[motif.start].type,
            print "STOP RES:", chainRes[motif.end - 1].type
        Midas.color("red", motifSel)
        Midas.rescolor("red", motifSel)

        if gHaveCore:
            # Hilight coreMotif
            coreMotifSel = "#%d:%d-%d.%s" % (
                modelNo, chainRes[motif.coreStart].id.position,
                chainRes[motif.coreEnd - 1].id.position, motif.chainid)
            print "CORESEL:", coreMotifSel
            Midas.color("yellow", coreMotifSel)

        print motif

        return group