Package: nmrgnn
Graph neural network for predicting NMR chemical shiftsThis library is the code and a pre-trained model to predict NMR chemical shifts from protein structures and organic molecules. It relies on thenmrdatapackage which includes embeddings and NMR parameters.InstallInstall using pippipinstallnmrgnnColabTo use this package without installing,use this colabCommand Line UsageAvailable commands arenmrgnn eval-structto predict chemical shifts of structure via MDAnalysis library as coordinate readernmrgnn trainto train a modelnmrgnn hyperto tune hyperparametersnmrgnn eval-tfrecordsto evaluate model on records in format fromnmrdatapackagePredict NMR Chemical ShfitsNote: This model is trained on models with no solvent, so remove that before use. For small molecules, the model was trained mostly on water solutions. You should
only expect agreement in relative chemical shifts between atoms depending on your solvent and reference.To predict NMR chemical shifts via the MDAnalysis library as a reader:nmrgnneval-struct[struct-file][output-csv]wherestruct-filecould be a pdb file or equivalent. Example:nmrgnn eval-struct 108M.pdb 108M-predicted.csvFor a trajectory, trynmrgnn eval-struct 108M.pdb 108M.trr 108M-predicted.csv --stride 5which computes shifts every 5 frames.Warning about PeaksIf you receive a warning about peaks being poor, you likely have no hydrogens in your protein. You can add using online tools or use these commands to fix quickly by
usingOpenMMcondainstall-y-comniaopenmm
pipinstallnmrdata[parse]@git+git://github.com/ur-whitelab/nmrgnn.git
nmrparseclean-pdb[your-pdb][your-pdb]-H.pdbLibrary UsageAvailable functions areload_modelto load the included pre-trained model or specify a path to a trained modeluniverse2graphto convert an MDAnalysis universe into a tuple of atoms, neighbor list, edges, inverse_degree.check_peaksto estimate validity of predicted peaksThe example below predicts peaks and estimates (True/False) if the peaks are valid. Examples of why peaks are
not valid are that the elements are not inlcuded in training data (e.g., oxygen shifts) or unusual chemistries or
you forgot to remove solvent.importMDAnalysisasmdimportnmrgnnmodel=nmrgnn.load_model()u=md.Universe('108M.pdb')g=nmrgnn.universe2graph(u)peaks=model(g)# check_peaks only uses first element of tuple (atom identities)confident=nmrgnn.check_peaks(g[0],peaks)You should not trust peaks coming from model without checkingAnalyzing TrajectoriesHere is an example for analzying a trajectoryimportMDAnalysisasmdimportnmrgnnmodel=nmrgnn.load_model()u=md.Universe(PATH_TO_FILES)fortsinu.trajectory:x=nmrgnn.universe2graph(u)peaks=model(x)nmrgnn.check_peaks(x[0],peaks)# do something with peaks....CitationPlease citePredicting Chemical Shifts with Graph Neural Networks@article{yang2021predicting,title={Predicting Chemical Shifts with Graph Neural Networks},author={Yang, Ziyue and Chakraborty, Maghesree and White, Andrew D},journal={Chemical Science},year={2021},publisher={Royal Society of Chemistry}}Model PerformanceHere is the included model performance on proteins (Pprefix) and organic molecules (Molprefix).ris correlation coefficient andrmsdis root mean square deviation. These results vary from paper values because they are evaluated on whole proteins instead of 256 atom fragments.NbaselineMol-H-r3070.9591749434360993Mol-H-rmsd3070.39710393617916234P-C-r67010.864163P-H-r77470.72265P-N-r76400.890842P-CA-r83050.97374P-CB-r68270.990706P-CD-r7390.996123P-CD1-r9610.999515P-CD2-r6090.999223P-CE-r3400.991736P-CE1-r2610.958121P-CE2-r1730.943739P-CE3-r37-0.215088P-CG-r16740.998763P-CG1-r5890.93124P-CG2-r8390.829016P-CH2-r430.158363P-CZ-r1250.984575P-CZ2-r450.311805P-CZ3-r370.164961P-HA-r55650.839377P-HA2-r4620.495514P-HA3-r4490.262298P-HB-r9600.958713P-HB2-r34270.901358P-HB3-r32550.901234P-HD1-r3830.44733P-HD11-r7530.615756P-HD12-r7530.585852P-HD13-r7530.609181P-HD2-r10430.988991P-HD21-r4280.617599P-HD22-r4280.651927P-HD23-r4280.605888P-HD3-r6370.95089P-HE-r930.396258P-HE1-r4130.879142P-HE2-r5610.98963P-HE3-r2930.985685P-HG-r3890.810401P-HG1-r110.0653286P-HG11-r3500.572609P-HG12-r3500.498696P-HG13-r3500.558426P-HG2-r13170.867619P-HG21-r9360.689592P-HG22-r9360.674086P-HG23-r9360.662057P-HG3-r12000.856177P-HH-r1nanP-HH2-r510.217372P-HZ-r1340.407285P-HZ2-r540.419415P-HZ3-r450.318577P-ND1-r90.184443P-ND2-r1730.320299P-NE-r880.0135033P-NE1-r640.0998792P-NE2-r1490.972614P-NH1-r3-0.914066P-NH2-r3-0.276087P-NZ-r1nanP-C-rmsd67011.22819P-H-rmsd77470.279766P-N-rmsd76406.65505P-CA-rmsd83051.3298P-CB-rmsd68273.10571P-CD-rmsd73910.3192P-CD1-rmsd9612.74597P-CD2-rmsd6094.35399P-CE-rmsd3401.14623P-CE1-rmsd2614.69154P-CE2-rmsd1734.82229P-CE3-rmsd373.0327P-CG-rmsd16741.63828P-CG1-rmsd5891.558P-CG2-rmsd8391.87753P-CH2-rmsd431.95861P-CZ-rmsd1254.32496P-CZ2-rmsd451.22984P-CZ3-rmsd371.99567P-HA-rmsd55650.0903255P-HA2-rmsd4620.119584P-HA3-rmsd4490.234069P-HB-rmsd9600.103812P-HB2-rmsd34270.10552P-HB3-rmsd32550.117287P-HD1-rmsd3830.114696P-HD11-rmsd7530.0699893P-HD12-rmsd7530.0744762P-HD13-rmsd7530.0711484P-HD2-rmsd10430.105893P-HD21-rmsd4280.0737762P-HD22-rmsd4280.0689306P-HD23-rmsd4280.0764191P-HD3-rmsd6370.0869007P-HE-rmsd930.422132P-HE1-rmsd4130.376196P-HE2-rmsd5610.0861489P-HE3-rmsd2930.0855213P-HG-rmsd3890.118694P-HG1-rmsd1110.3704P-HG11-rmsd3500.0504736P-HG12-rmsd3500.0552385P-HG13-rmsd3500.0516929P-HG2-rmsd13170.0654069P-HG21-rmsd9360.0634577P-HG22-rmsd9360.0650697P-HG23-rmsd9360.0679991P-HG3-rmsd12000.0775636P-HH-rmsd14.07231P-HH2-rmsd510.0862706P-HZ-rmsd1340.147387P-HZ2-rmsd540.13507P-HZ3-rmsd450.083249P-ND1-rmsd91576.13P-ND2-rmsd1736.56618P-NE-rmsd88231.589P-NE1-rmsd644.51713P-NE2-rmsd14913.9975P-NH1-rmsd35.76985P-NH2-rmsd30.91028P-NZ-rmsd1165.069