fix: score HPA genes over the cell types they were measured in - #680
Merged
Conversation
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.
Function test results241 tests 219 ✅ 1m 2s ⏱️ Results for commit 7f16635. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main improvements in this PR:
scoreComplexModelscored 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 byremoveLowScoreGenes, 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.tINIT.mfor a gene measured in one of two cell types.Instructions on merging this PR:
develop3as target branch, and will be resolved with a squash-merge.