Skip to content

Commit

Permalink
Update options-util.js
Browse files Browse the repository at this point in the history
  • Loading branch information
vickydaiya committed Nov 30, 2023
1 parent 574a8ba commit 4aee043
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions steps/js/options-util.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
var ALGORITHMS = ["azimuth", "celltypist", "popv"];
var ALGORITHMS = ['azimuth', 'celltypist', 'popv'];

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

return null;
return undefined;
}

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

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

0 comments on commit 4aee043

Please sign in to comment.