Skip to content

Commit

Permalink
Update options-util.js
Browse files Browse the repository at this point in the history
  • Loading branch information
vickydaiya authored Dec 1, 2023
1 parent fdbd90a commit b095d64
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions steps/js/options-util.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
var ALGORITHMS = ['azimuth', 'celltypist', 'popv'];
var ALGORITHMS = ["azimuth", "celltypist", "popv"];

function _find_algorithm(obj) {
for (var spec of obj.algorithms) {
for (var key of Object.keys(spec)) {
if (ALGORITHMS.includes(key)) {
return key;
}
for (var index = 0; index < ALGORITHMS.length; ++index) {
var name = ALGORITHMS[index];
if (typeof obj[name] === "object") {
return name;
}
}
return undefined;

return null;
}

function selectOutputDirectory(obj) {
return obj['directory'] || _find_algorithm(obj) || '.';
return obj["directory"] || _find_algorithm(obj) || ".";
}

function getSummarizeOptions(obj) {
function getDefaultSummarizeOptions(obj) {
return {
annotationMethod: _find_algorithm(obj) || 'unknown',
...(obj.algorithms.splice(-1)[0].summarize ?? {}),
annotationMethod: _find_algorithm(obj) || "unknown",
};
}

0 comments on commit b095d64

Please sign in to comment.