add diff exp action

This commit is contained in:
Colin Megill
2017-12-29 00:15:53 -08:00
parent 80c5d056ad
commit b22d5bc3e5
+24 -2
View File
@@ -117,7 +117,28 @@ const ___hardcoded___requestGeneExpressionCountsPOST = () => {
}
}
const requestDifferentialExpression = (celllist1, celllist2, num_genes = 5) => {
return (dispatch, getState) => {
dispatch({type: "request differential expression started"})
fetch(`${globals.API.prefix}${globals.API.version}diffexpression`, {
method: "POST",
body: JSON.stringify({
celllist1,
celllist2,
num_genes,
}),
headers: new Headers({
"accept": "application/json",
"Content-Type": "application/json"
})
})
.then(res => res.json())
.then(
data => dispatch({type: "request differential expression success", data}),
error => dispatch({type: "request differential expression error", error})
)
}
}
export default {
initialize,
@@ -125,5 +146,6 @@ export default {
requestGeneExpressionCounts,
___hardcoded___requestGeneExpressionCountsPOST,
attemptCategoricalMetadataSelection,
attemptCategoricalMetadataDeselection
attemptCategoricalMetadataDeselection,
requestDifferentialExpression
}