Re: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-23 Thread Edward d'Auvergne
Hi Atul,

As Troels asked, could you create a support request with the link
https://gna.org/support/?func=additemgroup=relax and attach the files
there?  Files should not be attached to public mailing list messages
as it puts a large amount of strain on the infrastructure, not only
with the mail server but also the 4 independent mailing list archives:

https://mail.gna.org/public/relax-users/2014-08/msg00025.html
http://www.mail-archive.com/relax-users@gna.org/msg01672.html
http://thread.gmane.org/gmane.science.nmr.relax.user/1735/focus=1736
http://marc.info/?l=relax-usersr=1w=2

As you can see from these archived messages, your attachment has been
stripped out of your email.  The relax mail server is configured to
delete all attachments before sending out the message.

For your problem, I think I might now understand the issue.  But it
would still be useful to have the files attached to the support
request for future reference.  If you would like to keep the data
private, then maybe delete all data in the files except for one or two
residues (this also helps for converting the data into a relax system
test).  And you could also slightly randomise the peak intensity
values if you really want to keep the real data private.

The issue is that the ordering of relaxation dispersion data in relax
is as follows:

1)  Experiment type (certain dispersion models handle mixed experiment
types, for example the MMQ models,
2)  The spins of the cluster,
3)  Magnetic field strength,
4)  Offsets (for both R1rho and CPMG, though off-resonance CPMG models
such as in CATIA are yet to be added to relax),
5)  Dispersion points (nu_CPMG and nu_1).

So for 5), you only have one point per offset.  But to specify the
reference, this needs to be at the lower dispersion point level.  So
for each offset value, you will need to have your reference and the
point.  You need to make relax load the reference peak intensities
multiple times, once for each offset value.  So maybe you need:

-
data = [
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   2100,
None, 0.320,  900.0e6, 9],
['900MHz_2100','2100_off_reso_R1rho_ubi_2.list',   2100,
1500, 0.320,  900.0e6, 9],
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   2728,
None, 0.320,  900.0e6, 9],
['900MHz_2728','2728_off_reso_R1rho_ubi_3.list',   2728,
1500, 0.320,  900.0e6, 9],
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   3357,
None, 0.320,  900.0e6, 9],
['900MHz_3357','3357_reso_R1rho_ubi_4.list',   3357,
1500, 0.320,  900.0e6, 9],
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   3985,
None, 0.320,  900.0e6, 9],
['900MHz_3985','3985_off_reso_R1rho_ubi_5.list',   3985,
1500, 0.320,  900.0e6, 9],
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   4614,
None, 0.320,  900.0e6, 9],
['900MHz_4614','4614_off_reso_R1rho_ubi_6.list',   4614,
1500, 0.320,  900.0e6, 9],
['900MHz_rep_4614','4614_rep_off_reso_R1rho_ubi_10.list',  4614,
1500, 0.320,  900.0e6, 9],
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   5242,
None, 0.320,  900.0e6, 9],
['900MHz_5242','5242_off_reso_R1rho_ubi_7.list',   5242,
1500, 0.320,  900.0e6, 9],
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   5871,
None, 0.320,  900.0e6, 9],
['900MHz_5871','5871_off_reso_R1rho_ubi_8.list',   5871,
1500, 0.320,  900.0e6, 9],
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   6500,
None, 0.320,  900.0e6, 9],
['900MHz_6500','6500_off_reso_R1rho_ubi_9.list',   6500,
1500, 0.320,  900.0e6, 9]
]
---

Please carefully check the printouts to make sure the correct numbers
are being sent into the correct user functions.  Specifying the
reference at the higher offset level is not yet supported in relax.
But with your data set attached to a support request, maybe in the
future it could be turned into a relax system test and such a feature
implemented.  I hope this information helps.

Regards,

Edward


On 22 August 2014 23:01, Atul Srivastava asriv...@umn.edu wrote:
 Dear Edward,

 Thanks for providing help and insights. I used an improved script. The
 scripts is able to calculate the R2eff and the omegaeffective properly, but
 it is not able to fit any model. It also sees dispersion point as a constant
 1500 Hz (see attached file in results/R2eff/disp_55_N.out).

 I have attached all sample data, script and results for your review. Please
 see the last few lines in the log file for the error message.

 Thanks,
 Atul




 On Fri, Aug 22, 2014 at 3:02 AM, Edward 

Re: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-22 Thread Edward d'Auvergne
Hi Atul,

Continuing from Troels' post at
http://thread.gmane.org/gmane.science.nmr.relax.user/1718/focus=1732,
this time with the ppm units:


On 21 August 2014 12:00, Troels Emtekær Linnet tlin...@nmr-relax.com wrote:
 Dear Atul.

