Skip to content

Commit

Permalink
Merge pull request #685 from chanzuckerberg/main
Browse files Browse the repository at this point in the history
chore: deploy staging <- main
  • Loading branch information
Daniel Hegeman authored Dec 14, 2023
2 parents 79acc47 + cd045db commit 2803e19
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions client/src/components/geneExpression/quickGene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ function QuickGene() {
const df: Dataframe = await annoMatrix.fetch("var", varIndex);
let dfIds: Dataframe;
const geneIdCol = "feature_id";
const isFilteredCol = "feature_is_filtered";
const isFiltered =
annoMatrix.getMatrixColumns("var").includes(isFilteredCol) &&
(await annoMatrix.fetch("var", isFilteredCol));

// if feature id column is available in var
if (annoMatrix.getMatrixColumns("var").includes(geneIdCol)) {
Expand All @@ -69,7 +73,20 @@ function QuickGene() {
}

setStatus("success");
setGeneNames(df.col(varIndex).asArray() as DataframeValue[]);

if (isFiltered) {
const isFilteredArray = isFiltered.col(isFilteredCol).asArray();
setGeneNames(
df
.col(varIndex)
.asArray()
.filter(
(_, index) => !isFilteredArray[index] && _
) as DataframeValue[]
);
} else {
setGeneNames(df.col(varIndex).asArray() as DataframeValue[]);
}
} catch (error) {
setStatus("error");
throw error;
Expand Down Expand Up @@ -159,7 +176,6 @@ function QuickGene() {
);
});
}, [userDefinedGenes, geneNames, geneIds, dispatch]);

return (
<div style={{ width: "100%", marginBottom: "16px" }}>
<H4
Expand Down

0 comments on commit 2803e19

Please sign in to comment.