mailr8598 - in /branches/multi_structure: generic_fns/structure/main.py prompt/structure.py


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

Header


Content

Posted by edward on January 22, 2009 - 16:09:
Author: bugman
Date: Thu Jan 22 16:09:57 2009
New Revision: 8598

URL: http://svn.gna.org/viewcvs/relax?rev=8598&view=rev
Log:
Changed the struct_index arg of the structure.write_pdb() user function to 
model_num.


Modified:
    branches/multi_structure/generic_fns/structure/main.py
    branches/multi_structure/prompt/structure.py

Modified: branches/multi_structure/generic_fns/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/main.py?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- branches/multi_structure/generic_fns/structure/main.py (original)
+++ branches/multi_structure/generic_fns/structure/main.py Thu Jan 22 
16:09:57 2009
@@ -415,7 +415,7 @@
             print "Extracted " + spin.name + "-" + attached_name + " vectors 
for " + `id` + '.'
 
 
-def write_pdb(file=None, dir=None, struct_index=None, force=False):
+def write_pdb(file=None, dir=None, model_num=None, force=False):
     """The PDB writing function.
 
     @keyword file:          The name of the PDB file to write.
@@ -423,9 +423,9 @@
     @keyword dir:           The directory where the PDB file will be placed. 
 If set to None, then
                             the file will be placed in the current directory.
     @type dir:              str or None
-    @keyword stuct_index:   The index of the structure to write.  If set to 
None, then all
-                            structures will be written.
-    @type stuct_index:      int or None
+    @keyword model_num:     The model to place into the PDB file.  If not 
supplied, then all
+                            models will be placed into the file.
+    @type model_num:        None or int
     @keyword force:         The force flag which if True will cause the file 
to be overwritten.
     @type force:            bool
     """
@@ -455,4 +455,4 @@
     file = open_write_file(file_path, force=force)
 
     # Write the structures.
-    cdp.structure.write_pdb(file, struct_index=struct_index)
+    cdp.structure.write_pdb(file, model_num=model_num)

Modified: branches/multi_structure/prompt/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_structure/prompt/structure.py?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- branches/multi_structure/prompt/structure.py (original)
+++ branches/multi_structure/prompt/structure.py Thu Jan 22 16:09:57 2009
@@ -586,7 +586,7 @@
         generic_fns.structure.main.vectors(attached=attached, 
spin_id=spin_id, model=model, verbosity=verbosity, ave=ave, unit=unit)
 
 
-    def write_pdb(self, file=None, dir=None, struct_index=None, force=False):
+    def write_pdb(self, file=None, dir=None, model_num=None, force=False):
         """The PDB writing function.
 
         Keyword Arguments
@@ -596,7 +596,7 @@
 
         dir:  The directory where the file is located.
 
-        struct_index:  The index of the structure to write.
+        model_num:  The optional model to place in the PDB file.
 
         force:  A flag which, if set to True, will overwrite the any 
pre-existing file.
 
@@ -604,25 +604,23 @@
         Description
         ~~~~~~~~~~~
 
-        If the struct_index argument is None, then each loaded structure 
will be written to a single
-        file as different models.  This index covers all the structures 
loaded from individual files
-        and all the structures present as different models within each file.
+        If the model_num argument is None, then all models will be written 
to a single file.
 
 
         Example
         ~~~~~~~
 
-        To write all structures to the PDB file 'ensemble.pdb' within the 
directory '~/pdb', type
+        To write all models and molecules to the PDB file 'ensemble.pdb' 
within the directory '~/pdb', type
         one of:
 
         relax> structure.write_pdb('ensemble.pdb', '~/pdb')
         relax> structure.write_pdb(file='ensemble.pdb', dir='pdb')
 
 
-        To write the 4th model loaded from a PDB file into the new file 
'test.pdb', use one of:
-
-        relax> structure.write_pdb('test.pdb', struct_index=3)
-        relax> structure.write_pdb(file='test.pdb', struct_index=3)
+        To write model number 3 into the new file 'test.pdb', use one of:
+
+        relax> structure.write_pdb('test.pdb', model_num=3)
+        relax> structure.write_pdb(file='test.pdb', model_num=3)
         """
 
         # Function intro text.
@@ -630,7 +628,7 @@
             text = sys.ps3 + "structure.write_pdb("
             text = text + "file=" + `file`
             text = text + ", dir=" + `dir`
-            text = text + ", struct_index=" + `struct_index`
+            text = text + ", model_num=" + `model_num`
             text = text + ", force=" + `force` + ")"
             print text
 
@@ -642,13 +640,13 @@
         if dir != None and type(dir) != str:
             raise RelaxNoneStrError, ('directory name', dir)
 
-        # The struct_index argument.
-        if struct_index != None and type(struct_index) != int:
-            raise RelaxNoneIntError, ('structure index', struct_index)
+        # The model_num argument.
+        if model_num != None and type(model_num) != int:
+            raise RelaxNoneIntError, ('model number', model_num)
 
         # The force flag.
         if type(force) != bool:
             raise RelaxBoolError, ('force flag', force)
 
         # Execute the functional code.
-        generic_fns.structure.main.write_pdb(file=file, dir=dir, 
struct_index=struct_index, force=force)
+        generic_fns.structure.main.write_pdb(file=file, dir=dir, 
model_num=model_num, force=force)




Related Messages


Powered by MHonArc, Updated Thu Jan 22 16:20:02 2009