Template: Basic NMR#

To use this template, you need to prepare a text file with NMR relaxation data in it (see HETs_15N.txt or ubi_soln.txt for example). If you intend to run on a local pyDR installation, then you just need to point pyDR to the file. If you want to run in Google Colab, the file needs to be available online somehow. My recommendation is to use a shared link from Google drive or something similar.

One can also mount Google drive in Google Colab. Note that this poses security risks. Basically, once Google Drive is mounted, the Python software could in principle send files in it to us, or we could delete things. We promise not to do that! However, I think it’s worth mentioning that this in general poses a risk and you shouldn’t mount Google Drive using untrusted notebooks.

Parameters#

Below, you find the parameters you would typically change for your own analysis

#Where's  your data??
# path_to_nmr_data='data/HETs_15N.txt'  #Data stored locally
path_to_nmr_data='https://github.com/alsinmr/pyDR_tutorial/raw/main/data/HETs_15N.txt' #Github raw link
# path_to_nmr_data='https://drive.google.com/file/d/1w_0cR6ykjL7xvdxU2W90fRXvZ8XfLFc3/view?usp=share_link' #Google drive share link

# How many detectors
n=4

#Is there a PDB ID or saved topology file associated with your structure? 
#(set =None if no structure)
topo='2KJ3'

#What Nucleus did you measure? (see below for more explanation)
Nuc='N'  #This refers to the backbone nitrogen, specifically
segids='B' # The example data (HETs) has 3 copies of the molecule, so we need to specify this
# You will probably want to set segids=None
# SETUP pyDR
import os
os.chdir('../..')
#Imports
import pyDR

Load NMR Data#

The best way to get load your data depends if you’re running locally (just point to the file) or if you’re running online (download from somewhere, mount Google Drive)

Note that you can use commands such as ‘ls’, ‘cd’, and ‘pwd’ if you’re confused where your files are.

data=pyDR.IO.readNMR(path_to_nmr_data)

Put data into a project#

Projects are convenient ways to manage a lot of data, and provide convenient tools for overlaying data in 2D plots, as well as visualizing data in 3D in ChimeraX. Not used extensively in this template.

proj=pyDR.Project(directory=None)    #Include a directory to save the project
proj.append_data(data)

Attach structure to the data#

Download a pdb and attach it to the data object. For protein backbone dynamics, we recommend using the labels to provide the residue number, making this step easier.

Available bonds (‘Nuc’)

  • N,15N,N15 : Backbone N and the directly bonded hydrogen

  • C,CO,13CO,CO13 : Backbone carbonyl carbon and the carbonyl oxygen

  • CA,13CA,CA13 : Backbone CA and the directly bonded hydrogen (only HA1 for glycine)

  • CACB : Backbone CA and CB (not usually relaxation relevant)

  • IVL/IVLA/CH3 : Methyl groups in Isoleucine/Valine/Leucine, or ILV+Alanine, or simply all methyl groups. Each methyl group returns 3 pairs, corresponding to each hydrogen

  • IVL1/IVLA1/CH31 : Same as above, except only one pair

  • IVLl/IVLAl/CH3l : Same as above, but with only the ‘left’ leucine and valine methyl group

  • IVLr/IVLAr/CH3r : Same as above, but selects the ‘right’ methyl group

  • FY_d,FY_e,FY_z : Phenylalanine and Tyrosine H–C pairs at either the delta, epsilon, or zeta positions.

  • FY_d1,FY_e1,FY_z1:Same as above, but only one pair returned for each amino acid

We can also filter based on residues, segments, and a filter string (MDAnalysis format).

if topo is not None and Nuc is not None:
    data.select=pyDR.MolSelect(topo=topo)
    data.select.select_bond(Nuc=Nuc,resids=data.label,segids=segids)

Plot the data#

plt_obj=data.plot(style='bar')
plt_obj.fig.set_size_inches([8,10])
_images/5f54f81c30d246076ca760f430b5f68e076f7f778648d198c56437ee2389be7e.png

Process NMR data#

data.detect.r_auto(n)    #Set number of detectors here
if data.S2 is not None:
    data.detect.inclS2() #Include order parameters

fit=data.fit()  #Fit the data

Plot the results#

proj.close_fig('all')
plt_obj=fit.plot(style='bar')
plt_obj.fig.set_size_inches([8,10])
plt_obj.show_tc()
_=plt_obj.ax[-1].set_xlabel('Residue')
_images/452d3a963127ca88fe412d07dd99396eb77b13da17dce1ce2ea3c93c701417b3.png

Plot the fit quality#

fig=fit.plot_fit()[0].axes.figure
fig.set_size_inches([12,10])
_images/baf0e9b0b31d15222c5a723502496e526f3549d8bc49e53c936a8e5723018d4a.png

Visualize with NGL viewer#

fit.nglview(1)

Visualize with ChimeraX#

fit.chimera()