How To Make Pymol Display A Custom Color For A User Specified Residue
0
0
Entering edit mode
11.1 years ago
dave • 0

I currently have a python script, which takes in a pdb file. I have associated a colour to a residue. Now what I want, and what I cannot do, is to run pymol and make my own method which can be run in pymol, where you type in the residue number and pymol colours it in that particular colour.

global resList
resList=[list of residues]
resultss = [list of colours associated with residue)
def colourapply(self,event):
      def colourModel():
            for i in range(len(resList)):
                residueID = resList[i]
                colour = results[i]
                pymol.cmd.do("color "+colour+" , resi "+residueID)
      pymol.cmd.extend("colourModel", colourModel)

This is what I have tried, but it doesn't work. What I want, for example is, if you call in pymol - colourModel resi 112, it then colours the resi 112 the particular colour it was assigned.

pymol python • 3.4k views
ADD COMMENT

Login before adding your answer.

Traffic: 2203 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6