Just to give everyone the benefit of Tim's solution for this problem......
On Wed, 29 Mar 2006, Tim Stevens wrote:
> One thing you could try is to put every experiment in one shift list, then
> split things up again - this will give all the resonances entries in at
> least one shift list. You can then sort by resonance assignment to get
> pairs that can be merged.
>
> However, if there are loads of duplicates I suppose we need a script.
> Something like:
>
> from ccpnmr.analysis.AssignmentBasic import mergeResonances, makeResonanceGuiName
>
> dict = {}
> for r in top.project.resonances:
> if r.resonanceSet:
> key = makeResonanceGuiName(r)
> if dict.get(key) is None:
> dict[key] = []
> dict[key].append(r)
>
> for rr in dict.values():
> if len(rr) > 1:
> r1 = rr[0]
> for r2 in rr[1:]:
> mergeResonances(r1, r2)
This script works well with the modification
mergeResonances(r2, r1)
and Tim's latest AssignmentBasic.py update. You may like to throw in a
print statement in place of the mergeReonances for a dry run so that you
can assure yourself that you're doing what you inteneded. i.e. replace
the second block with something like:
for rr in dict.values():
if len(rr) > 1:
print "multiple resonances: ",rr
r1 = rr[0]
for r2 in rr[1:]:
print "would try to merge: ", r2, r1
--
Dr. Brian O. Smith ---------------------- B Smith at bio gla ac uk
Division of Biochemistry & Molecular Biology,
Institute Biomedical & Life Sciences,
Joseph Black Building, University of Glasgow, Glasgow G12 8QQ, UK.
Tel: 0141 330 5167/6459/3089 Fax: 0141 330 8640
|