I'll answer what I can from the below.
(1) This is better answered by Tim or Rasmus, and involves experiment
types. (Of course this relies on the experiment type having been set by
the user.)
(2) Not sure I totally understand the question. The key of PeakContrib is
"serial" (a number automatically generated when you create a PeakContrib).
This is the key relative to the parent. So you can do something like:
peakContrib = peak.findFirstPeakContrib(serial=...)
The full key of an object is found by walking up the tree. So for
peakContrib it is
(peakContrib.serial,
peakContrib.peak.serial,
peakContrib.peak.peakList.serial,
peakContrib.peak.peakList.dataSource.serial,
peakContrib.peak.peakList.dataSource.experiment.serial)
(At each level in this example the key is serial, but that's a bit of an
accident, because there are no "natural" keys for these classes so we use
"serial" as a substitute.)
(3) x.abc is indeed the same as x.getAbc().
(4) peakDimContrib.dim is indeed the same as dataDim.dim for the
corresponding dataDim of dataSource. In the current API these things come
out as ordered lists but in the big change in the API (coming soon) most
links will not be ordered but sets. So don't rely on ordering if you
can avoid it (some of the Analysis code will need changing because of
this). Instead you can find the associated dataDim by doing something
like:
dataDim =
peakDimContrib.peakDim.peak.peakList.dataSource.findFirstDataDim(dim=peakDimContrib.dim)
We can add so-called derived attributes for cases like this if it seems
the expression will be used by lots of people, to avoid everybody having
to write that code. Indeed peakDimContrib.dim is one such derived
attribute, defined to be peakDimContrib.peakDim.dim.
Wayne
On Wed, 5 Apr 2006, Gary Thompson wrote:
> sorry more questions
>
> 1. if i am looking at a spectrum from the python world and it has two axes
> with identical isotope types eg 1h-15n-hsqc-1hnoesy. How do i tell/ can i tell
> from the python objects which is the 1H noe axis and which is the 1H hsqc axis
> nb I have noted that I can tell the direct dimension and indirect dimensions
> in the data model
>
> 2. peakContrib's appear according to the docs to have a keyword value you
> can serach on, but, when I try try to access it as a python object attribute
> there is nothing there how does this work?
>
> 3. the model provides access to attributes by function e.g.
> dataSource.getDataDims() is there any real difference between this form and
> using the relevant python attributes e.g.dataSource.dataDims
>
> 4. when you retrieve a dimContribs from a peak are they garunteed to be in
> the same order as the axes in it's dataSource, as you can navigate
>
> peak->peakContrib->dimContrib->Dim
>
> with dim being an integer presumambly in the data source
>
> regards
> gary
>
|