mailr8025 - /branches/spectral_errors/prompt/spectrum.py


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

Header


Content

Posted by edward on November 26, 2008 - 10:57:
Author: bugman
Date: Wed Nov 26 10:57:42 2008
New Revision: 8025

URL: http://svn.gna.org/viewcvs/relax?rev=8025&view=rev
Log:
Wrote the interface for the spectrum.replicated() user function.


Modified:
    branches/spectral_errors/prompt/spectrum.py

Modified: branches/spectral_errors/prompt/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spectral_errors/prompt/spectrum.py?rev=8025&r1=8024&r2=8025&view=diff
==============================================================================
--- branches/spectral_errors/prompt/spectrum.py (original)
+++ branches/spectral_errors/prompt/spectrum.py Wed Nov 26 10:57:42 2008
@@ -476,3 +476,56 @@
 
         # Execute the functional code.
         spectrum.read(file=file, dir=dir, spectrum_id=spectrum_id, 
heteronuc=heteronuc, proton=proton, int_col=int_col, int_method=int_method, 
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)
+
+
+    def replicated(self, spectrum_ids=None):
+        """Function for specifying which spectra are replicates.
+
+        Keyword Arguments
+        ~~~~~~~~~~~~~~~~~
+
+        spectrum_ids:  The list of replicated spectra identification strings.
+
+
+        Description
+        ~~~~~~~~~~~
+
+        This user function is used to identify which loaded spectra are 
replicates of each other.
+        This is very important for error analysis.
+
+
+        Examples
+        ~~~~~~~~
+
+        To specify that the NOE spectra labelled 'ref1', 'ref2', and 'ref3' 
are the same spectrum
+        replicated, type one of:
+
+        relax> spectrum.replicated(['ref1', 'ref2', 'ref3'])
+        relax> spectrum.replicated(spectrum_ids=['ref1', 'ref2', 'ref3'])
+
+        To specify that the two R2 spectra 'ncyc2' and 'ncyc2b' are the same 
time point, type:
+
+        relax> spectrum.replicated(['ncyc2', 'ncyc2b'])
+        """
+
+        # Function intro text.
+        if self.__relax__.interpreter.intro:
+            text = sys.ps3 + "spectrum.replicated("
+            text = text + "spectrum_ids=" + `spectrum_ids` + ")"
+            print text
+
+        # Spectrum ids.
+        if type(spectrum_ids) != list:
+            raise RelaxListStrError, ('spectrum ids', spectrum_ids)
+        else:
+            # Empty list.
+            if spectrum_ids == []:
+                raise RelaxListStrError, ('spectrum ids', spectrum_ids)
+
+            # Check the values.
+            for i in xrange(len(spectrum_ids)):
+                if type(spectrum_ids[i]) != str:
+                    raise RelaxListStrError, ('spectrum ids', spectrum_ids)
+
+        # Execute the functional code.
+        spectrum.replicated(spectrum_ids=spectrum_ids)




Related Messages


Powered by MHonArc, Updated Wed Nov 26 18:20:02 2008