Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable search for new samples query #163

Merged

Conversation

qu8n
Copy link
Collaborator

@qu8n qu8n commented Sep 26, 2024

This PR includes the work for cards #1224 and #1281, with most changes for the former.

This enables search for the new samples query written in #162.

High-level details of the new flow:

  • User inputs some value(s) into the search bar and press Enter or click "Search"
  • The React frontend calls a new GraphQL query called DashboardSamples
  • In the Apollo server, the resolvers for this query run Cypher queries and return the results

TODOs in the next PR:

  • Re-enable editing
  • Re-enable users' ability to download >500 and <5,000 samples. Right now, users can either download up to 500 or not at all
  • Resolve the duplicate tableElements.tsx files
  • Consider implementing or using a 3rd party package for a Cypher query builder
  • Fix exported file to show only the non-hidden columns

We previously used dataloader to make a single query for samples via
the OGM. Otherwise, the `samples` and `samplesConnection` sub-queries
would be call it twice.

With the new approach, we use two slightly different queries to get
samples data and the count of samples. We could use dataloader to access
the oncotree cache, but this operation is very fast (< 0.05ms).
frontend/src/components/SamplesList.tsx Show resolved Hide resolved
frontend/src/shared/tableElements-records.tsx Outdated Show resolved Hide resolved
graphql-server/src/schemas/custom.ts Outdated Show resolved Hide resolved
@qu8n qu8n requested a review from ao508 September 27, 2024 13:17
@qu8n qu8n marked this pull request as ready for review September 27, 2024 13:17
ao508

This comment was marked as resolved.

@qu8n

This comment was marked as resolved.

@qu8n

This comment was marked as outdated.

ao508

This comment was marked as resolved.

Copy link
Collaborator

@ao508 ao508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I've noticed while testing is that all columns get downloaded on the samples page even when there are columns hidden. Is this a TODO for a later card?

Related to this: there still seems to be a cap of 500 samples here when downloading from the samples page

To replicate: I used search term "BRCNOS" which should return 804 samples (dev server)

@qu8n
Copy link
Collaborator Author

qu8n commented Sep 27, 2024

One thing I've noticed while testing is that all columns get downloaded on the samples page even when there are columns hidden. Is this a TODO for a later card?

@ao508 Thanks for catching that. Adding it to the next PR's todos now.

Related to this: there still seems to be a cap of 500 samples here when downloading from the samples page

To replicate: I used search term "BRCNOS" which should return 804 samples (dev server)

This is one of my TODOs for the next PR. You can find this list in this PR's description here for now. I'll add this list to the next Zenhub card after we finish with this PR.

import styles from "./records.module.scss";
import { getUserEmail } from "../utils/getUserEmail";
import { openLoginPopup } from "../utils/openLoginPopup";
import { Title } from "../shared/components/Title";
import { BreadCrumb } from "../shared/components/BreadCrumb";
import { useParams } from "react-router-dom";
import { DataName } from "../shared/types";
import { parseUserSearchVal } from "../utils/parseSearchQueries";

const POLLING_INTERVAL = 2000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind increasing this to 2700 (45 seconds)? I'm hoping that the extra interval of time will result in less "blinking" when viewing and updating samples for a request/patient/cohort

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in milliseconds, so this is currently at 2 seconds. I just bumped it up to 5 seconds in the dev dashboard. Let me know if you're still seeing it. If you're able to record a clip of this "blinking", I'm happy to take a look as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If this blinking is a big problem, we can consider using websocket to display real-time sample updates instead. More optimal as we don't continuously refetch for no reason.)

Copy link
Collaborator

@ao508 ao508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thank you!

@ao508 ao508 merged commit b09494b into mskcc:samples-query-optimization Sep 27, 2024
2 checks passed
@qu8n qu8n deleted the enable-search-for-new-samples-query branch November 14, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants