Skip to content

fix: score HPA genes over the cell types they were measured in - #680

Merged
edkerk merged 1 commit into
develop3from
fix/hpa-unmeasured-celltypes
Jul 17, 2026
Merged

fix: score HPA genes over the cell types they were measured in#680
edkerk merged 1 commit into
develop3from
fix/hpa-unmeasured-celltypes

Conversation

@edkerk

@edkerk edkerk commented Jul 17, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

  • fix:
    • scoreComplexModel scored an unmeasured cell type as 0, and 0 outranks 'Not detected' (-8). A gene not detected in one of two cell types therefore scored 0 under the default 'max', and was never pruned by removeLowScoreGenes, which only prunes below zero. 'average' likewise divided by the number of cell types rather than the number of measurements. Both now reduce over the measurements that exist.
  • documentation:
    • Test in tINIT.m for a gene measured in one of two cell types.

Instructions on merging this PR:

  • This PR has develop3 as target branch, and will be resolved with a squash-merge.

The HPA cell-type reduction built a sparse GENESxCELLTYPES score matrix and
reduced over the full row. Sparse structural zeros are numeric zeros, and 0
sits between 'Low' (10) and 'Not detected' (-8), so under the default 'max' a
gene not detected in one of two cell types scored 0 rather than -8. Measured:
0. Since hpaScores override arrayScores and removeLowScoreGenes prunes only
below zero, such a gene was then never pruned.

'average' had the matching defect, dividing by the number of cell types rather
than the number of measurements.

Both now reduce over the measurements that exist, which is what the arrayData
branch above already does. Adds a test for a gene measured in one of two cell
types.
@github-actions

Copy link
Copy Markdown

Function test results

241 tests   219 ✅  1m 2s ⏱️
 23 suites   22 💤
  1 files      0 ❌

Results for commit 7f16635.

@edkerk
edkerk merged commit 18bdcf9 into develop3 Jul 17, 2026
4 checks passed
@edkerk
edkerk deleted the fix/hpa-unmeasured-celltypes branch July 17, 2026 17:08
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.

1 participant