473,763 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3317
Andy Cheesman <An***********@ bristol.ac.ukwr ites:
>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.ukwr ote:
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(Wo rld):
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
1720
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, graphic display, realtime simulation and communities tools like pygame and ...) It's in San Diego February 9-12, 2004. "Session presentations are 45 or 90 minutes long, and tutorials are either a half-day (3 hours) or a full day (6 hours)."
2
2571
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 sequence(genomic sequence).I want to write the python code so that it utilizes all the 4 cpu's.Moreover do i need some other libraries. Kindly advice. Thanks
699
34116
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 capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
9
3195
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 programs. To do this I need to draw pictures of the molecules, typically using OpenGL, and do some basic control, using some widget set. The code currently uses GTK, and runs on Macintosh OS X under Fink, and Linux. I would like to support the...
5
1873
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 to be able to type in a word (say for a logo) and then see it in all the fonts. I would like to write something similar for Linux (and maybe it'll work on others) in Python. I am not really a pro - this would be my first significant Python...
114
9879
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
5286
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 -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o Modules/python.o Modules/python.c gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o...
8
3671
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 PYMOL(http://pymol.sourceforge.net/) as before. it sucks. anybody do the same thing as i am doing? i wanna seek a buddy to disscuss it together.
1
2305
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
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.