INNER CODE UNIT · JavaScript

fmtSci

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

function fmtSci(value) {
  const number = Number(value);
  return Number.isFinite(number)
    ? number.toExponential(1)
    : "NA";
}
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;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…