Opened 10 years ago

Closed 10 years ago

#618 closed (fixed)

Spectrum viewers should show mass values as tool-tips

Reported by: olle Owned by: olle
Milestone: Proteios SE 2.10 Keywords:
Cc:

Description

Spectrum viewers should show mass values as tool-tips, when the mouse pointer is in the vicinity of a mass peak, at least for the mass peaks dominating their near-by mass range. The mass range to use should be chosen to show tool-tips for many peaks, while still not increase the size of the web page more than that most web browsers can handle it. The functionality is intended to complement that of zooming a spectrum, not replacing the latter.

Change History (10)

comment:1 Changed 10 years ago by olle

Status: newassigned

Ticket accepted.

comment:2 Changed 10 years ago by olle

Traceability note:

  • Class ViewActivePeakList was introduced in changeset [801] 2006-10-25 12:33:56.
  • Class PlotSpectrum was introduced in changeset [922] 2006-11-15 14:37:40..
  • The extension project for SpectrumFileInspectorExtension currently includes four tickets:

    1. Ticket #1 (Extension to inspect spectra in a selected spectrum file).
    2. Ticket #2 (Extension documentation).
    3. Ticket #3 (Spectrum File Inspector Extension should display Spectrum Properties).
    4. Ticket #4 (Spectrum File Inspector Extension should display Spectrum File Info).
    5. Ticket #5 (Spectrum File Inspector Extension should forward action to InspectActiveSpectrumFile).

    Since extension SpectrumFileInspectorExtension now relies on class InspectActiveSpectrumFile for its functionality, it is only needed to update the latter class.
  • Mass value annotation in displayed mass spectra was introduced in Ticket #425 (Show mass values for some peaks in mass spectra).
  • Class InspectActiveSpectrumFile was introduced in ticket #540 (Peaklist file cell in Hits table should have view action for inspecting the spectrum file).
  • Zooming of spectra was introduced in Ticket #592 (zoom in spectra).
  • Spectrum display was updated in Ticket #609 (Spectrum peaks displayed as wide).
  • Spectrum file viewer was updated in Ticket #611 (Problems with spectrum viewer when many spectra).
  • Spectrum file viewer was updated in Ticket #616 (Spectrum File Inspector should have buttons for previous and next spectrum).

comment:3 Changed 10 years ago by Fredrik Levander

Could we have masses with 4 decimals as default here?

comment:4 Changed 10 years ago by olle

Design discussion:

Design related to display of mass values as tool-tips:

  • The same approximate mapping of mass peaks to image location as used in class PeakAnnotationUtil will be used.
  • Class/file action/peakList/PeakAnnotationUtil.java in client/servlet/ will be updated with methods for creating an image map for an input spectrum.
  • An image map for a mass peak will be a one-pixel wide rectangle (start and stop x-values differ by 1) with a top y-value at the top of the mass peak, and bottom y-value at the spectrum base-line.
  • In order not to create more HTML image map tags than needed, if several mass peaks fall inte the same one-pixel width range, the image map should be created for the largest mass peak in the range. This will limit the number of image map tags to at most the width of the spectrum in pixels.
  • The mass value displayed in the tool-tip might have more decimals than used for the fixed mass annotation, as only one tool-tip will be shown at any one time, and there is therefore no problem with mass annotations for different peaks overlapping. The default will be to display 4 decimals.

Design related to display of tool-tips coupled to an image map:

  • Display of tool-tips in the web browser will be based on DHTML JavaScript code in example in http://www.dynamicdrive.com/dynamicindex5/texttool.htm, where tool-tips coupled to an image map are shown. The web site home page http://www.dynamicdrive.com/ describes the site as "the #1 place on the net to obtain free, original DHTML & Javascripts to enhance your web site", so there should be no problem using the scripts.
  • Two new classes/files, gui/ImageMap.java and gui/ImageMapArea.java, both in client/servlet/, for storing data related to an image map related to an image object.
  • Class/file gui/Image.java in client/servlet/ is updated to support an ImageMap instance variable.
  • Two new HTML Tag classes/files, se/lu/thep/waf/dom/html/Map.java and se/lu/thep/waf/dom/html/Area.java, both in api/waf/, for creating HTML image maps.
  • Class/file src/se/lu/thep/waf/dom/html/Img.java in api/waf/ updated with new public method Img setUsemap(String usemap) to set a usemap attribute.
  • JavaScript file www/static/js/script.js in client/servlet/ will be updated with two new functions, showtip(current,e,text) and hidetip().
  • Class/file gui/web/GUIConverter.java in client/servlet/ updated in public method Tag convert(Image img) to transfer optional image map data in input Image object to an HTML Map tag in current div tag, and set a reference in created HTML Img tag to the image map tag. The new JavaScript functions showtip(current,e,text) and hidetip() will be used to support tool-tips.

