mailr20581 - in /branches/relax_disp: ./ devel_scripts/ docs/ lib/ lib/spectrum/ pipe_control/


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

Header


Content

Posted by edward on August 13, 2013 - 14:45:
Author: bugman
Date: Tue Aug 13 14:45:51 2013
New Revision: 20581

URL: http://svn.gna.org/viewcvs/relax?rev=20581&view=rev
Log:
Merged revisions 20571-20576,20580 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r20571 | bugman | 2013-08-09 10:02:09 +0200 (Fri, 09 Aug 2013) | 5 lines
  
  A number of updates and improvements to the document explaining how to 
setup a Mac OS X framework.
  
  This Framework Python setup is used to build the binary distribution files.
........
  r20572 | bugman | 2013-08-09 11:20:53 +0200 (Fri, 09 Aug 2013) | 3 lines
  
  Updated the Mac Framework testing script to handled 4-way binaries (ppc74 
included).
........
  r20573 | bugman | 2013-08-09 11:33:39 +0200 (Fri, 09 Aug 2013) | 3 lines
  
  Better support for 4-way binaries in the Mac OS X Framework detection 
script.
........
  r20574 | bugman | 2013-08-09 11:44:14 +0200 (Fri, 09 Aug 2013) | 3 lines
  
  Added support for the 'current ar archive random library' file type in the 
Mac OS X Framework testing script.
........
  r20575 | bugman | 2013-08-09 12:36:08 +0200 (Fri, 09 Aug 2013) | 3 lines
  
  Added py2app to the Mac OS X Framework setup instructions.
........
  r20576 | bugman | 2013-08-09 14:58:32 +0200 (Fri, 09 Aug 2013) | 5 lines
  
  Shifted code from pipe_control.spectrum to the new lib.spectrum.peak_list 
relax library module.
  
  This follows from 
http://thread.gmane.org/gmane.science.nmr.relax.devel/3972/focus=4347.
........
  r20580 | bugman | 2013-08-13 14:42:28 +0200 (Tue, 13 Aug 2013) | 3 lines
  
  Added a special script for locating all Python versions and printing out 
the installed modules.
........

Added:
    branches/relax_disp/devel_scripts/python_seek.py
      - copied unchanged from r20580, trunk/devel_scripts/python_seek.py
    branches/relax_disp/lib/spectrum/
      - copied from r20580, trunk/lib/spectrum/
Modified:
    branches/relax_disp/   (props changed)
    branches/relax_disp/devel_scripts/framework_bin_test
    branches/relax_disp/docs/Mac_framework_build_3way
    branches/relax_disp/lib/__init__.py
    branches/relax_disp/pipe_control/spectrum.py

Propchange: branches/relax_disp/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug 13 14:45:51 2013
@@ -1,1 +1,1 @@
-/trunk:1-20569
+/trunk:1-20580

Modified: branches/relax_disp/devel_scripts/framework_bin_test
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/devel_scripts/framework_bin_test?rev=20581&r1=20580&r2=20581&view=diff
==============================================================================
--- branches/relax_disp/devel_scripts/framework_bin_test (original)
+++ branches/relax_disp/devel_scripts/framework_bin_test Tue Aug 13 14:45:51 
2013
@@ -78,7 +78,37 @@
 
         # The type.
         file_type = None
