Published
Edited
Mar 12, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
circosChromosomesOfInterest = ["chr20", "chr21", "chr22"]
Insert cell
circosBigwigDefaultZoomLevel = 4
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/**
* Get bigwig data from file(s) at specified zoom level
*
* @param chrom chromosome name (UCSC-formatted)
* @param zoomLevel the zoom level at which to retrieve data
* (1-9: 1 is usually the highest zoom level; values higher than 4
* are clipped to 4 to reduce network traffic)
*
* @return bigwig data
**/
async function bigwigDataForChromosomeAndZoomLevel(chrom, zoomLevel) {
zoomLevel = zoomLevel < 1 || zoomLevel > 4 ? 4 : parseInt(zoomLevel);
return await Promise.all(
bigwigReaders.map(bigwigReader =>
bigwigReader.readZoomData(
chrom,
0,
chrom,
chromsizeForChrom(chrom),
zoomLevel
)
)
);
}
Insert cell
Insert cell
// bigwigHeaders = await Promise.all(
// bigwigReaders.map(bigwigReader => bigwigReader.getHeader())
// )
Insert cell
// bigwigSummaries = await Promise.all(
// bigwigHeaders.map(bigwigHeader => bigwigHeader.totalSummary)
// )
Insert cell
// chr14TestData = await Promise.all(
// bigwigReaders.map(bigwigReader =>
// bigwigReader.readBigWigData("chr14", 19_485_000, "chr14", 19_500_000)
// )
// )
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chr2Size = chromsizeForChrom("chr2")
Insert cell
Insert cell
Insert cell
Insert cell
cytobands = d3.tsvParseRows(cytobandTxt, d => {
return { chrom: d[0], start: +d[1], stop: +d[2], id: d[3], gieStain: d[4] };
})
Insert cell
cytobandForChrom = function(chrom) {
return cytobands.filter(d => d.chrom === chrom)[0].stop;
}
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