> I have a set of chemAtomSets and a set of atomSets What is the most
> efficient way to get from the chemAtomsSets to the relevant atomSets. Is
> it via munging relevant keywords or traversing hierachies in parallel
Not sure what you mean by munging. Anyhow, this is what I'd do:
lookup = {}
for atomSet in atomSets:
atom = atomSet.findFirstAtom()
chemAtomSet = atom.chemAtom.chemAtomSet
if chemAtomSet:
lookup[chemAtomSet] = lookup.get(chemAtomSet, []) + atomSet
chemAtomSet2 = chemAtomSet.chemAtomSet: # E.g ValHg*
if chemAtomSet2:
lookup[chemAtomSet2] = lookup.get(chemAtomSet2, []) + atomSet
for chemAtomSet in myChemAtomSets:
atomSets = lookup.get(chemAtomSet, [])
...
> in explanation this is a problem to do with measuring distances on
> structure which i believe I can ge via getAtomSetsDistance (atomSets1,
> atomSets2, structure, coordSet=0, method='noe')...
That's the right function, although one should always take care with
ambiguous prochirals. Depending on what you're doing, sometimes the 'min'
method is more informative than 'noe'. :-)
T.
-------------------------------------------------------------------------------
Dr Tim Stevens Email: [log in to unmask]
Department of Biochemistry [log in to unmask]
University of Cambridge Phone: +44 1223 766018 (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- -------
-------------------------------------------------------------------------------
|