Ticket #611 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

Problems with spectrum viewer when many spectra

Reported by: fredrik Owned by: olle
Milestone: Proteios SE 2.9 Keywords:
Cc:

Description

If there are many spectra in a mzData or mzML file, the current spectrum inspector will write out the IDs of all, resulting in a long list which common browsers have problems displaying. A solution could be to display a maximum number of rows with spectrum ids per page, like in the Hits table for example. It would also be nice with a 'jump to next spectrum' feature, although not necessary if the above can be accomplished.

Change History

comment:1 Changed 2 years ago by olle

  • Status changed from new to assigned

Ticket accepted.

comment:2 Changed 2 years ago by olle

Traceability note:

  • 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.
  • 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).

comment:3 Changed 2 years ago by olle

Design discussion.

  • The suggestion in the ticket description that it should be possible to jump to the next spectrum in the spectrum list would indeed be helpful, especially if could be activated without needing to scroll down the form (provided that a reasonably large web browser window is used). It should be complemented by the possibility to jump to the previous spectrum. This functionality has therefore been given its own ticket, Ticket #616 (Spectrum File Inspector should have buttons for previous and next spectrum).

comment:4 Changed 2 years ago by olle

(In [3426]) Refs #616. Refs #611. Refs #540. Refs #287. Inspection of mass spectra stored in spectrum files updated with buttons to select previous or next spectrum in list:

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

client/servlet/ updated:

  1. Protected method void runMe() updated with new form to

support the tool-bar with two new spectrum iteration buttons in. It will be placed directly below the spectrum plot, above the zoom mass range selection form. The "Previous spectrum" and "Next spectrum" buttons will be coupled to an action link to the spectrum file inspector class, but with value of valid parameter PlotFileSpectrum.VSPECTRUMID set to the spectrum id string for the previous and next spectrum, respectively. The latter spectrum id strings are obtained by calling new convenience methods String fetchPreviousListItem(String currentItem, List<String inList) and String fetchNextListItem(String currentItem, List<String> inList). The button action is disabled if the spectrum id string to use is null, indicating that the start or end of the list is reached.

  1. New public convenience method

String fetchPreviousListItem(String currentItem, List<String> inList) added. It fetches the previous list item from the input string list. Returns null if current item is the first item in the list.

  1. New public convenience method

String fetchNextListItem(String currentItem, List<String> inList) added. It fetches the next list item from the input string list. Returns null if current item is the last item in the list.

  1. English dictionary file locale/en/dictionary in client/servlet/

updated with new entries for various string keys.

comment:5 Changed 2 years ago by olle

Design of solution for only showing part of the spectrum list.

Background:

The Scroller class was introduced in changeset [1206] in connection with work on the first TableFactory class, and was also used with the following TableFactory2 class, then via class ConfigureTableFactory2. The Scroller class will also be used to handle a page-managed spectrum list for this ticket, with code adapted from the use of the Scroller class in public method <E extends BasicItem> Table build() in class TableFactory.

Differences between previous use of the Scroller class the current one:

When Scroller was used for a table factory, the main form consisted of the generated table, and any selection of table items were made by clicking on an item in the table. In the case of inspecting mass spectra stored in a spectrum file, the spectrum can either be pre-selected (e.g. when a spectrum file cell in a Hits table is selected, and the hit has a non-null spectrum id), selected by the spectrum iterator buttons for previous and next spectrum, or by clicking on a spectrum in the list. In addition, the current spectrum can be re-drawn with new zoom settings. It is desirable that the interaction between the page-managed spectrum list and the other spectrum selection options simplifies for the user:

  • Selection of a new spectrum list page should not change the displayed spectrum or any zoom settings.
  • Selection or re-display of a spectrum in any way, should result in the spectrum list page containing the current spectrum being shown.

