mailr5541 - /1.3/prompt/sequence.py


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

Header


Content

Posted by edward on April 10, 2008 - 12:29:
Author: bugman
Date: Thu Apr 10 12:29:25 2008
New Revision: 5541

URL: http://svn.gna.org/viewcvs/relax?rev=5541&view=rev
Log:
Updated the sequence.display() user function.


Modified:
    1.3/prompt/sequence.py

Modified: 1.3/prompt/sequence.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/sequence.py?rev=5541&r1=5540&r2=5541&view=diff
==============================================================================
--- 1.3/prompt/sequence.py (original)
+++ 1.3/prompt/sequence.py Thu Apr 10 12:29:25 2008
@@ -42,63 +42,63 @@
         self.__relax__ = relax
 
 
-    def display(self, mol_name_col=0, res_num_col=1, res_name_col=2, 
spin_num_col=3, spin_name_col=4, sep=None):
+    def display(self, sep=None, mol_name_flag=True, res_num_flag=True, 
res_name_flag=True, spin_num_flag=True, spin_name_flag=True):
         """Function for displaying sequences of molecules, residues, and/or 
spins.
 
         Keyword Arguments
         ~~~~~~~~~~~~~~~~~
 
-        mol_name_col:  The molecule name column (the default is 0, i.e. the 
first column).
-
-        res_num_col:  The residue number column (the default is 1, i.e. the 
second column).
-
-        res_name_col:  The residue name column (the default is 2, i.e. the 
third column).
-
-        spin_num_col:  The spin number column (the default is 3, i.e. the 
forth column).
-
-        spin_name_col:  The spin name column (the default is 4, i.e. the 
fifth column).
-
-        sep:  The column separator (the default is white space).
+        sep:  The column separator (the default of None corresponds to white 
space).
+
+        mol_name_flag:  A flag whic if True will cause the molecule name 
column to be shown.
+
+        res_num_flag:  A flag whic if True will cause the residue number 
column to be shown.
+
+        res_name_flag:  A flag whic if True will cause the residue name 
column to be shown.
+
+        spin_num_flag:  A flag whic if True will cause the spin number 
column to be shown.
+
+        spin_name_flag:  A flag whic if True will cause the spin name column 
to be shown.
 
         """
 
         # Function intro text.
         if self.__relax__.interpreter.intro:
             text = sys.ps3 + "sequence.display("
-            text = text + "mol_name_col=" + `mol_name_col`
-            text = text + ", res_num_col=" + `res_num_col`
-            text = text + ", res_name_col=" + `res_name_col`
-            text = text + ", spin_num_col=" + `spin_num_col`
-            text = text + ", spin_name_col=" + `spin_name_col`
-            text = text + ", sep=" + `sep` + ")"
+            text = text + "sep=" + `sep`
+            text = text + "mol_name_flag=" + `mol_name_flag`
+            text = text + ", res_num_flag=" + `res_num_flag`
+            text = text + ", res_name_flag=" + `res_name_flag`
+            text = text + ", spin_num_flag=" + `spin_num_flag`
+            text = text + ", spin_name_flag=" + `spin_name_flag` + ")"
             print text
-
-        # Molecule name column.
-        if mol_name_col != None and type(mol_name_col) != int:
-            raise RelaxNoneIntError, ('molecule name column', mol_name_col)
-
-        # Residue number column.
-        if res_name_col != None and type(res_num_col) != int:
-            raise RelaxNoneIntError, ('residue number column', res_num_col)
-
-        # Residue name column.
-        if res_name_col != None and type(res_name_col) != int:
-            raise RelaxNoneIntError, ('residue name column', res_name_col)
-
-        # Spin number column.
-        if spin_num_col != None and type(spin_num_col) != int:
-            raise RelaxNoneIntError, ('spin number column', spin_num_col)
-
-        # Spin name column.
-        if spin_name_col != None and type(spin_name_col) != int:
-            raise RelaxNoneIntError, ('spin name column', spin_name_col)
 
         # Column separator.
         if sep != None and type(sep) != str:
             raise RelaxNoneStrError, ('column separator', sep)
 
+        # Molecule name flag.
+        if type(mol_name_flag) != bool:
+            raise RelaxBoolError, ('molecule name flag', mol_name_flag)
+
+        # Residue number flag.
+        if type(res_num_flag) != bool:
+            raise RelaxBoolError, ('residue number flag', res_num_flag)
+
+        # Residue name flag.
+        if type(res_name_flag) != bool:
+            raise RelaxBoolError, ('residue name flag', res_name_flag)
+
+        # Spin number flag.
+        if type(spin_num_flag) != bool:
+            raise RelaxBoolError, ('spin number flag', spin_num_flag)
+
+        # Spin name flag.
+        if type(spin_name_flag) != bool:
+            raise RelaxBoolError, ('spin name flag', spin_name_flag)
+
         # Execute the functional code.
-        sequence.display(mol_name_col=mol_name_col, res_num_col=res_num_col, 
res_name_col=res_name_col, spin_num_col=spin_num_col, 
spin_name_col=spin_name_col, sep=sep)
+        sequence.display(sep=sep, mol_name_flag=mol_name_flag, 
res_num_flag=res_num_flag, res_name_flag=res_name_flag, 
spin_num_flag=spin_num_flag, spin_name_flag=spin_name_flag)
 
 
     def read(self, file=None, dir=None, mol_name_col=None, res_num_col=0, 
res_name_col=1, spin_num_col=None, spin_name_col=None, sep=None):




Related Messages


Powered by MHonArc, Updated Thu Apr 10 12:40:13 2008