[snip]

 # Set the relaxation dispersion experiment type.
 relax_disp.exp_type(spectrum_id=id, exp_type='R1rho')
 - Well, the program needs to know which code-path to take. Not CPMG code. 
 :-)


 # Set the relaxation dispersion spin-lock field strength (nu1).
 relax_disp.spin_lock_field(spectrum_id=id, field=field)
 - Here: 'help(relax_disp.spin_lock_field)', show is that this should be in 
 Hz.
 - Let is review figure Fig1_Palmer_Massi_2006.png
 - This is the w_1 on S_x axis.
 - What is here put into relax is nu_1. This is then later converted
 to w_1, by multiplying with 2*pi.
 - It seems that you have: 'spin-lock amplitude' / nu_1 / 'spin-lock
 field' in column 4, while the the sample script has this in Column 3.

 # Set the spin-lock offset.
 relax_disp.spin_lock_offset(spectrum_id=id, offset=offset)
 - Here: 'help(relax_disp.spin_lock_offset)', show is that this should
 be in ppm.
 - I see you have the distance/position (in Hz)  of the spin-lock
 carrier in column 3. Values of 2100, 2728, ...  ... ...6500
 - Relax needs to know the position in ppm. Edward can give you a
 detailed description why we use ppm. It is related to minimise user
 error input.
 - You need to calculate this yourself.
 If you use NMRPipe, and look in 'fic.com', it could look like this
 var2pipe -in ./fid \
  -noaswap  \
   -xN  2044  -yN   256  \
   -xT  1022  -yT   128  \
   -xMODEComplex  -yMODE  Rance-Kay  \
   -xSW12001.200  -ySW 2659.928  \
   -xOBS 750.061  -yOBS  76.012  \
   -xCAR  4.7893  -yCAR 118.536  \
   -xLAB  HN  -yLAB N15  \
   -ndim   2  -aq2D  States  \
   -out ./test.fid -verb -ov

 Or try this script in relax:

 relax test.py
   test.py
 from math import pi
 from lib.physical_constants import return_gyromagnetic_ratio

 H_frq = 900.0e6
 print(The magnetic field strength as the proton frequency in Mega
 Hertz: %3.2f % (H_frq / 1.E6) )

 xOBS_Hz = H_frq
 B0_tesla =  xOBS_Hz / return_gyromagnetic_ratio(nucleus='1H') * 2.0 * pi
 print(BO in Tesla: %3.2f % B0_tesla)

 yOBS_N15_Hz = abs( xOBS_Hz / return_gyromagnetic_ratio(nucleus='1H') *
 return_gyromagnetic_ratio(nucleus='15N') )
 print(The precess frequency for 15N in MHz: %3.2f % (yOBS_N15_Hz / 1.E6) )

 offset_Hz = 2100.

 offset_ppm_N15 = offset_Hz / yOBS_N15_Hz * 1E6
 print(The offset ppm: %3.2f % (offset_ppm_N15) )

 # Position of carrier.
 yCAR_N15_ppm = 118.536
 print(The center position of the carrier: %3.2f % (yCAR_N15_ppm) )

 omega_rf_ppm = yCAR_N15_ppm + offset_ppm_N15
 print(The omega_rf in ppm: %3.2f % (omega_rf_ppm) )
 

This is correct, you will have have to convert to ppm values.  The
reason is simple, this is the most universal way of specifying the
position in the spectrum as it is field strength independent.  And it
matches the ppm units of the chemical shifts you will have loaded.
Some people measure Hz units from the centre of the spectrum, others
from the edge of the spectrum.  It often depends if you are a Varian,
Bruker, or Joel user.  But with ppm units, such issues do not need to
be handled within relax.

Regards,

Edward

___
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: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-22 Thread Edward d'Auvergne
Hi Atul,

Again continuing from Troels' post at
http://thread.gmane.org/gmane.science.nmr.relax.user/1718/focus=1732.
Well, actually, as Troels fully covered all of you questions in more
detail than I could have provided, I don't have anything to add.  If
you have other questions, please don't hesitate to ask.

Regards,

Edward


On 21 August 2014 12:00, Troels Emtekær Linnet tlin...@nmr-relax.com wrote:

[snip]

 relax_disp.relax_time(spectrum_id=id, time=relax_time)
 - This is used for the initial R2eff calculation, for exponential
 curve fitting.

 # Set the NMR field strength of the spectrum.
 spectrometer.frequency(id=id, frq=H_frq)
 - This is used for conversion between nucleus, etc.

 # Load the R1 data.
 relax_data.read(ri_id='500MHz', ri_type='R1', frq=500e6,
 file='R1_500MHz.out', dir=DATA_PATH, mol_name_col=1, res_num_col=2,
 res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6,
 error_col=7)
 - R1 needs to be loaded. This is because that R1 is part of the
 equations. :-) The next release of relax, will implement feature where
 R1 is fitted.
 Note, that fitting introduces another variable in the equations.

 # Read the chemical shift data.
 chemical_shift.read(file='ref_500MHz.list', dir=DATA_PATH)

 - This is needed to get the ppm position of the nucleus.
 - See now: http://www.nmr-relax.com/manual/Dispersion_model_summary.html
 - The average resonance in the rotating frame Omega(bar) = w_(bar) - w_rf.
 - Here w_bar is the chemical shift, and w_rf is the offset.
 - Let is review figure Fig1_Palmer_Massi_2006.png
 - This is the S_z axis.

 That should be it.

 If you have any questions, please don't hesitate to write again.

 If you need more help, consider writing a support request on the
 homepage tracker.
 - https://gna.org/support/?group=relax

 Add following information:
 # Please attach a system info file
 relax -i -t relax_i.txt

 # Please write up, which buttons you pushed, or attach your script.
 # Consider adding your data in sample format. Meaning that you
 delete all confidential information from the files, and only have 1-2
 residues left for testing.

 If you write such a support request, it it easier to share script files, and
 help other users.

 The benefits from such a support request is:
   - The information is available to all users, which can benefit
 others in same situation.
   - The information can be tracked back.
   - The relax manual can be expanded, to help future users in same situation.


 Good luck!

 Best
 Troels Emtekær Linnet
 PhD student
 Copenhagen University
 SBiNLab, 3-0-41
 Ole Maaloes Vej 5
 2200 Copenhagen N
 Tlf: +45 353-22083
 Lync Tlf: +45 353-30195

