epam / NGB

New Genome Browser (NGB) - a Web - based NGS data viewer with unique Structural Variations (SVs) visualization capabilities, high performance, scalability, and cloud data support
MIT License
161 stars 40 forks source link

Feature count tracks shall support histogram view #521

Open mzueva opened 3 years ago

mzueva commented 3 years ago

Background

Due to #462, NGB supports featureCounts format. Currently, featureCounts tracks are displaying only in a single view type in the "Browser" - similar to genes or features. It would be convenient to support a histogram view as well - e.g. bar graph with heights proportionally to feature counts.

Approach

Add a new item to the featureCounts track header to have the ability to select a view type - Display. This item shall open a list of possible view types:

If the "Bar Graph" view is selected - featureCounts track shall be displayed as a histogram:

Example: image

In case when the origin featureCounts file has several source SAM/BAM files used as the input:

Example for the featureCounts track with 3 read counts sources: image

Example for the featureCounts track with 2 read counts sources and zoomed-out:
image

Note: on big scales with "Bar Graph" mode, to not confuse users we shall show only info message like "Zoom in to see features" (default zoom level threshold should be 10m bp).

Additionally, only in case of multi-inputs, the item "Sources" shall appear in the track header. User shall have the ability to click this item to select source SAM/BAM files to show as sub-tracks. By default, all sources (sub-tracks) shall be displayed: image

Notes:

Other options

For the histogram view:

mzueva commented 3 years ago

@rodichenko Some minor improvements:

NShaforostov commented 3 years ago

@rodichenko another minor improvement: When user opens the Manual scale pop-up (in the Bar Graph display mode):

Tatyana2022 commented 3 years ago

Bug was found: The checkbox setting for the "Log scale" field is not saved in Manual scale

Prerequisites

  1. Go to NGB
  2. Select SV_Sample_1.byGTF.featureCounts file in SV_Sample1 dataset
  3. Go to GENES panel
  4. Find gene with kras name using filter
  5. Click on found kras gene

Steps to reproduce:

  1. Go to Browser panel
  2. Go to Feature_Counts track in Browser panel from Prerequisite
  3. Select Bar Graph in Displays menu(if not select)
  4. Select Manual scale in Scale menu (if not select)
  5. Set checkbox in Log scale field
  6. Click Save button
  7. Reopen Manual Scale

Expected result: The checkbox is set to the Log scale field. Actual result: The checkbox is not set to the Log scale field. Extra Details: The checkbox is not set to the Log scale field in the Displays menu also

@rodichenko

Verified

Tatyana2022 commented 3 years ago

Bug was found: An error is displayed in the console when selected any one source and Log scale in multi track

Prerequisites: Open Console (F12)

Steps to reproduce:

  1. Go to NGB
  2. Go to DATASETS panel
  3. Select SV_Sample_multi.featureCounts file in SV_Sample1 dataset
  4. Go to BROWSER panel
  5. Set CHR 5: 31387327 - 31545365 coordinates
  6. Go to Feature_Counts track
  7. Set Bar Graph display (if not set)
  8. Set Log Scale display (if not set)
  9. Uncheck any one source (e.g. **sv_sample_1.bam)
  10. Look at console

Expected result: No errors in the console Actual result: An error displays in the console: app.bundle.js:514 Uncaught TypeError: Cannot read properties of null (reading 'height') at Sprite.get (app.bundle.js:514) at CoordinateSystem.value (app.bundle.js:1025) at BarChartSourceRenderer.value (app.bundle.js:1025) at app.bundle.js:1024 at Array.forEach (<anonymous>) at FCBarChartRenderer.value (app.bundle.js:1024) at FCBarChartRenderer.value (app.bundle.js:729) at FCBarChartRenderer.value (app.bundle.js:1024) at FeatureCountsTrack.value (app.bundle.js:1023) at FeatureCountsTrack.value (app.bundle.js:717)

Screenshots:

@mzueva @rodichenko

Verified

Tatyana2022 commented 3 years ago

Bug was found: Unable to uncheck a "Features" display

Prerequisites: Dataset = sv_sample1 File = sv_sample_1.byGTF.featureCounts

Steps to reproduce:

  1. Go to NGB
  2. Go to DATASETS panel
  3. Select dataset and file from Prerequisites
  4. Go to GENES panel
  5. Find gene with kras gene name
  6. Click on found gene
  7. Go to Feature_Counts track on BROWSER
  8. Set Features display (if not set)
  9. Click one more time on Features checkbox

Expected result: Features display should be unchecked. Bar Graph display should be selected automatically Actual result: Features display is still selected. Extra details: The Features checkbox is unchecked only after switching to the Bar graph display

@mzueva @rodichenko

Verified

rodichenko commented 3 years ago

@Tatyana2022

Bug was found: An error is displayed in the console when selected any one source and Log scale in multi track

and

Bug was found: Unable to uncheck a "Features" display

should be fixed by #595 and 8f1b3b5

Fixed

NShaforostov commented 3 years ago

Docs were added via #566 and located here.