-
Notifications
You must be signed in to change notification settings - Fork 7
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
H-Score report fix #63
Open
christianrickert
wants to merge
11
commits into
akoyabio:9000
Choose a base branch
from
himsr-lab:h-score_fix
base: 9000
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
HIMSR noticed an issue with the H-Score report in phenoptrReports being noticeably off. Akoya offered a possible explanation: Cells without valid compartment measurements (missing cytoplasm with corresponding mean intensities given as `#N/A`) are erroneously put into the 3+ category. This fix places all intensity measurements with numerical values (existing cell compartment) into their respective H-Score categories, while ignoring all non-numerical (`#N/A`) values. Notice that this means that cells without valid compartments are not reported in the H-score summary.
Error message was: ```> write_h_score_sheet(wb, h_score_1) Warning: Error in str_replace_all: `string` must be a vector, not a symbol. 2: shiny::runApp 1: phenoptrReports:::addin_30_analysis_app ``` It turns out that the function `remove_marker_mean` is called with a symbol instead of a string. The fix avoids side effects by casting the function argument `s` to string before use.
`sum(1:3, NA)` evaluates to `NA`, if the `na.rm` parameter is not set to remove `NA` values prior to calculating the sum.
``` Returning data frames from `filter()` expressions was deprecated in dplyr 1.0.8. ℹ Please use `if_any()` or `if_all()` instead. ℹ The deprecated feature was likely used in the phenoptrReports package. Please report the issue at <https://github.com/akoyabio/phenoptrReports/issues>. ```
``` ── Warning (test_smoke.R:136:3): file generation works ───────────────────────── `cross2()` was deprecated in purrr 1.0.0. i Please use `tidyr::expand_grid()` instead. i See <tidyverse/purrr#768>. ```
When comparing H-Score values from (previous) `phenoptrReports` and (current) `inForm`, it's important to understand that both scored missing measurements into extreme categories (`3+`/`0+`) skewing the reported values depending on the number of missing measurements. The current version of `phenoptrReports` omits missing measurements completely and reports adjusted counts and percentages.
When a specific phenotype hasn't been identified for a particular slide, the H-Scores were erroneously reported as `FALSE` values. This fix inserts missing counts as `NA` values.
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.
Aim of this PR is to address an issue with
phenoptrReport
when reporting H-Score values for cells missing mean pixel intensity measurements (#N/A
). Measurement can be missing when the corresponding cellular compartment (cytoplasm, membrane) is missing as a result of cell segmentation. Cells mostly affected will be those located in densely packed clusters, where the cell expansion of the cytoplasm failed due to the presence of neighboring cells in close proximity.3+
categoryIt has to be noted that the results of the fixed version of
phenoptrReports
may deviate frominForm
.0+
categoryAs part of QC, compare the total number of cells reported in the
Cell Counts
tab with the corresponding total number of cells in the individualH-Score
tabs. A significant reduction of available cells for the H-Score calculation indicates cell segmentation issues. As a workaround, a different, physiologically relevant, compartment may be selected for scoring.phenoptrReports
passes all tests without warnings.