index.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  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. <button style="padding: 3px;" onclick="superposed()">Superposed</button>
  76. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  77. <button style="padding: 3px;" onclick="motifs1()">Motifs 1</button>
  78. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  79. <button style="padding: 3px;" onclick="motifs2()">Motifs 2</button>
  80. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  81. <button style="padding: 3px" onclick="propset()">Propset</button>
  82. </div>
  83. <script>
  84. function loadExample(index) {
  85. var e = examples[index]
  86. viewer.loadPdbId(e.id, e.props)
  87. }
  88. var examples = [
  89. {
  90. id: '1CRN',
  91. info: 'small: only polymer',
  92. props: {
  93. kind: 'validation'
  94. }
  95. },
  96. {
  97. id: '3CUP',
  98. info: 'small',
  99. props: {
  100. kind: 'density'
  101. }
  102. },
  103. {
  104. id: '6JI7',
  105. info: 'small: NMR structure with RCI'
  106. },
  107. {
  108. id: '3PQR',
  109. info: 'medium: polymer, carbs, ligands',
  110. props: {
  111. kind: 'feature',
  112. assemblyId: '2',
  113. target: {
  114. label_comp_id: 'RET'
  115. }
  116. }
  117. },
  118. {
  119. id: '1NMR',
  120. info: 'medium: nmr models',
  121. props: {
  122. kind: 'standard',
  123. modelIndex: 2
  124. }
  125. },
  126. {
  127. id: '4HHB',
  128. info: 'medium: classic, lots of validation geometry problems',
  129. props: {
  130. kind: 'standard',
  131. assemblyId: '1'
  132. }
  133. },
  134. {
  135. id: '1A6D',
  136. info: 'medium: dihedral symmetry (D8)',
  137. props: {
  138. kind: 'symmetry',
  139. assemblyId: '1',
  140. symmetryIndex: 1
  141. }
  142. },
  143. {
  144. id: '1LTI',
  145. info: 'medium: local symmetry (C5)'
  146. },
  147. {
  148. id: '1QO1',
  149. info: 'medium: C-alpha only, local symmetries (C10, C3)'
  150. },
  151. {
  152. id: '6V9Q',
  153. info: 'medium: local symmetries (H, C2)'
  154. },
  155. {
  156. id: '6R6B',
  157. info: 'medium: local symmetries (H x2)'
  158. },
  159. {
  160. id: '2VTU',
  161. info: 'medium: octahedral symmetry (O)'
  162. },
  163. {
  164. id: '4NWP',
  165. info: 'medium: tetrahedral symmetry (T)'
  166. },
  167. {
  168. id: '1RB8',
  169. info: 'medium-large: small virus capsid, icosahedral symmetry (I)'
  170. },
  171. {
  172. id: '6QVK',
  173. info: 'large: The cryo-EM structure of bacteriophage phi29 prohead (C5)'
  174. },
  175. {
  176. id: '5Y6P',
  177. info: 'large: Structure of the phycobilisome from the red alga Griffithsia pacifica'
  178. },
  179. {
  180. id: '6O2S',
  181. info: 'large: Deacetylated Microtubules (H)'
  182. },
  183. {
  184. id: '5MQ7',
  185. info: 'large: Structure of AaLS-13'
  186. },
  187. {
  188. id: '5IV5',
  189. info: 'large: Cryo-electron microscopy structure of the hexagonal pre-attachment T4 baseplate-tail tube complex'
  190. },
  191. {
  192. id: '3JC8',
  193. info: 'large: Architectural model of the type IVa pilus machine in a piliated state'
  194. },
  195. {
  196. id: '4V99',
  197. info: 'large: The Crystallographic Structure of Panicum Mosaic Virus'
  198. },
  199. {
  200. id: '3J3Q',
  201. info: 'large: Atomic-level structure of the entire HIV-1 capsid'
  202. },
  203. {
  204. id: '6NCL',
  205. info: 'large: Near-atomic structure of icosahedrally averaged PBCV-1 capsid'
  206. },
  207. {
  208. id: '6EKC',
  209. info: 'large: Crystal structure of the BSD2 homolog of Arabidopsis thaliana bound to the octameric assembly of RbcL from Thermosynechococcus elongatus'
  210. },
  211. {
  212. id: '1M4X',
  213. info: 'large: PBCV-1 virus capsid, quasi-atomic model'
  214. },
  215. {
  216. id: '4V5A',
  217. info: 'large: Structure of the Ribosome Recycling Factor bound to the Thermus thermophilus 70S ribosome with mRNA, ASL-Phe and tRNA-fMet'
  218. },
  219. {
  220. id: '4UDF',
  221. info: 'large: STRUCTURAL BASIS OF HUMAN PARECHOVIRUS NEUTRALIZATION BY HUMAN MONOCLONAL ANTIBODIES'
  222. },
  223. {
  224. id: '6J5K',
  225. info: 'Cryo-EM structure of the mammalian ATP synthase tetramer bound with inhibitory protein IF1'
  226. },
  227. {
  228. id: '6RVV',
  229. info: 'Structure of left-handed protein cage consisting of 24 eleven-membered ring proteins held together by gold (I) bridges.'
  230. },
  231. {
  232. id: '6EK5',
  233. info: 'Near-atomic resolution structure of a plant geminivirus determined by electron cryo-microscopy'
  234. },
  235. {
  236. id: '4V93',
  237. info: 'Fitted coordinates for Lumbricus terrestris hemoglobin cryo-EM complex'
  238. },
  239. {
  240. id: '5VLZ',
  241. info: 'Backbone model for phage Qbeta capsid'
  242. },
  243. {
  244. id: '5XTI',
  245. info: 'Cryo-EM architecture of human respiratory chain megacomplex-I2III2IV2'
  246. },
  247. {
  248. id: '6BY7',
  249. info: 'Folding DNA into a lipid-conjugated nano-barrel for controlled reconstitution of membrane proteins'
  250. },
  251. {
  252. id: '6C50',
  253. info: 'Cross-alpha Amyloid-like Structure alphaAmS'
  254. },
  255. {
  256. id: '6K3I',
  257. info: 'Salmonella hook in curved state - 66 subunit models'
  258. },
  259. {
  260. id: '1UNO',
  261. info: 'Crystal structure of a d,l-alternating peptide. Double-starnded helix from beta-sheets.'
  262. },
  263. {
  264. id: '1GRM',
  265. info: 'REFINEMENT OF THE SPATIAL STRUCTURE OF THE GRAMICIDIN A TRANSMEMBRANE ION-CHANNEL. Single-starnded helix from beta-sheet. NMR structure.'
  266. },
  267. {
  268. id: '1B5F',
  269. info: 'oligosaccharide: NATIVE CARDOSIN A FROM CYNARA CARDUNCULUS L.',
  270. props: {
  271. kind: 'feature',
  272. target: {
  273. label_asym_id: 'E'
  274. }
  275. }
  276. },
  277. {
  278. id: '1BRR',
  279. info: 'membrane: X-RAY STRUCTURE OF THE BACTERIORHODOPSIN TRIMER/LIPID COMPLEX with ANVIL membrane prediction',
  280. props: {
  281. kind: 'membrane'
  282. }
  283. },
  284. {
  285. id: '3SN6',
  286. info: 'membrane: Crystal structure of the beta2 adrenergic receptor-Gs protein complex with ANVIL membrane prediction',
  287. props: {
  288. kind: 'membrane'
  289. }
  290. },
  291. {
  292. id: '1SQX',
  293. info: 'membrane + assembly: Crystal Structure Analysis of Bovine Bc1 with Stigmatellin A',
  294. props: {
  295. kind: 'membrane',
  296. assemblyId: '1'
  297. }
  298. },
  299. {
  300. id: '6WJC',
  301. info: 'ligand validation: Muscarinic acetylcholine receptor 1 - muscarinic toxin 7 complex: Focus + Density',
  302. props: {
  303. kind: 'feature-density',
  304. target: {
  305. label_asym_id: 'D',
  306. auth_seq_id: 502
  307. },
  308. // radius: 0,
  309. // hiddenChannels: ['fo-fc(+ve)', 'fo-fc(-ve)']
  310. }
  311. },
  312. {
  313. id: '5RL9',
  314. info: 'ligand focus on wrong assembly: Crystal Structure of SARS-CoV-2 helicase in complex with Z1703168683',
  315. props: {
  316. kind: 'feature',
  317. assemblyId: '1',
  318. // UR7 is not present in assembly 1
  319. target: {
  320. label_comp_id: 'UR7'
  321. }
  322. }
  323. },
  324. {
  325. id: '5VL5',
  326. info: 'motif selection with operator: Coordination Chemistry within a Protein Host: Regulation of the Secondary Coordination Sphere',
  327. props: {
  328. kind: 'motif',
  329. assemblyId: '1',
  330. targets: [
  331. { label_asym_id: 'A', label_seq_id: 61 },
  332. { label_asym_id: 'A', label_seq_id: 69 },
  333. { label_asym_id: 'A', label_seq_id: 87, operatorName: 'ASM_4' }
  334. ],
  335. }
  336. },
  337. {
  338. id: '5VL5',
  339. info: 'motif selection with strucmotif-expression: Coordination Chemistry within a Protein Host: Regulation of the Secondary Coordination Sphere',
  340. props: {
  341. kind: 'motif',
  342. assemblyId: '1',
  343. targets: [
  344. { label_asym_id: 'A', label_seq_id: 61 },
  345. { label_asym_id: 'A', label_seq_id: 69 },
  346. { label_asym_id: 'A', label_seq_id: 87, struct_oper_id: '4' }
  347. ],
  348. }
  349. },
  350. {
  351. id: '2BFU',
  352. info: 'motif selection with strucmotif-expression: X-ray structure of CPMV top component',
  353. props: {
  354. kind: 'motif',
  355. assemblyId: '6',
  356. targets: [
  357. { label_asym_id: 'A', label_seq_id: 46, struct_oper_id: 'X0x5' },
  358. { label_asym_id: 'A', label_seq_id: 49, struct_oper_id: 'X0x5' },
  359. { label_asym_id: 'A', label_seq_id: 145, struct_oper_id: 'X0x5' }
  360. ],
  361. }
  362. },
  363. {
  364. id: '1G2F',
  365. info: 'motif selection with strucmotif-expression & chain: STRUCTURE OF A CYS2HIS2 ZINC FINGER/TATA BOX COMPLEX (TATAZF;CLONE #6)',
  366. props: {
  367. kind: 'motif',
  368. targets: [
  369. { label_asym_id: 'F', label_seq_id: 7 },
  370. { label_asym_id: 'F', label_seq_id: 25 },
  371. { label_asym_id: 'F', label_seq_id: 29 }
  372. ],
  373. }
  374. }
  375. ];
  376. var examplesSelect = document.getElementById('examples');
  377. for (var i = 0, il = examples.length; i < il; ++i) {
  378. var e = examples[i]
  379. var option = document.createElement('option')
  380. Object.assign(option, { text: '[' + e.id + '] ' + e.info, value: i })
  381. examplesSelect.appendChild(option)
  382. }
  383. //
  384. function superposed() {
  385. viewer.clear()
  386. .then(function() {
  387. return viewer.loadPdbId('3pqr', { kind: 'standard', assemblyId: '1' })
  388. })
  389. .then(function() {
  390. return viewer.loadPdbId('1u19', { kind: 'standard', assemblyId: '1' }, [
  391. -0.67160917400372, 0.28222298510688404, 0.6850488398834855, 0,
  392. 0.13262098666685063, 0.9554691407700946, -0.26361033961856695, 0,
  393. -0.7289399153866256, -0.08619120567473626, -0.6791305379047228, 0,
  394. -7.602670654900173, -30.317901981509067, 24.605855585357773, 1
  395. ])
  396. })
  397. .then(function() {
  398. viewer.resetCamera(0)
  399. });
  400. }
  401. function motifs1() {
  402. viewer.clear()
  403. .then(function() {
  404. return viewer.loadPdbIds([{
  405. pdbId: '5CBG',
  406. props: {
  407. label: '5CBG',
  408. kind: 'motif',
  409. // assemblyId: '2', // library should be able to infer assemblyId of the query
  410. targets: [
  411. { label_asym_id: 'C', label_seq_id: 30, struct_oper_id: '3' },
  412. { label_asym_id: 'C', label_seq_id: 32, struct_oper_id: '3' },
  413. { label_asym_id: 'C', label_seq_id: 34, struct_oper_id: '3' }
  414. ],
  415. // color: 13203230
  416. }
  417. }, {
  418. pdbId: '2W02',
  419. props: {
  420. label: '2W02 #1',
  421. kind: 'motif',
  422. assemblyId: '2',
  423. targets: [
  424. { label_asym_id: 'B', label_seq_id: 519 },
  425. { label_asym_id: 'B', label_seq_id: 517 },
  426. { label_asym_id: 'B', label_seq_id: 515 }
  427. ],
  428. // color: 4947916
  429. },
  430. matrix: [
  431. 0.7953831708253857, -0.6048923987758781, 0.03835097744411625, 0,
  432. -0.23732979915044658, -0.2525976533016715, 0.9380133218572628, 0,
  433. -0.5577097614377604, -0.7551818399893184, -0.344470913935246, 0,
  434. 154.77888998938096, 207.0215940587305, 25.17873980937774, 1
  435. ]
  436. }]);
  437. })
  438. .then(function() {
  439. viewer.resetCamera(0)
  440. });
  441. }
  442. function motifs2() {
  443. viewer.clear()
  444. .then(function() {
  445. return viewer.loadPdbIds([{
  446. pdbId: '1M4X',
  447. props: {
  448. label: '1M4X',
  449. kind: 'motif',
  450. // assemblyId: '7', // library should be able to infer assemblyId of the query
  451. targets: [
  452. { label_asym_id: 'C', label_seq_id: 161, struct_oper_id: 'Px81' },
  453. { label_asym_id: 'C', label_seq_id: 165, struct_oper_id: 'Px81' },
  454. { label_asym_id: 'C', label_seq_id: 170, struct_oper_id: 'Px81' }
  455. ],
  456. // color: 13203230
  457. }
  458. }, {
  459. pdbId: '6KIN',
  460. props: {
  461. label: '6KIN @ 1.88 RMSD',
  462. kind: 'motif',
  463. assemblyId: '1',
  464. targets: [
  465. { label_asym_id: 'B', label_seq_id: 160 },
  466. { label_asym_id: 'B', label_seq_id: 163 },
  467. { label_asym_id: 'B', label_seq_id: 167 }
  468. ],
  469. // color: 13203230
  470. },
  471. matrix: [
  472. -0.8175763932146345, -0.5719837107806522, 0.0663586909134339, 0,
  473. -0.4927708198934652, 0.7546183669143351, 0.43327593907008527, 0,
  474. -0.29790226638894773, 0.32153655300313416, -0.8988150448024284, 0,
  475. 340.5134831570596, -107.81055538151446, 774.3972821273203, 1.0
  476. ]
  477. }]);
  478. })
  479. .then(function() {
  480. viewer.resetCamera(0)
  481. });
  482. }
  483. function propset() {
  484. viewer.clear()
  485. .then(function () {
  486. return viewer.loadPdbIds([{
  487. pdbId: '4HHB',
  488. props: {
  489. kind: 'prop-set',
  490. representation: [{
  491. name: 'color',
  492. positions: [{
  493. label_asym_id: 'A',
  494. label_seq_id: { beg: 4, end: 141 }
  495. }],
  496. value: 13203230
  497. }],
  498. selection: [{
  499. label_asym_id: 'A',
  500. label_seq_id: { beg: 4, end: 141 }
  501. }]
  502. }
  503. }, {
  504. pdbId: '1OJ6',
  505. props: {
  506. kind: 'prop-set',
  507. representation: [{
  508. name: 'color',
  509. positions: [{
  510. label_asym_id: 'A',
  511. label_seq_id: { beg: 3, end: 44 }
  512. }, {
  513. label_asym_id: 'A',
  514. label_seq_id: { beg: 48, end: 49 }
  515. }, {
  516. label_asym_id: 'A',
  517. label_seq_id: { beg: 54, end: 95 }
  518. }, {
  519. label_asym_id: 'A',
  520. label_seq_id: { beg: 98, end: 149 }
  521. }],
  522. value: 4947916
  523. }],
  524. selection: [{
  525. label_asym_id: 'A',
  526. label_seq_id: { beg: 3, end: 44 }
  527. }, {
  528. label_asym_id: 'A',
  529. label_seq_id: { beg: 48, end: 49 }
  530. }, {
  531. label_asym_id: 'A',
  532. label_seq_id: { beg: 54, end: 95 }
  533. }, {
  534. label_asym_id: 'A',
  535. label_seq_id: { beg: 98, end: 149 }
  536. }]
  537. },
  538. matrix: [
  539. -0.6263111483773867, -0.38259812283613237, -0.6792297268380318, 0.0,
  540. 0.3014888059527303, 0.6846150421427817, -0.6636314820418288, 0.0,
  541. 0.7189150473480135, -0.6204199549290021, -0.313432982027257, 0.0,
  542. -30.829713890311414, 24.04442469172666, 55.437150645037654, 1.0
  543. ]
  544. }]);
  545. })
  546. .then(function () {
  547. viewer.resetCamera(0)
  548. });
  549. }
  550. </script>
  551. </body>
  552. </html>