Closed adamnovak closed 1 year ago
We also want the default colors for a track type to be consistent between e.g. the chunk extraction scripts and the client code. And we want them to be sensible; read colors should match the UCSC Genome Browser by default (where I think blue is forward and red is reverse), graph paths should highlight the reference path but make the others look distinct, and haplotype colors should be distinct from each other and distinct from path colors.
We might want to add some new named color schemes to make this all work, or revise/get rid of Ygreys
which was doing the work of trying to highlight the reference path by itself.
We will need to:
defaultGraphColorPalette
in the config: https://github.com/vgteam/sequenceTubeMap/blob/429fb486abc3a7fa500dfbfece00d067b33bcdc8/src/config.json#L68C1-L68C1config.json
, use jq
to read out the default track color settings from config.json
, and use those instead of hardcoded values in the script.config.json
. Reads should be blue on the forward strand and red on the reverse strand, which I think is what the UCSC genome browser does. Graph tracks should have a distinctive main palette (maybe a single color like #000000
?) for the primary reference, and some mutually distinct colors for the alt palette for the non-reference paths (of which we don't expect more than 2 or 3 to usually exist). Hapolotypes should probably use the rainbow colors preset by default on the main palette, and they don't actually use their alt palette. You can create new preset sets of colors if appropriate.Here's a relevant jq example:
[anovak@swords sequenceTubeMap]% cat src/config.json | jq '.defaultReadColorPalette'
{
"mainPalette": "blues",
"auxPalette": "reds",
"colorReadsByMappingQuality": false
}
[anovak@swords sequenceTubeMap]% READ_PALETTE="$(cat src/config.json | jq '.defaultReadColorPalette')"
[anovak@swords sequenceTubeMap]% echo "$READ_PALETTE"
{
"mainPalette": "blues",
"auxPalette": "reds",
"colorReadsByMappingQuality": false
}
Red should indeed mean reverse: https://genome.ucsc.edu/goldenPath/help/hgBamTrackHelp.html
In the solution for https://github.com/vgteam/sequenceTubeMap/issues/217 we found that, if you make a new track and then set its type, it keeps whatever default colors there are for a default created track. It doesn't magically adopt the default colors appropriate for the type of track you have made it be.
We should allow the default colors to differ depending on track type, and if you change track types it should reset the colors to sensible defaults for that track type.