comment:5 Changed 10 years ago by olle

(In [3441]) Refs #618. Support of image maps with optional HTML link and tool-tip added:

  1. Two new classes/files added, gui/ImageMap.java and

gui/ImageMapArea.java, both in client/servlet/, for storing data related to an image map related to an image object.

  1. Class/file gui/Image.java in client/servlet/ updated to

support an ImageMap instance variable.

  1. Two new HTML Tag classes/files added,

se/lu/thep/waf/dom/html/Map.java and se/lu/thep/waf/dom/html/Area.java, both in api/waf/, for creating HTML image maps.

  1. Class/file src/se/lu/thep/waf/dom/html/Img.java in api/waf/

updated with new public method Img setUsemap(String usemap) to set a usemap attribute.

  1. JavaScript file www/static/js/script.js in client/servlet/

updated with two new functions, showtip(current,e,text) and hidetip(), based on DHTML JavaScript code in example in http://www.dynamicdrive.com/dynamicindex5/texttool.htm

  1. Class/file gui/web/GUIConverter.java in client/servlet/ updated

in public method Tag convert(Image img) to transfer optional image map data in input Image object to an HTML Map tag in current div tag, and set a reference in created HTML Img tag to the image map tag. The new JavaScript functions showtip(current,e,text) and hidetip() will be used to support tool-tips.

comment:6 Changed 10 years ago by olle

(In [3442]) Refs #618. Refs #425. Refs #592. Inspection of mass spectra stored in spectrum files or in the database updated to show mass values as tool-tips for peaks, when the mouse pointer is in the vicinity of a mass peak, if the latter dominates its near-by mass range:

  1. Class/file action/peakList/PeakAnnotationUtil.java in

client/servlet/ updated:

  1. Public method

void annotateMassValues(BufferedImage image, SpectrumInterface spectrum) updated with minor changes in comments and debug output.

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips(SpectrumInterface spectrum, int imageWidth, int imageHeight) added. It creates mass peak annotation tool-tips for HTML.

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips( double[] massArray, double[] intensityArray, int width, int height, int spectrumAreaWidth, int spectrumAreaHeight, int xSpectrumOffsetLeft, int ySpectrumOffsetBottom, int yInnerAreaOffsetBottom, double massMin, double massRange, double maxIntensity, int numberOfDecimals) added. It creates mass peak annotation tool-tips for HTML.

  1. Class/file action/peakList/PlotFileSpectrum.java in

client/servlet/ updated:

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer spectrumFileId, String spectrumId, String massCutoffLowStr, String massCutoffHighStr) added. It creates mass peak annotation tool-tips for HTML, by calling new public method SpectrumInterface fetchSpectrum(DbControl dc, Integer spectrumFileId, String spectrumId, Float massCutoffLow, Float massCutoffHigh) and public method ImageMap fetchMassPeakAnnotationToolTips(SpectrumInterface spectrum, int imageWidth, int imageHeight) in class PeakAnnotationUtil.

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer spectrumFileId, String spectrumId, Float massCutoffLow, Float massCutoffHigh) added. It creates mass peak annotation tool-tips for HTML, by calling new public method SpectrumInterface fetchSpectrum(DbControl dc, Integer spectrumFileId, String spectrumId, Float massCutoffLow, Float massCutoffHigh) and public method ImageMap fetchMassPeakAnnotationToolTips(SpectrumInterface spectrum, int imageWidth, int imageHeight) in class PeakAnnotationUtil.

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer spectrumFileId, String spectrumId, Float massCutoffLow, Float massCutoffHigh, int imageWidth, int imageHeight) added. It creates mass peak annotation tool-tips for HTML, by calling new public method SpectrumInterface fetchSpectrum(DbControl dc, Integer spectrumFileId, String spectrumId, Float massCutoffLow, Float massCutoffHigh) and public method ImageMap fetchMassPeakAnnotationToolTips(SpectrumInterfac spectrum, int imageWidth, int imageHeight) in class PeakAnnotationUtil.

  1. New public method

SpectrumInterface fetchSpectrum(DbControl dc, Integer spectrumFileId, String spectrumId, Float massCutoffLow, Float massCutoffHigh) added. It fetches spectrum given spectrum file id, spectrum id, and zoom limit parameters.

  1. Class/file action/file/InspectActiveSpectrumFile.java in

client/servlet/ updated:

  1. Protected method void runMe() updated by obtaining an image

