Skip to content

Commit

Permalink
fix: SLAPenrich section size
Browse files Browse the repository at this point in the history
  • Loading branch information
carcruz committed Nov 6, 2023
1 parent 778ce54 commit d905358
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
18 changes: 7 additions & 11 deletions packages/sections/src/evidence/SlapEnrich/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import Description from "./Description";
import { dataTypesMap } from "../../dataTypes";
import SLAPENRICH_QUERY from "./sectionQuery.gql";
import { sentenceCase } from "../../utils/global";
import { defaultRowsPerPageOptions, naLabel } from "../../constants";
import { defaultRowsPerPageOptions, naLabel, sectionsBaseSizeQuery } from "../../constants";

const reactomeUrl = (id) => `https://identifiers.org/reactome:${id}`;
const reactomeUrl = id => `https://identifiers.org/reactome:${id}`;

const columns = [
{
Expand All @@ -32,8 +32,7 @@ const columns = [
<Link to={`/disease/${disease.id}`}>{disease.name}</Link>
</Tooltip>
),
filterValue: ({ disease, diseaseFromSource }) =>
[disease.name, diseaseFromSource].join(),
filterValue: ({ disease, diseaseFromSource }) => [disease.name, diseaseFromSource].join(),
},
{
id: "pathwayName",
Expand All @@ -56,9 +55,7 @@ const columns = [
),
numeric: true,
sortable: true,
renderCell: ({ resourceScore }) => (
<ScientificNotation number={resourceScore} />
),
renderCell: ({ resourceScore }) => <ScientificNotation number={resourceScore} />,
},
];

Expand All @@ -67,6 +64,7 @@ function Body({ id, label, entity }) {
const variables = {
ensemblId: ensgId,
efoId,
size: sectionsBaseSizeQuery,
};

const request = useQuery(SLAPENRICH_QUERY, {
Expand All @@ -79,10 +77,8 @@ function Body({ id, label, entity }) {
entity={entity}
chipText={dataTypesMap.affected_pathway}
request={request}
renderDescription={() => (
<Description symbol={label.symbol} name={label.name} />
)}
renderBody={(data) => (
renderDescription={() => <Description symbol={label.symbol} name={label.name} />}
renderBody={data => (
<DataTable
columns={columns}
dataDownloader
Expand Down
3 changes: 2 additions & 1 deletion packages/sections/src/evidence/SlapEnrich/sectionQuery.gql
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
query SlapEnrichQuery($ensemblId: String!, $efoId: String!) {
query SlapEnrichQuery($ensemblId: String!, $efoId: String!, $size: Int!) {
disease(efoId: $efoId) {
id
slapEnrich: evidences(
ensemblIds: [$ensemblId]
enableIndirect: true
datasourceIds: ["slapenrich"]
size: $size
) {
count
rows {
Expand Down

0 comments on commit d905358

Please sign in to comment.