Skip to content

Scatter getter handles single cell gene expression term requests#4305

Merged
xzhou82 merged 4 commits intomasterfrom
sc.6
Mar 13, 2026
Merged

Scatter getter handles single cell gene expression term requests#4305
xzhou82 merged 4 commits intomasterfrom
sc.6

Conversation

@creilly8
Copy link
Collaborator

@creilly8 creilly8 commented Mar 12, 2026

Description

  1. Removed previous implementation in vocabApi.getScatterData() and data processing function in the scatterModel. Instead, altered the return object from termdb/sampleScatter route with adjustments in the scatterModel.
  2. Removed all 'singleCellCellType' and 'singleCellGeneExpression' strings and replaced with imported const, when allowed (not allowed in types).
  3. Updated some of the violin integration tests messages to match pass and fail, instead of only pass.
  4. Let the formatter change double quotes to single quotes because it sometimes throws linter warnings on my IDE.

All tests pass for me.

Test with:

  1. TermdbTest example
  2. SC GDC example and current GDC single cell plot example.
  3. B-ALL example

Supports efforts detailed in SC roadmap

Checklist

Check each task that has been performed or verified to be not applicable.

  • Tests: Added and/or passed unit and integration tests, or N/A
  • Todos: Commented or documented, or N/A
  • Notable Changes: updated release.txt, prefixed a commit message with "fix:" or "feat:", added to an internal tracking document, or N/A
  • Rust: Checked to see whether Rust needs to be re-compiled because of this PR, or N/A

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR moves single-cell gene expression data processing from the client-side (vocabApi.getScatterData() and processGEData in scatterModel) to the server-side termdb/sampleScatter route, and replaces hardcoded term type strings (e.g. 'singleCellCellType') with imported constants.

Changes:

  • Consolidated gene expression scatter data handling into the server route (termdb.sampleScatter.ts) and removed client-side processGEData and the termdb/singlecellData fetch path.
  • Replaced all 'singleCellCellType' and 'singleCellGeneExpression' string literals with imported constants across client and server code.
  • Updated violin integration test messages and reformatted quotes (double → single) in utility files.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/routes/termdb.sampleScatter.ts Server now returns geneExp per cell and conditionally builds colorMap; uses imported constants
client/plots/scatter/model/scatterModel.ts Removed processGEData; unified data flow; added geMin/geMax to ranges
client/plots/scatter/scatterTypes.ts Added geMin/geMax to ScatterChart ranges type
client/termdb/TermdbVocab.js Removed special singlecellData fetch path for gene expression
client/tw/TwRouter.ts Replaced string literals with constants
client/tw/qualitative.ts Replaced string literals with constants
client/tw/numeric.ts Replaced string literals with constants
client/plots/sc/view/PlotButtons.ts Replaced string literals with constants
client/test/testdata/data.ts Replaced string literals with constants
client/termsetting/test/termsetting.integration.spec.js Replaced string literal with constant
client/plots/scatter/test/scatter.integration.spec.js Added colorTW to test config; imported getScctTw
client/plots/test/violin.integration.spec.js Updated test messages; imported constant
shared/utils/src/urljson.js Quote reformatting
shared/utils/src/time.js Quote reformatting
shared/utils/src/joinUrl.js Quote reformatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@xzhou82 xzhou82 merged commit 0eb7c5b into master Mar 13, 2026
3 checks passed
@xzhou82 xzhou82 deleted the sc.6 branch March 13, 2026 02:41
else throw new Error('unsupported tw')
}

if (tw.term.type == SINGLECELL_GENE_EXPRESSION) arg.gene = tw.term.gene
Copy link
Collaborator

Choose a reason for hiding this comment

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

please change to explicitly detecting scct and not to assume it (more such sc term types coming soon eg atac)

if(tw.term.type==scGeneExp) {
} else if(tw.term.type==scct) {
} else {
    throw 'xx'
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@xzhou82, this will be addressed in my next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants