Gene sets UI, right sidebar refactor (#2097)

* prototyping

* render histos on open gene set

* prototyping

* render histos on open gene set

* factor out add genes to own component

* remove unused import

* mock reducer

* color by geneset stub

* menus and buttons

* geneset dialogue stub

* remove heatmap mock

* componetize histogram

* reenable add genes

* re-add isuserdefined

* test data

* remove have fetched

* add isExpanded state to gene, and pass to histogram

* expand button

* toggleable

* mini

* bump number of genes to 50

* don't clear diffexp on subset

* move create category to top

* render diffexp as geneset

* geneset show mean expression

* gene set reducer

* add geneset UI reducer

* wire e2e gene set loading prototype

* fix sniffing bug

* fix typo

* add gene modals

* client/src/actions/

* add autosave

* rename data-dir cli param

* add geneset, add gene, delete set

* prototype: remove csv upload placeholder

* handle delete gene from set

* prepopulate geneset with genes from modal

* add geneset: rename action

* icons, language consistency

* chevron after

* handle empty string case on genes for create geneset

* edit geneset

* fix language on create

* copy correction

* add popper2
upgrade react popper
upgrade react popper
adding popover2 package

* truncate uses tooltip2

* gene set button text typo

* remove logging

* moving server over

* remove test imports

* don't try to destructure map, use array.from

* fix add gene map datastructure error

* Revert "fix add gene map datastructure error"

This reverts commit b0eed45952.

* name --> genesetName, genes --> geneSymbols

* add gene to geneset, temporary format

* handle empty case, clear form input

* lint -- genesets wasn't passed via props

* userinfo

* move genes string to object conversion to action

* remove tmp gene description

* emptystring default for description

* remove empty string

* remove top level package json

* remove package lock as well

* remove flag for feature toggle

* remove comments in geneset

* comment cleanup

* remove comment

* revert diffexp genes to 10

* color by gene set

* disable color by gene set

* Gene menus are now inline, remove dead prototype code

* remove todo, magic number to variable

* remove jshint in rightsidebar

Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>

* remove unused geneset validation code

* tmp format pending geneset description

* move magic number into variable

* reorganize genesetsUI reducer pending tests

* rewire edit given new action name

* add basic validation and feedback for geneset name uniqueness

* mv annoDialog

* mv label, repair paths

* Update client/src/components/brushableHistogram/header.js

Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>

* add imports for icon in histo

* update jest snapshots given blueprint/tooltip2 usage of index -1

* ensure no empty paragraph

* intent from blueprint

* remove remainder of jshint references

* do not push undo when autosave fires

* fix autosave bugs

* remove todos

* clamp to util

* scient to util

* revert clearing diffexp

* rename value to be more specific stacked bar

* clean up logging and commetns

* remove gene entry tests pending rewrite

* tab index -1

* update jest snapshot, blueprint tooltip 2

* caret margin

* snapshot update

* ensure histogram is centered

* add geneset actions to config

* comment maybeScientific

* comment clamp

* comment ui reducer

* remove prototype code

* remove error log

* remove references to bl.ocks

* componetize parseBulkGeneString

* catch case where geneset rename same name

* genesetui reducer tests

* add geneset ui to index reducer config

Co-authored-by: bkmartinjr <bruce@chanzuckerberg.com>
Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>
This commit is contained in:
Colin Megill
2021-03-24 16:33:26 -04:00
committed by GitHub
co-authored by Severiano Badajoz bkmartinjr
parent 5335c39184
commit e6e358ddc8
66 changed files with 1926 additions and 905 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ const Autosave = (
return {
...state,
genesetSaveInProgress: false,
lastSavedGenesets: nextSharedState.genesets,
lastSavedGenesets: nextSharedState.genesets.genesets,
};
}
-1
View File
@@ -1,4 +1,3 @@
// jshint esversion: 6
const Config = (
state = {
displayNames: null,
-2
View File
@@ -1,5 +1,3 @@
// jshint esversion: 6
import _ from "lodash";
import { subsetAndResetGeneLists } from "../util/stateManager/controlsHelpers";
-2
View File
@@ -1,5 +1,3 @@
// jshint esversion: 6
const Differential = (
state = {
diffExp: null,
+1
View File
@@ -200,6 +200,7 @@ const GeneSets = (
*/
case "geneset: add genes": {
const { genesetName, genes } = action;
if (!state.genesets.has(genesetName))
throw new Error("geneset: add genes -- geneset name does not exist.");
+88
View File
@@ -0,0 +1,88 @@
/*
Reducers for geneset UI-state.
*/
const GeneSetsUI = (
state = {
createGenesetModeActive: false,
isEditingGenesetName: false,
isAddingGenesToGeneset: false,
},
action
) => {
switch (action.type) {
/**
* Activate interface for adding a new geneset
* No params, if the action is fired we flip
* a boolean here.
*/
case "geneset: activate add new geneset mode": {
return {
...state,
createGenesetModeActive: true,
};
}
/**
* Disable interface for adding a new geneset
* No params, if the action is fired we flip
* a boolean here.
*/
case "geneset: disable create geneset mode": {
return {
...state,
createGenesetModeActive: false,
};
}
/**
* Activate the interface for adding new genes to a geneset
* isAddingGenesToGeneset {
* geneset: string, name of geneset
* },
*/
case "geneset: activate add new genes mode": {
return {
...state,
isAddingGenesToGeneset: action.geneset,
};
}
/**
* Disable the interface for adding new genes to a geneset
* No params, if the action is fired we flip
* a boolean here.
*/
case "geneset: disable add new genes mode": {
return {
...state,
isAddingGenesToGeneset: false,
};
}
/**
* Activate the interface for renaming a geneset
* isEditingGenesetName: {
* type: "geneset: activate rename geneset mode",
* data: geneset, // a string, name of geneset
* }
*/
case "geneset: activate rename geneset mode": {
return {
...state,
isEditingGenesetName: action.data,
};
}
/**
* Disable the interface for renaming a geneset
* No params, if the action is fired we flip
* a boolean here.
*/
case "geneset: disable rename geneset mode": {
return {
...state,
isEditingGenesetName: false,
};
}
default:
return state;
}
};
export default GeneSetsUI;
+3
View File
@@ -16,6 +16,7 @@ import layoutChoice from "./layoutChoice";
import controls from "./controls";
import annotations from "./annotations";
import genesets from "./genesets";
import genesetsUI from "./genesetsUI";
import autosave from "./autosave";
import ontology from "./ontology";
import centroidLabels from "./centroidLabels";
@@ -33,6 +34,7 @@ const Reducer = undoable(
["ontology", ontology],
["annotations", annotations],
["genesets", genesets],
["genesetsUI", genesetsUI],
["layoutChoice", layoutChoice],
["categoricalSelection", categoricalSelection],
["continuousSelection", continuousSelection],
@@ -58,6 +60,7 @@ const Reducer = undoable(
"layoutChoice",
"centroidLabels",
"genesets",
"genesetsUI",
"annotations",
],
undoableConfig
+21
View File
@@ -17,6 +17,8 @@ const skipOnActions = new Set([
"window resize",
"reset colorscale",
"reset centroid labels",
"geneset: initial load",
"geneset: set tid",
"graph brush change",
"continuous metadata histogram brush",
@@ -30,6 +32,9 @@ const skipOnActions = new Set([
"writable obs annotations - save complete",
"writable obs annotations - save started",
"writable obs annotations - save error",
"autosave: genesets started",
"autosave: genesets error",
"autosave: genesets complete",
/* annotation component action */
"annotation: activate add new label mode",
@@ -39,6 +44,14 @@ const skipOnActions = new Set([
"annotation: activate edit label mode",
"annotation: cancel edit label mode",
"set annotations collection name",
/* geneset component action */
"geneset: activate add new geneset mode",
"geneset: disable create geneset mode",
"geneset: activate add new genes mode",
"geneset: disable add new genes mode",
"geneset: activate rename geneset mode",
"geneset: disable rename geneset mode",
]);
/*
@@ -90,6 +103,14 @@ const saveOnActions = new Set([
"annotation: label current cell selection",
"annotation: delete label",
"annotation: category edited",
/* geneset component action */
"geneset: create",
"geneset: delete",
"geneset: update",
"geneset: add genes",
"geneset: delete genes",
"geneset: set gene description",
]);
/**