-        if data[0][:-1] == 'Mach-O universal binary with 3 architectures':
+        if data[0][:-1] == 'Mach-O universal binary with 4 architectures':
+            file_type = '4-way'
+
+            # Arch.
+            arch = [None, None, None, None]
+            for i in range(4):
+                row = data[i+1].split('\t')
+                arch[i] = row[1][:-1]
+            arch.sort()
+
+            # The full file type printout.
+            if arch == ['Mach-O 64-bit executable ppc64', 'Mach-O 64-bit 
executable x86_64', 'Mach-O executable i386', 'Mach-O executable ppc']:
+                part_type = '%s [i386, ppc, x86_64, ppc64]' % file_type
+                full_type = '%s exec [i386, ppc, x86_64, ppc64]' % file_type
+            elif arch == ['Mach-O 64-bit bundle ppc64', 'Mach-O 64-bit 
bundle x86_64', 'Mach-O bundle i386', 'Mach-O bundle ppc']:
+                part_type = '%s [i386, ppc, x86_64, ppc64]' % file_type
+                full_type = '%s bundle [i386, ppc, x86_64, ppc64]' % 
file_type
+            elif arch == ['Mach-O 64-bit dynamically linked shared library 
ppc64', 'Mach-O 64-bit dynamically linked shared library x86_64', 'Mach-O 
dynamically linked shared library i386', 'Mach-O dynamically linked shared 
library ppc']:
+                part_type = '%s [i386, ppc, x86_64, ppc64]' % file_type
+                full_type = '%s lib [i386, ppc, x86_64, ppc64]' % file_type
+            elif arch == ['Mach-O 64-bit object ppc64', 'Mach-O 64-bit 
object x86_64', 'Mach-O object i386', 'Mach-O object ppc']:
+                part_type = '%s [i386, ppc, x86_64, ppc64]' % file_type
+                full_type = '%s obj [i386, ppc, x86_64, ppc64]' % file_type
+            elif arch == ['current ar archive random library', 'current ar 
archive random library', 'current ar archive random library', 'current ar 
archive random library']:
+                part_type = '%s ar' % file_type
+                full_type = '%s current ar archive random library' % 
file_type
+            else:
+                full_type = '%s %s' % (file_type, arch)
+                part_type = full_type
+
+        elif data[0][:-1] == 'Mach-O universal binary with 3 architectures':
             file_type = '3-way'
 
             # Arch.
@@ -101,6 +131,9 @@
             elif arch == ['Mach-O 64-bit object x86_64', 'Mach-O object 
i386', 'Mach-O object ppc']:
                 part_type = '%s [i386, ppc, x86_64]' % file_type
                 full_type = '%s obj [i386, ppc, x86_64]' % file_type
+            elif arch == ['current ar archive random library', 'current ar 
archive random library', 'current ar archive random library']:
+                part_type = '%s ar' % file_type
+                full_type = '%s current ar archive random library' % 
file_type
             else:
                 full_type = '%s %s' % (file_type, arch)
                 part_type = full_type
@@ -128,6 +161,9 @@
             elif arch == ['Mach-O object i386', 'Mach-O object ppc']:
                 part_type = '%s [i386, ppc]' % file_type
                 full_type = '%s obj [i386, ppc]' % file_type
+            elif arch == ['current ar archive random library', 'current ar 
archive random library']:
+                part_type = '%s ar' % file_type
+                full_type = '%s current ar archive random library' % 
file_type
             else:
                 full_type = '%s %s' % (file_type, arch)
                 part_type = full_type

Modified: branches/relax_disp/docs/Mac_framework_build_3way
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/docs/Mac_framework_build_3way?rev=20581&r1=20580&r2=20581&view=diff
==============================================================================
--- branches/relax_disp/docs/Mac_framework_build_3way (original)
+++ branches/relax_disp/docs/Mac_framework_build_3way Tue Aug 13 14:45:51 2013
@@ -14,7 +14,7 @@
 PATH=$PATH:$HOME/bin
 export PATH
 
-Check the Python Framework 3-way architecture using the 
scripts/framework_bin_test script.  The Tk module might fail as the 10.5 Mac 
SDK could be only i386 and ppc build.  Then a custom Tcl/Tk build will be 
required (e.g. at http://cran.r-project.org/bin/macosx/tools/) and the 
tkinter module build by hand, changing the -isysroot flag to / at the last 
step.
+Check the Python Framework 3-way architecture using the 
devel_scripts/framework_bin_test script.  The Tk module might fail as the 
10.5 Mac SDK could be only i386 and ppc build.  Then a custom Tcl/Tk build 
will be required (e.g. at http://cran.r-project.org/bin/macosx/tools/) and 
the tkinter module build by hand, changing the -isysroot flag to / at the 
last step.
 
 
 
@@ -32,9 +32,9 @@
 
 Install the appropriate GNU fortran version to add to Xcode (for example 
gfortran-42-5664.pkg from http://r.research.att.com/tools/).  Xcode does not 
come with a Fortran compiler and the fink version will not be able to create 
Universal 3-way binaries.
 
-$ PATH=/usr/local/bin/:$PATH ~/bin/python2.7 setup.py install
+$ PATH=/usr/local/bin/:$PATH C_INCLUDE_PATH=/sw/include/suitesparse/ 
~/bin/python2.7 setup.py install
 
-The PATH option is needed if gfortran is located in both /usr/local/bin/ and 
/sw/bin/.
+The PATH option is needed if gfortran is located in both /usr/local/bin/ and 
/sw/bin/.  The C_INCLUDE_PATH may be needed if the suitesparse header files 
cannot be found.
 
 
 
@@ -98,4 +98,35 @@
 Download and unpack the latest source release.  In the base directory, type:
 
 $ cd wxPython
-$ ~/bin/python2.7 build-wxpython.py --build_dir=../bld --osx_cocoa 
--mac-universal-binary --prefix=$HOME --unicode --install
+$ ~/bin/python2.7 build-wxpython.py --build_dir=../bld --osx_cocoa 
--mac_universal_binary --prefix=$HOME --unicode --install
+
+
+
+# SCons.
+
+Download and unpack the latest 2.x.x release, then type:
+
+$ ~/bin/python2.7 setup.py install
+$ cd ~/bin
+$ ln -s 
/Users/edward/Library/Frameworks/Python.framework/Versions/2.7/bin/scons-2.x.x
 scons
+
+Then edit the scons file and change the top of the file from:
+
+#! /usr/bin/env python
+#
+# SCons - a Software Constructor
+#
+
+To:
+
+#! /Users/edward/bin/python
+#
+# SCons - a Software Constructor
+#
+
+
+# Py2app.
+
+This is needed to create the universal binary DMG distribution file.  
Download the latest version from https://pypi.python.org/pypi/py2app/.  Then 
open it and:
+
+$ ~/bin/python2.7 setup.py install

Modified: branches/relax_disp/lib/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/__init__.py?rev=20581&r1=20580&r2=20581&view=diff
==============================================================================
--- branches/relax_disp/lib/__init__.py (original)
+++ branches/relax_disp/lib/__init__.py Tue Aug 13 14:45:51 2013
@@ -47,6 +47,7 @@
     'selection',
     'software',
     'spectral_densities',
+    'spectrum',
     'statistics',
     'structure',
     'text',

Modified: branches/relax_disp/pipe_control/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/pipe_control/spectrum.py?rev=20581&r1=20580&r2=20581&view=diff
==============================================================================
--- branches/relax_disp/pipe_control/spectrum.py (original)
+++ branches/relax_disp/pipe_control/spectrum.py Tue Aug 13 14:45:51 2013
@@ -32,8 +32,9 @@
 
 # relax module imports.
 from lib.errors import RelaxError, RelaxImplementError, 
RelaxNoSequenceError, RelaxNoSpectraError
-from lib.io import extract_data, read_spin_data, strip, write_data
+from lib.io import extract_data, write_data
 from lib.software import nmrpipe, nmrview, sparky, xeasy
+from lib.spectrum.peak_list import autodetect_format, intensity_generic
 from lib.warnings import RelaxWarning, RelaxNoSpinWarning
 from pipe_control import pipes
 from pipe_control.mol_res_spin import exists_mol_res_spin_data, 
generate_spin_id_unique, return_spin, spin_loop
@@ -250,38 +251,6 @@
         # Set the error to the RMSD multiplied by the square root of the 
total number of points.
         for key in spin.intensity.keys():
             spin.intensity_err[key] = spin.baseplane_rmsd[key] * sqrt(spin.N)
-
-
-def autodetect_format(file_data):
-    """Automatically detect the format of the peak list.
-
-    @param file_data:   The processed results file data.
-    @type file_data:    list of lists of str
-    """
-
-    # The first header line.
-    for line in file_data:
-        if line != []:
-            break
-
-    # Sparky format.
-    if line[0] == 'Assignment':
-        return 'sparky'
-
-    # NMRView format.
-    if line == ['label', 'dataset', 'sw', 'sf']:
-        return 'nmrview'
-
-    # NMRPipe SeriesTab.
-    if line[0] == 'REMARK' and line[1] == 'SeriesTab':
-        return 'seriestab'
-
-    # XEasy format.
-    if line == ['No.', 'Color', 'w1', 'w2', 'ass.', 'in', 'w1', 'ass.', 
'in', 'w2', 'Volume', 'Vol.', 'Err.', 'Method', 'Comment']:
-        return 'xeasy'
-
-    # Assume a generic format.
-    return 'generic'
 
 
 def baseplane_rmsd(error=0.0, spectrum_id=None, spin_id=None):
@@ -481,79 +450,6 @@
     """
 
     raise RelaxImplementError
-
-
-def intensity_generic(file_data=None, spin_id_col=None, mol_name_col=None, 
res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, 
data_col=None, sep=None, spin_id=None):
-    """Return the process data from the generic peak intensity file.
-
-    The residue number, heteronucleus and proton names, and peak intensity 
will be returned.
-
-
-    @keyword file_data:     The data extracted from the file converted into 
a list of lists.
-    @type file_data:        list of lists of str
-    @keyword spin_id_col:   The column containing the spin ID strings (used 
by the generic intensity file format).  If supplied, the mol_name_col, 
res_name_col, res_num_col, spin_name_col, and spin_num_col arguments must be 
none. @type spin_id_col:      int or None @keyword mol_name_col:  The column 
containing the molecule name information (used by the generic intensity file 
format).  If supplied, spin_id_col must be None.
-    @type mol_name_col:     int or None
-    @keyword res_name_col:  The column containing the residue name 
information (used by the generic intensity file format).  If supplied, 
spin_id_col must be None.
-    @type res_name_col:     int or None
-    @keyword res_num_col:   The column containing the residue number 
information (used by the generic intensity file format).  If supplied, 
spin_id_col must be None.
-    @type res_num_col:      int or None
-    @keyword spin_name_col: The column containing the spin name information 
(used by the generic intensity file format).  If supplied, spin_id_col must 
be None.
-    @type spin_name_col:    int or None
-    @keyword spin_num_col:  The column containing the spin number 
information (used by the generic intensity file format).  If supplied, 
spin_id_col must be None.
-    @type spin_num_col:     int or None
-    @keyword data_col:      The column containing the peak intensities.
-    @type data_col:         int or list of int
-    @keyword sep:           The column separator which, if None, defaults to 
whitespace.
-    @type sep:              str or None
-    @keyword spin_id:       The spin ID string used to restrict data loading 
to a subset of all spins.
-    @type spin_id:          None or str
-    @raises RelaxError:     When the expected peak intensity is not a float.
-    @return:                The extracted data as a list of lists.  The 
first dimension corresponds to the spin.  The second dimension consists of 
the proton name, heteronucleus name, spin ID string, and the intensity value.
-    @rtype:                 list of lists of str, str, str, float
-    """
-
-    # Check the intensity column argument.
-    if data_col == None:
-        raise RelaxError("The data column argument has not been supplied.")
-
-    # Strip the data.
-    file_data = strip(file_data)
-
-    # Convert the the data_col argument to a list if needed.
-    if not isinstance(data_col, list):
-        data_col = [data_col]
-
-    # Loop over the data columns.
-    data = []
-    for i in range(len(data_col)):
-        # Loop over the data.
-        row_index = 0
-        for values in read_spin_data(file_data=file_data, 
spin_id_col=spin_id_col, 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, data_col=data_col[i], sep=sep, spin_id=spin_id):
-            # Check the values.
-            if len(values) != 6:
-                raise RelaxError("The molecule name, residue number and 
name, spin number and name, and value columns could not be found in the data 
%s." % repr(values))
-
-            # Unpack.
-            mol_name, res_num, res_name, spin_num, spin_name, value = values
-
-            # Create the unique spin ID.
-            id = generate_spin_id_unique(mol_name=mol_name, res_num=res_num, 
res_name=res_name, spin_num=spin_num, spin_name=spin_name)
-
-            # Store the necessary data.
-            if i == 0:
-                # Convert the value to a list if multiple columns are 
present.
-                if len(data_col) > 1:
-                    data.append([None, None, id, [value], id])
-                else:
-                    data.append([None, None, id, value, id])
-            else:
-                data[row_index][3].append(value)
-
-            # Go to the next row.
-            row_index += 1
-
-    # Return the data.
-    return data
 
 
 def read(file=None, dir=None, spectrum_id=None, heteronuc=None, proton=None, 
int_col=None, int_method=None, spin_id_col=None, mol_name_col=None, 
res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, 
sep=None, spin_id=None, ncproc=None, verbose=True):




Related Messages


Powered by MHonArc, Updated Tue Aug 13 18:00:02 2013