Published
Edited
Sep 7, 2022
1 star
Insert cell
# Calling GRCh37 CGR
Insert cell
{
const chrName = "1";
const pos = 123456
const startByte = pos-2;
const endByte = pos;
const msg = await (await fetch(`https://storage.googleapis.com/storage/v1/b/chaos-game-representation-grch37/o/chr${chrName}%2Fsequence.bin?alt=media`, { headers: {
"Content-Type": "application/octet-stream",
"Range": `bytes=${startByte}-${endByte}`}})).arrayBuffer();
const view = new DataView(msg);
let seq = ""
for (let i=0; i < view.byteLength; i++) {
seq += String.fromCharCode(view.getUint8(i));
}
return seq;
}
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