diff --git a/packages/sections/src/target/ChemicalProbes/Body.jsx b/packages/sections/src/target/ChemicalProbes/Body.jsx index f99d6398b..87382f025 100644 --- a/packages/sections/src/target/ChemicalProbes/Body.jsx +++ b/packages/sections/src/target/ChemicalProbes/Body.jsx @@ -6,6 +6,7 @@ import { definition } from "."; import Description from "./Description"; import CHEMICAL_PROBES_QUERY from "./ChemicalProbes.gql"; import { naLabel, defaultRowsPerPageOptions } from "../../constants"; +import _ from "lodash"; /** * Style the tooltips as "label: value" with a bold label @@ -96,17 +97,24 @@ function Body({ id, label: symbol, entity }) { request={request} entity={entity} renderDescription={() => } - renderBody={(data) => - data.target.chemicalProbes?.length > 0 ? ( + renderBody={(data) => { + // sort probes manually as we need a custom sort based score, quality and origin + const sortedProbes = _.orderBy(data.target.chemicalProbes, [ + 'probesDrugsScore', + 'isHighQuality', + p => p.origin?.map(o => o.toLowerCase()).includes('experimental'), + ], ['desc', 'desc', 'desc']); + + return data.target.chemicalProbes?.length > 0 ? ( ) : null } + } /> ); }