-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdbd90a
commit b095d64
Showing
1 changed file
with
10 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}; | ||
} |