feat: diffexp returns two genesets (#2230)

* feat: return two lists for diffexp (#2221)

* sp

* split out derive sort order, tests passing

* sp

* return diff exp results in two lists

* update

* copy implementation over to desktop

* add tests for two lists

* small fixes to complete backend implementation

* accept new diffexp response

* map diff exp response to genesets

* delete )

* name diffexp genesets with population names

* take constants out of state and allow width prop to override

* shorten mini-histo properly truncate and resize depending on expansion

* prepend new genesets

* rename data within diffexp action

* backend

* move diffexp ttest to common code module, update tests

* update for unit tests

* reference actual var

Co-authored-by: Madison Dunitz <madison.dunitz@chanzuckerberg.com>
Co-authored-by: Madison Dunitz <dunitzm@gmail.com>
This commit is contained in:
Severiano Badajoz
2021-06-08 21:02:19 +00:00
committed by GitHub
co-authored by Madison Dunitz Madison Dunitz
parent 7ed53c0f5b
commit 28b526b3fc
25 changed files with 268 additions and 284 deletions
+19 -13
View File
@@ -1,13 +1,14 @@
import React from "react";
import { connect } from "react-redux";
import { AnchorButton, Icon } from "@blueprintjs/core";
import { Button, Icon } from "@blueprintjs/core";
import Truncate from "../util/truncate";
import HistogramBrush from "../brushableHistogram";
import * as globals from "../../globals";
import actions from "../../actions";
const MINI_HISTOGRAM_WIDTH = 110;
@connect((state, ownProps) => {
const { gene } = ownProps;
@@ -65,7 +66,7 @@ class Gene extends React.Component {
isScatterplotYYaccessor,
} = this.props;
const { geneIsExpanded } = this.state;
const genesetNameLengthVisible = 310; /* this magic number determines how much of a long geneset name we see */
const geneSymbolWidth = 60 + (geneIsExpanded ? MINI_HISTOGRAM_WIDTH : 0);
return (
<div>
@@ -108,7 +109,8 @@ class Gene extends React.Component {
>
<span
style={{
width: globals.leftSidebarWidth - genesetNameLengthVisible,
width: geneSymbolWidth,
display: "inline-block",
}}
data-testid={`${gene}:gene-label`}
>
@@ -117,11 +119,16 @@ class Gene extends React.Component {
</Truncate>
</div>
{!geneIsExpanded ? (
<HistogramBrush isUserDefined field={gene} mini />
<HistogramBrush
isUserDefined
field={gene}
mini
width={MINI_HISTOGRAM_WIDTH}
/>
) : null}
</div>
<div style={{ flexShrink: 0, marginLeft: 2 }}>
<AnchorButton
<Button
minimal
small
data-testid={`delete-from-geneset-${gene}`}
@@ -130,8 +137,7 @@ class Gene extends React.Component {
style={{ fontWeight: 700, marginRight: 2 }}
icon={<Icon icon="trash" iconSize={10} />}
/>
)
<AnchorButton
<Button
minimal
small
data-testid={`plot-x-${gene}`}
@@ -141,8 +147,8 @@ class Gene extends React.Component {
style={{ fontWeight: 700, marginRight: 2 }}
>
x
</AnchorButton>
<AnchorButton
</Button>
<Button
minimal
small
data-testid={`plot-y-${gene}`}
@@ -152,8 +158,8 @@ class Gene extends React.Component {
style={{ fontWeight: 700, marginRight: 2 }}
>
y
</AnchorButton>
<AnchorButton
</Button>
<Button
minimal
small
data-testclass="maximize"
@@ -164,7 +170,7 @@ class Gene extends React.Component {
icon={<Icon icon="maximize" iconSize={10} />}
style={{ marginRight: 2 }}
/>
<AnchorButton
<Button
minimal
small
data-testclass="colorby"