CcpnForum
ImportBmrbCsI.py error - Printable Version

+- CcpnForum (https://www.ccpn.ac.uk/forums)
+-- Forum: CcpNmr Analysis Version 3 (https://www.ccpn.ac.uk/forums/forumdisplay.php?fid=4)
+--- Forum: V3 Macros (https://www.ccpn.ac.uk/forums/forumdisplay.php?fid=14)
+--- Thread: ImportBmrbCsI.py error (/showthread.php?tid=51)



ImportBmrbCsI.py error - micaelsilva - 11-14-2019

Dear all,

I tried the macro ImportBmrbCsi.py after v3.0.0 with updates (in MacOS Mojave), but there is an error with the chosen NMR-STAR v3.1: (BMRB 25501). The file examples run well but only created a chemical shift list and a new NmrChain. There is no add peaks in the spectra. 

Many thanks,

Micael Silva


Error:

Traceback (most recent call last):
  File "/Applications/CcpNmrLauncher.app/Contents/Resources/ccpnmr3.0.0/src/python/ccpn/macros/ImportBmrbCsl.py", line 175, in _okButton
    _importAndCreateV3Objs(bmrbFile)
  File "/Applications/CcpNmrLauncher.app/Contents/Resources/ccpnmr3.0.0/src/python/ccpn/macros/ImportBmrbCsl.py", line 141, in _importAndCreateV3Objs
    makeCSLfromDF(df)
  File "/Applications/CcpNmrLauncher.app/Contents/Resources/ccpnmr3.0.0/src/python/ccpn/macros/ImportBmrbCsl.py", line 134, in makeCSLfromDF
    cs.valueError = float(row[Val_err])
ValueError: could not convert string to float: '.'
INFO   : project.newChemicalShiftList(name=None, unit='ppm', autoUpdate=True, isSimulated=False, comment=None)    (Logging._info:109)
INFO   : projectfetchNmrChain(shortName=None)                                                          (Logging._info:109)
INFO   : get('NC:@3').fetchNmrResidue(sequenceCode='1', residueType='MET')                             (Logging._info:109)
INFO   : get('NR:@3.1.MET').newNmrAtom(name='C', isotopeCode=None, comment=None)                       (Logging._info:109)
INFO   : get('CL:chemicalshiftlist_2').newChemicalShift(value=173.424, nmrAtom='NA:@3.1.MET.C', valueError=0.0, figureOfMerit=1.0, comment=None)    (Logging._info:109)


RE: ImportBmrbCsI.py error - VickyH - 11-14-2019

Hi Micael,

Luca will probably be more help with this, but just want to check that you are using the v3.1 NmrStar file at
http://bmrb.wisc.edu/ftp/pub/bmrb/entry_lists/nmr-star3.1/bmr25501.str
Not the old-style v2.1 NmrStar file

Vicky


RE: ImportBmrbCsI.py error - LucaM - 11-14-2019

Hi Micael. Can you please drag and drop your bmrb file on sidebar, check the option simulate peaks. Select the nmrAtoms you need, like H and N and click import. When you have the new peakList, just copy to your spectra of interest. Thanks
Luca


RE: ImportBmrbCsI.py error - LucaM - 11-14-2019

Just tried your file. Yes there is an error in the code, it assumes the "_Atom_chem_shift.Val_err" is always present in the table. You can either change the bmrb file to 0 instead of . , so you can also create peakList using the drag and drop or comment out the line 133 and 134 in the macro if you are interested only in importing the CSL. I hope this helps.


Python
  1. #if row[Val_err] is not None:
  2. # cs.valueError = float(row[Val_err])



Luca


RE: ImportBmrbCsI.py error - micaelsilva - 11-14-2019

Thanks Vicky and Luca for the fast reply. I changed the "_Atom_chem_shift.Val_err" to 0, and now it reads the bmrb file (drag and drop). However in this file there is two chemical shift lists, is possible to read both of them? Only the 1st list is read.
The NH is nicely read (BMRB ATOM_ID N,H ; Assign to Axis N,H) but if I add the CA or CB and C in the axis, the NHC peaklist created doesn't contain assignment.

Other question, it's easily to create a 2nd Chemical shift list associated with other NmrChain but with the same sequence (cases for slow exchange: Folded and Unfolded state for the same peak)? I have been trying to overlap two NEF files (where I assigned N,H,CA,CB,C for each case) but they have the same NmrChain...

Many thanks,

Micael


RE: ImportBmrbCsI.py error - LucaM - 11-14-2019

Hi Micael,
Sorry for this, we are still in testing mode with Bmrb, and the AxisCodes are currently a big issue.
A temporary fix for your import could be:
to import CA and CB you can do in this way:
Drop twice the same file:
the first drop:
Select H,CA,N
second drop:
Select H,CB,N

Copy the peaks from the peakList containing your CB to The one containing the CA! So you will merge the two. You can do this from Menu, spectrum, Copy Peaks.

I will Check soon the issue with importing multiple List. I hope this (partially) helps.


RE: ImportBmrbCsI.py error - micaelsilva - 11-14-2019

Dear Luca,

Thanks for the help. I managed my problem in a different way. Importing a project from V2 (HSQC assigned with two chemical shift list associated with two different nmrchain), I used your macro "AutopickAndAssign" (few changes in the code) that run wonderful, thanks! Could you add code to do the same for carbonyl 'C', 'C i-1' as in HNCO and HNCACO spectra?

Cheers,

Micael


RE: ImportBmrbCsI.py error - VickyH - 11-15-2019

Hi Micael,

glad you managed to sort things out.

For clarification: Shift Lists are associated with spectra (double-click on a spectrum in the side-bar to change the shift list a spectrum is linked to). NmrChains/Residues/Atoms can be associated with peaks belonging to different shift lists.

Example 1: Protein A in two different conditions (with/without ligand, at different temperatures or pHs etc.):
You would have a single NmrChain, but the spectra recorded would be linked to different chemical shift lists

Example 2: Protein in two different conformations in the same sample (e.g. slow exchange):
You would have a single shift list, as this is a single spectrum, but you would have two NmrChains - one for the the A conformation and one for the B conformation.

Hope this helps.

Vicky