Public
Edited
Apr 24, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//pbd file is attached for now, can pull from the web.
pdbText = REM2_PDB.text()
Insert cell
Insert cell
schemeId = {
return NGL.ColormakerRegistry.addScheme(function (params) {
this.atomColor = function (atom) {
if(selected_sites[atom.residue.resno]) {
console.log("# Site: " + atom.residue.resno)
let site_color = "gray"; // gray for Neutral
console.log("Class: " + selected_sites[atom.residue.resno].class)
if (selected_sites[atom.residue.resno].class == "Purifying") {
site_color = "red";
}

if (selected_sites[atom.residue.resno].class == "Diversifying") {
site_color = "blue";
}

if (selected_sites[atom.residue.resno].class == "Invariable") {
site_color = "yellow";
}

return color_hash[site_color];
//return color_hash[selected_sites[atom.residue.resno].color];
}
else {
// gray
//return 0x808080;
return color_hash["gray"]
}
}
})
}
Insert cell
Insert cell
Insert cell
html`<div id='alignment_div'>`
Insert cell
d3=require("d3")
Insert cell
bioseq = require("bioseq")
Insert cell
React = r('react')
Insert cell
r = require.alias({
react: "react@16/umd/react.production.min.js",
"react-dom": "react-dom@16/umd/react-dom.production.min.js"
})
Insert cell
Insert cell
Insert cell
// component.defaultParameters
Insert cell
selected_sites = {
let site_table = ResultsTable;
let site_hash = {};
site_table.forEach(site_datum => site_hash[+site_datum.PDBSite] = site_datum);
return site_hash;
}
Insert cell
Insert cell
Insert cell
Insert cell
import {textcolor} from "@observablehq/text-color-annotations-in-markdown"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
color_hash = {
return {
blue: 0x00FFFF,
red: 0xcf5b5b,
yellow: 0xFFFF00,
green: 0x5fcf5b,
pink: 0xFFC0CB,
gray: 0x808080
};
}
Insert cell
selection_string = _.map (
Object.keys(selected_sites), (i, s) => ['A'].map(chain => i + ':' + chain).join(" OR ")
).join (" OR ")
Insert cell
Insert cell
REM2_PDB = FileAttachment("3cbq.pdb")
Insert cell
Insert cell
ResultsTable = FileAttachment("mammalian_REM2_StructureView@9.csv").csv()
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more