___
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: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-22 Thread Atul Srivastava
Dear Edward,

Thanks for providing help and insights. I used an improved script. The
scripts is able to calculate the R2eff and the omegaeffective properly, but
it is not able to fit any model. It also sees dispersion point as
a constant 1500 Hz (see attached file in results/R2eff/disp_55_N.out).

I have attached all sample data, script and results for your review. Please
see the last few lines in the log file for the error message.

Thanks,
Atul




On Fri, Aug 22, 2014 at 3:02 AM, Edward d'Auvergne edw...@nmr-relax.com
wrote:

 Hi Atul,

 Again continuing from Troels' post at
 http://thread.gmane.org/gmane.science.nmr.relax.user/1718/focus=1732.
 Well, actually, as Troels fully covered all of you questions in more
 detail than I could have provided, I don't have anything to add.  If
 you have other questions, please don't hesitate to ask.

 Regards,

 Edward


 On 21 August 2014 12:00, Troels Emtekær Linnet tlin...@nmr-relax.com
 wrote:

 [snip]

  relax_disp.relax_time(spectrum_id=id, time=relax_time)
  - This is used for the initial R2eff calculation, for exponential
  curve fitting.
 
  # Set the NMR field strength of the spectrum.
  spectrometer.frequency(id=id, frq=H_frq)
  - This is used for conversion between nucleus, etc.
 
  # Load the R1 data.
  relax_data.read(ri_id='500MHz', ri_type='R1', frq=500e6,
  file='R1_500MHz.out', dir=DATA_PATH, mol_name_col=1, res_num_col=2,
  res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6,
  error_col=7)
  - R1 needs to be loaded. This is because that R1 is part of the
  equations. :-) The next release of relax, will implement feature where
  R1 is fitted.
  Note, that fitting introduces another variable in the equations.
 
  # Read the chemical shift data.
  chemical_shift.read(file='ref_500MHz.list', dir=DATA_PATH)
 
  - This is needed to get the ppm position of the nucleus.
  - See now:
 http://www.nmr-relax.com/manual/Dispersion_model_summary.html
  - The average resonance in the rotating frame Omega(bar) = w_(bar) -
 w_rf.
  - Here w_bar is the chemical shift, and w_rf is the offset.
  - Let is review figure Fig1_Palmer_Massi_2006.png
  - This is the S_z axis.
 
  That should be it.
 
  If you have any questions, please don't hesitate to write again.
 
  If you need more help, consider writing a support request on the
  homepage tracker.
  - https://gna.org/support/?group=relax
 
  Add following information:
  # Please attach a system info file
  relax -i -t relax_i.txt
 
  # Please write up, which buttons you pushed, or attach your script.
  # Consider adding your data in sample format. Meaning that you
  delete all confidential information from the files, and only have 1-2
  residues left for testing.
 
  If you write such a support request, it it easier to share script files,
 and
  help other users.
 
  The benefits from such a support request is:
- The information is available to all users, which can benefit
  others in same situation.
- The information can be tracked back.
- The relax manual can be expanded, to help future users in same
 situation.
 
 
  Good luck!
 
  Best
  Troels Emtekær Linnet
  PhD student
  Copenhagen University
  SBiNLab, 3-0-41
  Ole Maaloes Vej 5
  2200 Copenhagen N
  Tlf: +45 353-22083
  Lync Tlf: +45 353-30195

___
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: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-22 Thread Troels Emtekær Linnet
Dear Atul.

Please use the support tracker when you upload files.
The email list is fragile, and cannot handle email attachment.

I made small modifications to your script.

I normally split them up.

1st script for setup, and printing stuff to check.
2nd script, which just call the previous script, and run analysis.

So, I would:
relax 1_setup_r1rho.py
to check everything.

When I am happy, I just:
relax 2_pre_run_r2eff.py

which call script 1, setup, and then run.

Did you know you can also:
relax 1_setup_r1rho.py -p

This runs the script, and enters terminal. Like python -i script.py
Any variable saved in the cdp can be accessed.

Try:
relax 1_setup_r1rho.py -p
print cdp.temp

You can also run relax with the debug option -d
relax 2_pre_run_r2eff.py -d

This gives more information about where the error is.

Anyway.
The problem seems related to, that you only have one reference
intensity per offset.

1_setup_r1rho.py
# Python module imports.
from os import sep, getcwd

