Published
Edited
Aug 4, 2021
2 stars
Insert cell
Insert cell
Insert cell
data = {
const r = [
{tool: "FGS", type: "short", reads: 23373, theads: 1, time: 11.2361},
{tool: "FGS+", type: "short", reads: 23373, theads: 1, time: 1.1971},
{tool: "FGSrs", type: "short", reads: 23373, theads: 1, time: 0.9974},
{tool: "FGS", type: "long", reads: 19349, theads: 1, time: 31.7019},
{tool: "FGS+", type: "long", reads: 19349, theads: 1, time: 10.5704},
{tool: "FGSrs", type: "long", reads: 19349, theads: 1, time: 8.643},
];
r.forEach(d => {
if (d.type === "short") d.type = "Short reads (80bp)";
if (d.type === "long") d.type = "Long reads (1328bp)";
d.rps = d.reads / d.time;
});
return r;
}

Insert cell
Insert cell
vl.markBar()
.data(data)
.encode(
vl.x().fieldQ("rps").axis({ title: "Reads per second", titleFontSize: 10 }),
vl.y().fieldN("tool").title(null).axis({labelAlign: "left", labelPadding: 32}),
vl.color().fieldN("tool").legend(null),
vl.row({spacing: 10}).fieldN("type").header({ labelFontWeight: "bold", title: null, labelOrient: "top", labelAnchor: "start", labelFontSize: 12, labelPadding: 0 }).sort(["Short reads (80bp)"]),
)
.resolve({ scale: { x: "independent" } })
.title({text: "Performance of the FragGeneScan implementations",subtitle: "Reads per second – higher is better", dy: -3})
.width(300)
.render()
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more