Published unlisted
Edited
Apr 8, 2022
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
sars_cov2_phylogeny = {
let root = await FileAttachment('cleaned_cov2_data.json').json()

let accumulate_fitness_mutation = (node,d) => {
node.date = new Date(node.date)
node.year = node.date.getUTCFullYear()
node.month = node.date.getUTCMonth()
node.depth = d
let children = node.children
if(children.length == 0) {
return node.mutational_fitness
}

let summed_fitness = 0
for(let c = 0; c < children.length; c++) {
let child_fitness = accumulate_fitness_mutation(children[c],d+1)
summed_fitness += child_fitness
}
node.mutational_fitness = summed_fitness
return summed_fitness
}
accumulate_fitness_mutation(root,1)
return root
}
Insert cell
Insert cell
cleaned_geo_data = await FileAttachment('cleaned_geo_data.json').json()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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