Re: [bug #9259] Reduced spectral density mapping yielding bad values

2007-06-15 Thread Edward d'Auvergne
Hi,

That is awesome work tracking down this problem.  Thank you!  I'll
apply your patch and then hopefully make a new relax 1.2 release with
your fixes very soon.  I do have a important question first though.

My question relates to the multiplication of the frequency by 2pi to
convert from Hz to rad/s units.  The symbol for the frequency in Hz is
nu whereas the frequency in rad/s is omega.  In all the relaxation
equations composed of spectral density components, the frequencies are
in rad/s and are represented by the omega symbol.  This includes the
CSA constant defined in SI units as

   c = (omegaX.CSA)^2/3,

where CSA is the chemical shift anisotropy and

   omegaX = gammaX.B0.

To get nuX which is the frequency of the X nucleus in Hz, omegaX
measured in rad/s should be divided by 2pi.  So my question is, do you
get the same results as the Mathematica notebooks of Leo Spyracopoulos
if you retain the multiplication of the frequency by 2pi?

Thanks,

Edward


P.S.  The problem with the list of frequencies is probably the major
issue.  I'm not sure why I attempted to fill out the entire list of
frequencies as the reduced spectral density mapping code only uses the
value in self.data.frq_list[0, 1], the frequency of the heteronucleus,
to calculate the CSA constant.  The higher frequencies are never used
in the calculation.  Anyway, your patch fixes this problem.




On 6/13/07, Sebastien Morin [EMAIL PROTECTED] wrote:
 Hi !

 I've checked the equations used for reduced spectral density mapping in
 relax. They're all right... The assumption about the factor of (mu0 /
 (4pi))^2 is ok since the old equations were written in Gaussian units
 (cgs) and now we use SI units.

 However, 2 things seem to be wrong.


 1.

 The frequencies need not to be scaled by a factor of 2 pi since the unit
 of frequency in the SI is Hz. Thus, line 52 of 'maths_fns/jw_mapping.py'
 must be removed.


 2.

 The frequency used for calculating the CSA seems not to be the
 heteronuclear frequency. In fact, there is an error in lines 57 to 60
 from 'maths_fns/jw_mapping.py' since the same item in the list is
 assigned different values one after the other. Changing those lines from :

 self.data.frq_list[0, 1] = frqX
 self.data.frq_list[0, 1] = frq - frqX
 self.data.frq_list[0, 1] = frq
 self.data.frq_list[0, 1] = frq + frqX

 to :

 self.data.frq_list[0, 1] = frqX
 self.data.frq_list[0, 2] = frq - frqX
 self.data.frq_list[0, 3] = frq
 self.data.frq_list[0, 4] = frq + frqX

 should work. The important thing is that item 1 stays the heteronuclear
 frequency so it matches with line 1020 of 'maths_fns/ri_comps.py' :

  data.csa_const_fixed[j] = data.frq_sqrd_list[j, 1] / 3.0

 where the constant 'c' is calculated using the squared heteronuclear
 frequency.


 With those two modifications, I now get the same values as when
 calculating manually or using Leo Spyracopoulos's Mathematica notebooks
 (http://www.bionmr.ualberta.ca/~lspy/index_7.html).

 Bye !


 Sébastien  :)





 Edward d'Auvergne wrote:
  Hi,
 
  For the reduced spectral density mapping in relax, I have used
  equations 10 to 12 from:
 
  Markus M. A., Dayie K. T., Matsudaira P., and Wagner G.  Local
  mobility within villin 14T probed via heteronuclear relaxation
  measurements and a reduced spectral density mapping.  Biochemistry.
  1996, 35(6):1722-32.
 
  The equations themselves are derived from:
 
  Lefevre J. F., Dayie K. T., Peng J. W., and Wagner G.  Internal
  mobility in the partially folded DNA binding and dimerization domains
  of GAL4: NMR analysis of the N-H spectral density functions.
  Biochemistry. 1996, 35(8):2674-86.
 
  One problem may be that I made the assumption that the dipolar
  constant of equation 7 of the first reference was missing the factor
  of (mu0 / (4pi))^2!  I based this assumption on the SI units
  formulation of the R1, R2, and NOE equations and how the CSA constant
  is defined.  I think this is a fairly safe assumption though if you
  look at equations 1, 2, and 8 of that paper.
 
  Could the problem be the definition of the equations used?  I've
  looked at the code in relax and it seems to replicate these equations
  correctly.  Are the equations of Markus et al., (1996) correct?  Is my
  assumption about the dipolar constant correct?  If you manually
  calculate the reduced spectral density values using these alternative
  equations, does relax produce the same values?  I'm sorry that I can't
  exactly pinpoint the problem, but something is seriously amiss.
 
  Regards,
 
  Edward
 
 
 
 
  On 6/1/07, anonymous [EMAIL PROTECTED] wrote:
 
  URL:
http://gna.org/bugs/?9259
 
   Summary: Reduced spectral density mapping yielding bad
  values
   Project: relax
  Submitted by: None
  Submitted on: Friday 06/01/2007 at 17:15 CEST
  Category: relax's source code
  Severity: 4 - 

