- edited description
Customise the residues and correlation displayed in pymol.dccm
After running pymol.dccm(cij, pdb, type="launch"), all the correlations for all the residues are shown in the pymol. Can I ask if I can
1) only show particular residues? 2) only display certain correlations? For example, now the correlation interval is 0.2 by default. Can I only display correlations of 0.9-1 ?
At http://thegrantlab.org/bio3d/html/pymol.html It said: The PyMOL script file is stored in the working directory with filename “R.py”. As I look at the "R.py", I think each line represents a correlation line. But what is the meaning of each number for the 'obj.extend':
obj.extend([CYLINDER, 26.633,15.219,13.215, -3.7,-0.974,25.743, 0.15, 0.5947, 0.5947, 0.9961, 0.5947, 0.5947, 0.9961, ])
Comments (10)
-
reporter -
reporter - edited description
-
Hi,
Hacking the "R.py" file is hard. Try
pymol.dccm(cij, pdb, type='launch', step=0.1)
. Then you will have options to keep just 0.9-1 in Pymol.Side-note: Always check help document of a specific function using
help()
in R before posting questions. That will save time for both sides. Thanks! -
reporter Thank you Xin-Qiu. the step=0.1 could work.
I tried help(pymol.dccm), but there are no arguments available to only display correlations of certain residues in pymol. So I wish this feature can be added.
Also, there is not an argument to set a particular range. "step" and "omit" can do a bit of the work, but they could not set a range like 0.87-0.95. A way to work around is, use "step = 0.01" then select the eight intervals between 0.87 and 0.95 to show the particular range.
-
reporter I think I know how to hack the "R.py" file now. After looking at here, the meaning of
obj.extend([CYLINDER, 26.633,15.219,13.215, -3.7,-0.974,25.743, 0.15, 0.5947, 0.5947, 0.9961, 0.5947, 0.5947, 0.9961, ])
isobj.extend([CYLINDER, x1, y1, z1, x2, y2, z2, radius, r1, b1, g1, r2, b2, g2 ])
So we can delete the C-alpha correlations we do not want, and only keep the ones we want in the "R.py" file, and rename it as e.g. "R1.py". Then, in the pymol terminal, type "run path/to/R1.py". I tested it, and succeeded!
I have another question now. For a particular "x1, y1, z1" correlating with "x2, y2, z2", why the "x1, y1, z1" is regarded as "x1, y1, z1" instead of "x2, y2, z2"? I mean, for example, in
obj.extend([CYLINDER, 26.633,15.219,13.215, -3.7,-0.974,25.743, 0.15, 0.5947, 0.5947, 0.9961, 0.5947, 0.5947, 0.9961, ])
, why "26.633,15.219,13.215" is regarded as "x1, y1, z1" instead of "x2, y2, z2"? Is there a algorithm for the order? -
Hi,
We really don't recommend modify the raw "R.py" file because it might introduce errors by mistake. Instead, modify the source code generating the file, i.e. 'pymol.dccm.R', if you really need to.
Regarding your question, correlation does not have a direction, so no need to distinguish x1 and x2, etc.
-
reporter Thank you Xin-Qiu, can I ask the official way to find the raw code of 'pymol.dccm.R', is it here? I am not familiar with R, also how to save it as a new function and run the new code?
-
The simplest way is to type
pymol.dccm
and return in R and it will show the code. Copy and paste it to a file and modify. To use it, typesource('pymol.dccm.R')
(remember to replace it with the actual file name you create) and then call the function as usual.Let me know if you have any questions.
-
- changed status to resolved
-
reporter thank you Xin-Qiu, the R code has 215 lines, I ended up writing a python script with 62 lines to hack the R.py file. :) Thank you for your help!
- Log in to comment