Design description from a more technical view:

  • Class InspectActiveSpectrumFile will be updated by having the spectrum list page-managed by the Scroller and ScrollTo classes, with code adapted from the use of the Scroller class in public method <E extends BasicItem> Table build() in class TableFactory. However, the InspectActiveSpectrumFile class itself will be used for table configuration action, instead of the SetTableConfiguration class used for TableFactory.
  • In order for the page links created by Scroller to work, the generated HTML code for the form containing the page-managed table must contain a hidden input tag specifying the action to be related to the table. For example, for a table named "peaklists" (the name used for the spectrum list table in InspectActiveSpectrumFile), public method Tag convert(org.proteios.gui.table.Table table) in class GUIConverter will create an outer form named "formOfpeaklists", and the required line is:

    <INPUT NAME="action" ID="formOfpeaklistsaction" TYPE="hidden"/>

    However, this line will only be added by the GUIConverter method if the table has a tool-bar. For this reason it is therefore necessary to add a tool-bar to the spectrum list table, even if no buttons are added. The first lines of the HTML code for the spectrum list table will then be (crucial line in bold):

    <TABLE CELLPADDING="0" CLASS="grid" CELLSPACING="0" WIDTH="100%">
    ...
    <FORM NAME="formOfpeaklists" ID="formOfpeaklists" METHOD="POST" ACTION="/proteios/app">
    <INPUT CLASS="hidden" TYPE="submit"/>
    <INPUT NAME="action" ID="formOfpeaklistsaction" TYPE="hidden"/>

  • The value of valid parameter VInteger Scroller.VFROM is set to the list starting index, when one off the Scroller page links are clicked. This value is therefore checked by InspectActiveSpectrumFile at an early stage to set a flag indicating if the page was selected by clicking on a page link; a null value indicates that this was not the case.
  • An integer instance variable itemsFrom (corresponding to variable queryFrom in TableFactory) indicates the list index to start from when creating the spectrum list table. If processing of the class was initiated by clicking on a page link, the value will be set by the link, otherwise it is set ensuring that the selected spectrum will be included in the displayed table page.
  • Valid parameters for other data needed to be transferred between spectrum display sessions are added, and set to current values in hidden text fields in the spectrum table.

comment:6 Changed 2 years ago by olle

(In [3433]) Refs #611. Refs #616. Refs #540. Refs #592. Inspection of mass spectra stored in spectrum files updated to use a page-managed spectrum list table:

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

client/servlet/ updated:

  1. New private instance variable int maxResults with public

accessor methods added. It stores the max number of items to be shown in the spectrum list table. Initially set to 20.

  1. New private instance variable int itemsFrom with public

accessor methods added. It stores the index of the first item to show in the spectrum list table. Initially set to 0.

  1. New private instance variable boolean pageSelectedFromScroller

with public accessor methods added. It stores a flag indicating that page is selected by clicking a page link. Currently set to false.

  1. Protected method void runMe() updated to support page-managed

spectrum list using Scroller and ScrollTo classes. The value of valid parameters VInteger Scroller.VFROM and VInteger Scroller.VMAXRESULT are checked at an early stage to set a flag indicating if the page was selected by clicking on a page link. If so, the value of integer instance variable itemsFromwill be set to the value of Scroller.VFROM, otherwise it is set ensuring that the selected spectrum will be included in the displayed table page. A tool-bat is added to the spectrum list table, to ensure that GUConverter will add a hidden input tag specifying the action to be related to the table in the created HTML code, as this line is necessary for the page links created by the Scroller class to work. Valid parameters for other data needed to be transferred between spectrum display sessions are added, and set to current values in hidden text fields in the spectrum table.

  1. New public convenience method

Integer fetchStringListItemIndex(String currentItem, List<String> inList) added. It fetches index for an item from from string list.

  1. New private convenience method private void restoreScrollerState()

added. It restores table scroller settings stored as valid parameters.

comment:7 Changed 2 years ago by olle

  • severity changed from 4 to 16

Severity set to 16, since the generated HTML code for the form containing the page-managed table needed to contain a hidden input tag specifying the action to be related to the table (thanks to Gregory Vincic for explaining the details around this).

comment:8 Changed 2 years ago by olle

  • Status changed from assigned to closed
  • Resolution set to fixed

Ticket closed as the spectrum list table now is page-managed, when the number of spectra is large (>20).

Note: See TracTickets for help on using tickets.