Skip to content

feat(wasap): add GenSpectrum collections analysis mode#1327

Open
fhennig wants to merge 12 commits into
mainfrom
implement-wastewater-cov-spectrum-collection-mode
Open

feat(wasap): add GenSpectrum collections analysis mode#1327
fhennig wants to merge 12 commits into
mainfrom
implement-wastewater-cov-spectrum-collection-mode

Conversation

@fhennig

@fhennig fhennig commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Closes #1324, closes #1328

Summary

  • Adds a new 'collection' analysis mode to WASAP that uses GenSpectrum's own backend collections, separate from the existing 'covSpectrumCollection' mode (CovSpectrum API)
  • COVID gets both modes side by side; RSV-A and RSV-B get only the new collection mode (CovSpectrum collections don't exist for RSV)
  • CollectionInfo component updated to accept sourceLabel and optional collectionUrl to show appropriate links per source

New files

  • CollectionAnalysisFilter.tsx — filter dropdown that lists collections for the current organism via getCollectionSummaries({ organism })

Key implementation notes

  • Data fetch uses getBackendServiceForClientside().getCollection({ id })
  • Handles both query variants (countQuery used directly) and filterObject variants (mutation arrays joined into a query string)
  • All query strings validated through LAPIS parseQuery + validateGenomeOnly before display, same as the CovSpectrum path
  • filterObject variants with only mutation arrays (no lineage catchall fields) are converted; empty results are marked invalid

Test plan

  • TypeScript passes (npx tsc --noEmit)
  • COVID WASAP page shows both "Collection" and "CovSpectrum Collection" in the mode dropdown
  • RSV-A and RSV-B WASAP pages show "Collection" mode (no CovSpectrum mode)
  • Selecting a collection and applying the filter renders GsQueriesOverTime with the collection's variants
  • Info box shows "GenSpectrum collection" label with a link to the collection page; CovSpectrum mode still shows the CovSpectrum link

TODO

  • Consider adding a WasapPage.browser.spec.tsx that mocks getCollection via BackendRouteMocker and asserts the "No valid variants" message renders when all variants are empty/invalid

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Jul 13, 2026 10:47am

Request Review

fhennig and others added 3 commits July 9, 2026 14:21
Also converts WasapAnalysisMode, SignatureType, ExcludeSetName to const-object
pattern (matching VARIANT_TIME_FRAME), adds SEQUENCE_TYPE for the external
SequenceType, exports fetchWasapPageData for direct testing, and adds
BackendRouteMocker.mockGetCollection to routeMocker.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… customColumns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eFrame tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fhennig

fhennig commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Waiting for #1332 so we can add some more tests.

fhennig and others added 9 commits July 13, 2026 12:46
Adds a new 'collection' analysis mode to the WASAP dashboard that browses
GenSpectrum's own collection system, enabling RSV-A and RSV-B to have a
collections mode (CovSpectrum collections only exist for COVID).

- Config: CollectionAnalysisModeConfig discriminated union; no extra URL
  needed since the backend is our own
- Data fetch: getBackendServiceForClientside().getCollection(), handles
  both 'query' and 'filterObject' variant types via parseQuery validation
- Filter UI: GsCollectionAnalysisFilter lists collections by organism via
  getCollectionSummaries()
- COVID gets both modes; RSV-A and RSV-B get only the new mode
- CollectionInfo now accepts sourceLabel/collectionUrl to distinguish
  CovSpectrum vs GenSpectrum collection links in the page view

Closes #1324

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…llection link

- Deduplicate display labels in fetchCollectionModeData: duplicate names
  get a counter suffix ("Resistance", "Resistance (2)") so GsQueriesOverTime
  doesn't throw on collections like the RSV-A resistance set
- Add clickable link to the GenSpectrum collection info box using
  Page.viewCollection(config.internalName, id)

See #1328 for the same fix on the CovSpectrum path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pdown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…isFilter

Also auto-selects the first collection on load via useEffect and removes
the empty placeholder option from the dropdown.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fhennig fhennig force-pushed the implement-wastewater-cov-spectrum-collection-mode branch from 209b0e1 to 0973b71 Compare July 13, 2026 10:47
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.

fix(wasap): handle duplicate variant display labels in CovSpectrum collection mode feat(wasap): add GenSpectrum collections analysis mode

1 participant