mailr7057 - /1.3/generic_fns/vmd.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 01, 2008 - 12:09:
Author: bugman
Date: Fri Aug  1 11:11:39 2008
New Revision: 7057

URL: http://svn.gna.org/viewcvs/relax?rev=7057&view=rev
Log:
Converted the VMD code to the new relax design.


Modified:
    1.3/generic_fns/vmd.py

Modified: 1.3/generic_fns/vmd.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/vmd.py?rev=7057&r1=7056&r2=7057&view=diff
==============================================================================
--- 1.3/generic_fns/vmd.py (original)
+++ 1.3/generic_fns/vmd.py Fri Aug  1 11:11:39 2008
@@ -35,7 +35,7 @@
 from relax_errors import RelaxNoPdbError
 
 
-def view(self, run):
+def view():
     """Function for viewing the collection of molecules using VMD."""
 
     # Test if the module is available.
@@ -43,16 +43,19 @@
         print "VMD is not available (cannot import 
Scientific.Visualization.VMD due to missing Numeric dependency)."
         return
 
+    # Alias the current data pipe.
+    cdp = ds[ds.current_pipe]
+
     # Test if the PDB file has been loaded.
-    if not ds.pdb.has_key(run):
-        raise RelaxNoPdbError, run
+    if not hasattr(cdp, 'structure'):
+        raise RelaxNoPdbError
 
     # Create an empty scene.
-    ds.vmd_scene = VMD.Scene()
+    cdp.vmd_scene = VMD.Scene()
 
     # Add the molecules to the scene.
-    for i in xrange(len(ds.pdb[run].structures)):
-        ds.vmd_scene.addObject(VMD.Molecules(ds.pdb[run].structures[i]))
+    for i in xrange(len(cdp.structure.structures)):
+        cdp.vmd_scene.addObject(VMD.Molecules(cdp.structure.structures[i]))
 
     # View the scene.
-    ds.vmd_scene.view()
+    cdp.vmd_scene.view()




Related Messages


Powered by MHonArc, Updated Fri Aug 01 13:00:12 2008