Author: bugman Date: Fri Nov 23 15:29:47 2007 New Revision: 3845 URL: http://svn.gna.org/viewcvs/relax?rev=3845&view=rev Log: Converted the diplay() class method to a module 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=3845&r1=3844&r2=3845&view=diff ============================================================================== --- 1.3/generic_fns/sequence.py (original) +++ 1.3/generic_fns/sequence.py Fri Nov 23 15:29:47 2007 @@ -25,6 +25,21 @@ from relax_errors import RelaxError, RelaxFileEmptyError, RelaxNoPdbChainError, RelaxNoPipeError, RelaxNoSequenceError, RelaxSequenceError from relax_io import extract_data, strip + + +def display(run=None): + """Function for displaying the sequence.""" + + # Test if the sequence data is loaded. + if not relax_data_store.res.has_key(run): + raise RelaxNoSequenceError, run + + # Print a header. + print "%-8s%-8s%-10s" % ("Number", "Name", "Selected") + + # Print the sequence. + for i in xrange(len(relax_data_store.res[run])): + print "%-8i%-8s%-10i" % (relax_data_store.res[run][i].num, relax_data_store.res[run][i].name, relax_data_store.res[run][i].select) def read(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): @@ -225,25 +240,6 @@ self.relax = relax - def display(self, run=None): - """Function for displaying the sequence.""" - - # Test if the run exists. - if not run in relax_data_store.run_names: - raise RelaxNoPipeError, run - - # Test if the sequence data is loaded. - if not relax_data_store.res.has_key(run): - raise RelaxNoSequenceError, run - - # Print a header. - print "%-8s%-8s%-10s" % ("Number", "Name", "Selected") - - # Print the sequence. - for i in xrange(len(relax_data_store.res[run])): - print "%-8i%-8s%-10i" % (relax_data_store.res[run][i].num, relax_data_store.res[run][i].name, relax_data_store.res[run][i].select) - - def load_PDB_sequence(self, run=None): """Function for loading the sequence out of a PDB file. _______________________________________________ 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