Re: problem loading R1, R2 and nOe files for modelfree

2014-06-27 Thread Edward d'Auvergne
Hi Ravi,

Which version of relax are you using and which operating system are
you running it on?  Are you using the newest 3.2.2 version?  Could you
run 'relax -i' or, in the GUI, select the 'Tools-System information'
menu item and the copy and paste the output into the body of a new
email?  Note that due to too much abuse of the system, attachments are
no longer allowed on the relax mailing lists to avoid excessive strain
on the open source infrastructure.  All attachments are filtered, i.e.
stripped from the message.  See your archived message at
http://article.gmane.org/gmane.science.nmr.relax.user/1695 for
example.  If you would like to share a file in such a situation, the
best solution is to create a bug report using the link
https://gna.org/bugs/?func=additemgroup=relax and to attach the file
there.  There are also support requests for non-bug related issues
where files can also be attached
(https://gna.org/support/?func=additemgroup=relax).

Cheers,

Edward


On 27 June 2014 00:50, Ravi Pratap Barnwal ravi1...@gmail.com wrote:
 Hi,
 I am encountering problem while loading R1,R2 and nOe values calculated for
 two different fields into relax (precompiled version 3.2.2) for mac 10.8.5.
 When i try to add the data and try to change the free format file
 settings for respective file, it is kind of hanging and does not proceed
 anywhere. My files are in the following format,
 3   GLY 1.814795542 0.090739777
 4   SER 2.267446596 0.11337233
 5   MET 2.621469801 0.13107349
 6   ASP 2.751590887 0.137579544


 Am i doing something wrong? I am following the protocol from this link,

 http://www.nmr-relax.com/manual/d_Auvergne_protocol_GUI_mode_data_pipe_initialisation.html

 I have attached a screen-shot for the problem. Any help is highly
 appreciated.

 regards
 ravi
 ___
 relax (http://www.nmr-relax.com)

 This is the relax-users mailing list
 relax-users@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-users

___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@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-users


Re: Side chain dynamics

2014-06-27 Thread Edward d'Auvergne
Hi Mengjun,

Sorry for not getting back to you earlier.  The papers you mention are:

Oscar Millet and Anthony Mittermaier and David Baker and Lewis E.
Kay (2003)  The Effects of Mutations on Motions of Side-chains in
Protein L Studied by 2H NMR Dynamics and Scalar Couplings.  Journal of
Molecular Biology, 329, 551-563
(http://dx.doi.org/10.1016/S0022-2836(03)00471-6)

Eric Johnson and Walter J. Chazin and Mark Rance (2006)  Effects
of Calcium Binding on the Side-chain Methyl Dynamics of Calbindin D9k:
A 2H NMR Relaxation Study. Journal of Molecular Biology, 357,
1237-1252 (http://dx.doi.org/10.1016/j.jmb.2006.01.031).

The key here is that if these papers use the standard model-free
theory with no modifications, which I think they do though you need to
carefully check this, then this will work fine in relax where the
standard theory is implemented.  If the theory has been modified and
hence is not the original equations, then it might be time to learn
some computer programming ;)  But if you look at equation (1) of the
Rance paper, you will see that they measure 5 quadrupolar relaxation
rates.  If you have measured these, then you cannot use them in relax
yet.

There is currently no support in relax for quadrapolar relaxation
rates.  However it would be relatively easy to add.  Note that all of
the required infrastructure is in place.  The model-free spectral
density functions are all located in lib/spectral_densities.  Also
present are all model-free models, the highest quality optimisation
infrastructure, powerful model selection techniques, model elimination
infrastructure for failed models, the automated protocol that I came
up with for solving the convoluted diffusion tensor vs. internal
motion problem (though I don't know if this protocol would work if you
only measured Me deuterium relaxation and do not combine it with
backbone relaxation), powerfully data visualisation infrastructure,
etc.  The only work required is:

1)  Extending the list of input relaxation data types in the
relax_data.read user function.  This is trivial - the hard part is
deciding what to call these rates.
2)  Adding relevant functions to the relax library
lib/auto_relaxation/ modules to handle the additional rates.  This is
where the real work is.
3)  Added the quadrupolar coupling constant Q (or e2qQ/h) as a
model-free parameter that can be set via the value.set user function
(see 
http://www.nmr-relax.com/api/3.2/specific_analyses.model_free.parameter_object-pysrc.html#Model_free_params.__init__).
This requires one line of code.

The hardest part would be obtaining published test data.  That would
only require emailing one of the corresponding authors and explaining
what you would like to do, and the data in the Rance paper, especially
figure 4 appears to be the best for this.  The test data is then
turned into a system test - this is a mini-analysis used to check that
everything runs as expected.  I could do this in ~2 weeks of solid
work, but I don't have the time to allocate to such a task.  This
would also require the gradients and Hessians (1st and 2nd partial
derivatives) to be calculated for the relaxation rates:

http://www.nmr-relax.com/manual/Ri_theta_gradients.html
http://www.nmr-relax.com/manual/Ri_theta_Hessians.html
http://www.nmr-relax.com/manual/Ri_prime_theta_gradients.html
http://www.nmr-relax.com/manual/Ri_prime_theta_Hessians.html

This is rather trivial in Maxima, wxMaxima, Mathematica, or other
symbolic algebra systems.  However it is so simple that it could be
derived by hand in a few minutes.  If you would be interested in
adding this to relax, you could then mention this in your paper - that
you implemented quadrapolar relaxation rates in relax.  This could
then be added to the reference list in the citations chapter
(http://www.nmr-relax.com/manual/Model_free_analysis_references.html)
as well as a new section for citations at the start of the model-free
chapter (http://www.nmr-relax.com/manual/Model_free_analysis.html) so
that people using relax with such rates should then cite your paper.

Regards,

Edward

On 12 June 2014 14:35,  mengjun@mailbox.tu-berlin.de wrote:
 Hi Edward,

 Thank you so much. I would like to replicate the analysis in the publication
 The Effects of Mutations on Motions of Side-chains in Protein L Studied by
 2H NMR Dynamics and Scalar Couplings and Effects of Calcium Binding on the
 Side-chain Methyl Dynamics of Calbindin D9k: A 2H NMR Relaxation Study

 , where models LS2 and LS3 were used for fitting.

 Best regards,

 Mengjun





 Quoting mengjun@mailbox.tu-berlin.de:

 Hi Edward,
 There is some script in Relax software which can be used for analyzing
 side chain dynamics (R1 and R1r of deuterium in CH2D isotopomers)? Thank
 you.

 Best regards,

 Mengjun





___
relax (http://www.nmr-relax.com)

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

To unsubscribe from this list, get a password
reminder, 

Re: R1rho RD analysis

2014-06-27 Thread Troels Emtekær Linnet
Dear Andrew.

Thank you for your valuable comments!

It becomes clear for me, that I should sit down with theory to grasp,
why I actually do:

1) matrix exponential
2) matrix power

in all the numerical models.
Then I would be able to select which best method to apply.

For:
ns_cpmg_2site_star.py = 2x2 matrix, ns_mmq_2site.py = 2x2 matrix.
I should write up the closed form.

So, the corresponding characteristic polynomial is quadratic so the
eigenvalues can be expressed in closed form in terms of the matrix
elements.

M = [ [a b], [b c] ]

discriminant: D = sqrt(a**2 + 4b**2 - 2ac + c**2=
Eigenvalues, lamda1, lamda2.
l1 = 0.5*(a + c - D), l2 = 0.5*(a + c + D)

Define M:
M = V^-1 * [ [l1 0], [0 l2] ] * V

V11 = (a - c - D)/2b
V12 = 1
V21 = (a - c + D)/2b
V22 = 1

V = [ [v11 v12], [v21 v22] ]

For:
ns_mmq_3site.py = 3x3 matrix, ns_cpmg_2site_3d.py = 7 X 7 matrix,
ns_r1rho_2site.py = 6x6 matrix, ns_r1rho_3site.py = 9x9 matrix.

I also asked on the Scipy mailing.
(Their mail server link is not working, so here a short reference).

### Charles R Harris:
Are you solving a differential equation? If so, an explicit solution
may not be the best way to go.

### Eric Moore:
There are expansions for the matrix exponential in terms of Chebyshev
and Laguerre matrix polynomials.
(The first of which does get use a bit for calculating propagators in
NMR, for instance, spinevolution and simpson both can/do use it.)
However, your matrices seem quite small, even if there are a large
number of them, so it may be very difficult to speed this up by much.

### Stephan Hoyer:
My experience with solving very similar quantum mechanics problems is
that using an ODE integrator like zofe (via scipy.integrate.ode)
can be much faster than solving the propagator exactly.

### Michael Kreim:
I agree with Stephan and Charles that it my be worth trying to solve
the ODE using any suitable ODE solver.
In Matlab I made the experience that it is very problem depended if
the ode solver or the matrix exponential method is faster.

Also you can have a look at expokit which is a very good
implementation of matrix exponential solvers (using Krylov subspace
methods):
http://www.maths.uq.edu.au/expokit/. Unfortunately there is no Python
implementation but maybe you can call the fortran or C++ version from
python.

And you can have a look at operator splitting methods. If it is
possible to split your problem in two (or more) sub problems, then
these methods
often speed up the numerical computations. The problem usually lies in
finding a suitable splitting. The implementation is not very
complicated, if you have numerical methods for the sub problems.

##

So here, it sounds like I should figure out to do a ordinary
differential equation, for magnetisation evolution.

Would this be the right way to go?

I am very happy for any comments.

Best
Troels

2014-06-26 13:46 GMT+02:00 Andrew Baldwin andrew.bald...@chem.ox.ac.uk:
I am looking for a solution I can apply to all numerical models :-)

 The 'close formed' solutions I describe are eigenvalue decompositions. So
 that's just a slightly smart way of doing that rather than asking a
 minimiser to do it for you. No general closed form solutions exist for the
 eigenvalues (hence eigenvectors) I think above 3x3.

 Incidentally, the theoretical treatments of the R1rho (needing minimum of
 6x6) relies on being able to approximate the smallest real eigenvalues of
 the six. So the theoretical R1rho theoretical treatments are in essence
 methods for approximating one of the six eigenvalues (which is hard enough).
 Getting the other five is far from straightforward and might not even be
 possible. This is also why a general CEST expression isn't going to happen:
 to get a complete treatment of the CEST experiment you need all six
 eigenvalues, and no-one has (yet) come up with a way of getting them all.

 If the matrix is sparse then you can get some speedups. But in my hands at
 least, those algorithms only tend to work well on huge matrices that are
 really sparse (eg100x100 with not much over 10% of elements having entries).






 On 26/06/2014 09:44, Troels Emtekær Linnet wrote:

 Hi Andrew.

 I am looking for a solution I can apply to all numerical models :-)

 The current implementation, is the eigenvalue decomposition.
 http://svn.gna.org/svn/relax/branches/disp_spin_speed/lib/dispersion/matrix_exponential.py

 It the bottom, I provide the profiling for NS R1rho 2site.
 You will see, that using the eig function, takes 50% of the time:

 That is i little sad, that the reason why Numerical solutions is so slow, is
 numpy.linalg.eig().

 They differ a little in matrix size.

 http://svn.gna.org/svn/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py
 7 X 7 matrix.

 http://svn.gna.org/svn/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py
 2x2 matrix

 http://svn.gna.org/svn/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py
 2x2 matrix.

 

Re: R1rho RD analysis

2014-06-27 Thread Edward d'Auvergne
Hi Troels,

For reference for the relax users reading this, the abbreviations
Troels used for the relaxation dispersion models can be decoded using
the relax wiki page
http://wiki.nmr-relax.com/Category:Relaxation_dispersion.

 Just a little heads-up.

 Within a week or two, we should be able to release a new version of relax.

 This update has focused on speed, recasting the data to higher
 dimensional numpy arrays, and
 moving the multiple dot operations out of the for loops.

 So we have quite much better speed now. :-)

