Skip to content

Commit

Permalink
Merge pull request #332 from vgteam/highlightReferencePaths
Browse files Browse the repository at this point in the history
Highlight reference paths
  • Loading branch information
adamnovak authored Aug 31, 2023
2 parents 586b044 + c739059 commit dbbdf1e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/components/TrackSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const TrackSettings = ({

function colorRenderSwitch(fileType) {
switch(fileType) {
case "graph":
case "haplotype":
return(
<Form>
Expand All @@ -64,13 +63,14 @@ export const TrackSettings = ({
</Row>
</Form>
);
case "graph":
case "read":
return(
<Form>
<Row>
<Col className="radio-row">
<RadioRow
rowHeading="Forward Reads"
rowHeading={fileType === "read" ? "Forward Reads" : "Reference Path"}
color={trackColorSettings.mainPalette}
setting="mainPalette"
setColorSetting={setTrackColorSetting}
Expand All @@ -90,7 +90,7 @@ export const TrackSettings = ({
<Row>
<Col className="radio-row">
<RadioRow
rowHeading="Reverse Reads"
rowHeading={fileType === "read" ? "Reverse Reads" : "Non-Reference Path"}
color={trackColorSettings.auxPalette}
setting="auxPalette"
setColorSetting={setTrackColorSetting}
Expand Down
4 changes: 2 additions & 2 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
},

"defaultReadColorPalette" : {
"mainPalette": "reds",
"auxPalette": "blues",
"mainPalette": "blues",
"auxPalette": "reds",
"colorReadsByMappingQuality": false
},

Expand Down
11 changes: 6 additions & 5 deletions src/util/tubemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2480,18 +2480,19 @@ function generateTrackColor(track, highlight) {
// Don't repeat the color of the first track (reference) to highilight is better.
// TODO: Allow using color 0 for other schemes not the same as the one for the reference path.
// TODO: Stop reads from taking this color?

const colorSet = getColorSet(config.colorSchemes[sourceID].mainPalette);
if (track.id === 0 || colorSet.length === 1) {
trackColor = colorSet[0];
const auxColorSet = getColorSet(config.colorSchemes[sourceID].auxPalette);
const primaryColorSet = getColorSet(config.colorSchemes[sourceID].mainPalette);
if (track.id === 0) {
trackColor = primaryColorSet[0];
} else {
trackColor = colorSet[((track.id - 1) % (colorSet.length - 1)) + 1];
trackColor = auxColorSet[((track.id - 1) % (auxColorSet.length))];
}
} else {
const colorSet = getColorSet(config.exonColors);
trackColor = colorSet[track.id % colorSet.length];
}
}
console.log("trackColor:", trackColor)
return trackColor;
}

Expand Down

0 comments on commit dbbdf1e

Please sign in to comment.