Public
Edited
Sep 8, 2023
4 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
input_counts = FileAttachment("znormalized_counts@5.txt").text()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
znormalized_counts.columns
Insert cell
znormalized_counts.rows
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
average = d3.mean(data.map(d=> d.value))
Insert cell
Insert cell
margin = ({ top: 10, left: 150, right: 40, bottom: 50 })
Insert cell
height = 1000
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chartClustered.drawData(20)
Insert cell
upgma_result = {
let dataPerGene = separateByGene(data)
return upgma(dataPerGene,20)
}
Insert cell
Insert cell
Insert cell
function upgma(data, threshold) {
// Initialize clusters with individual data points
const clusters = data.map((item, index) => new Cluster(item[0], 1, [item[0]], item[1]));
// Calculate the pairwise distance matrix
const distanceMatrix = calculateDistanceMatrix(clusters);
// Run UPGMA on the given distance matrix
return helper_upgma(distanceMatrix, threshold, clusters)
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
euclideanDistance([3, 4, 4, 6, 7, 14, 15], [9, 6, 6, 7, 6, 15, 19])
Insert cell
Insert cell
Insert cell
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