# relax module imports.
from pipe_control.mol_res_spin import generate_spin_string,
return_spin, spin_loop
from specific_analyses.relax_disp.data import average_intensity,
generate_r20_key, get_curve_type, has_exponential_exp_type,
has_r1rho_exp_type, loop_exp_frq, loop_exp_frq_offset_point,
loop_exp_frq_offset_point_time, loop_time, return_grace_file_name_ini,
return_param_key_from_data

# Set up the data pipe.
###

# The path to the data files.
DATA_PATH = getcwd()

# Create the data pipe.
pipe_name = 'base pipe'
pipe_bundle = 'relax_disp'
pipe.create(pipe_name=pipe_name, bundle=pipe_bundle, pipe_type='relax_disp')

# Read the spins from a spectum file instead. This already contain the
spin name.
spectrum.read_spins(file='2100_off_reso_R1rho.list', dir=DATA_PATH)

# Set the isotope information.
spin.isotope(isotope='15N')

# Loop over spins, to see current setup.
for cur_spin, mol_name, resi, resn, spin_id in
spin_loop(full_info=True, return_id=True, skip_desel=True):
print mol_name, resi, resn, spin_id
print  
print cur_spin

# The spectral data - spectrum ID, peak list file name, spin-lock
field strength (Hz), the spin-lock offset (ppm), the relaxation time
(s), spectrometer frequency (Hz), and experimental error (RMSD of the
base plane noise for each spectrum).
data = [
['ref_off_reso_R1rho', 'ref_off_reso_R1rho.list', None, 150.87,
0.320,  900.21422558574e6, 9.0],
['2100_off_reso_R1rho', '2100_off_reso_R1rho.list', 1500.0,
141.01, 0.320,  900.21422558574e6, 9.0],
['2728_off_reso_R1rho', '2728_off_reso_R1rho.list', 1500.0,
147.89, 0.320,  900.21422558574e6, 9.0],
['3357_off_reso_R1rho', '3357_off_reso_R1rho.list', 1500.0,
154.78, 0.320,  900.21422558574e6, 9.0],
['3985_off_reso_R1rho', '3985_off_reso_R1rho.list', 1500.0,
161.66, 0.320,  900.21422558574e6, 9.0],
['4614_off_reso_R1rho', '4614_off_reso_R1rho.list', 1500.0,
168.55, 0.320,  900.21422558574e6, 9.0],
['5242_off_reso_R1rho', '5242_off_reso_R1rho.list', 1500.0,
175.43, 0.320,  900.21422558574e6, 9.0],
['5871_off_reso_R1rho', '5871_off_reso_R1rho.list', 1500.0,
182.32, 0.320,  900.21422558574e6, 9.0],
['6500_off_reso_R1rho', '6500_off_reso_R1rho.list', 1500.0,
189.21, 0.320,  900.21422558574e6, 9.0]
]

