taxonium-component
Version:
React component for exploring large phylogenetic trees in the browser
37 lines (36 loc) • 1.11 kB
JavaScript
import { r as n } from "./rxjs-BnZkaVAs.js";
import { S as o } from "./simpleFeature-Bntv68qr.js";
import f from "./FromConfigAdapter-CiB-ZikG.js";
import { a2 as u, a3 as d } from "./JBrowsePanel-uJIA-L6s.js";
class l extends f {
getFeatures(e) {
return n.ObservableCreate(async (a) => {
const t = (await u(super.getFeatures(e).pipe(d())))[0];
a.next(new o({
...t.toJSON(),
uniqueId: `${t.id()}:${e.start}-${e.end}`,
end: e.end,
start: e.start,
seq: t.get("seq").slice(Math.max(e.start - t.get("start"), 0), Math.max(e.end - t.get("start"), 0))
})), a.complete();
});
}
async getRegions() {
const e = [];
for (const [a, r] of this.features) {
let t;
for (const s of r)
t && t.end >= s.get("start") && t.start <= s.get("end") ? t.end = s.get("end") : (t && e.push(t), t = {
refName: a,
start: s.get("start"),
end: s.get("end")
});
t && e.push(t);
}
return e;
}
}
export {
l as default
};
//# sourceMappingURL=FromConfigSequenceAdapter-FArXfA_e.js.map