[bug #9259] Reduced spectral density mapping yielding bad values

2007-06-15 Thread Sébastien Morin

Additional Item Attachment, bug #9259 (project relax):

File name: patch_2007-06-15   Size:0 KB


___

Reply to this item at:

  http://gna.org/bugs/?9259

___
  Message sent via/by Gna!
  http://gna.org/


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

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


Re: [bug #9259] Reduced spectral density mapping yielding bad values

2007-06-15 Thread Sebastien Morin
Hi,

I made a patch for the test-suite so the spectral density test passes
(patch_2007-06-15)...

This patch should go with the one for solving the bug that I uploaded
yesterday.

Cheers


Sébastien

P.S. I have a question about the test-suite. Should the test-suite files
be modified when a patch is sent as an answer to a bug report ? The
patch from yesterday made the test-suite fail, I believe it is thus fine
to also make a patch for the test-suite. Do you prefer making 2
different patches or a single one with everything in it (as the output
from svn diff) ?





Edward d'Auvergne wrote:
 Hi,

 That is awesome work tracking down this problem.  Thank you!  I'll
 apply your patch and then hopefully make a new relax 1.2 release with
 your fixes very soon.  I do have a important question first though.

 My question relates to the multiplication of the frequency by 2pi to
 convert from Hz to rad/s units.  The symbol for the frequency in Hz is
 nu whereas the frequency in rad/s is omega.  In all the relaxation
 equations composed of spectral density components, the frequencies are
 in rad/s and are represented by the omega symbol.  This includes the
 CSA constant defined in SI units as

   c = (omegaX.CSA)^2/3,

 where CSA is the chemical shift anisotropy and

   omegaX = gammaX.B0.

 To get nuX which is the frequency of the X nucleus in Hz, omegaX
 measured in rad/s should be divided by 2pi.  So my question is, do you
 get the same results as the Mathematica notebooks of Leo Spyracopoulos
 if you retain the multiplication of the frequency by 2pi?

 Thanks,

 Edward


 P.S.  The problem with the list of frequencies is probably the major
 issue.  I'm not sure why I attempted to fill out the entire list of
 frequencies as the reduced spectral density mapping code only uses the
 value in self.data.frq_list[0, 1], the frequency of the heteronucleus,
 to calculate the CSA constant.  The higher frequencies are never used
 in the calculation.  Anyway, your patch fixes this problem.




 On 6/13/07, Sebastien Morin [EMAIL PROTECTED] wrote:
 Hi !

 I've checked the equations used for reduced spectral density mapping in
 relax. They're all right... The assumption about the factor of (mu0 /
 (4pi))^2 is ok since the old equations were written in Gaussian units
 (cgs) and now we use SI units.

 However, 2 things seem to be wrong.


 1.

 The frequencies need not to be scaled by a factor of 2 pi since the unit
 of frequency in the SI is Hz. Thus, line 52 of 'maths_fns/jw_mapping.py'
 must be removed.


 2.

 The frequency used for calculating the CSA seems not to be the
 heteronuclear frequency. In fact, there is an error in lines 57 to 60
 from 'maths_fns/jw_mapping.py' since the same item in the list is
 assigned different values one after the other. Changing those lines
 from :

 self.data.frq_list[0, 1] = frqX
 self.data.frq_list[0, 1] = frq - frqX
 self.data.frq_list[0, 1] = frq
 self.data.frq_list[0, 1] = frq + frqX

 to :

 self.data.frq_list[0, 1] = frqX
 self.data.frq_list[0, 2] = frq - frqX
 self.data.frq_list[0, 3] = frq
 self.data.frq_list[0, 4] = frq + frqX

 should work. The important thing is that item 1 stays the heteronuclear
 frequency so it matches with line 1020 of 'maths_fns/ri_comps.py' :

  data.csa_const_fixed[j] = data.frq_sqrd_list[j, 1] / 3.0

 where the constant 'c' is calculated using the squared heteronuclear
 frequency.


 With those two modifications, I now get the same values as when
 calculating manually or using Leo Spyracopoulos's Mathematica notebooks
 (http://www.bionmr.ualberta.ca/~lspy/index_7.html).

 Bye !


 Sébastien  :)





 Edward d'Auvergne wrote:
  Hi,
 
  For the reduced spectral density mapping in relax, I have used
  equations 10 to 12 from:
 
  Markus M. A., Dayie K. T., Matsudaira P., and Wagner G.  Local
  mobility within villin 14T probed via heteronuclear relaxation
  measurements and a reduced spectral density mapping.  Biochemistry.
  1996, 35(6):1722-32.
 
  The equations themselves are derived from:
 
  Lefevre J. F., Dayie K. T., Peng J. W., and Wagner G.  Internal
  mobility in the partially folded DNA binding and dimerization domains
  of GAL4: NMR analysis of the N-H spectral density functions.
  Biochemistry. 1996, 35(8):2674-86.
 
  One problem may be that I made the assumption that the dipolar
  constant of equation 7 of the first reference was missing the factor
  of (mu0 / (4pi))^2!  I based this assumption on the SI units
  formulation of the R1, R2, and NOE equations and how the CSA constant
  is defined.  I think this is a fairly safe assumption though if you
  look at equations 1, 2, and 8 of that paper.
 
  Could the problem be the definition of the equations used?  I've
  looked at the code in relax and it seems to replicate these equations
  correctly.  Are the equations of Markus et al., (1996) correct?  Is my
  assumption about the dipolar constant correct?  If you manually