sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
intermalte's Avatar
intermalte intermalte is offline
Member
 
Join Date: May 2006
Location: Germany
Posts: 32
I start a new thread for the new version.
The thread according pdb2blend v1.0 is here: http://blenderartists.org/forum/showthread.php?t=67279

I fixed these file convention problems of the first version.
Now you should be able to import pdb files from databases like PDB (http://www.rcsb.org) properly.
Please try it out and report bugs!
For those who didn't read the first thread:

Quote:
It's more a wizard than a conversion tool as the pdb-files only provides atom types and positions and connectivity tables. The script builds balls of different sizes for any atom with materials linked to the atom types. When chosen the atoms are connected by sticks with rounded ends.

The tool is now working somehow. You can download it at http://www.malte-reimold.de/blender/pdb2blend.html as well as some pdb molecule files for testing purposes for those who are not familiar with molecule models.

I built this script with blender 2.41 and Python 2.4 on WinXP.

Please try the script and give me some feedback about functionality on other platforms or versions.
............................................
...if your grandmother or any other member of your family should die, put them outside, but remember to tag them first for identification purposes...
#1   Old 06-Nov-06, 12:59   
Reply With Quote


CC_BY's Avatar
CC_BY CC_BY is offline
Member
 
Join Date: Nov 2006
Posts: 9
Thanks very much for this script !

It works so far very well. A friend of mine was searching for that in Maya and XSI where there is an expensive plugin. He's now very interested to use Blender

Thanks !
#2   Old 17-Nov-06, 14:41   
Reply With Quote
Meta-Androcto's Avatar
Meta-Androcto Meta-Androcto is offline
Member
 
Join Date: Aug 2006
Location: australia
Posts: 2,356
Hi, thanks for the update.
The script works well. Very good job.

Files from this large database work:
http://ndbserver.rutgers.edu/download_data/index.html

There is a zip file with at least 200 .pdb files that work here:
http://www.biocheminfo.org/klotho/
All the ones I tested worked. Never get to test all of them.

Your dna test file was 3 min to build sticks and bones.

Some files from:
http://www.nyu.edu/pages/mathmol/library/
Dont work....
but I have enough .pdb files to last me forever anyway.

Thanks M.A.
#3   Old 17-Nov-06, 16:00   
Reply With Quote
Tenzin's Avatar
Tenzin Tenzin is offline
Member
 
Join Date: Oct 2006
Location: Adesh Pradesh
Posts: 12
Thanks for the update, the previous one didn't work for me at all. This works here in Blender 242a, Python 2.3, SuSE Linux 9.2. Whatever code in this is responsible for it being backward compatible with Python 2.3, please don't change this

Now I have a highly flexible way of working with PDB models in addition to exporting RIB's from VMD, and POVRay variants like POVChem, Grasp4POV, POVscript, and PyMOL and Jmol.

Thanks again,

Tenzin.
#4   Old 18-Nov-06, 01:26   
Reply With Quote
rwst rwst is offline
Member
 
Join Date: Dec 2006
Posts: 1
Hello, thanks for your script. It imports pdbs from CORINA (http://www.molecular-networks.com/on...rina_demo.html ) with the right positions but it appears it can only recognize one atom type. Is this a problem with the pdbs? I'm using Blender 2.42a. Regards, rwst
P.S. I just see the pdbs work if you remove and everything after ' 0.00 0.00' in the ATOM lines. Thanks anyway!

Last edited by rwst; 27-Dec-06 at 11:44.
#5   Old 27-Dec-06, 11:17   
Reply With Quote
malCanDo malCanDo is offline
Member
 
Join Date: Dec 2002
Location: Ireland
Posts: 343
That is very cool!

I remember years ago having to parse the PDB file format for an online Shockwave 3D viewer ( interactive ) - as the file only stores positiions, it was challenging figuring out how to recreate structures such as bonds etc from them optimally - also, some of the PDB files stored huge amounts of data.

If anyone on Mac or PC is interested, you can view the interactive demo here...
http://www.candointeractive.com/demos/molecule.htm


You can specify PDB ids and load them directly - they will stream from the main server ( you'll probably get a security alert, as it tries to load the data from a different server, the main one in the US ).

Keep up the great work with the Blender plugin - I'm sure we'll see some great renders of molecules with lots of fancy rendering features ( AO, NPR etc )
Mal
............................................
Check out some cool web 3D demos at...http://www.candointeractive.com
#6   Old 08-Jan-07, 11:41   
Reply With Quote
kanu kanu is offline
Member
 
Join Date: Jan 2007
Posts: 2
for a very fast way to build a structure in blender i use a small script which makes a vertex for each ATOM entry in a pdb file. This takes about 1 second for a file with 7000 atoms.
After that i add a sphere as child to that mesh and use DupliVert to display it at each vertex. The advantage is that you still have control over the appearance of balls after creation.
For anyone who has problems with some pdb files, Babel or OpenBabel solves a lot of them.
http://openbabel.sourceforge.net/wiki/Guides
#7   Old 14-Jan-07, 09:36   
Reply With Quote
mrmunkily's Avatar
mrmunkily mrmunkily is offline
Member
 
Join Date: Nov 2001
Location: On a Bullet Train to Party Town
Posts: 734
Hey, do you know of any way to get solvent-accessible structures (from MSMS or the like) into blender?
............................................
She is starting to damage my calm!
#8   Old 16-Jan-07, 21:54   
Reply With Quote
intermalte's Avatar
intermalte intermalte is offline
Member
 
Join Date: May 2006
Location: Germany
Posts: 32
Thanks for your comments and bug reports!
I will try to improve pdb2blend according all of your suggestions and to eliminate the reported bugs!

@kanu
I was thinking about this strategy too - especially for big structures.

@mrmunkily
Not yet. It should be possible to build such surfaces from structures in blender. However if the programs you use store those surfaces in special file formats it should be possible to extract the information one needs too build up a surface in blender.
............................................
...if your grandmother or any other member of your family should die, put them outside, but remember to tag them first for identification purposes...

Last edited by intermalte; 13-Feb-07 at 10:16.
#9   Old 13-Feb-07, 10:13   
Reply With Quote
kanu kanu is offline
Member
 
Join Date: Jan 2007
Posts: 2
Whats about starting your script with building vertices for ATOMs and edges for CONECTs. And in a 2nd run you assign Meshes to these.
For the Atoms you can DupliVert everything you love to but I am not sure how easy it is to handle the connections.
#10   Old 13-Feb-07, 10:29   
Reply With Quote
mrmunkily's Avatar
mrmunkily mrmunkily is offline
Member
 
Join Date: Nov 2001
Location: On a Bullet Train to Party Town
Posts: 734
VMD can export solvent surfaces as STLs or OBJs - but the geometry is rather poor.

I solved my problem using PMV, written by the same people who maintain msms. It can calculate surfaces and output STLs of pretty decent quality.
............................................
She is starting to damage my calm!
#11   Old 13-Feb-07, 22:42   
Reply With Quote
ronghester's Avatar
ronghester ronghester is offline
Member
 
Join Date: Jan 2007
Location: India (Delhi)
Posts: 36
hi,
i have mail you some days before for extending the script for some more files.
and functionality.
#12   Old 14-Feb-07, 18:57   
Reply With Quote
intermalte's Avatar
intermalte intermalte is offline
Member
 
Join Date: May 2006
Location: Germany
Posts: 32
@ronghester
sorry for not answering your mail yet. I had a lot of work and so it left my mind too fast.
However - why not? I will mail you a concept of the way I think this script could be improved.

@kanu
This is indeed the way I want to go. However my idea is to place two additional vertices at the middle of the connection and use vertex groups for atom types. This way multimaterial meshes can be built leading to simple stick-models when using wire-materials.
I want to separate import- and modelling routines, making it easier to handle molecules and even to change the 3d structure in blender.
............................................
...if your grandmother or any other member of your family should die, put them outside, but remember to tag them first for identification purposes...
#13   Old 22-Feb-07, 21:31   
Reply With Quote
Cire's Avatar
Cire Cire is offline
Member
 
Join Date: Feb 2006
Location: California
Posts: 1,536
Intermalte, are there any updates on this script's development? It doesn't seem to be compatible with Blender 2.43 . . . will this happen soon?

Thanks in advance for any info!




.
............................................
Current work in progress:
. . : : the Blue Beast (& his big ball of fire) : : . .
............................................
System specs for testing:
XP64 & Ubuntu64 | GTX 285 | Quad 4GHz | 8GB
#14   Old 03-Apr-07, 23:42   
Reply With Quote
EP1 EP1 is offline
Member
 
Join Date: May 2006
Posts: 113
what would be cool is if this script allowed for interaction mapping of the imported molecules, its just that it would allow for great animations for talks/presentations.
#15   Old 04-Apr-07, 11:33   
Reply With Quote
ParkerJones ParkerJones is offline
Member
 
Join Date: Oct 2007
Posts: 1
Quote:
Originally Posted by Cire View Post
Intermalte, are there any updates on this script's development? It doesn't seem to be compatible with Blender 2.43 . . . will this happen soon?

.
Has anyone got it working under 2.43?
#16   Old 10-Oct-07, 16:31   
Reply With Quote
Meta-Androcto's Avatar
Meta-Androcto Meta-Androcto is offline
Member
 
Join Date: Aug 2006
Location: australia
Posts: 2,356
Works fine with 2.44, 2.45. I presume the problem may be with the pdb files you are trying to import, the links above to pdb files work well.
m.a.
#17   Old 11-Oct-07, 06:55   
Reply With Quote
Titanium Beard Titanium Beard is offline
Member
 
Join Date: Aug 2006
Posts: 118
This is a great script, just what I needed for my current project! But, I am having a problem. It doesn't make the sticks connecting all the spheres. I downloaded this .pdb and can import it correctly into Blender with this script. However, when you compare what you get in Blender with the view of it here, you can see that there is a big difference. Only a few atoms are connected thanks to the CONECT tags at the botton of the .pdb file, but not all of them like they are shown in the WebMol viewer. I would really like all of the sticks to be made, but do not know how to do this. Thanks for your help and work on this script!

Last edited by Titanium Beard; 17-Nov-07 at 21:59. Reason: changed a dumb question
#18   Old 17-Nov-07, 20:31   
Reply With Quote
Omega_ Omega_ is offline
Member
 
Join Date: May 2008
Posts: 2
Quote:
Originally Posted by anthonyesau View Post
Only a few atoms are connected thanks to the CONECT tags at the botton of the .pdb file, but not all of them like they are shown in the WebMol viewer. I would really like all of the sticks to be made, but do not know how to do this.
By definition, PDB files must only contain atom coordinates, not bond records (which, as you correctly noticed, are defined as CONECT records). PDB files CAN contain extra info though. Most molecular viewers draw bonds between atoms by making the assumption that atoms with a certain distance must be bonded. Usually this assumption is sufficient to draw a reasonable molecule, for things like DNA, proteins and peptides. But for drugs, co-factors, and other small and strained molecules, it is not always a safe assumption that atoms are bound if they are close together. This is really a general limitation in the PDB file format.

You have at least two choices to draw bonds correctly: 1) explicitly write them out as CONECT records in the PDB file then load that file, or 2) draw them after the PDB file has been interpreted, by making the distance assumption. Roughly speaking, you can assume that a useful distance to assume is when d is less than the sum of the van der Waals radii of the atoms in question (that is, draw a bond when there is interpenetration of vdW spheres). Van der Waals radii can be looked up all over the web, or in the classical reference (A.Bondi, J. Phys. Chem., 68, 441-452, 1964).

I guess another alternative would be to import your PDB file into some molecular modeling program, and have it write out explicit CONECT records. I can't think of any free program that will do so reliably, off the top of my head. It really shouldn't be too terribly tedious to edit the CONECT records manually for a single file.
#19   Old 23-May-08, 06:36   
Reply With Quote
Sjoerd's Avatar
Sjoerd Sjoerd is offline
Member
 
Join Date: Aug 2007
Location: Utrecht, The Netherlands
Posts: 77
The PRODRG server ( davapc1.bioch.dundee.ac.uk/prodrg ) generates PDBs with CONECT statements for small molecules, and it's free for non-profit use. Like Omega says, you can infer the bonds in case of proteins and DNA.
#20   Old 27-May-08, 14:49   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blender Tool Death Finished Projects 15 29-Sep-08 20:48
Decal Tool: Shall I Request one? dante Basics & Interface 10 04-May-06 13:26
New tool for character artists GustavoM News & Discussion 12 24-Jan-06 12:10
Toon Material Conversion Script RobertT Python & Plugins 4 15-Jan-06 18:21
A.N.T. ( Another Noise Tool ) Jimmy Haze Python & Plugins 12 16-Jul-04 22:04


All times are GMT. The time now is 14:41.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists