Color by gene set mean expression (#2157)

* colorby histo

* color graph by mean expression

* move var index after returns

* add genesets as an argument

* varindex

* undo redo for mean expression

* destructure

* ternary

* Revert "destructure"

This reverts commit 2d9432c1c7.

* color by mean for diffexp
This commit is contained in:
Colin Megill
2021-04-22 13:58:30 -04:00
committed by GitHub
parent 860547ced1
commit fd2a7a53ab
10 changed files with 170 additions and 27 deletions
@@ -106,16 +106,26 @@ const continuous = (selectorId, colorScale, colorAccessor) => {
@connect((state) => ({
annoMatrix: state.annoMatrix,
colors: state.colors,
genesets: state.genesets.genesets,
differential: state.differential,
}))
class ContinuousLegend extends React.Component {
async componentDidUpdate(prevProps) {
const { annoMatrix, colors } = this.props;
const { annoMatrix, colors, genesets, differential } = this.props;
if (!colors || !annoMatrix) return;
if (colors !== prevProps?.colors || annoMatrix !== prevProps?.annoMatrix) {
const { schema } = annoMatrix;
const { colorMode, colorAccessor, userColors } = colors;
const colorQuery = createColorQuery(colorMode, colorAccessor, schema);
const colorQuery = createColorQuery(
colorMode,
colorAccessor,
schema,
genesets,
differential.diffExp
);
const colorDf = colorQuery ? await annoMatrix.fetch(...colorQuery) : null;
const colorTable = createColorTable(
colorMode,