mailr3232 - in /1.3: generic_fns/selection.py prompt/residue.py


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

Header


Content

Posted by edward on March 19, 2007 - 06:27:
Author: bugman
Date: Mon Mar 19 06:26:45 2007
New Revision: 3232

URL: http://svn.gna.org/viewcvs/relax?rev=3232&view=rev
Log:
Wrote the identification string documentation.

This documentation is the string 'generic_fns.selection.id_string_doc'.  The 
residue.delete() user
function docstring has had this string added to the end.

Modified:
    1.3/generic_fns/selection.py
    1.3/prompt/residue.py

Modified: 1.3/generic_fns/selection.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/selection.py?rev=3232&r1=3231&r2=3232&view=diff
==============================================================================
--- 1.3/generic_fns/selection.py (original)
+++ 1.3/generic_fns/selection.py Mon Mar 19 06:26:45 2007
@@ -24,10 +24,36 @@
 from os import F_OK, access
 from re import compile, match, split
 from string import strip
+from textwrap import fill
 
 # relax module imports.
 from data import Data as relax_data_store
 from relax_errors import RelaxError, RelaxNoRunError, RelaxNoSequenceError, 
RelaxRegExpError, RelaxResSelectDisallowError, RelaxSpinSelectDisallowError
+
+
+id_string_doc = """
+Identification string documentation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The identification string is composed of three components: the molecule id 
token beginning with the '#' character, the residue id token beginning with 
the ':' character, and the atom or spin system id token beginning with the 
'@' character.  Each token can be composed of multiple elements separated by 
the ',' character and each individual element can either be a number (which 
must be an integer, in string format), a name, or a range of numbers 
separated by the '-' character.  Negative numbers are supported.  The full id 
string specification is
+
+    #<mol_name> :<res_id>[, <res_id>[, <res_id>, ...]] @<atom_id>[, 
<atom_id>[, <atom_id>, ...]],
+
+where the token elements are
+
+    <mol_name>, the name of the molecule,
+    <res_id>, the residue identifier which can be a number, name, or range 
of numbers,
+    <atom_id>, the atom or spin system identifier which can be a number, 
name, or range of numbers.
+
+If one of the tokens is left out then all elements will be assumed to match. 
 For example if the string does not contain the '#' character then all 
molecules will match the string.
+"""
+
+# Wrap the id string doc.
+string = ''
+for line in split('\n', id_string_doc):
+    string = string + fill(line, width=100, initial_indent=8*' ', 
subsequent_indent=8*' ') + '\n'
+id_string_doc = string
+    
 
 
 

Modified: 1.3/prompt/residue.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/residue.py?rev=3232&r1=3231&r2=3232&view=diff
==============================================================================
--- 1.3/prompt/residue.py (original)
+++ 1.3/prompt/residue.py Mon Mar 19 06:26:45 2007
@@ -22,10 +22,12 @@
 
 # Python module imports.
 import sys
+from string import replace
 
 # relax module imports.
 import help
 from generic_fns import residue
+from generic_fns.selection import id_string_doc
 from relax_errors import RelaxBinError, RelaxIntError, RelaxNoneStrError, 
RelaxStrError
 
 
@@ -151,7 +153,9 @@
         Description
         ~~~~~~~~~~~
 
-        This function can be used to delete a single or sets of residues.
+        This function can be used to delete a single or sets of residues.  
See the identification
+        string documentation below for more information.  If spin 
system/atom ids are included a
+        RelaxError will be raised.
         """
 
         # Function intro text.
@@ -354,3 +358,13 @@
 
         # Execute the functional code.
         self.__relax__.generic.sequence.write(run=run, file=file, dir=dir, 
force=force)
+
+
+    # Docstring modification.
+    #########################
+
+    # Indent the identification string documentation.
+    #id_string_doc = replace(id_string_doc, '\n', '\n' + 8*' ')
+
+    # Delete function.
+    delete.__doc__ = delete.__doc__ + "\n\n" + id_string_doc + "\n"




Related Messages


Powered by MHonArc, Updated Mon Mar 19 07:00:19 2007