Skip to content

Commit

Permalink
Merge pull request #488 from VEuPathDB/fix-471-appconstraints2
Browse files Browse the repository at this point in the history
Fix 471 appconstraints
  • Loading branch information
asizemore authored Sep 11, 2023
2 parents 8e4f9c5 + d67b306 commit e267f16
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,20 @@ export function AbundanceConfiguration(props: ComputationConfigProps) {
);

const collectionVarItems = useMemo(() => {
return collections.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
return collections
.filter((collectionVar) => {
return collectionVar.normalizationMethod
? collectionVar.normalizationMethod !== 'NULL'
: true;
})
.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
}, [collections]);

const selectedCollectionVar = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,20 @@ export function AlphaDivConfiguration(props: ComputationConfigProps) {
);

const collectionVarItems = useMemo(() => {
return collections.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
return collections
.filter((collectionVar) => {
return collectionVar.normalizationMethod
? collectionVar.normalizationMethod !== 'NULL'
: true;
})
.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
}, [collections]);

const selectedCollectionVar = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,20 @@ export function BetaDivConfiguration(props: ComputationConfigProps) {
);

const collectionVarItems = useMemo(() => {
return collections.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
return collections
.filter((collectionVar) => {
return collectionVar.normalizationMethod
? collectionVar.normalizationMethod !== 'NULL'
: true;
})
.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
}, [collections]);

const selectedCollectionVar = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,22 @@ export function DifferentialAbundanceConfiguration(
);

const collectionVarItems = useMemo(() => {
return collections.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
return collections
.filter((collectionVar) => {
return collectionVar.normalizationMethod
? !collectionVar.isProportion &&
collectionVar.normalizationMethod === 'NULL' &&
!collectionVar.displayName?.includes('pathway')
: true;
})
.map((collectionVar) => ({
value: {
variableId: collectionVar.id,
entityId: collectionVar.entityId,
},
display:
collectionVar.entityDisplayName + ' > ' + collectionVar.displayName,
}));
}, [collections]);

const selectedCollectionVar = useMemo(() => {
Expand Down
3 changes: 3 additions & 0 deletions packages/libs/eda/src/lib/core/types/study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ export const CollectionVariableTreeNode = t.intersection([
units: t.string,
entityId: t.string,
entityDisplayName: t.string,
isCompositional: t.boolean,
isProportion: t.boolean,
normalizationMethod: t.string,
}),
]);

Expand Down

0 comments on commit e267f16

Please sign in to comment.