Skip to content

Commit 0abcf69

Browse files
authored
Merge pull request #93 from Integrative-Transcriptomics/dev
Dev
2 parents 37b0e38 + 825e753 commit 0abcf69

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/Result/UpSet.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function UpSet({ showUpSet, allGenomes, filterForPlots, tableColumns, tableData,
7373
};
7474
useEffect(() => {
7575
/**
76-
* for upset plot: count frequncy of each tss class
76+
* for upset plot: count frequency of each tss class
7777
* and get all genome/condition names
7878
*/
7979
const TSSperPosition = (rows, columns) => {
@@ -82,9 +82,14 @@ function UpSet({ showUpSet, allGenomes, filterForPlots, tableColumns, tableData,
8282
const secondaryIdx = columns.findIndex((col) => col["header"] === "Secondary");
8383
const internalIdx = columns.findIndex((col) => col["header"] === "Internal");
8484
const antisenseIdx = columns.findIndex((col) => col["header"] === "Antisense");
85-
const superPosIdx = columns.findIndex((col) => col["header"] === "SuperPos");
85+
// Either SuperPos or Pos
86+
// if superPos is not in the columns, use the Pos column
87+
const allHeaders = columns.map((col) => col["header"]);
88+
const searchForPos = allHeaders.includes("SuperPos") ? "SuperPos" : "Pos";
89+
const superPosIdx = columns.findIndex((col) => col["header"] === searchForPos);
8690
const variableFilterTSS = columns.findIndex((col) => col["header"] === filterForPlots);
87-
const superStrandIdx = columns.findIndex((col) => col["header"] === "SuperStrand");
91+
const searchForStrand = allHeaders.includes("SuperStrand") ? "SuperStrand" : "Strand";
92+
const superStrandIdx = columns.findIndex((col) => col["header"] === searchForStrand);
8893

8994

9095

0 commit comments

Comments
 (0)