Troels, you just gave away the surprise of the relax 3.2.3 or 3.2.4
release!  Note that relax was not particularly slow before these
changes, but that you have taken far greater advantage of the
BLAS/LAPACK libraries behind the numpy functions to make the
dispersion models in relax super fast, especially when spins are
clustered.  It's a pity we don't have the means to compare the
optimisation target function speed between relax and other software to
show how much faster relax now is, as the relax advantage of having a
grid search to find the initial non-biased position for optimisation
(a very important technique for optimisation that a number of other
dispersion software do not provide) will give many relax users the
incorrect impression that relax is slower than the other software.
Though if relax is used on a cluster with OpenMPI, this is a
non-issue.


 But we still have a bottleneck with numerical models, where doing the
 matrix exponential via eigenvalue decomposition is slow!
 Do any of you any experience with a faster method for doing matrix 
 exponential?

 These initial results shows that if you are going to use the R1rho
 2site model, you can expect:

 -R1rho
 100 single spins analysis:
 DPL94:  23.525+/-0.409 -   1.138+/-0.035,  20.676x 
 faster.
 TP02:   20.191+/-0.375 -   1.238+/-0.020,  16.308x 
 faster.
 TAP03:  31.993+/-0.235 -   1.956+/-0.025,  16.353x 
 faster.
 MP05:   24.892+/-0.354 -   1.431+/-0.014,  17.395x 
 faster.
 NS R1rho 2-site:   245.961+/-2.637 -  36.308+/-0.458,   6.774x 
 faster.

 Cluster of 100 spins analysis:
 DPL94:  23.872+/-0.505 -   0.145+/-0.002, 164.180x 
 faster.
 TP02:   20.445+/-0.411 -   0.172+/-0.004, 118.662x 
 faster.
 TAP03:  32.212+/-0.234 -   0.294+/-0.002, 109.714x 
 faster.
 MP05:   25.013+/-0.362 -   0.188+/-0.003, 132.834x 
 faster.
 NS R1rho 2-site:   246.024+/-3.724 -  33.119+/-0.320,   7.428x 
 faster.

 -CPMG
 100 single spins analysis:
 CR72:2.615+/-0.018 -   1.614+/-0.024,   1.621x 
 faster.
 CR72 full:   2.678+/-0.020 -   1.839+/-0.165,   1.456x 
 faster.
 IT99:1.837+/-0.030 -   0.881+/-0.010,   2.086x 
 faster.
 TSMFK01: 1.665+/-0.049 -   0.742+/-0.007,   2.243x 
 faster.
 B14: 5.851+/-0.133 -   3.978+/-0.049,   1.471x 
 faster.
 B14 full:5.789+/-0.102 -   4.065+/-0.059,   1.424x 
 faster.
 NS CPMG 2-site expanded: 8.225+/-0.196 -   4.140+/-0.062,   1.987x 
 faster.
 NS CPMG 2-site 3D: 240.027+/-3.182 -  45.056+/-0.584,   5.327x 
 faster.
 NS CPMG 2-site 3D full:240.910+/-4.882 -  45.230+/-0.540,   5.326x 
 faster.
 NS CPMG 2-site star:   186.480+/-2.299 -  36.400+/-0.397,   5.123x 
 faster.
 NS CPMG 2-site star full:  187.111+/-2.791 -  36.745+/-0.689,   5.092x 
 faster.

 Cluster of 100 spins analysis:
 CR72:2.610+/-0.035 -   0.118+/-0.001,  22.138x 
 faster.
 CR72 full:   2.674+/-0.021 -   0.122+/-0.001,  21.882x 
 faster.
 IT99:0.018+/-0.000 -   0.009+/-0.000,
 2.044x faster. IT99: Cluster of only 1 spin analysis, since v. 3.2.2
 had a bug with clustering analysis.:
 TSMFK01: 1.691+/-0.091 -   0.039+/-0.000,  43.369x 
 faster.
 B14: 5.891+/-0.127 -   0.523+/-0.004,  11.264x 
 faster.
 B14 full:5.818+/-0.127 -   0.515+/-0.021,  11.295x 
 faster.
 NS CPMG 2-site expanded: 8.167+/-0.159 -   0.702+/-0.008,  11.638x 
 faster.
 NS CPMG 2-site 3D: 238.717+/-3.025 -  41.380+/-0.950,   5.769x 
 faster.
 NS CPMG 2-site 3D full:507.411+/-803.089 -  41.852+/-1.317,
 12.124x faster.
 NS CPMG 2-site star:   187.004+/-1.935 -  30.823+/-0.371,   6.067x 
 faster.
 NS CPMG 2-site star full:  187.852+/-2.698 -  30.882+/-0.671,   6.083x 
 faster.