# Loop over the spectra.
for id, file, field, offset, relax_time, H_frq, rmsd in data:
print(\n###)
print(id=%s, field=%s, offset=%3.2f, time=%1.3f, frq=%3.1f,
rmsd=%3.2f % (id, field, offset, relax_time, H_frq/1e6, rmsd) )

# Load the peak intensities and set the errors.
spectrum.read_intensities(file=file, dir=DATA_PATH,
spectrum_id=id, int_method='height')
spectrum.baseplane_rmsd(spectrum_id=id, error=rmsd)

# Set the relaxation dispersion experiment type.
relax_disp.exp_type(spectrum_id=id, exp_type='R1rho')

# Set the relaxation dispersion spin-lock field strength (nu1).
relax_disp.spin_lock_field(spectrum_id=id, field=field)

# Set the spin-lock offset.
relax_disp.spin_lock_offset(spectrum_id=id, offset=offset)

# Set the relaxation times (in s).
relax_disp.relax_time(spectrum_id=id, time=relax_time)

# Set the NMR field strength of the spectrum.
spectrometer.frequency(id=id, frq=H_frq)

# Load the R1 data.
relax_data.read(ri_id='R1', ri_type='R1', frq=H_frq,
file='R1_relax.out', dir=DATA_PATH, mol_name_col=1, res_num_col=2,
res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6,
error_col=7)

# Read the chemical shift data.
chemical_shift.read(file='2100_off_reso_R1rho.list', dir=DATA_PATH)

# Loop over spins, to see current setup.
for cur_spin, mol_name, resi, resn, spin_id in
spin_loop(full_info=True, return_id=True, skip_desel=True):
print mol_name, resi, resn, spin_id
print  
print cur_spin

print  

# Loop over setup.
for id in cdp.exp_type.keys():
print id, cdp.exp_type[id], cdp.spectrometer_frq[id],
cdp.spin_lock_offset[id], cdp.spin_lock_nu1[id]

print 

cdp.temp = []

Re: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-21 Thread Troels Emtekær Linnet
Dear Atul.

Thank you for a very descriptive problem.

I am sure this post will help others.
I will write an extended detailed description, in hope it can help others.
Most of it will be trivial for you.

Let us arm ourself with some reference information, to let the details
become clearer.

Since your last post, I have quickly expanded the wiki tutorial on
R1rho off resonance:

In the section: 1_setup_r1rho.py
http://wiki.nmr-relax.com/Tutorial_for_Relaxation_dispersion_analysis_r1rho_fixed_time_recorded_on_varian_as_sequential_spectra

And also the sample script you mention:
relax/sample_scripts/relax_disp/R1rho_analysis.py
http://svn.gna.org/viewcvs/*checkout*/relax/trunk/sample_scripts/relax_disp/R1rho_analysis.py?revision=HEAD

And we can use Figure 1 and 10 in the reference.
Palmer, A.G.  Massi, F. (2006). Characterization of the dynamics of
biomacromolecules using rotating-frame spin relaxation NMR
spectroscopy. Chem. Rev. 106, 1700-1719
DOI: http://dx.doi.org/10.1021/cr04042875

I have tried to reproduce that figure here:
http://wiki.nmr-relax.com/images/1/12/Fig1_Palmer_Massi_2006.png

--
Let us go through lines in the Sample script.

# Load the sequence.
sequence.read('fake_sequence.in', dir=DATA_PATH, res_num_col=1, res_name_col=2)
- This basically creates the spin-data structure, to store subsequent
information.

# Set the isotope information.
spin.isotope(isotope='15N')
- By defining which isotope, we can convert to ppm, when we have the
spectrometer field.
-  The physical constants are pulled from: cat lib/physical_constants.py

Then comes a section, to load data.
In the sample script, the data is put in manually.
In the wiki tutorial, it is pulled from files, which are prepared in bash.
That is a 'preference' issue. The data I have analysed, were with 70+ spectrum.
So I preferred to do it in files.

Then we loop over the spectrums:

spectrum.read_intensities(file=file, dir=DATA_PATH, spectrum_id=id,
int_method='height')
spectrum.baseplane_rmsd(spectrum_id=id, error=rmsd)
- The intensities, and its associated error. One can either measure
the RMSD of the spectrum,
 or replicate spectrums. For R1rho, it will normally measuring the RMSD.
- A quick way in linux is (for NMRPipe data):
showApod test.ft2 | grep REMARK Automated Noise Std Dev in Processed
Data: | awk '{print $9}'

Or in SPARKY:
http://wiki.nmr-relax.com/Tutorial_for_Relaxation_dispersion_analysis_cpmg_fixed_time_recorded_on_varian_as_fid_interleaved#Measure_the_backgorund_noise_.22RMSD.22_in_each_of_the_.ft2_files

# Set the relaxation dispersion experiment type.
relax_disp.exp_type(spectrum_id=id, exp_type='R1rho')
- Well, the program needs to know which code-path to take. Not CPMG code. :-)


# Set the relaxation dispersion spin-lock field strength (nu1).
relax_disp.spin_lock_field(spectrum_id=id, field=field)
- Here: 'help(relax_disp.spin_lock_field)', show is that this should be in Hz.
- Let is review figure Fig1_Palmer_Massi_2006.png
- This is the w_1 on S_x axis.
- What is here put into relax is nu_1. This is then later converted
to w_1, by multiplying with 2*pi.
- It seems that you have: 'spin-lock amplitude' / nu_1 / 'spin-lock
field' in column 4, while the the sample script has this in Column 3.

# Set the spin-lock offset.
relax_disp.spin_lock_offset(spectrum_id=id, offset=offset)
- Here: 'help(relax_disp.spin_lock_offset)', show is that this should
be in ppm.
- I see you have the distance/position (in Hz)  of the spin-lock
carrier in column 3. Values of 2100, 2728, ...  ... ...6500
- Relax needs to know the position in ppm. Edward can give you a
detailed description why we use ppm. It is related to minimise user
error input.
- You need to calculate this yourself.
 If you use NMRPipe, and look in 'fic.com', it could look like this
var2pipe -in ./fid \
 -noaswap  \
  -xN  2044  -yN   256  \
  -xT  1022  -yT   128  \
  -xMODEComplex  -yMODE  Rance-Kay  \
  -xSW12001.200  -ySW 2659.928  \
  -xOBS 750.061  -yOBS  76.012  \
  -xCAR  4.7893  -yCAR 118.536  \
  -xLAB  HN  -yLAB N15  \
  -ndim   2  -aq2D  States  \
  -out ./test.fid -verb -ov

Or try this script in relax:

 relax test.py
  test.py
from math import pi
from lib.physical_constants import return_gyromagnetic_ratio

H_frq = 900.0e6
print(The magnetic field strength as the proton frequency in Mega
Hertz: %3.2f % (H_frq / 1.E6) )

xOBS_Hz = H_frq
B0_tesla =  xOBS_Hz / return_gyromagnetic_ratio(nucleus='1H') * 2.0 * pi
print(BO in Tesla: %3.2f % B0_tesla)

yOBS_N15_Hz = abs( xOBS_Hz / return_gyromagnetic_ratio(nucleus='1H') *
return_gyromagnetic_ratio(nucleus='15N') )
print(The precess frequency for 15N in MHz: %3.2f % (yOBS_N15_Hz / 1.E6) )

offset_Hz = 2100.

offset_ppm_N15 = offset_Hz / yOBS_N15_Hz * 1E6
print(The offset ppm: %3.2f % (offset_ppm_N15) )

# Position of carrier.
yCAR_N15_ppm = 118.536

