feat(geneset): save diff exp result as geneset (#2216)

* update package lock

* allow falsey vals

* remove old diff exp handling

* save diff exp results as geneset

* delete test

* check for undefined or null

* use global geneset description for diffexp

* remove diffexp special code, no longer showing adjpval + logfoldchange

* remove differential map to state

* remove clear from FSM, since we no longer support those actions

* restore controlHelpers test with todo
This commit is contained in:
Severiano Badajoz
2021-05-25 10:51:31 -07:00
committed by GitHub
parent 6f6634a4d9
commit a4050f10e1
23 changed files with 21894 additions and 355 deletions
@@ -8,22 +8,17 @@ const HistogramFooter = React.memo(
rangeMax,
rangeColorMin,
rangeColorMax,
logFoldChange,
pvalAdj,
isObs,
isGeneSetSummary,
}) => {
/*
Footer of each histogram. Will render range, title, and optionally
differential expression info.
Footer of each histogram. Will render range and title.
Required props:
* displayName - the displayName, aka "n_genes", "FOXP2", etc.
* hideRanges - true/false, enables/disable rendering of ranges
* range - length two array, [min, max], containing the range values to display
* rangeColor - length two array, [mincolor, maxcolor], each a CSS color
* logFoldChange - lfc to display, optional.
* pValue - pValue to display, optional.
*/
return (
<div>
@@ -60,30 +55,6 @@ const HistogramFooter = React.memo(
max {rangeMax.toPrecision(4)}
</span>
</div>
{logFoldChange && pvalAdj ? (
<div
style={{
display: "flex",
justifyContent: "center",
alignItems: "baseline",
}}
>
<span>
<strong>log fold change:</strong>
{` ${logFoldChange.toPrecision(4)}`}
</span>
<span
style={{
marginLeft: 7,
padding: 2,
}}
>
<strong>p-value (adj):</strong>
{pvalAdj < 0.0001 ? " < 0.0001" : ` ${pvalAdj.toFixed(4)}`}
</span>
</div>
) : null}
</div>
);
}
@@ -14,9 +14,9 @@ import StillLoading from "./loading";
import ErrorLoading from "./error";
@connect((state, ownProps) => {
const { isObs, isUserDefined, isDiffExp, isGeneSetSummary, field } = ownProps;
const { isObs, isUserDefined, isGeneSetSummary, field } = ownProps;
const myName = makeContinuousDimensionName(
{ isObs, isUserDefined, isDiffExp, isGeneSetSummary },
{ isObs, isUserDefined, isGeneSetSummary },
field
);
return {
@@ -80,7 +80,6 @@ class HistogramBrush extends React.PureComponent {
field,
isObs,
isUserDefined,
isDiffExp,
isGeneSetSummary,
} = this.props;
@@ -98,7 +97,6 @@ class HistogramBrush extends React.PureComponent {
continuousNamespace: {
isObs,
isUserDefined,
isDiffExp,
isGeneSetSummary,
},
};
@@ -115,7 +113,6 @@ class HistogramBrush extends React.PureComponent {
field,
isObs,
isUserDefined,
isDiffExp,
isGeneSetSummary,
} = this.props;
const minAllowedBrushSize = 10;
@@ -156,7 +153,6 @@ class HistogramBrush extends React.PureComponent {
continuousNamespace: {
isObs,
isUserDefined,
isDiffExp,
isGeneSetSummary,
},
};
@@ -362,10 +358,7 @@ class HistogramBrush extends React.PureComponent {
field,
isColorAccessor,
isUserDefined,
isDiffExp,
logFoldChange,
isGeneSetSummary,
pvalAdj,
isScatterplotXXaccessor,
isScatterplotYYaccessor,
zebra,
@@ -383,7 +376,7 @@ class HistogramBrush extends React.PureComponent {
heightMini,
} = this.state;
const fieldForId = field.replace(/\s/g, "_");
const showScatterPlot = isDiffExp || isUserDefined;
const showScatterPlot = isUserDefined;
return (
<Async
@@ -406,9 +399,7 @@ class HistogramBrush extends React.PureComponent {
id={`histogram_${fieldForId}`}
data-testid={`histogram-${field}`}
data-testclass={
isDiffExp
? "histogram-diffexp"
: isUserDefined
isUserDefined
? "histogram-user-gene"
: "histogram-continuous-metadata"
}
@@ -454,15 +445,12 @@ class HistogramBrush extends React.PureComponent {
<HistogramFooter
isGeneSetSummary={isGeneSetSummary}
isObs={isObs}
isDiffExp={isDiffExp}
displayName={field}
hideRanges={asyncProps.isSingleValue}
rangeMin={asyncProps.unclippedRange[0]}
rangeMax={asyncProps.unclippedRange[1]}
rangeColorMin={asyncProps.unclippedRangeColor[0]}
rangeColorMax={asyncProps.unclippedRangeColor[1]}
logFoldChange={logFoldChange}
pvalAdj={pvalAdj}
/>
)}
</div>