add GET routes for expression data (#1387)

* add GET routes for expression data

* fix comment typo
This commit is contained in:
Bruce Martin
2020-04-13 11:28:35 -07:00
committed by GitHub
parent 98c2a1359b
commit 136093d583
7 changed files with 323 additions and 139 deletions
+27 -26
View File
@@ -20,8 +20,6 @@ const Controls = (
scatterplotXXaccessor: null, // just easier to read
scatterplotYYaccessor: null,
graphRenderCounter: 0 /* integer as <Component key={graphRenderCounter} - a change in key forces a remount */,
__storedStateForCelllist1__: null /* will need procedural control of brush ie., brush.extent https://bl.ocks.org/micahstubbs/3cda05ca68cba260cb81 */,
__storedStateForCelllist2__: null
},
action,
nextSharedState,
@@ -62,7 +60,7 @@ const Controls = (
universeExists &&
embeddingsExist &&
varAnnotationsIndexExists
)
),
};
}
case "initial data load complete (universe exists)": {
@@ -71,38 +69,42 @@ const Controls = (
...state,
loading: false,
error: null,
resettingInterface: false
resettingInterface: false,
};
}
case "reset World to eq Universe": {
const [ newUserDefinedGenes, newDiffExpGenes ] = subsetAndResetGeneLists(state);
const [newUserDefinedGenes, newDiffExpGenes] = subsetAndResetGeneLists(
state
);
return {
...state,
resettingInterface: false,
userDefinedGenes: newUserDefinedGenes,
diffexpGenes: newDiffExpGenes
diffexpGenes: newDiffExpGenes,
};
}
case "set World to current selection": {
const [ newUserDefinedGenes, newDiffExpGenes ] = subsetAndResetGeneLists(state);
const [newUserDefinedGenes, newDiffExpGenes] = subsetAndResetGeneLists(
state
);
return {
...state,
loading: false,
error: null,
userDefinedGenes: newUserDefinedGenes,
diffexpGenes: newDiffExpGenes
diffexpGenes: newDiffExpGenes,
};
}
case "request user defined gene started": {
return {
...state,
userDefinedGenesLoading: true
userDefinedGenesLoading: true,
};
}
case "request user defined gene error": {
return {
...state,
userDefinedGenesLoading: false
userDefinedGenesLoading: false,
};
}
case "request user defined gene success": {
@@ -113,50 +115,49 @@ const Controls = (
return {
...state,
userDefinedGenes: _userDefinedGenes,
userDefinedGenesLoading: false
userDefinedGenesLoading: false,
};
}
case "request differential expression success": {
const { world } = prevSharedState;
const varIndexName = world.schema.annotations.var.index;
const _diffexpGenes = [];
action.data.forEach(d => {
action.data.forEach((d) => {
_diffexpGenes.push(world.varAnnotations.at(d[0], varIndexName));
});
return {
...state,
diffexpGenes: _diffexpGenes
diffexpGenes: _diffexpGenes,
};
}
case "clear differential expression": {
return {
...state,
diffexpGenes: []
diffexpGenes: [],
};
}
case "clear user defined gene": {
const { userDefinedGenes } = state;
const newUserDefinedGenes = _.filter(
userDefinedGenes,
d => d !== action.data
(d) => d !== action.data
);
return {
...state,
userDefinedGenes: newUserDefinedGenes
userDefinedGenes: newUserDefinedGenes,
};
}
case "clear all user defined genes": {
return {
...state,
userDefinedGenes: []
userDefinedGenes: [],
};
}
case "expression load error":
case "initial data load error": {
return {
...state,
loading: false,
error: action.error
error: action.error,
};
}
@@ -166,24 +167,24 @@ const Controls = (
case "change graph interaction mode":
return {
...state,
graphInteractionMode: action.data
graphInteractionMode: action.data,
};
case "change opacity deselected cells in 2d graph background":
return {
...state,
opacityForDeselectedCells: action.data
opacityForDeselectedCells: action.data,
};
case "increment graph render counter": {
const c = state.graphRenderCounter + 1;
return {
...state,
graphRenderCounter: c
graphRenderCounter: c,
};
}
case "interface reset started": {
return {
...state,
resettingInterface: true
resettingInterface: true,
};
}
@@ -193,18 +194,18 @@ const Controls = (
case "set scatterplot x":
return {
...state,
scatterplotXXaccessor: action.data
scatterplotXXaccessor: action.data,
};
case "set scatterplot y":
return {
...state,
scatterplotYYaccessor: action.data
scatterplotYYaccessor: action.data,
};
case "clear scatterplot":
return {
...state,
scatterplotXXaccessor: null,
scatterplotYYaccessor: null
scatterplotYYaccessor: null,
};
default: