Hi Brian,
Works with Num, fixed for extra lines at top! New file attached.
Best,
Wim
On 16 Mar 2015, at 17:10, Brian Smith <[log in to unmask]> wrote:
>
> Hi Wim,
>
> The altered code addresses the "****" issue - great.
>
> Before checking in:
>
> Would be good to make the test for the header line test for Num as well as NUM.
>
> The code still throws an uninformative error dialog with the files as downloaded from SHIFTX2 which have a line before the header line that tells you which set of atoms had the shifts predicted. I would suggest that the parser discards lines until it encounters the header line in the same way it seems to for empty lines currently?
>
> Brian
>
> On Mon, 16 Mar 2015, Wim Vranken wrote:
>
>> Try attached chemShiftsIO.py… so replace the original in ccp/format/shiftx/.
>> Let us know if it works, we’ll check it in.
>> On 16 Mar 2015, at 10:53, Brian Smith <[log in to unmask]> wrote:
>> > Hi,
>> >
>> > I'm trying to read the output from SHIFTX2 web server into a project (I've
>> tried empty, and already populated).
>> >
>> > The files look like
>> >
>> > BACKBONE ATOMS
>> > Num RES CA CB CO N H HA
>> > 14 P 63.5624 32.1090 175.9337 **** **** 4.4734
>> > 15 R 55.6609 31.3586 175.4507 118.2871 7.7702 4.3459
>> > 16 K 55.2252 34.6261 175.5421 125.3618 8.7211 4.5907
>> >
>> > etc.
>> >
>> > Initially I just got a dialog saying that importing the file had failed. I
>> made the guess that
>> >
>> > ccp/format/shiftx/chemShiftsIO.py line 131
>> >
>> > if cols[0].count('NUM'):
>> >
>> > Is case sensitive so fixed Num to NUM. Now I get the traceback below,
>> which I suspect is an issue with handling the "****" empty shift
>> placeholders since the first three shifts are imported.
>> >
>> > Incidentally I was able to read in the webserver output with the NMRStar
>> format - although only after adding the Star wrappers harvested from
>> > https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=CCPNMR;87fbe4c2.1410
>> > reproduced at the end of this email.
>> >
>> > Traceback:
>> > ERROR in ccp.nmr.Nmr.Shift.__init__
>> > Exception in Tkinter callback
>> > Traceback (most recent call last):
>> > File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 1410, in
>> __call__
>> > return self.func(*args)
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/gui/ImportExportFormatP
>> > opup.py", line 981, in ok
>> > if (not self.apply()):
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/gui/ImportExportFormatP
>> > opup.py", line 994, in apply
>> > returnValue = self.importExportFile(self.component) # If none, will do
>> all c
>> > omponents
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/gui/ImportExportFormatP
>> > opup.py", line 801, in importExportFile
>> > returnValue = rwFunc(*addArgs,**addKeywds)
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/converters/DataFormat.p
>> > y", line 1806, in readShifts
>> > return self.readMeasurements(*args, **keywds)
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/converters/DataFormat.p
>> > y", line 2044, in readMeasurements
>> > self.setMeasurements()
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/converters/DataFormat.p
>> > y", line 5345, in setShifts
>> > self.setSingleResonanceMeasurementsGeneric()
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/converters/DataFormat.p
>> > y", line 5169, in setSingleResonanceMeasurementsGeneric
>> > self.measurement =
>> self.createMeasurement(resonance,self.rawMeasurement)
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/converters/DataFormat.p
>> > y", line 8071, in createShift
>> > self.createSingleResonanceMeasurement(resonance,rawMeasurement)
>> > File
>> "/usr/local/ccpnmr/ccpnmr2.4/python/ccpnmr/format/converters/DataFormat.p
>> > y", line 8050, in createSingleResonanceMeasurement
>> > return self.ApiMeasurement(self.measurementList, value =
>> rawMeasurement.valu
>> > e, resonance = resonance, **keywds)
>> > File "/usr/local/ccpnmr/ccpnmr2.4/python/ccp/api/nmr/Nmr.py", line
>> 105944, in
>> > __init__
>> > func(self, value)
>> > File "/usr/local/ccpnmr/ccpnmr2.4/python/ccp/api/nmr/Nmr.py", line 5148,
>> in se
>> > tValue
>> > + ": %s" % (value,)
>> > ApiError: ccp.nmr.Nmr.Shift.setValue:
>> > memops.Implementation.Float input is not of a valid type: None
>> >
>> > NMRStar header and footer:
>> >
>> >
>> > save_shifts
>> > _Saveframe_category assigned_chemical_shifts
>> > loop_
>> > _Atom_shift_assign_ID
>> > _Residue_seq_code
>> > _Residue_label
>> > _Atom_name
>> > _Chem_shift_value
>> > _Chem_shift_value_error
>> > _Chem_shift_ambiguity_code
>> > ....SHIFTX2 output here......
>> > stop_
>> > save_
>> >
>> >
>> >
>> > Dr. Brian O. Smith --------------------------- Brian Smith at glasgow ac
>> uk
>> > Institute of Molecular, Cell and Systems Biology & School of Life
>> Sciences,
>> > College of Medical, Veterinary & Life Sciences,
>> > Joseph Black Building, University of Glasgow, Glasgow G12 8QQ, UK.
>> > Tel: 0141 330 5167/6459/3089
>> > ----------------------------------------------------------------------
>> > The University of Glasgow, charity number SC004401
>> ---------------------------------------------------------------------------
>> ------------
>> Prof. Dr. Wim Vranken
>> [log in to unmask] Tel: +32 (0)2 6291996 (VUB)
>> +32 (0)2
>> 6505943 (IB^2)
>> Building E, 5th Floor, E5.03, Pleinlaan 2
>> 1050 Brussels, Belgium
>> VUB - Structural Biology Brussels, http://more.vub.ac.be/
>> VIB - Structural Biology Research Center (SBRC)
>> ULB-VUB - Interuniversity Institute of Bioinformatics in Brussels (IB^2)
>> Vice-director, http://ibsquare.be/
>> ---------------------------------------------------------------------------
>> ------------
>>
>
> --
> Dr. Brian O. Smith --------------------------- Brian Smith at glasgow ac uk
> Institute of Molecular, Cell and Systems Biology & School of Life Sciences,
> College of Medical, Veterinary & Life Sciences,
> Joseph Black Building, University of Glasgow, Glasgow G12 8QQ, UK.
> Tel: 0141 330 5167/6459/3089 Fax: 0141 330 4600
> ----------------------------------------------------------------------
> The University of Glasgow, charity number SC004401
---------------------------------------------------------------------------------------
Prof. Dr. Wim Vranken
[log in to unmask] Tel: +32 (0)2 6291996 (VUB)
+32 (0)2 6505943 (IB^2)
Building E, 5th Floor, E5.03, Pleinlaan 2
1050 Brussels, Belgium
VUB - Structural Biology Brussels, http://more.vub.ac.be/
VIB - Structural Biology Research Center (SBRC)
ULB-VUB - Interuniversity Institute of Bioinformatics in Brussels (IB^2)
Vice-director, http://ibsquare.be/
---------------------------------------------------------------------------------------
|