473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Python molecular viewer

Dear People,

I was wondering if people could recommend a simple molecular viewing
package written in python. I'm working in Theoretical chemistry and I'm
not after an all-singing dancing molecular rendering package(pymol does
that rather well) but a program which reads XYZ files and displays
simple structures which can be rotated in 3D

Thanks

Andy
Aug 29 '07 #1
3 3299
Andy Cheesman <An***********@bristol.ac.ukwrites:
>Dear People,
>I was wondering if people could recommend a simple molecular viewing
package written in python. I'm working in Theoretical chemistry and I'm
not after an all-singing dancing molecular rendering package(pymol does
that rather well) but a program which reads XYZ files and displays
simple structures which can be rotated in 3D
>Thanks
>Andy
Check out http://www.cgl.ucsf.edu/chimera/. Unlike PyMol, all of the
molecular data is accesible from Python. It still might be too much
of an all-singing dancing molecular rendering package for you though.

Greg Couch
UCSF Computer Graphics Lab
Aug 30 '07 #2
Andy Cheesman wrote:
Dear People,

I was wondering if people could recommend a simple molecular viewing
package written in python. I'm working in Theoretical chemistry and I'm
not after an all-singing dancing molecular rendering package(pymol does
that rather well) but a program which reads XYZ files and displays
simple structures which can be rotated in 3D
You could use VPython if you know how to convert XYZ files to ball and
stick locations to cartesian coordinates.
Aug 30 '07 #3
On Aug 29, 8:31 am, Andy Cheesman <Andy.chees...@bristol.ac.ukwrote:
Dear People,

I was wondering if people could recommend a simple molecular viewing
package written in python. I'm working in Theoretical chemistry and I'm
not after an all-singing dancing molecular rendering package(pymol does
that rather well) but a program which reads XYZ files and displays
simple structures which can be rotated in 3D

Thanks

Andy
slut is an OpenGL wrapper that I found to be very intuitive to use,
and comes with some simple "moving ball" animations, but the
animations also can be panned, zoomed, and rotated. In your case, you
wouldn't need to do the animation, just plot the balls in 3D and then
pan and zoom to your heart's content.

Here is a simple program that plots a series of points on a sphere:

from slut import *

# points on a sphere
data = [
(1.0, 0.0, 0.0),
(0.945, 0.0, -0.325),
(0.789, 0.0, -0.613),
(0.547, 0.0, -0.836),
(0.246, 0.0, -0.968),
(-0.083, 0.0, -0.997),
(-0.402, 0.0, -0.916),
(-0.677, 0.0, -0.735),
....
(-0.078, 0.027, 0.997),
(0.232, -0.080, 0.968),
(0.517, -0.177, 0.836),
(0.746, -0.256, 0.613),
(0.895, -0.307, 0.325),
(0.945, -0.325, 0.0) ]

from slut import *

class SphereViewer(World):
def onSetup(self):
self.width = 400
self.height = 400
self.name = "Points on a Sphere"

def onDraw(self):
# draw translucent sphere
glColor4f(0.7, 0.7, 0.7, 0.5)
sphere(0, 0, 0, 1.0)
glColor4f(0.3, 0.3, 0.4, 1.0)

# plot points on surface
glPointSize(4)
for d in data:
point(*d)

# connect points with path
glLineWidth(1.5)
lastd = data[-1]
for d in data:
line( *(lastd + d) )
lastd = d

viewer = SphereViewer()
viewer.run()

And here is a short Wink video showing me working with a simplified
version of this sphere: http://www.geocities.com/ptmcg/python/sphere1.htm.

If you have your molecules' 3D coordinates, you should be able to just
plot them, and then use slut to view the molecule.

-- Paul

Aug 30 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cognite | last post by:
This venue would surely appreciate the cool stuff being done in python on bioinformatics and python's tools for info parsing and extraction (like fulltext indexing, xml tools, parser builders,...
2
by: BalyanM | last post by:
Hi, I am new to python.I am using it on redhat linux 9. I am interested to run python on a sun machine(SunE420R,os=solaris) with 4 cpu's for a pattern discovery/search program on biological...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
9
by: Rick Muller | last post by:
I have a problem that I would like to get some advice on from other Pythonistas. I currently manage a (soon to be) open source project for displaying molecular graphics for a variety of different...
5
by: Bats | last post by:
Hello. On Windows, I used to have a little app that would let me navigate visually through my 20,000+ fonts and I could create groups of them for quick install/remove from the system. It was great...
114
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
1
by: Karalius, Joseph | last post by:
Can anyone explain what is happening here? I haven't found any useful info on Google yet. Thanks in advance. mmagnet:/home/jkaralius/src/zopeplone/Python-2.3.5 # make gcc -pthread -c...
8
by: wen | last post by:
due to the work reason, i have to learn python since last month. i have spent 1 week on learning python tutorial and felt good. but i still don't understand most part of sourcecode of...
1
by: shimpy | last post by:
1)shape of molecular orbitals must be known in depth. 2)proper assignment of bonding and antibonding molecular orbitals should be stated. 3)proper computer program code where applicable.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.