INNER CODE UNIT · JavaScript

motifLabel

oncologylab/fp-tools · src/fp_tools/resources/static_browser/app.js:59

function motifLabel(motif) {
  return motif
    ? `${motif.name}${motif.motif_id ? ` (${motif.motif_id})` : ""}`
    : "";
}
function sampleDisplayName(sample, condition = "") {
  if (sample && typeof sample === "object" && sample.display_name)
    return String(sample.display_name);
  const name = String(sample?.name ?? sample ?? "");
  if (name.includes("::")) return name.split("::").slice(1).join("::");
  const prefix = condition ? `${condition}_` : "";
  return prefix && name.startsWith(prefix) ? name.slice(prefix.length) : name;
}
function logp(value) {
  return -Math.log10(Math.max(1e-300, finite(value, 1)));
}
function niceStep(range, count = 5) {
  const raw = Math.max(range / count, 1e-12),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…