There are a number of ways of computing the matrix exponential.
Avoiding eigenvalue decomposition is the essential key.  The Pade
approximation is probably the best, followed by one of the Taylor
series expansion approximations.  As I mentioned in a different post
to the relax-devel mailing list, this was used earlier in relax via
Scipy.  But I removed this and wrote my own algorithm using eigenvalue
decomposition as the Scipy 

Re: problem loading R1, R2 and nOe files for modelfree

2014-06-27 Thread Ravi Pratap Barnwal
Hi Edward,
I am using version 3.2.2 on mac 10.8.5 (mountain lion). I am using GUI mode
to run the relax. Here is the report from Tools- System Information




relax 3.2.2

  Molecular dynamics by NMR data analysis

 Copyright (C) 2001-2006 Edward d'Auvergne
 Copyright (C) 2006-2014 the relax development team

This is free software which you are welcome to modify and redistribute
under the conditions of the
GNU General Public License (GPL).  This program, including all modules, is
licensed under the GPL
and comes with absolutely no warranty.  For details type 'GPL' within the
relax prompt.

Assistance in using the relax prompt and scripting interface can be
accessed by typing 'help' within
the prompt.

Processor fabric:  Uni-processor.


relax sys_info()

Hardware information:
Machine: x86_64
Processor:   i386
Processor name:  Intel(R) Xeon(R) CPU   W3530  @ 2.80GHz
Endianness:  little
Total RAM size:  2048.0 Mb
Total swap size: 11264.0 Mb

