Reset surface programatically from python
Hi everyone, I have this line of code where I want to load a density and export a negative surface of it: import chimera as ch mod = ch.openModels.open(‘./density.em')[0] mod.surface_levels = [-1,0] mod.display = True ch.exports.doExportCommand('WebGL', 'tmp.html’) However, the surface of the density is rendered for positive values. How can I refresh the display after I specify the surface_levels? Thanks, Thomas
Hi Thomas, You need mod.show() to have the density map recompute its contour surface. You can remove the mod.display = True line. Your code mod.surface_levels = [-1,0] is setting two contour levels one at density value -1 and one at 0. Is that what you intend? If you only wanted a single level you would use mod.surface_levels = [-1] Tom On Dec 27, 2013, at 3:24 PM, Thomas Hrabe wrote:
Hi everyone,
I have this line of code where I want to load a density and export a negative surface of it:
import chimera as ch mod = ch.openModels.open(‘./density.em')[0] mod.surface_levels = [-1,0] mod.display = True ch.exports.doExportCommand('WebGL', 'tmp.html’)
However, the surface of the density is rendered for positive values. How can I refresh the display after I specify the surface_levels?
Thanks, Thomas
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
Thank you. My script now works on my workstation. On another linux machine where I am running the headless chimera, it is not processed. I start it with chimera —send tmp.py but all I end up in is the chimera console. Any suggestions? Thanks, Thomas On Dec 30, 2013, at 12:05 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Thomas,
You need
mod.show()
to have the density map recompute its contour surface. You can remove the mod.display = True line. Your code
mod.surface_levels = [-1,0]
is setting two contour levels one at density value -1 and one at 0. Is that what you intend? If you only wanted a single level you would use
mod.surface_levels = [-1]
Tom
On Dec 27, 2013, at 3:24 PM, Thomas Hrabe wrote:
Hi everyone,
I have this line of code where I want to load a density and export a negative surface of it:
import chimera as ch mod = ch.openModels.open(‘./density.em')[0] mod.surface_levels = [-1,0] mod.display = True ch.exports.doExportCommand('WebGL', 'tmp.html’)
However, the surface of the density is rendered for positive values. How can I refresh the display after I specify the surface_levels?
Thanks, Thomas
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
Hi Thomas, I'm not sure why "chimera --send tmp.py" is not working. But I am also confused why you are using the "--send" option? That is intended to send the script to an already running Chimera (or starts a Chimera if it finds none running). If that is not what you are aiming for you can just use "chimera tmp.py" or 'chimera --script "tmp.py 1.5 100"' if your script wants some arguments. If you really are trying to send the script to an already running Chimera, report a bug using Chimera menu Help / Report a Bug… in Chimera (non-headless version) and explain that the problem is with the linux headless version. Tom On Dec 30, 2013, at 12:40 PM, Thomas Hrabe wrote:
Thank you.
My script now works on my workstation. On another linux machine where I am running the headless chimera, it is not processed.
I start it with
chimera —send tmp.py
but all I end up in is the chimera console.
Any suggestions? Thanks, Thomas
On Dec 30, 2013, at 12:05 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Thomas,
You need
mod.show()
to have the density map recompute its contour surface. You can remove the mod.display = True line. Your code
mod.surface_levels = [-1,0]
is setting two contour levels one at density value -1 and one at 0. Is that what you intend? If you only wanted a single level you would use
mod.surface_levels = [-1]
Tom
On Dec 27, 2013, at 3:24 PM, Thomas Hrabe wrote:
Hi everyone,
I have this line of code where I want to load a density and export a negative surface of it:
import chimera as ch mod = ch.openModels.open(‘./density.em')[0] mod.surface_levels = [-1,0] mod.display = True ch.exports.doExportCommand('WebGL', 'tmp.html’)
However, the surface of the density is rendered for positive values. How can I refresh the display after I specify the surface_levels?
Thanks, Thomas
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
Chimera command-line flags described here http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/options.html Tom On Dec 30, 2013, at 12:48 PM, Tom Goddard wrote:
Hi Thomas,
I'm not sure why "chimera --send tmp.py" is not working. But I am also confused why you are using the "--send" option? That is intended to send the script to an already running Chimera (or starts a Chimera if it finds none running). If that is not what you are aiming for you can just use "chimera tmp.py" or 'chimera --script "tmp.py 1.5 100"' if your script wants some arguments. If you really are trying to send the script to an already running Chimera, report a bug using Chimera menu Help / Report a Bug… in Chimera (non-headless version) and explain that the problem is with the linux headless version.
Tom
On Dec 30, 2013, at 12:40 PM, Thomas Hrabe wrote:
Thank you.
My script now works on my workstation. On another linux machine where I am running the headless chimera, it is not processed.
I start it with
chimera —send tmp.py
but all I end up in is the chimera console.
Any suggestions? Thanks, Thomas
On Dec 30, 2013, at 12:05 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Thomas,
You need
mod.show()
to have the density map recompute its contour surface. You can remove the mod.display = True line. Your code
mod.surface_levels = [-1,0]
is setting two contour levels one at density value -1 and one at 0. Is that what you intend? If you only wanted a single level you would use
mod.surface_levels = [-1]
Tom
On Dec 27, 2013, at 3:24 PM, Thomas Hrabe wrote:
Hi everyone,
I have this line of code where I want to load a density and export a negative surface of it:
import chimera as ch mod = ch.openModels.open(‘./density.em')[0] mod.surface_levels = [-1,0] mod.display = True ch.exports.doExportCommand('WebGL', 'tmp.html’)
However, the surface of the density is rendered for positive values. How can I refresh the display after I specify the surface_levels?
Thanks, Thomas
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
Thank you Tom, the script parameter was what I was looking for. My headless chimera now exports those webgl html files. One more question: if I display negative density, how do I programmatically set Surface & Mesh options > Cap high values at box faces? Thanks, Thomas On Dec 30, 2013, at 12:48 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Thomas,
I'm not sure why "chimera --send tmp.py" is not working. But I am also confused why you are using the "--send" option? That is intended to send the script to an already running Chimera (or starts a Chimera if it finds none running). If that is not what you are aiming for you can just use "chimera tmp.py" or 'chimera --script "tmp.py 1.5 100"' if your script wants some arguments. If you really are trying to send the script to an already running Chimera, report a bug using Chimera menu Help / Report a Bug… in Chimera (non-headless version) and explain that the problem is with the linux headless version.
Tom
On Dec 30, 2013, at 12:40 PM, Thomas Hrabe wrote:
Thank you.
My script now works on my workstation. On another linux machine where I am running the headless chimera, it is not processed.
I start it with
chimera —send tmp.py
but all I end up in is the chimera console.
Any suggestions? Thanks, Thomas
On Dec 30, 2013, at 12:05 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Thomas,
You need
mod.show()
to have the density map recompute its contour surface. You can remove the mod.display = True line. Your code
mod.surface_levels = [-1,0]
is setting two contour levels one at density value -1 and one at 0. Is that what you intend? If you only wanted a single level you would use
mod.surface_levels = [-1]
Tom
On Dec 27, 2013, at 3:24 PM, Thomas Hrabe wrote:
Hi everyone,
I have this line of code where I want to load a density and export a negative surface of it:
import chimera as ch mod = ch.openModels.open(‘./density.em')[0] mod.surface_levels = [-1,0] mod.display = True ch.exports.doExportCommand('WebGL', 'tmp.html’)
However, the surface of the density is rendered for positive values. How can I refresh the display after I specify the surface_levels?
Thanks, Thomas
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
Hi Thomas, The best way to set the contour level and also to turn off capping box faces is by calling the set_parameters() method. mod.set_parameters(surface_levels = [-1], cap_faces = False) mod.show() Tom On Dec 30, 2013, at 1:32 PM, Thomas Hrabe wrote:
Thank you Tom,
the script parameter was what I was looking for. My headless chimera now exports those webgl html files.
One more question: if I display negative density, how do I programmatically set Surface & Mesh options > Cap high values at box faces?
Thanks, Thomas
On Dec 30, 2013, at 12:48 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Thomas,
I'm not sure why "chimera --send tmp.py" is not working. But I am also confused why you are using the "--send" option? That is intended to send the script to an already running Chimera (or starts a Chimera if it finds none running). If that is not what you are aiming for you can just use "chimera tmp.py" or 'chimera --script "tmp.py 1.5 100"' if your script wants some arguments. If you really are trying to send the script to an already running Chimera, report a bug using Chimera menu Help / Report a Bug… in Chimera (non-headless version) and explain that the problem is with the linux headless version.
Tom
On Dec 30, 2013, at 12:40 PM, Thomas Hrabe wrote:
Thank you.
My script now works on my workstation. On another linux machine where I am running the headless chimera, it is not processed.
I start it with
chimera —send tmp.py
but all I end up in is the chimera console.
Any suggestions? Thanks, Thomas
On Dec 30, 2013, at 12:05 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Thomas,
You need
mod.show()
to have the density map recompute its contour surface. You can remove the mod.display = True line. Your code
mod.surface_levels = [-1,0]
is setting two contour levels one at density value -1 and one at 0. Is that what you intend? If you only wanted a single level you would use
mod.surface_levels = [-1]
Tom
On Dec 27, 2013, at 3:24 PM, Thomas Hrabe wrote:
Hi everyone,
I have this line of code where I want to load a density and export a negative surface of it:
import chimera as ch mod = ch.openModels.open(‘./density.em')[0] mod.surface_levels = [-1,0] mod.display = True ch.exports.doExportCommand('WebGL', 'tmp.html’)
However, the surface of the density is rendered for positive values. How can I refresh the display after I specify the surface_levels?
Thanks, Thomas
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (2)
-
Thomas Hrabe
-
Tom Goddard