Author: bugman
Date: Fri Nov 23 15:41:40 2007
New Revision: 3850

URL: http://svn.gna.org/viewcvs/relax?rev=3850&view=rev
Log:
Fixes for the write() function.


Modified:
    1.3/generic_fns/sequence.py

Modified: 1.3/generic_fns/sequence.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/sequence.py?rev=3850&r1=3849&r2=3850&view=diff
==============================================================================
--- 1.3/generic_fns/sequence.py (original)
+++ 1.3/generic_fns/sequence.py Fri Nov 23 15:41:40 2007
@@ -275,22 +275,18 @@
     """Function for writing sequence data."""
 
     # Test if the sequence data is loaded.
-    if not count_spins:
-        raise RelaxNoSequenceError, run
+    if not count_spins():
+        raise RelaxNoSequenceError
 
     # Open the file for writing.
     seq_file = open_write_file(file, dir, force)
 
-    # Loop over the sequence.
-    for i in xrange(len(relax_data_store.res[run])):
-        # Residue number.
-        seq_file.write("%-5i" % relax_data_store.res[run][i].num)
-
-        # Residue name.
-        seq_file.write("%-6s" % relax_data_store.res[run][i].name)
-
-        # New line.
-        seq_file.write("\n")
+    # Write a header.
+    seq_file.write("%-8s%-8s%-8s%-8s%-8s%-10s\n" % ("Mol name", "Res num", 
"Res name", "Spin num", "Spin name", "Selected"))
+
+    # Loop over the spins.
+    for spin, mol_name, res_num, res_name in spin_loop(full_info=True):
+        seq_file.write("%-8s%-8i%-8s%-8i%-8s%-10i\n" % (mol_name, res_num, 
res_name, spin.num, spin.name, spin.select))
 
     # Close the results file.
     seq_file.close()


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to