Operating system information:
System:  Darwin
Release: 12.5.0
Version: Darwin Kernel Version 12.5.0: Sun Sep 29
13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64
Mac version: 10.8.5 (, , ) x86_64
Distribution:
Full platform string:Darwin-12.5.0-x86_64-i386-64bit

Python information:
Architecture:64bit
Python version:  2.7.2
Python branch:
Python build:default, Apr  5 2012 18:46:15
Python compiler: GCC 4.2.1 (Apple Inc. build 5666) (dot 3)
Libc version:
Python implementation:   CPython
Python revision:
Python executable:   /Applications/relax.app/Contents/MacOS/python
Python flags:sys.flags(debug=0, py3k_warning=0,
division_warning=0, division_new=0, inspect=0, interactive=0, optimize=1,
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0,
tabcheck=0, verbose=0, unicode=0, bytes_warning=0)
Python float info:   sys.float_info(max=1.7976931348623157e+308,
max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021,
min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16,
radix=2, rounds=1)
Python module path:
['/Applications/relax.app/Contents/Resources/lib/python27.zip',
'/Applications/relax.app/Contents/Resources/lib/python2.7',
'/Applications/relax.app/Contents/Resources/lib/python2.7/plat-darwin',
'/Applications/relax.app/Contents/Resources/lib/python2.7/plat-mac',
'/Applications/relax.app/Contents/Resources/lib/python2.7/plat-mac/lib-scriptpackages',
'/Applications/relax.app/Contents/Resources/lib/python2.7/lib-tk',
'/Applications/relax.app/Contents/Resources/lib/python2.7/lib-old',
'/Applications/relax.app/Contents/Resources/lib/python2.7/lib-dynload',
'/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip',
'/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages',
'/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages']

Python packages and modules (most are optional):

Name   InstalledVersion
Path

minfx  True 1.0.6
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/minfx

bmrblibTrue 1.0.3
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/bmrblib

numpy  True 1.6.1
/Applications/relax.app/Contents/Resources/lib/python2.7/numpy

scipy  True 0.10.1
/Applications/relax.app/Contents/Resources/lib/python2.7/scipy

wxPython   True 2.9.3.1 osx-cocoa (classic)
/Applications/relax.app/Contents/Resources/lib/python2.7/wx

matplotlib
False

mpi4py True 1.2.2
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/mpi4py

epydoc True 3.0.1
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/epydoc

optparse   True 1.5.3
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/optparse.pyc

readline
False

profileTrue
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/profile.pyc

bz2True
/Applications/relax.app/Contents/Resources/lib/python2.7/lib-dynload/bz2.so

gzip   True
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/gzip.pyc

io True
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/io.pyc

xmlTrue 0.8.4 (internal)
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/xml/__init__.pyc

xml.dom.minidomTrue
/Applications/relax.app/Contents/Resources/lib/python2.7/site-packages.zip/xml/dom/minidom.pyc


relax