diff --git a/packages/libs/eda/src/lib/core/components/computations/plugins/differentialabundance.tsx b/packages/libs/eda/src/lib/core/components/computations/plugins/differentialabundance.tsx index e022caaf28..8dedad88af 100644 --- a/packages/libs/eda/src/lib/core/components/computations/plugins/differentialabundance.tsx +++ b/packages/libs/eda/src/lib/core/components/computations/plugins/differentialabundance.tsx @@ -35,7 +35,6 @@ import { GetBinRangesProps, getBinRanges, } from '../../../../map/analysis/utils/defaultOverlayConfig'; -import { config } from 'process'; const cx = makeClassNameHelper('AppStepConfigurationContainer'); @@ -91,7 +90,13 @@ export const plugin: ComputationPlugin = { createDefaultConfiguration: () => undefined, isConfigurationValid: isCompleteDifferentialAbundanceConfig, visualizationPlugins: { - volcanoplot: volcanoPlotVisualization, // Must match name in data service and in visualization.tsx + volcanoplot: volcanoPlotVisualization.withOptions({ + getPlotSubtitle(config) { + if (DifferentialAbundanceConfig.is(config)) { + return `Differential abundance computed using ${config.differentialAbundanceMethod} with default parameters.`; + } + }, + }), // Must match name in data service and in visualization.tsx }, }; diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx index a093726e0b..429a0c3279 100755 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx @@ -25,7 +25,7 @@ import { createVisualizationPlugin } from '../VisualizationPlugin'; import LabelledGroup from '@veupathdb/components/lib/components/widgets/LabelledGroup'; import { NumberInput } from '@veupathdb/components/lib/components/widgets/NumberAndDateInputs'; -import { LayoutOptions } from '../../layouts/types'; +import { LayoutOptions, TitleOptions } from '../../layouts/types'; import { RequestOptions } from '../options/types'; // Volcano plot imports @@ -54,6 +54,7 @@ import SliderWidget, { import { ResetButtonCoreUI } from '../../ResetButton'; import AxisRangeControl from '@veupathdb/components/lib/components/plotControls/AxisRangeControl'; import { fixVarIdLabel } from '../../../utils/visualization'; +import { OutputEntityTitle } from '../OutputEntityTitle'; // end imports const DEFAULT_SIG_THRESHOLD = 0.05; @@ -106,6 +107,7 @@ export const VolcanoPlotConfig = t.partial({ interface Options extends LayoutOptions, + TitleOptions, RequestOptions {} // Volcano Plot Visualization @@ -384,6 +386,11 @@ function VolcanoPlotViz(props: VisualizationProps) { ] ); + // plot subtitle + const plotSubtitle = options?.getPlotSubtitle?.( + computation.descriptor.configuration + ); + // Add labels to the extremes of the x axis. These may change in the future based on the type // of data. For example, for genes we may want to say Up regulated in... const comparisonLabels = @@ -627,12 +634,7 @@ function VolcanoPlotViz(props: VisualizationProps) { /> - {/* This should be populated with info from the colections var. So like "Showing 1000 taxa blah". Waiting on collections annotations. */} - {/* */} +