Skip to content

Commit

Permalink
skip UMAP when number of cases is greater than 500
Browse files Browse the repository at this point in the history
  • Loading branch information
Ren Zuo committed Nov 15, 2021
1 parent 4648580 commit 07050f3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions histoqc/ui/UserInterface/scripts/data_load.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ function load_raw_data () {
.text("Current dataset: " + cur_file.name + " | Size: " +
ORIGINAL_DATASET.length + " slides");

if (ORIGINAL_DATASET.length >= 500) {
CALC_UMAP = false;
} else {
CALC_UMAP = true;
}

// update all necessary global variables -------------------------------
// build case list
ORIGINAL_CASE_LIST = ORIGINAL_DATASET.map(function (d) {
Expand Down
1 change: 1 addition & 0 deletions histoqc/ui/UserInterface/scripts/global_vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ var CHART_SVG, PARAC_SVG,
var PARA_COOR_SELECTED;
var CURRENT_PARALLEL_ATTRIBUTES;
var COLOR_PLATE = [];
var CALC_UMAP;

/****************** IMAGE VIEW ****************/
var SKIP_IMAGE_EXTENSIONS = [];
Expand Down
13 changes: 13 additions & 0 deletions histoqc/ui/UserInterface/scripts/scatter_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@ function calc_umap_embedding (cases) {
});

return data;
} else if (!CALC_UMAP) {
var data = cases.map(function (d, i) {
return {
case_name: d["filename"],
groupid: d["groupid"],
testind: d["testind"],
x_pos: 0,
y_pos: 0
};
});

return data;
} else {
var pre_matrix = cases.map(function (d) {
var case_value = [];
Expand Down Expand Up @@ -376,6 +388,7 @@ function init_scatter_vars_selector(
});

$("#umap-rerun-btn").on("click", function () {
CALC_UMAP = true;
update_chart_view("scatter_plot", CURRENT_MULTI_SELECTED);
});

Expand Down

0 comments on commit 07050f3

Please sign in to comment.