Re: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-20 Thread Atul Srivastava
Dear Edward,

I already mentioned the issue but I realized  that perhaps the question was
not very clear.

Following is the situation I am trying to solve by 'relax':
I have constant-relaxation-time relaxation-dispersion data for
off-resonance 15N R1rho acquired on Bruker spectrometers (I would like to
mention that I have 15N R1 data as well) at two magnetic fields.
In this relaxation-dispersion experiment I have used a constant spin-lock
amplitude of 1500 Hz. Spin-lock time  was 0.04 second.
I varied only the position of the spin-lock carrier. The distance (in Hz)
between the center of the spectrum (along 15N dimension) and the spin-lock
carrier were 2100, 2728, ...  ... ...6500 Hz.

As you know that the effective field sensed by each spin will be different
according to the position of the peak in the spectrum. I tried to calculate
that by 'relax' that gave a output file 'w2_eff.out'; but these values did
not match with what I calculated manually.

I request you to please provide a new sample script for the
relaxation-dispersion analysis appropriate for the above mentioned case.


Further,  in the following format the column for offset (third column) does
not accept 'None' which I needed to set reference intensity. It returns the
message RelaxError: The offset value must be provided.. However, the
program accepts 'None' for 'field',.
--
data = [
['900MHz_reference','ref_off_reso_R1rho_ubi_1.list',   None, 1500,
0.320,  900.0e6, 9],
['900MHz_2100','2100_off_reso_R1rho_ubi_2.list',   2100, 1500,
0.320,  900.0e6, 9],
['900MHz_2728','2728_off_reso_R1rho_ubi_3.list',   2728, 1500,
0.320,  900.0e6, 9],
['900MHz_3357','3357_reso_R1rho_ubi_4.list',   3357, 1500,
0.320,  900.0e6, 9],
['900MHz_3985','3985_off_reso_R1rho_ubi_5.list',   3985, 1500,
0.320,  900.0e6, 9],
['900MHz_4614','4614_off_reso_R1rho_ubi_6.list',   4614, 1500,
0.320,  900.0e6, 9],
['900MHz_rep_4614','4614_rep_off_reso_R1rho_ubi_10.list',  4614, 1500,
0.320,  900.0e6, 9],
['900MHz_5242','5242_off_reso_R1rho_ubi_7.list',   5242, 1500,
0.320,  900.0e6, 9],
['900MHz_5871','5871_off_reso_R1rho_ubi_8.list',   5871, 1500,
0.320,  900.0e6, 9],
['900MHz_6500','6500_off_reso_R1rho_ubi_9.list',   6500, 1500,
0.320,  900.0e6, 9]
]
---

I emphasized few things above for clarity, though they are trivial for you.

Thanks,
Atul


On Tue, Aug 19, 2014 at 9:52 AM, Atul Srivastava asriv...@umn.edu wrote:

 Hi Edward,

 Thanks for yours and Troels' kind help. I am trying to get the data on
 second field.
 I am still working with the test data and trying to analyze few residues
 manually to check if the analysis is consistent.  I will update you once I
 am satisfied with my analysis.

 Thanks again,
 Atul


 On Mon, Aug 18, 2014 at 2:37 AM, Edward d'Auvergne edw...@nmr-relax.com
 wrote:

 Hi Atul,

 I have just returned from holidays, hence my late reply.  However
 Troels' reply should have fully addressed your questions and issues.
 Is the analysis now working for you?  Note that the spin-lock
 amplitude Omega_1 is the spin-lock field strength or nu_1, as you have
 supplied (converted using the factor of 2*pi).  Tilt angles and
 anything else the specific model requires are calculated from this and
 the difference of the spin's chemical shift and the experiment
 specific spin-lock offset.

 Regards,

 Edward




 On 2 August 2014 09:52, Troels Emtekær Linnet tlin...@nmr-relax.com
 wrote:
  Dear Atul.
 
  I forgot one question.
 
  Do you have R1 data available?
 
  relax cannot currently do calculation without these measured values.
  relax_data.read(ri_id='R1', ri_type='R1',
  frq=cdp.spectrometer_frq_list[0], file= .)
 
  I am about to try to also make it possible to fit R1 values.
  sr #3135: Optimisation of the R1 relaxation rate for the off-resonance
  R1rho relaxation dispersion models.
  https://gna.org/support/?3135
 
  But that can take some weeks before it is implemented, and tested
 properly.
 
  Best
  Troels
 
  2014-08-02 9:47 GMT+02:00 Troels Emtekær Linnet tlin...@nmr-relax.com
 :
  Dear Atul.
 
  Welcome to the mailing list!
 
  This question is a very good one, and is not covered good enough in
 the manual !
 
  There has been a question related to this question on the mailing list
 recently.
  From Peixiang, at:
  http://thread.gmane.org/gmane.science.nmr.relax.user/1654
  http://thread.gmane.org/gmane.science.nmr.relax.user/1666
  http://thread.gmane.org/gmane.science.nmr.relax.user/1667
 
  Try to go through these post first, to cover the background.
  Don't get to confused, I will give you the answer 

Re: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-18 Thread Edward d'Auvergne
Hi Atul,

