Skip to content

Commit

Permalink
swap significance_colors indices
Browse files Browse the repository at this point in the history
  • Loading branch information
asizemore committed Apr 17, 2023
1 parent 26fba4d commit 6d62e39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/libs/components/src/plots/VolcanoPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ function assignSignificanceColor(
pValue: number,
significanceThreshold: number,
log2FoldChangeThreshold: number,
significanceColors: string[] // Assuming the order is [high (up regulated), low (down regulated), insignificant]
significanceColors: string[] // Assuming the order is [insignificant, high (up regulated), low (down regulated)]
) {
// Name indices of the significanceColors array for easier accessing.
const HIGH = 0;
const LOW = 1;
const INSIGNIFICANT = 2;
const INSIGNIFICANT = 0;
const HIGH = 1;
const LOW = 2;

// Test 1. If the y value is higher than the significance threshold, just return not significant
if (pValue >= significanceThreshold) {
Expand Down
4 changes: 2 additions & 2 deletions packages/libs/components/src/types/plots/addOns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ export const gradientConvergingColorscaleMap = scaleLinear<string>()
.range(ConvergingGradientColorscale)
.interpolate(interpolateLab);

// Significance colors
export const significanceColors = ['#AC3B4E', '#0E8FAB', '#B5B8B4'];
// Significance colors (not significant, high, low)
export const significanceColors = ['#B5B8B4', '#AC3B4E', '#0E8FAB'];

/** truncated axis flags */
export type AxisTruncationAddon = {
Expand Down

0 comments on commit 6d62e39

Please sign in to comment.