Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#792 closed enhancement (fixed)

Add support for units to annotation values

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.9
Component: core Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

See trunk/doc/src/docbook/figures/uml/datalayer.annotations.png for an UML diagram.

Philippe wrote:

Hi Nicklas, base-developpers,

Dominic an myself are currently working on a MAGE-TAB*(http://www.mged.org/mage-tab/) importer for BASE2. The format allows specifying Units to qualify descriptors such as protocol parameter, experimental factors, biomaterial descriptors. I can be quite handy for instance when having to report doses ranges of various compound fed to animals. When trying to get the unit information in BASE2, we are facing the following: Essentially, in order to retain unit information, we have to 'squeeze the information in an Annotation Type of type string that will get the numerical value + the unit value represented in the MAGE-TAB document.

Several drawbacks in using this mechanism in BASE2

  • loss of data type
  • loss of data validation capability offered by BASE2 Annotation Type
  • loss of computation (using BASE formulas for instance) over numerical Annotation types.

The other option of creation several Annotation Type of type float with different labels to reflect unit changes, has serious User friendlyness issues.

Are there any plans to provide a support for units in BASE2 Annotation Type, and if so on which timeline ?

It is not on the timeline. I remember that we discussed it a long time ago, but it was never added as a ticket to the trac system. I think the earliest we can do is for the 2.6 relese. 2.5 is already overloaded with features.

Is it a viable options to alter Float Value and Integer Value for Annotation Type in BASE2 to allow for specification of units (possibly as free text in a first go) ?

Not if we want to do something better in the future. It is very hard to change a temporary solution.

(I reckon this would requires changes to the interface..)

Are we the only BASE2 users confronted with this units/annotation type pb and would there people out there interested in developing this feature and contribute it to BASE2 ?

I remember a few ideas that I had when this issue was discussed earlier.

  • A central registry of units that defines all possible units (much like we have for MIME types already).
  • To each (numerical) annotation type is an (optional) list of units that are possible to use.
  • When annotating an item the user can select one of the possible units as defined by the annotation type.

There will be some problems with queries:

  • If we ignore units: >=5 finds items with 5mg and 5g but not 2g
  • If we require exact match of unit: >=5mg finds items with 5mg but not 0.005g

A possible solution is to convert all unit-enabled annotations to a standard unit before they are stored in the database. For example, all weights are stored in grams. Query filters are also converted to the standard unit before they are applied. The original unit is remembered by each annotation and the values are converted back when displayed. A drawback is that the conversion can only work for float/double annotation values.

/Nicklas

Change History (34)

comment:1 by Nicklas Nordborg, 16 years ago

Milestone: BASE 2.x+BASE 2.9

comment:2 by Nicklas Nordborg, 16 years ago

Lots of units and conversion factors: http://www.convertworld.com

comment:4 by Nicklas Nordborg, 16 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:5 by Nicklas Nordborg, 16 years ago

(In [4538]) References #792: Add support for units to annotation values

First version of API design.

comment:6 by Nicklas Nordborg, 16 years ago

Description: modified (diff)

comment:7 by Nicklas Nordborg, 16 years ago

(In [4541]) References #792: Add support for units to annotation values

Major part of the core/data layer is in place, including some test code.

comment:8 by Nicklas Nordborg, 16 years ago

(In [4542]) References #792: Add support for units to annotation values

Add 'referenceOffset' to UML diagram.

comment:9 by Nicklas Nordborg, 16 years ago

(In [4543]) References #792: Add support for units to annotation values

Added web interface for handling units.

comment:10 by Nicklas Nordborg, 16 years ago

(In [4544]) References #792: Add support for units to annotation values

  • Made it possible to select a default unit for an annotation type
  • Display annotations with units on the "Annotations" tab in the single-item view
  • Test for displaying annotations with units in list pages on the Array designs list page

comment:11 by Nicklas Nordborg, 16 years ago

(In [4545]) References #792: Add support for units to annotation values

  • Change installation to use an XML file with unit information
  • Display symbols instead of names in quantities list

comment:12 by Nicklas Nordborg, 16 years ago

(In [4546]) References #792: Add support for units to annotation values

Add missing file and remove debug output.

comment:13 by Nicklas Nordborg, 16 years ago

(In [4547]) References #792: Add support for units to annotation values

  • Added support for selecting unit when annotating items
  • Display units for inherited annotations

comment:14 by Nicklas Nordborg, 16 years ago

(In [4548]) References #792: Add support for units to annotation values

Display/use annotation with units in the following places:

  • Experimental factors for an experiment
  • Experiment overview
  • Plot tool
  • Experiment explorer
  • Roles test program
  • Table exporter

comment:15 by Nicklas Nordborg, 16 years ago

(In [4549]) References #792: Add support for units to annotation values

Added force and frequency units.

comment:16 by Nicklas Nordborg, 16 years ago

(In [4552]) References #792: Add support for units to annotation values

Added 'density' and 'energy' units.

comment:17 by Nicklas Nordborg, 16 years ago

(In [4555]) References #792: Add support for units to annotation values

Made it possible to use units with filters

comment:18 by Nicklas Nordborg, 16 years ago

(In [4556]) References #792: Add support for units to annotation values

Re-calculate annotation values when factor/offset for a unit changes or when default unit for an annotation type is changed.

comment:19 by Nicklas Nordborg, 16 years ago

(In [4557]) References #792: Add support for units to annotation values

Made UnitSymbols.symbol a case-sensitive column so we can tell the difference between units with milli (m) and mega (M) prefixes.

comment:20 by Nicklas Nordborg, 16 years ago

(In [4558]) References #792: Add support for units to annotation values

Added units for power, pressure, electric potential and electric resistance.

comment:21 by Nicklas Nordborg, 16 years ago

(In [4560]) References #792: Add support for units to annotation values

All list pages can now display units.

comment:22 by Nicklas Nordborg, 16 years ago

(In [4561]) References #792: Add support for units to annotation values

Updated user documentation.

comment:23 by Nicklas Nordborg, 16 years ago

(In [4562]) References #792: Add support for units to annotation values

Added several new quantities:

comment:24 by Nicklas Nordborg, 16 years ago

(In [4565]) References #792: Add support for units to annotation values

Added some more units and fixed some bugs in existing units. Minor additions to documentation and web interface.

comment:25 by Nicklas Nordborg, 16 years ago

(In [4566]) References #792: Add support for units to annotation values

Added note about selecting quantity to the docs.

comment:26 by Nicklas Nordborg, 16 years ago

(In [4577]) References #792: Add support for units to annotation values

Make it possible to set role permissions for units and quantities through web interface.

comment:27 by Nicklas Nordborg, 16 years ago

(In [4596]) References #792: Add support for units to annotation values

Fixes a display issue for annotations without a unit (the string 'null' was displayed) in list pages.

comment:28 by Nicklas Nordborg, 16 years ago

(In [4608]) References #792: Add support for units to annotation values

Fixes javascript error for annotation types that can't use a unit.

comment:29 by Nicklas Nordborg, 16 years ago

Resolution: fixed
Status: assignedclosed

Seems to be working ok.

comment:30 by Nicklas Nordborg, 16 years ago

(In [4632]) References #792: Add support for units to annotation values

Fixes a permission problem with annotation flat file importer that doesn't try to use units, but still receieved a PermissionDeniedException

comment:31 by Nicklas Nordborg, 16 years ago

(In [4634]) References #792: Add support for units to annotation values

Use the value returned from DbEngine.getCaseSensitiveVarchar() and not the hard-coded one.

comment:32 by Nicklas Nordborg, 16 years ago

(In [4635]) References #792: Add support for units to annotation values

Use the non-greek versions of micro (?\194?\181) and ohm (?\206?\169) since those are more supported and recommended by SI.

comment:33 by Nicklas Nordborg, 16 years ago

(In [4650]) References #792: Add support for units to annotation values

Fixed some IE-related Javascript problems.

comment:34 by Nicklas Nordborg, 16 years ago

(In [4656]) References #792: Add support for units to annotation values

Test instructions should not use units in the annotation title anymore.

Note: See TracTickets for help on using tickets.