Ensure top max-expressing tissue is shown, robustify curve shift #367
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.
This ensures the tissue with the maximum expression across all tissues is shown. It also fixes an edge case with reframing.
Previously (#366), the "Reference tissues by expression" list showed the top 10 tissues as sorted only by median. In rare but important cases, this would exclude tissues that had a remarkably high maximum expression for a given gene. Such rare cases can be biologically relevant. For example, the gene XDH is related to milk synthesis, and while it has extremely high maximum expression in the tissue "Breast - mammary gland", its median expression there is very low.
Now, such edge cases are intuitively accounted for. Specifically, if a tissue has the highest maximum expression but isn't among the top 10 tissues by median expression, then the last tissue in that list is replaced by the top max tissue. A brief inspection suggests the top max tissue is usually more biologically relevant than the 10-highest-by-median-expression tissue.
Here's how it looks!
Ensure_top_max_tissue__Ideogram_2024-01-15.mov