map with mass annotation tool-tips by calling new public method ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer spectrumFileId, String spectrumId, String massCutoffLowStr, String massCutoffHighStr) in class PlotFileSpectrum and attaching it to the created spectrum plot image.

  1. Class/file action/peakList/PlotSpectrum.java in

client/servlet/ updated:

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer peakListId, String massCutoffLowStr, String massCutoffHighStr) added. It creates mass peak annotation tool-tips for HTML, by calling new public method SpectrumInterface fetchSpectrum(DbControl dc, Integer peakListId, Float massCutoffLow, Float massCutoffHigh) and public method ImageMap fetchMassPeakAnnotationToolTips(SpectrumInterface spectrum, int imageWidth, int imageHeight) in class PeakAnnotationUtil.

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer peakListId, Float massCutoffLow, Float massCutoffHigh) added. It creates mass peak annotation tool-tips for HTML, by calling new public method SpectrumInterface fetchSpectrum(DbControl dc, Integer peakListId, Float massCutoffLow, Float massCutoffHigh) and public method ImageMap fetchMassPeakAnnotationToolTips(SpectrumInterface spectrum, int imageWidth, int imageHeight) in class PeakAnnotationUtil.

  1. New public method

ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer peakListId, Float massCutoffLow, Float massCutoffHigh, int imageWidth, int imageHeight) added. It creates mass peak annotation tool-tips for HTML, by calling new public method SpectrumInterface fetchSpectrum(DbControl dc, Integer peakListId, Float massCutoffLow, Float massCutoffHigh) and public method ImageMap fetchMassPeakAnnotationToolTips(SpectrumInterface spectrum, int imageWidth, int imageHeight) in class PeakAnnotationUtil.

  1. New public method

SpectrumInterface fetchSpectrum(DbControl dc, Integer peakListId, Float massCutoffLow, Float massCutoffHigh) added. It fetches spectrum given spectrum id and zoom limit parameters.

  1. Class/file action/peakList/ViewActivePeakList.java in

client/servlet/ updated:

  1. Public method void runMe() updated by obtaining an image

map with mass annotation tool-tips by calling new public method ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer peakListId, String massCutoffLowStr, String massCutoffHighStr) in class PlotSpectrum and attaching it to the created spectrum plot image.

comment:7 Changed 10 years ago by olle

(In [3446]) Refs #425. Refs #618. Classes/files action/peakList/PlotFileSpectrum.java and action/peakList/PlotSpectrum.java in client/servlet/ updated with fix of typos in variable names, in order to make the code more clear:

  1. Class/file action/peakList/PlotFileSpectrum.java in

client/servlet/ updated in protected method void runMe() by changing name of variable peakAnnotaionUtil to peakAnnotationUtil.

  1. Class/file action/peakList/PlotSpectrum.java in

client/servlet/ updated in protected method void runMe() by changing name of variable peakAnnotaionUtil to peakAnnotationUtil.

comment:8 Changed 10 years ago by olle

(In [3447]) Refs #618. Refs #425. Refs #592. Classes/files action/file/InspectActiveSpectrumFile.java and action/peakList/ViewActivePeakList.java in client/servlet/ updated by removal of log output for image map:

  1. Class/file action/file/InspectActiveSpectrumFile.java in

client/servlet/ updated in protected method void runMe() by removal of log output for image map.

  1. Class/file action/peakList/ViewActivePeakList.java in

client/servlet/ updated in public method void runMe() by removal of log output for image map.

comment:9 Changed 10 years ago by olle

(In [3448]) Refs #618. Refs #425. Refs #592. Classes/files action/hit/ViewActiveHitSpectrum.java and action/spectrumSearch/ViewActivePeptideSearchResult.java in client/servlet/ updated to show mass values as tool-tips for peaks, when the mouse pointer is in the vicinity of a mass peak, if the latter dominates its near-by mass range:

  1. Class/file action/hit/ViewActiveHitSpectrum.java

in client/servlet/ updated in public method void runMe() by obtaining an image map with mass annotation tool-tips by calling new public method ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer spectrumFileId, String spectrumId, String massCutoffLowStr, String massCutoffHighStr) in class PlotFileSpectrum and attaching it to the created spectrum plot image.

  1. Class/file action/spectrumSearch/ViewActivePeptideSearchResult.java

in client/servlet/ updated in public method void runMe() by obtaining an image map with mass annotation tool-tips by calling new public method ImageMap fetchMassPeakAnnotationToolTips(DbControl dc, Integer spectrumFileId, String spectrumId, String massCutoffLowStr, String massCutoffHighStr) in class PlotFileSpectrum and attaching it to the created spectrum plot image.

comment:10 Changed 10 years ago by olle

Resolution: fixed
Status: assignedclosed

Ticket closed as the requested functionality has been added.

Note: See TracTickets for help on using tickets.