mailr26595 - /trunk/lib/structure/pdb_write.py


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

Header


Content

Posted by edward on November 17, 2014 - 11:56:
Author: bugman
Date: Mon Nov 17 11:56:50 2014
New Revision: 26595

URL: http://svn.gna.org/viewcvs/relax?rev=26595&view=rev
Log:
Set more reasonable default values for the lib.structure.pdb_write functions 
atom() and hetatm().

The occupancy now defaults to 1.0 instead of '', and the temperature factor 
to 0.0 instead of ''.
This avoid painful errors when using these functions, as these arguments must 
be floating point
numbers at all times, hence the default value of '' causes a TypeError.


Modified:
    trunk/lib/structure/pdb_write.py

Modified: trunk/lib/structure/pdb_write.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/pdb_write.py?rev=26595&r1=26594&r2=26595&view=diff
==============================================================================
--- trunk/lib/structure/pdb_write.py    (original)
+++ trunk/lib/structure/pdb_write.py    Mon Nov 17 11:56:50 2014
@@ -89,7 +89,7 @@
         raise RelaxError("The PDB record '%s' contains NaN values." % record)
 
 
-def atom(file, serial='', name='', alt_loc='', res_name='', chain_id='', 
res_seq='', icode='', x='', y='', z='', occupancy='', temp_factor='', 
element='', charge=''):
+def atom(file, serial='', name='', alt_loc='', res_name='', chain_id='', 
res_seq='', icode='', x='', y='', z='', occupancy=1.0, temp_factor=0.0, 
element='', charge=''):
     """Generate the ATOM record.
 
     The following is the PDB v3.3 documentation 
U{http://www.wwpdb.org/documentation/format33/sect9.html#ATOM}.
@@ -297,6 +297,7 @@
         _handle_none(element),
         _handle_none(charge)
     )
+    print text
 
     # Validate.
     _record_validate(text)
@@ -972,7 +973,7 @@
     file.write('\n')
 
 
-def hetatm(file, serial='', name='', alt_loc='', res_name='', chain_id='', 
res_seq='', icode='', x='', y='', z='', occupancy='', temp_factor='', 
element='', charge=''):
+def hetatm(file, serial='', name='', alt_loc='', res_name='', chain_id='', 
res_seq='', icode='', x='', y='', z='', occupancy=1.0, temp_factor=0.0, 
element='', charge=''):
     """Generate the HETATM record.
 
     The following is the PDB v3.3 documentation 
U{http://www.wwpdb.org/documentation/format33/sect9.html#HETATM}.




Related Messages


Powered by MHonArc, Updated Mon Nov 17 12:00:03 2014