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

Add URL-based API for taking in JSON #2

Closed
sidneymbell opened this issue Feb 2, 2022 · 7 comments
Closed

Add URL-based API for taking in JSON #2

sidneymbell opened this issue Feb 2, 2022 · 7 comments

Comments

@sidneymbell
Copy link
Collaborator

Similar to nextstrain.org/fetch/URL

@sidneymbell sidneymbell added this to the Get galago ready for public use milestone Feb 3, 2022
@sidneymbell sidneymbell added the [theme] ecosystem integration Connecting with other tools label Feb 10, 2022
@sidneymbell
Copy link
Collaborator Author

Thanks to @jacoblerner-czi for consulting on this ticket from a security standpoint! Takeaways:

  • This is low risk because and we're alright to proceed because we never send any data away from the galago client to anywhere else
  • We should revisit this if we ever add features that send / share data from galago to somewhere else.
  • We should use a an HTTP proxy if we host a version of this on our own servers at some point in the future.

@sidneymbell sidneymbell modified the milestones: Ecosystem integration [eventual product team collab], V1 beta launch - audit P0 fixes Jul 10, 2022
@sidneymbell
Copy link
Collaborator Author

sidneymbell commented Jul 18, 2022

Requirements and pointers on where to start (cc @oliviabholmes to add / adjust) --

  • Can take in the same pre-signed URLs we use for Nextstrain
  • Should have parameters for:
    • [required] URL to tree file --> ingestNextstrain(path/to/treefile) & dispatch({type: "tree file uploaded", data: output_from_ingest_nextstrain}).
    • [optional] name of mrca node --> find_leaf_by_name(name, traverse_preorder(tree)) --> dispatch({type: "mrca clicked", data: output_from_find_leaf_by_name})
    • [optional] Home jurisdiction division (state) and location (county)
  • Nice to also have a parameter for:
    • URL to metadata csv/tsv file --> const { tidyMetadata, metadataCensus } = ingestCSVMetadata(results.data); dispatch({ type: "metadata uploaded and parsed", data: { metadataCensus: metadataCensus, tidyMetadata: tidyMetadata }, });

@oliviabholmes
Copy link

oliviabholmes commented Jul 20, 2022

@sidneymbell how are we currently ingesting JSON? Trying to understand why this is a blocker

@sidneymbell
Copy link
Collaborator Author

sidneymbell commented Jul 20, 2022

@oliviabholmes -- currently via direct upload

It's a blocker because it's required to take in data from CZ GEN EPI via the planned integration, which uses the same pre-signed URLs for trees that we use to link out to nextstrain.

@sidneymbell
Copy link
Collaborator Author

sidneymbell commented Aug 2, 2022

Related to #145 and #147

Notes from @vincent-czi --

  • For folks coming from CZ GEN EPI, don't dump them straight into the analysis page; rather, prepopulate the upload screen modal with their json and preliminary guess as to their jurisdiction of interest (based on their DPH home jurisdiction set in cz gen epi). This allows them to also upload metadata and/or change jurisdiction of interest without requiring Allow user to add epi metadata from the main app screen #162 or Allow users to select different location of interest (home_geo) within the app interface #161 .

  • One way to do this --

    • Encode what CZ GEN EPI thinks is their jurisdiction (i.e., division and location) in the URL alongside the tree json
    • Galago ingests the tree JSON and generates valid options for division and location
    • If the provided strings for division +/- location are valid options, then set those as default for the user
      (Or even use fuzzy string matching to choose the closest valid option)
    • If not, let the user choose from the list

@sidneymbell
Copy link
Collaborator Author

Status update: fetch is working for JSON and URL

Propose splitting the ticket to add the query params late next week (technically after launch).

@vincent-czi
Copy link
Collaborator

Closed as main chunk of work -- taking in the external URL JSON -- is complete. Follow up work for doing query / search params filed as #186

sidneymbell pushed a commit that referenced this issue Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Help needed
Development

No branches or pull requests

4 participants