Open NShaforostov opened 3 years ago
@NShaforostov @mzueva
API: Add the ability to read the conditions that define "variants of interest" from the JSON-file (e.g.
interest_conditions.json
). Such file will be placed on the server sideWhen the functionality is enabled:
- at the
VARIANTS
panel, rows background of those variants that matches "interest" conditions, should be highlighted in the configured color, e.g.:
how these conditions will be calculated - on the server-side (by providing a calculated result as a property of variant, e.g. highlighted=true
) or on the client?
highlighted
property for each variant;TBD for client-side calculation: how often should we fetch those conditions: on every VCF data request / once per session / once per datasets etc.?
@rodichenko I think highlight
value shall be calculated on the client, I'd suggest to use an existing endpoint "/defaultTrackSettings"
to get these settings.
@mzueva sure, it's definitely the only option after the last edition of the issue 😃
As only admins can configure profiles, it may be useful to show info about the certain profile - for "general" users.
For that, add an "Info" icon near the profile selected in the Settings, e.g.:
When user clicks that icon - the profile short description is shown in a tooltip, e.g.:
Here, a list of all configured profile's conditions and the corresponding highlighting colors should be displayed.
Think about highlighting variants of interest, when the big scale is set for the browser. Via the implementation described above (in the issue), variants of interest can be not very noticeable if for the browser the big scale is set. Perhaps, another approach is required for highlighting in such case.
Example of the testing profile:
{
"testing_profile" : {
"is_default" : true,
"conditions" : [
{
"highlight_color" : "0083FF",
"condition" : "('ReadPosRankSum' > '1') and ('ReadPosRankSum' < '3') and ('Dp' <= '200')"
},
{
"highlight_color" : "FF00B2",
"condition" : "('ReadPosRankSum' < '-1') and ('ReadPosRankSum' > '-3') and ('Dp' <= '200')"
},
{
"highlight_color" : "D8FF00",
"condition" : "(('BaseQRankSum' > '1') or ('BaseQRankSum' < '-1')) and ('Mq' > '83') and ('Dp' > '260')"
},
{
"highlight_color" : "149150",
"condition" : "('Dp' in '[386, 435]') and ('Sor' == '1.461')"
},
{
"highlight_color" : "CE632D",
"condition" : "('Dp' in '[386, 435]') and (('Sor' == '1.461') or ('Sor' == '1.227'))"
}
]
}
}
Should be tested on "dm6_data" dataset. Check the following position:
12592259
- here should be 2 variants highlighted by different colors (0083FF
and FF00B2
)12591884-12591885
- here should be 2 neighboring variants highlighted by the same color (D8FF00
)12591627-12591629
- here should be 2 neighboring variants highlighted by different colors (149150
and CE632D
)
Background
VCF files may include a large number of variations and it would be helpful to highlight variants of interest based on INFO field values. NGB shall provide an option to configure set of filters (highlight profiles) and highlight variants matching filter in Variation table and VCF track.
Approach
API:
Add the ability to read the conditions that define "variants of interest" from the JSON-file (e.g.
interest_profiles.json
). Such file will be placed on the server side. Content from that file should be read every time on the data update (to provide a hot swap of the conditions if needs). This file should contain a list of profiles. Each of these profiles shall include an own set of conditions by which "variants of interest" can be defined.The format of that file should be the following:
Where:
"is_default" : "true"
) - only first of them becomes "default" profile, other are ignoredcolor should be specified in HEX
)Each
<condition_set>
should have a structure:Where:
'ac'
,"mp"
,'excess het'
)==
- equals - for string, numeric and boolean values!=
- not equals - for string, numeric and boolean values>
- greater than - for numeric values>=
- greater than or equal to - for numeric values<
- less than - for numeric values<=
- less than or equal to - for numeric valuesin
- in - for arraysnotin
- not in - for arrays'2'
,"true"
,'[1, 10, 22]'
)and
or
There should be the ability to make up more complex sets from several comparisons by rules of Boolean algebra, using additional brackets, e.g.:
((<comparison1>) or (<comparison2>)) and ((<comparison3>) or (<comparison4>))
.Example of the profile:
By the example above, the default profile was described that has the following properties - variants of interest will be highlighted in color #FFBDBD if they match both conditions: allele count equals 2 and mapping quality greater than or equals to 80.
GUI:
Users shall have the ability to enable/disable highlighting of the "variants of interests". For that, the corresponding block shall be added into the![image](https://user-images.githubusercontent.com/45459424/116296964-7dfa5e00-a7a3-11eb-85fe-e579b3a87103.png)
VCF
tab of the main settings, e.g.:When the corresponding checkbox is enabled, the dropdown list with all profiles shall appear, e.g.:![image](https://user-images.githubusercontent.com/45459424/116299106-f2360100-a7a5-11eb-9d24-6d25e6acec78.png)
In this dropdown list:
When user selects the profile and saves changes:
VARIANTS
panel, rows background of those variants that matches "interest" conditions, should be highlighted in the profile color, e.g.:vcf
tracks, background of those variants that matches "interest" conditions, should be highlighted in the profile color, e.g.:BND
type of variants:BND
variant doesn't match the profile conditions and shall not be highlighted - described label should not be highlighted at all (currently, it is being always highlighted in yellow)vcf
tracks, when several variants are merged into a "bubble" and among them there are some variants of interest from different condition sets - such "bubble" should be highlighted in all corresponding colors (like pie chart diagram). Details of "bubble" highlighting: