From 8d4728166d00160cd8f4d34b5645807578208de5 Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Fri, 29 Dec 2017 00:16:18 -0800 Subject: [PATCH] diff exp component based on cell selections --- src/components/expression/expression.js | 68 +++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/src/components/expression/expression.js b/src/components/expression/expression.js index 3425a654..a282afe6 100644 --- a/src/components/expression/expression.js +++ b/src/components/expression/expression.js @@ -4,11 +4,13 @@ import { connect } from "react-redux"; import * as globals from "../../globals"; import styles from "./expression.css"; import SectionHeader from "../framework/sectionHeader" +import actions from "../../actions"; @connect((state) => { - return { - expression: state.expression.data + expression: state.expression.data, + currentCellSelection: state.controls.currentCellSelection, + differential: state.differential } }) class Expression extends React.Component { @@ -26,11 +28,71 @@ class Expression extends React.Component { }); } } + set1() { + const set = []; + + _.each(this.props.currentCellSelection, (cell) => { + if (cell["__selected__"]) { + set.push(cell.CellName) + } + }) + + this.props.dispatch({ + type: "store current cell selection as differential set 1", + data: set + }) + } + set2() { + const set = []; + + _.each(this.props.currentCellSelection, (cell) => { + if (cell["__selected__"]) { + set.push(cell.CellName) + } + }) + + this.props.dispatch({ + type: "store current cell selection as differential set 2", + data: set + }) + } + computeDiffExp() { + this.props.dispatch( + actions.requestDifferentialExpression( + this.props.differential.celllist1, + this.props.differential.celllist2 + ) + ) + } render () { if (!this.props.expression) return null + + console.log('expression render sees', this.props.differential) return (
- + +
+ + + + Gene count: + +
+ { _.map(this.props.expression.genes, (gene) => { return (