Skip to content

Commit

Permalink
Merge branch 'IPAD-479_common-tests-multimodel-multitest' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
paulnordlund committed Feb 14, 2024
2 parents 00c513f + 578c28b commit fdd55f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/components/Differential/Differential.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ class Differential extends Component {
differentialModel,
differentialModelsAndTests,
multiModelMappingFirstKey,
differentialTestIdsCommon,
);
// hotfix for multiModel_boxplot_pro until logic is clarified
if (plot.plotID === 'multiModel_boxplot_pro') {
Expand Down Expand Up @@ -815,6 +816,7 @@ class Differential extends Component {
differentialModel,
differentialModelsAndTests,
multiModelMappingFirstKey,
differentialTestIdsCommon,
);
// hotfix for multiModel_boxplot_pro until logic is clarified
if (plot.plotID === 'multiModel_boxplot_pro') {
Expand Down Expand Up @@ -986,6 +988,7 @@ class Differential extends Component {
differentialModel,
differentialModelsAndTests,
multiModelMappingFirstKey,
differentialTestIdsCommon,
);
// handle plotly differently than static plot svgs
if (multifeaturePlot[0].plotType.includes('plotly')) {
Expand Down Expand Up @@ -1066,6 +1069,7 @@ class Differential extends Component {
differentialModel,
differentialModelsAndTests,
multiModelMappingFirstKey,
differentialTestIdsCommon,
);
// handle plotly differently than static plot svgs
if (multifeaturePlot[i].plotType.includes('plotly')) {
Expand Down Expand Up @@ -1293,6 +1297,7 @@ class Differential extends Component {
differentialModel,
differentialModelsAndTests,
multiModelMappingFirstKey,
differentialTestIdsCommon,
);
try {
const promise = omicNavigatorService.plotStudyReturnSvg(
Expand Down
10 changes: 7 additions & 3 deletions src/components/Shared/helpers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,9 @@ export function getModelsArg(
differentialModel,
differentialModelsAndTests,
multiModelMappingFirstKey,
multiModelMappingArrays,
differentialTestIdsCommon,
) {
debugger;
// if plotType does not include 'multiModel', return the model
if (!plotType.includes('multiModel')) {
return differentialModel;
Expand All @@ -708,7 +709,7 @@ export function getModelsArg(
// 'multiTest': vector of each model,
// with the currently selected model moved to the first index
// repeated n times,
// where n is the number of tests present under the currently selected model
// where n is the number of tests (that are a member of ALL models) repeated under the currently selected model
let models = [];
const currentDifferentialModelsAndTestsIndex = [
...differentialModelsAndTests,
Expand All @@ -724,7 +725,10 @@ export function getModelsArg(
: differentialModelsAndTests;
currentDifferentialModelsAndTestsMoved.forEach((cdmtm) => {
cdmtm.tests.forEach((test) => {
models.push(cdmtm.modelID);
// check if test id is a member of ALL models
if (differentialTestIdsCommon?.includes(test.testID)) {
models.push(cdmtm.modelID);
}
});
});
return models;
Expand Down

0 comments on commit fdd55f3

Please sign in to comment.