> "Set Atom Type" to a dimension of all of the selected of peaks would make
> pickin/assigning this type of spectra much less mouse-laborious. Ideally
> with an option to activate a little type-in-here window in which something
> like F2 Cb can be typed right away.
Good idea.
The LinkPeakLists can be expanded very easily (I may do this today) to set
the atom type for HNcoCA/HNCA/HNCO
You could then use the CopyPeakAssignments popup to assign any CA peaks in
your HNCACB/HNcoCACB, leaving only the CBs to deal with. :-)
In general you could have an array of macros, one for each atom type.
Also, where there's only one match of spectrum dimension to the chemical
element of the atom type you wouldn't even have to type in a dim number.
> "Add to spin system":
> also applied to a selection of peaks rather than to a single one.
I assume you mean to add each peak to a different spin system? - As "Add
to spin system" already works with multiple peaks, but applies them to the
same spin system.
> Just for loughs below is how far i managed to poach other macros/functions
> for what needs to be in the first one:
>
> """Buckets need importing!"""
>
> def setAtomTypesToPeaks(argServer=None, peaks=None):
> """Descrn: Assigns atom type to all selected peaks
> Inputs: ArgumentServer, List of Nmr.Peaks, ???
> Output: ??
> """
> assert argServer or peaks
>
> if not peaks:
> peaks = argServer.getCurrentPeaks()
>
> for peak in peaks:
> """ select dimension """
> assignType(???,???)
from ccpnmr.analysis.AssignmentBasic import assignResonanceType
def setAtomTypesToPeaks(argServer, atomType=None):
"""Descrn: Assigns atom type to all selected peaks
Inputs: ArgumentServer, Word (Nmr.Resonance.assignName)
Output: None
"""
isotopeDict = {'C':'13C','H':'1H','N':'15N'}
peaks = argServer.getCurrentPeaks()
if not atomType:
atomType = argServer.askString('Atom Type:','CA')
if not atomType:
argServer.showWarning('No atom type specified')
return
atomType = atomType.upper()
isotope = isotopeDict.get(atomType[0])
if not isotope:
argServer.showWarning('No isotope found for %s atom type' % atomType)
return
project = argServer.getProject()
atomSet = project.findFirstAtomSet(name=atomType)
# We need an atomSet for assignResonanceType
if not atomSet:
argServer.showWarning('No atom sets in project of type %s' % atomType)
return
for peak in peaks:
for peakDim in peak.peakDims:
if peakDim.peakDimContribs:
if isotope in peakDim.dataDimRef.expDimRef.isotopeCodes:
for contrib in peakDim.peakDim.contribs:
assignResonanceType(contrib.resonance, [atomSet,])
def setCalphaToPeaks(argServer):
setAtomTypesToPeaks(argServer, atomType='CA')
def setCbetaToPeaks(argServer):
setAtomTypesToPeaks(argServer, atomType='CB')
-------------------------------------------------------------------------------
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- -------
-------------------------------------------------------------------------------
|