Skip to content

Commit

Permalink
feat(geneset): save diff exp result as geneset (#2216)
Browse files Browse the repository at this point in the history
* update package lock

* allow falsey vals

* remove old diff exp handling

* save diff exp results as geneset

* delete test

* check for undefined or null

* use global geneset description for diffexp

* remove diffexp special code, no longer showing adjpval + logfoldchange

* remove differential map to state

* remove clear from FSM, since we no longer support those actions

* restore controlHelpers test with todo
  • Loading branch information
seve authored May 25, 2021
1 parent 6f6634a commit a4050f1
Show file tree
Hide file tree
Showing 23 changed files with 21,894 additions and 355 deletions.
34 changes: 2 additions & 32 deletions client/__tests__/util/stateManager/controlsHelpers.test.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
/*
test controls helpers
*/
import { subsetAndResetGeneLists } from "../../../src/util/stateManager/controlsHelpers";
import * as globals from "../../../src/globals";

describe("controls helpers", () => {
test("subsetAndResetGeneLists", () => {
const geneList = [];
const genRandGene = () => Math.random().toString(36).substring(2, 6);

// build a unique set of genes
for (let i = 0; i < 150; i += 1) {
let randGene = genRandGene();
while (geneList.includes(randGene)) randGene = genRandGene();
geneList.push(randGene);
}
// insert duplicates
geneList[0] = "dupl";
geneList[20] = "dupl";
const state = {
userDefinedGenes: geneList.slice(0, 20),
diffexpGenes: geneList.slice(20),
};
const [newUserDefinedGenes, newDiffExpGenes] = subsetAndResetGeneLists(
state
);
const expectedNewUserDefinedGenes = [
...geneList.slice(0, 20),
...geneList.slice(21),
].slice(0, globals.maxGenes);
expect(globals.maxUserDefinedGenes).toBeLessThan(globals.maxGenes);
expect(geneList.length).toBeGreaterThan(globals.maxGenes);
expect(newUserDefinedGenes).toHaveLength(globals.maxGenes);
expect(newUserDefinedGenes).toStrictEqual(expectedNewUserDefinedGenes);
expect(newDiffExpGenes).toStrictEqual([]);
});
// TODO #2227 test: improve test coverage on control helper functions
// (`topNCategories()`, `isSelectableCategoryName()`, `selectableCategoryNames()`, `createCategorySummaryFromDfCol()`, `createCategoricalSelection()`, )
});
Loading

0 comments on commit a4050f1

Please sign in to comment.