I have just returned from holidays, hence my late reply.  However
Troels' reply should have fully addressed your questions and issues.
Is the analysis now working for you?  Note that the spin-lock
amplitude Omega_1 is the spin-lock field strength or nu_1, as you have
supplied (converted using the factor of 2*pi).  Tilt angles and
anything else the specific model requires are calculated from this and
the difference of the spin's chemical shift and the experiment
specific spin-lock offset.

Regards,

Edward




On 2 August 2014 09:52, Troels Emtekær Linnet tlin...@nmr-relax.com wrote:
 Dear Atul.

 I forgot one question.

 Do you have R1 data available?

 relax cannot currently do calculation without these measured values.
 relax_data.read(ri_id='R1', ri_type='R1',
 frq=cdp.spectrometer_frq_list[0], file= .)

 I am about to try to also make it possible to fit R1 values.
 sr #3135: Optimisation of the R1 relaxation rate for the off-resonance
 R1rho relaxation dispersion models.
 https://gna.org/support/?3135

 But that can take some weeks before it is implemented, and tested properly.

 Best
 Troels

 2014-08-02 9:47 GMT+02:00 Troels Emtekær Linnet tlin...@nmr-relax.com:
 Dear Atul.

 Welcome to the mailing list!

 This question is a very good one, and is not covered good enough in the 
 manual !

 There has been a question related to this question on the mailing list 
 recently.
 From Peixiang, at:
 http://thread.gmane.org/gmane.science.nmr.relax.user/1654
 http://thread.gmane.org/gmane.science.nmr.relax.user/1666
 http://thread.gmane.org/gmane.science.nmr.relax.user/1667

 Try to go through these post first, to cover the background.
 Don't get to confused, I will give you the answer below. :-)

 By asking here on the public mailing list, your question will
 potentially help any other users who would
 have the same question. And it will help us to turn our attention to
 the manual lacking a tutorial for R1rho models.

 For example this mailing list can be viewed here:
 http://thread.gmane.org/gmane.science.nmr.relax.user

 And searches in same mail directory can be done here:
 http://dir.gmane.org/gmane.science.nmr.relax.user

 Your specific question is now listed here:
 http://thread.gmane.org/gmane.science.nmr.relax.user/1718

 Edward can probably extend the your answer into details.
 I know, that he is on holiday for the next two weeks, so I can try to
 answer your question.

 I am a PhD student at the structural biology in Copenhagen, and have
 been working on the dispersion branch (CPMG and R1rho).
 So I will however do my best to try to help you in the meantime.

 # How to get help

 How to find help:
 The manual
 http://wiki.nmr-relax.com/Manual

 Related to: Relaxation Dispersion:
 http://www.nmr-relax.com/manual/Relaxation_dispersion.html
 http://www.nmr-relax.com/manual/Relaxation_dispersion_optimisation_theory.html
 http://www.nmr-relax.com/manual/Analysing_dispersion_in_prompt_script_UI_mode.html
 http://www.nmr-relax.com/manual/Dispersion_model_summary.html

 It seems we have a problem, that setting up R1rho experiments is not
 covered in well the manual.

 Then I see that you have found the folder with sample scripts.
 The sample script at:
 cat sample_scripts/relax_disp/R1rho_analysis.py

 Did you know, that you can get help to all the functions?

 You can start relax, and see the help information this way:
 relax
 help(sequence.read)
 help(spectrum.read_intensities)

 But what you are looking for is this:
 help(relax_disp.spin_lock_field)
 help(relax_disp.spin_lock_offset)

 Or go to the GUI, and in the top select:
 user functions (n-z) - relax_disp - spin_lock_field

 -

 Relax has something called system tests, which make sure that all
 functions of relax is kept when changing the code.

 Try opening the setup of one of these systemtests:
 gedit test_suite/system_tests/relax_disp.py

 And search for def setup_r1rho_kjaergaard.
 Skip all lines with:
 - self.assertEqual
 Delete all:
 - self.interpreter

 Here you can get another way to inspire you how to setup things.
 Test data resides in:
 cd test_suite/shared_data/dispersion/Kjaergaard_et_al_2013/

 And have been analysed by:
 http://wiki.nmr-relax.com/Tutorial_for_Relaxation_dispersion_analysis_r1rho_fixed_time_recorded_on_varian_as_sequential_spectra#Intro

 So back to your question.
 You mention spin-lock amplitude.
 This is in relax called spin-lock field or  spin-lock field strength.

 If we set in the setup:

 -
 # In MHz.
 yOBS = 81.050
 # In ppm
 yCAR = 118.078
 centerPPM_N15 = yCAR
 ---

 # So for varian giving offset in Hertz, and relax wants in ppm:

 # Calculating the spin-lock offset in ppm, from offsets values provided in 
 Hz.
 frq_N15_Hz = yOBS * 1E6
 offset_ppm_N15 = float(deltadof2) / frq_N15_Hz * 1E6
 omega_rf_ppm = centerPPM_N15 + offset_ppm_N15

 # Set The spin-lock offset, omega_rf, in ppm.
 relax_disp.spin_lock_offset(spectrum_id=sp_id, offset=omega_rf_ppm)


 For this experiment, 

