> > > raise ApiError("ccpnmr.Analysis.AtomSetMapping.getResonances(): key
> > > points to non-existent object")
> > > ApiError: ccpnmr.Analysis.AtomSetMapping.getResonances(): key points to
> > > non-existent object
>
> A quick fix is a bit difficult at the moment as it involves
> BrowseResonancesPopup.py which has had lots of new bits added for multiple
> object selection in ScrolledMatrix (tables), including in the area of
> deleting resonances. There are just too many dependencies to satisfy
> without getting really messy.
Actually, if I stop being dumb for a moment, I can make a quick fix for an
old version file (courtesty Brian) rather than trying to upgrade to the
new flashy one.
Two replacement functions for BrowseResonancesPopup.py:
def deleteResonance(self):
self.cancelAllWaits()
resonance = self.resonance
n = len(resonance.peakDimContribs)
if n > 0:
showWarning('Delete failed', 'Resonance still assigned to %d peaks' % n)
return
else:
if ( showOkCancel('Delete Resonance', 'Delete resonance %d?' % resonance.serial) ):
resonanceSet = resonance.resonanceSet
if resonanceSet:
if len(resonanceSet.resonances) == 1:
resonanceSet.delete()
else:
resonanceSet.removeResonance(resonance)
resonance.delete()
self.update()
-------------------------------------------------------------------------------
def deleteOrphans(self):
self.cancelAllWaits()
doomed = []
for resonance in self.resonances:
if len(resonance.peakDimContribs) < 1:
doomed.append(resonance)
if len(doomed) > 0:
if ( showOkCancel('Remove Orphans', 'Are you sure you want to\ndelete %d orphaned resonances?' % len(doomed) ) ):
for resonance in doomed:
resonanceSet = resonance.resonanceSet
if resonanceSet:
if len(resonanceSet.resonances) == 1:
resonanceSet.delete()
else:
resonanceSet.removeResonance(resonance)
resonance.delete()
self.update()
-------------------------------------------------------------------------------
Dr Tim Stevens Email: [log in to unmask]
Department of Biochemistry [log in to unmask]
University of Cambridge Phone: +44 1223 766022 (office)
80 Tennis Court Road +44 7816 338275 (mobile)
Old Addenbrooke's Site +44 1223 364613 (home)
Cambridge CB2 1GA WWWeb: http://www.bio.cam.ac.uk/~tjs23
United Kingdom http://www.pantonia.co.uk
-------------------------------------------------------------------------------
------ +NH3CH(CH(CH3)OH)C(O)NHCH(CH(CH3)CH2CH3)C(O)NHCH(CH2CH2SCH3)CO2- -------
-------------------------------------------------------------------------------
|