Skip to content

Commit dc7cda3

Browse files
authored
Fix up client for tall differential expression (#1595)
Note: dimensionality-reduction still TO DO - PCA is commented out. Some notes on this in CLAUDE-going-tall-next-steps.md * Enhance variable constraints system to filter on variableIds and implement basic InputVariables pickers for DE compute * next steps documentation * resolve some keyless list react errors * upgrade visx and revert Jeremy's fork to see what's going on * cleaned up notebook typing and null safety * remove duplication * small fix for new wdkState typing * wiring of EDA notebook to WDK params eda_analysis_spec, eda_dataset_id and eda_notebook_type * first fixes for stale state issues * improve verbiage * fix janky state updates in 'Comparison Group' dropdowns * auto section numbering * update Claude progress * add sense/antisense variable ID support * make compatible variables toggle work and add it by default * move metadata variable into the InputVariables system to get proper entity constraints, 'only show compatible vars' and cancel button functionality
1 parent f31e0e4 commit dc7cda3

29 files changed

Lines changed: 1672 additions & 1190 deletions

CLAUDE-going-tall-next-steps.md

Lines changed: 688 additions & 0 deletions
Large diffs are not rendered by default.

packages/libs/components/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"@typescript-eslint/eslint-plugin": "^5.46.0",
1313
"@typescript-eslint/parser": "^5.46.0",
1414
"@veupathdb/coreui": "workspace:^",
15-
"@visx/axis": "^3.1.0",
16-
"@visx/brush": "^3.0.1",
17-
"@visx/gradient": "^1.0.0",
18-
"@visx/group": "^1.0.0",
19-
"@visx/hierarchy": "^1.0.0",
20-
"@visx/shape": "^1.4.0",
21-
"@visx/text": "^1.3.0",
22-
"@visx/tooltip": "^1.3.0",
23-
"@visx/visx": "^1.1.0",
24-
"@visx/xychart": "https://github.com/jernestmyers/visx.git#visx-xychart",
15+
"@visx/axis": "^3.12.0",
16+
"@visx/brush": "^3.12.0",
17+
"@visx/gradient": "^3.12.0",
18+
"@visx/group": "^3.12.0",
19+
"@visx/hierarchy": "^3.12.0",
20+
"@visx/shape": "^3.12.0",
21+
"@visx/text": "^3.12.0",
22+
"@visx/tooltip": "^3.12.0",
23+
"@visx/visx": "^3.12.0",
24+
"@visx/xychart": "^3.12.0",
2525
"bootstrap": "^4.5.2",
2626
"color-math": "^1.1.3",
2727
"d3": "^7.1.1",

packages/libs/components/src/plots/NetworkPlot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { ToImgopts } from 'plotly.js';
2121
import { gray } from '@veupathdb/coreui/lib/definitions/colors';
2222
import { ExportPlotToImageButton } from './ExportPlotToImageButton';
2323
import { plotToImage } from './visxVEuPathDB';
24-
import { GlyphTriangle } from '@visx/visx';
24+
import { GlyphTriangle } from '@visx/glyph';
2525
import { Option as NodeLabelProp } from '../components/plotControls/MultiSelect';
2626

2727
import './NetworkPlot.css';

packages/libs/components/src/plots/VolcanoPlot.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
AnnotationLabel,
2525
Tooltip,
2626
} from '@visx/xychart';
27-
import findNearestDatumXY from '@visx/xychart/lib/utils/findNearestDatumXY';
2827
import { Group } from '@visx/group';
2928
import {
3029
gridStyles,
@@ -35,7 +34,7 @@ import {
3534
} from './visxVEuPathDB';
3635
import { Polygon } from '@visx/shape';
3736
import { useContext } from 'react';
38-
import { PatternLines } from '@visx/visx';
37+
import { PatternLines } from '@visx/pattern';
3938
import Spinner from '../components/Spinner';
4039
// For screenshotting
4140
import { ToImgopts } from 'plotly.js';
@@ -296,7 +295,6 @@ function VolcanoPlot(props: VolcanoPlotProps, ref: Ref<HTMLDivElement>) {
296295
],
297296
zero: false,
298297
}}
299-
findNearestDatumOverride={findNearestDatumXY}
300298
margin={{
301299
top: MARGIN_DEFAULT,
302300
right: showFlooredDataAnnotation ? 150 : MARGIN_DEFAULT + 10,
@@ -322,6 +320,7 @@ function VolcanoPlot(props: VolcanoPlotProps, ref: Ref<HTMLDivElement>) {
322320
comparisonLabels.map((label, ind) => {
323321
return (
324322
<Annotation
323+
key={ind}
325324
datum={{
326325
x: [xAxisMin, xAxisMax][ind], // Labels go at extremes of x axis
327326
y:
@@ -428,7 +427,6 @@ function VolcanoPlot(props: VolcanoPlotProps, ref: Ref<HTMLDivElement>) {
428427
data={data.statistics}
429428
{...dataAccessors}
430429
colorAccessor={(d: VolcanoPlotDataPoint) => d.significanceColor}
431-
findNearestDatumOverride={findNearestDatumXY}
432430
/>
433431
</Group>
434432
<Tooltip<VolcanoPlotDataPoint>

packages/libs/coreui/src/components/forms/NumberedHeader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react';
1+
import { ReactNode } from 'react';
22

33
export type NumberedHeaderProps = {
44
number: number;
5-
text: string;
5+
children: ReactNode;
66
color?: string;
77
};
88

@@ -48,7 +48,7 @@ export default function NumberedHeader(props: NumberedHeaderProps) {
4848
fontWeight: 'bold',
4949
}}
5050
>
51-
{props.text}
51+
{props.children}
5252
</div>
5353
</div>
5454
);

packages/libs/eda/src/lib/core/components/computations/ComputationStepContainer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type ComputationStepContainer = {
88
children: React.ReactChild;
99
computationStepInfo: {
1010
stepNumber: NumberedHeaderProps['number'];
11-
stepTitle: NumberedHeaderProps['text'];
11+
stepTitle: string;
1212
color?: NumberedHeaderProps['color'];
1313
};
1414
isStepDisabled?: boolean;
@@ -35,9 +35,10 @@ export function ComputationStepContainer(props: ComputationStepContainer) {
3535
{showStepNumber && (
3636
<NumberedHeader
3737
number={computationStepInfo.stepNumber}
38-
text={computationStepInfo.stepTitle}
3938
color={isStepDisabled ? 'darkgrey' : primaryColor}
40-
/>
39+
>
40+
{computationStepInfo.stepTitle}
41+
</NumberedHeader>
4142
)}
4243
{children}
4344
</div>

packages/libs/eda/src/lib/core/components/computations/Utils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,15 @@ export function partialToCompleteCodec<T extends {}>(
404404
): t.TypeC<T> {
405405
return t.type(partialCodec.props);
406406
}
407+
408+
/**
409+
* Stable IDs for gene expression variables in tall format.
410+
* These IDs are used to identify specific variables in the differential expression plugin.
411+
*/
412+
export const GENE_EXPRESSION_STABLE_IDS = {
413+
IDENTIFIER: 'VEUPATHDB_GENE_ID',
414+
COUNT: 'SEQUENCE_READ_COUNT',
415+
COUNT_SENSE: 'SEQUENCE_READ_COUNT_SENSE',
416+
COUNT_ANTISENSE: 'SEQUENCE_READ_COUNT_ANTISENSE',
417+
NORMALIZED: 'NORMALIZED_EXPRESSION',
418+
} as const;

0 commit comments

Comments
 (0)