Re: field strength off-resonance R1rho constant relax time relaxation dispersion

2014-08-02 Thread Troels Emtekær Linnet
Dear Atul.

Welcome to the mailing list!

This question is a very good one, and is not covered good enough in the manual !

There has been a question related to this question on the mailing list recently.
From Peixiang, at:
http://thread.gmane.org/gmane.science.nmr.relax.user/1654
http://thread.gmane.org/gmane.science.nmr.relax.user/1666
http://thread.gmane.org/gmane.science.nmr.relax.user/1667

Try to go through these post first, to cover the background.
Don't get to confused, I will give you the answer below. :-)

By asking here on the public mailing list, your question will
potentially help any other users who would
have the same question. And it will help us to turn our attention to
the manual lacking a tutorial for R1rho models.

For example this mailing list can be viewed here:
http://thread.gmane.org/gmane.science.nmr.relax.user

And searches in same mail directory can be done here:
http://dir.gmane.org/gmane.science.nmr.relax.user

Your specific question is now listed here:
http://thread.gmane.org/gmane.science.nmr.relax.user/1718

Edward can probably extend the your answer into details.
I know, that he is on holiday for the next two weeks, so I can try to
answer your question.

I am a PhD student at the structural biology in Copenhagen, and have
been working on the dispersion branch (CPMG and R1rho).
So I will however do my best to try to help you in the meantime.

# How to get help

How to find help:
The manual
http://wiki.nmr-relax.com/Manual

Related to: Relaxation Dispersion:
http://www.nmr-relax.com/manual/Relaxation_dispersion.html
http://www.nmr-relax.com/manual/Relaxation_dispersion_optimisation_theory.html
http://www.nmr-relax.com/manual/Analysing_dispersion_in_prompt_script_UI_mode.html
http://www.nmr-relax.com/manual/Dispersion_model_summary.html

It seems we have a problem, that setting up R1rho experiments is not
covered in well the manual.

Then I see that you have found the folder with sample scripts.
The sample script at:
 cat sample_scripts/relax_disp/R1rho_analysis.py

Did you know, that you can get help to all the functions?

You can start relax, and see the help information this way:
 relax
 help(sequence.read)
 help(spectrum.read_intensities)

But what you are looking for is this:
 help(relax_disp.spin_lock_field)
 help(relax_disp.spin_lock_offset)

Or go to the GUI, and in the top select:
user functions (n-z) - relax_disp - spin_lock_field

-

Relax has something called system tests, which make sure that all
functions of relax is kept when changing the code.

Try opening the setup of one of these systemtests:
 gedit test_suite/system_tests/relax_disp.py

And search for def setup_r1rho_kjaergaard.
Skip all lines with:
- self.assertEqual
Delete all:
- self.interpreter

Here you can get another way to inspire you how to setup things.
Test data resides in:
cd test_suite/shared_data/dispersion/Kjaergaard_et_al_2013/

And have been analysed by:
http://wiki.nmr-relax.com/Tutorial_for_Relaxation_dispersion_analysis_r1rho_fixed_time_recorded_on_varian_as_sequential_spectra#Intro

So back to your question.
You mention spin-lock amplitude.
This is in relax called spin-lock field or  spin-lock field strength.

If we set in the setup:

-
# In MHz.
yOBS = 81.050
# In ppm
yCAR = 118.078
centerPPM_N15 = yCAR
---

# So for varian giving offset in Hertz, and relax wants in ppm:

# Calculating the spin-lock offset in ppm, from offsets values provided in Hz.
frq_N15_Hz = yOBS * 1E6
offset_ppm_N15 = float(deltadof2) / frq_N15_Hz * 1E6
omega_rf_ppm = centerPPM_N15 + offset_ppm_N15

# Set The spin-lock offset, omega_rf, in ppm.
relax_disp.spin_lock_offset(spectrum_id=sp_id, offset=omega_rf_ppm)


For this experiment, we first had to do a calibration experiment to
find how the lock power translated into field strength.
That results is written into a python dictionary in the setup:

spin_lock_field_strengths_Hz = {'35': 431.0, '39': 651.2, '41': 800.5,
'43': 984.0, '46': 1341.11, '48': 1648.5}

# Looping over file with all settings:
dpwr2slock = line.split()[3]
spin_lock_field_strength = spin_lock_field_strengths_Hz[dpwr2slock]

# Set The spin-lock field strength, nu1, in Hz
relax_disp.spin_lock_field(spectrum_id=sp_id, field=spin_lock_field_strength)

I hope this helps!

Please write back here to the mailing list, if the answer covers your question.

Good luck!

Best
Troels Emtekær Linnet
PhD student
Copenhagen University
SBiNLab, 3-0-41
Ole Maaloes Vej 5
2200 Copenhagen N
Tlf: +45 353-22083
Lync Tlf: +45 353-30195



2014-08-01 19:42 GMT+02:00 Atul Srivastava asriv...@umn.edu:
 Dear Edward,

 I am trying to use 'relax' for the off-resonance R1rho
 constant-relaxation-time relaxation dispersion using R1rho_analysis.py
 script available as sample script with relax.

 The following is the section where I have question:
 ---
 data = [
 ['900MHz_reference_3000.list',