index.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  6. <link rel="icon" href="./favicon.ico" type="image/x-icon">
  7. <title>RCSB PDB Mol* Viewer</title>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. box-sizing: border-box;
  13. }
  14. #viewer {
  15. position: absolute;
  16. left: 5%;
  17. top: 100px;
  18. min-width: 90%;
  19. height: 85%;
  20. }
  21. .msp-layout-expanded {
  22. z-index: 10;
  23. }
  24. #menu {
  25. position: absolute;
  26. left: 5%;
  27. top: 20px;
  28. }
  29. #menu > select {
  30. width: 200px;
  31. }
  32. </style>
  33. <link rel="stylesheet" type="text/css" href="rcsb-molstar.css" />
  34. <script type="text/javascript" src="./rcsb-molstar.js"></script>
  35. </head>
  36. <body>
  37. <div id="viewer"></div>
  38. <script>
  39. function getQueryParam(id) {
  40. var a = new RegExp(id + '=([^&#=]*)', 'i')
  41. var m = a.exec(window.location.search)
  42. return m ? decodeURIComponent(m[1]) : undefined
  43. }
  44. var isEmbedded = getQueryParam('embedded') === '1';
  45. var pdbId = getQueryParam('pdbId')
  46. var url = getQueryParam('url')
  47. var _props = getQueryParam('props')
  48. var props = _props && JSON.parse(_props)
  49. var _loadPdbIds = getQueryParam('loadPdbIds')
  50. var loadPdbIds = _loadPdbIds && JSON.parse(_loadPdbIds)
  51. // create an instance of the plugin
  52. var viewer = new rcsbMolstar.Viewer('viewer', {
  53. showImportControls: !pdbId,
  54. showExportControls: true,
  55. showSessionControls: !pdbId,
  56. layoutShowLog: !pdbId,
  57. layoutShowControls: !isEmbedded,
  58. showMembraneOrientationPreset: true
  59. })
  60. // load pdbId or url
  61. if (pdbId) viewer.loadPdbId(pdbId, props)
  62. else if (loadPdbIds) viewer.loadPdbIds(loadPdbIds);
  63. else if (url) viewer.loadUrl(url, props)
  64. </script>
  65. <div id="menu">
  66. <h2> RCSB PDB Mol* Viewer - Test Page</h2>
  67. Examples
  68. <select id="examples" onchange="loadExample(parseInt(this.value))">
  69. <option value=''></option>
  70. </select>
  71. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  72. Clear
  73. <button style="padding: 3px;" onclick="viewer.clear()">all</button>
  74. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  75. Superposed
  76. <button style="padding: 3px;" onclick="superposed()">3PQR | 1U19</button>
  77. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  78. Superpose Motifs
  79. <button style="padding: 3px;" onclick="motifs()">4CHA | 6YIW</button>
  80. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  81. Superpose Propset
  82. <button style="padding: 3px" onclick="propset()">4HHB | 1OJ6</button>
  83. </div>
  84. <script>
  85. function loadExample(index) {
  86. var e = examples[index]
  87. viewer.loadPdbId(e.id, e.props)
  88. }
  89. var examples = [
  90. {
  91. id: '1CRN',
  92. info: 'small: only polymer',
  93. props: {
  94. kind: 'validation'
  95. }
  96. },
  97. {
  98. id: '3CUP',
  99. info: 'small',
  100. props: {
  101. kind: 'density'
  102. }
  103. },
  104. {
  105. id: '6JI7',
  106. info: 'small: NMR structure with RCI'
  107. },
  108. {
  109. id: '3PQR',
  110. info: 'medium: polymer, carbs, ligands',
  111. props: {
  112. kind: 'feature',
  113. assemblyId: '2',
  114. target: {
  115. label_comp_id: 'RET'
  116. }
  117. }
  118. },
  119. {
  120. id: '1NMR',
  121. info: 'medium: nmr models',
  122. props: {
  123. kind: 'standard',
  124. modelIndex: 2
  125. }
  126. },
  127. {
  128. id: '4HHB',
  129. info: 'medium: classic, lots of validation geometry problems',
  130. props: {
  131. kind: 'standard',
  132. assemblyId: '1'
  133. }
  134. },
  135. {
  136. id: '1A6D',
  137. info: 'medium: dihedral symmetry (D8)',
  138. props: {
  139. kind: 'symmetry',
  140. assemblyId: '1',
  141. symmetryIndex: 1
  142. }
  143. },
  144. {
  145. id: '1LTI',
  146. info: 'medium: local symmetry (C5)'
  147. },
  148. {
  149. id: '1QO1',
  150. info: 'medium: C-alpha only, local symmetries (C10, C3)'
  151. },
  152. {
  153. id: '6V9Q',
  154. info: 'medium: local symmetries (H, C2)'
  155. },
  156. {
  157. id: '6R6B',
  158. info: 'medium: local symmetries (H x2)'
  159. },
  160. {
  161. id: '2VTU',
  162. info: 'medium: octahedral symmetry (O)'
  163. },
  164. {
  165. id: '4NWP',
  166. info: 'medium: tetrahedral symmetry (T)'
  167. },
  168. {
  169. id: '1RB8',
  170. info: 'medium-large: small virus capsid, icosahedral symmetry (I)'
  171. },
  172. {
  173. id: '6QVK',
  174. info: 'large: The cryo-EM structure of bacteriophage phi29 prohead (C5)'
  175. },
  176. {
  177. id: '5Y6P',
  178. info: 'large: Structure of the phycobilisome from the red alga Griffithsia pacifica'
  179. },
  180. {
  181. id: '6O2S',
  182. info: 'large: Deacetylated Microtubules (H)'
  183. },
  184. {
  185. id: '5MQ7',
  186. info: 'large: Structure of AaLS-13'
  187. },
  188. {
  189. id: '5IV5',
  190. info: 'large: Cryo-electron microscopy structure of the hexagonal pre-attachment T4 baseplate-tail tube complex'
  191. },
  192. {
  193. id: '3JC8',
  194. info: 'large: Architectural model of the type IVa pilus machine in a piliated state'
  195. },
  196. {
  197. id: '4V99',
  198. info: 'large: The Crystallographic Structure of Panicum Mosaic Virus'
  199. },
  200. {
  201. id: '3J3Q',
  202. info: 'large: Atomic-level structure of the entire HIV-1 capsid'
  203. },
  204. {
  205. id: '6NCL',
  206. info: 'large: Near-atomic structure of icosahedrally averaged PBCV-1 capsid'
  207. },
  208. {
  209. id: '6EKC',
  210. info: 'large: Crystal structure of the BSD2 homolog of Arabidopsis thaliana bound to the octameric assembly of RbcL from Thermosynechococcus elongatus'
  211. },
  212. {
  213. id: '1M4X',
  214. info: 'large: PBCV-1 virus capsid, quasi-atomic model'
  215. },
  216. {
  217. id: '4V5A',
  218. info: 'large: Structure of the Ribosome Recycling Factor bound to the Thermus thermophilus 70S ribosome with mRNA, ASL-Phe and tRNA-fMet'
  219. },
  220. {
  221. id: '4UDF',
  222. info: 'large: STRUCTURAL BASIS OF HUMAN PARECHOVIRUS NEUTRALIZATION BY HUMAN MONOCLONAL ANTIBODIES'
  223. },
  224. {
  225. id: '6J5K',
  226. info: 'Cryo-EM structure of the mammalian ATP synthase tetramer bound with inhibitory protein IF1'
  227. },
  228. {
  229. id: '6RVV',
  230. info: 'Structure of left-handed protein cage consisting of 24 eleven-membered ring proteins held together by gold (I) bridges.'
  231. },
  232. {
  233. id: '6EK5',
  234. info: 'Near-atomic resolution structure of a plant geminivirus determined by electron cryo-microscopy'
  235. },
  236. {
  237. id: '4V93',
  238. info: 'Fitted coordinates for Lumbricus terrestris hemoglobin cryo-EM complex'
  239. },
  240. {
  241. id: '5VLZ',
  242. info: 'Backbone model for phage Qbeta capsid'
  243. },
  244. {
  245. id: '5XTI',
  246. info: 'Cryo-EM architecture of human respiratory chain megacomplex-I2III2IV2'
  247. },
  248. {
  249. id: '6BY7',
  250. info: 'Folding DNA into a lipid-conjugated nano-barrel for controlled reconstitution of membrane proteins'
  251. },
  252. {
  253. id: '6C50',
  254. info: 'Cross-alpha Amyloid-like Structure alphaAmS'
  255. },
  256. {
  257. id: '6K3I',
  258. info: 'Salmonella hook in curved state - 66 subunit models'
  259. },
  260. {
  261. id: '1UNO',
  262. info: 'Crystal structure of a d,l-alternating peptide. Double-starnded helix from beta-sheets.'
  263. },
  264. {
  265. id: '1GRM',
  266. info: 'REFINEMENT OF THE SPATIAL STRUCTURE OF THE GRAMICIDIN A TRANSMEMBRANE ION-CHANNEL. Single-starnded helix from beta-sheet. NMR structure.'
  267. },
  268. {
  269. id: '1B5F',
  270. info: 'oligosaccharide: NATIVE CARDOSIN A FROM CYNARA CARDUNCULUS L.',
  271. props: {
  272. kind: 'feature',
  273. target: {
  274. label_asym_id: 'E'
  275. }
  276. }
  277. },
  278. {
  279. id: '1BRR',
  280. info: 'membrane: X-RAY STRUCTURE OF THE BACTERIORHODOPSIN TRIMER/LIPID COMPLEX with ANVIL membrane prediction',
  281. props: {
  282. kind: 'membrane'
  283. }
  284. },
  285. {
  286. id: '3SN6',
  287. info: 'membrane: Crystal structure of the beta2 adrenergic receptor-Gs protein complex with ANVIL membrane prediction',
  288. props: {
  289. kind: 'membrane'
  290. }
  291. },
  292. {
  293. id: '1SQX',
  294. info: 'membrane + assembly: Crystal Structure Analysis of Bovine Bc1 with Stigmatellin A',
  295. props: {
  296. kind: 'membrane',
  297. assemblyId: '1'
  298. }
  299. },
  300. {
  301. id: '6WJC',
  302. info: 'ligand validation: Muscarinic acetylcholine receptor 1 - muscarinic toxin 7 complex: Focus + Density',
  303. props: {
  304. kind: 'feature-density',
  305. target: {
  306. label_asym_id: 'D',
  307. auth_seq_id: 502
  308. },
  309. // radius: 0,
  310. // hiddenChannels: ['fo-fc(+ve)', 'fo-fc(-ve)']
  311. }
  312. },
  313. {
  314. id: '5RL9',
  315. info: 'ligand focus on wrong assembly: Crystal Structure of SARS-CoV-2 helicase in complex with Z1703168683',
  316. props: {
  317. kind: 'feature',
  318. assemblyId: '1',
  319. // UR7 is not present in assembly 1
  320. target: {
  321. label_comp_id: 'UR7'
  322. }
  323. }
  324. },
  325. {
  326. id: '5VL5',
  327. info: 'motif selection with operator: Coordination Chemistry within a Protein Host: Regulation of the Secondary Coordination Sphere',
  328. props: {
  329. kind: 'motif',
  330. assemblyId: '1',
  331. targets: [
  332. { label_asym_id: 'A', label_seq_id: 61 },
  333. { label_asym_id: 'A', label_seq_id: 69 },
  334. { label_asym_id: 'A', label_seq_id: 87, operatorName: 'ASM_4' }
  335. ],
  336. }
  337. }
  338. ];
  339. var examplesSelect = document.getElementById('examples');
  340. for (var i = 0, il = examples.length; i < il; ++i) {
  341. var e = examples[i]
  342. var option = document.createElement('option')
  343. Object.assign(option, { text: '[' + e.id + '] ' + e.info, value: i })
  344. examplesSelect.appendChild(option)
  345. }
  346. //
  347. function superposed() {
  348. viewer.clear()
  349. .then(function() {
  350. return viewer.loadPdbId('3pqr', { kind: 'standard', assemblyId: '1' })
  351. })
  352. .then(function() {
  353. return viewer.loadPdbId('1u19', { kind: 'standard', assemblyId: '1' }, [
  354. -0.67160917400372, 0.28222298510688404, 0.6850488398834855, 0,
  355. 0.13262098666685063, 0.9554691407700946, -0.26361033961856695, 0,
  356. -0.7289399153866256, -0.08619120567473626, -0.6791305379047228, 0,
  357. -7.602670654900173, -30.317901981509067, 24.605855585357773, 1
  358. ])
  359. })
  360. .then(function() {
  361. viewer.resetCamera(0)
  362. });
  363. }
  364. function motifs() {
  365. viewer.clear()
  366. .then(function() {
  367. return viewer.loadPdbIds([{
  368. pdbId: '4cha',
  369. props: {
  370. label: '4CHA',
  371. kind: 'motif',
  372. assemblyId: '1',
  373. targets: [
  374. { label_asym_id: 'B', label_seq_id: 42 },
  375. { label_asym_id: 'B', label_seq_id: 87 },
  376. { label_asym_id: 'C', label_seq_id: 47 }
  377. ],
  378. // color: 13203230
  379. }
  380. }, {
  381. pdbId: '6yiw',
  382. props: {
  383. label: '6YIW #1',
  384. kind: 'motif',
  385. assemblyId: '1',
  386. targets: [
  387. { label_asym_id: 'A', label_seq_id: 40 },
  388. { label_asym_id: 'A', label_seq_id: 84 },
  389. { label_asym_id: 'A', label_seq_id: 177 }
  390. ],
  391. // color: 4947916
  392. },
  393. matrix: [
  394. 0.1651637134205112, 0.7020365618749254, 0.6927233311791812, 0,
  395. 0.39076998819946046, 0.5983062863806071, -0.6995201240851049, 0,
  396. -0.9055494266420474, 0.3862308292566522, -0.17551633097799743, 0,
  397. 2.4392572425563213, 13.865339409688449, 28.536458135725827, 1
  398. ]
  399. }]);
  400. })
  401. .then(function() {
  402. viewer.resetCamera(0)
  403. });
  404. }
  405. function propset() {
  406. viewer.clear()
  407. .then(function () {
  408. return viewer.loadPdbIds([{
  409. pdbId: '4HHB',
  410. props: {
  411. kind: 'prop-set',
  412. representation: [{
  413. name: 'color',
  414. positions: [{
  415. label_asym_id: 'A',
  416. label_seq_id: { beg: 4, end: 141 }
  417. }],
  418. value: 13203230
  419. }],
  420. selection: [{
  421. label_asym_id: 'A',
  422. label_seq_id: { beg: 4, end: 141 }
  423. }]
  424. }
  425. }, {
  426. pdbId: '1OJ6',
  427. props: {
  428. kind: 'prop-set',
  429. representation: [{
  430. name: 'color',
  431. positions: [{
  432. label_asym_id: 'A',
  433. label_seq_id: { beg: 3, end: 44 }
  434. }, {
  435. label_asym_id: 'A',
  436. label_seq_id: { beg: 48, end: 49 }
  437. }, {
  438. label_asym_id: 'A',
  439. label_seq_id: { beg: 54, end: 95 }
  440. }, {
  441. label_asym_id: 'A',
  442. label_seq_id: { beg: 98, end: 149 }
  443. }],
  444. value: 4947916
  445. }],
  446. selection: [{
  447. label_asym_id: 'A',
  448. label_seq_id: { beg: 3, end: 44 }
  449. }, {
  450. label_asym_id: 'A',
  451. label_seq_id: { beg: 48, end: 49 }
  452. }, {
  453. label_asym_id: 'A',
  454. label_seq_id: { beg: 54, end: 95 }
  455. }, {
  456. label_asym_id: 'A',
  457. label_seq_id: { beg: 98, end: 149 }
  458. }]
  459. },
  460. matrix: [
  461. -0.6263111483773867, -0.38259812283613237, -0.6792297268380318, 0.0,
  462. 0.3014888059527303, 0.6846150421427817, -0.6636314820418288, 0.0,
  463. 0.7189150473480135, -0.6204199549290021, -0.313432982027257, 0.0,
  464. -30.829713890311414, 24.04442469172666, 55.437150645037654, 1.0
  465. ]
  466. }]);
  467. })
  468. .then(function () {
  469. viewer.resetCamera(0)
  470. });
  471. }
  472. </script>
  473. </body>
  474. </html>