index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. })
  59. // load pdbId or url
  60. if (pdbId) viewer.loadPdbId(pdbId, props)
  61. else if (loadPdbIds) viewer.loadPdbIds(loadPdbIds);
  62. else if (url) viewer.loadUrl(url, props)
  63. </script>
  64. <div id="menu">
  65. <h2> RCSB PDB Mol* Viewer - Test Page</h2>
  66. Examples
  67. <select id="examples" onchange="loadExample(parseInt(this.value))">
  68. <option value=''></option>
  69. </select>
  70. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  71. Clear
  72. <button style="padding: 3px;" onclick="viewer.clear()">all</button>
  73. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  74. Superposed
  75. <button style="padding: 3px;" onclick="superposed()">3PQR | 1U19</button>
  76. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  77. Ligand Focus on wrong assembly
  78. <button style="padding: 3px" onclick="ligandAssembly()">5RLA</button>
  79. </div>
  80. <script>
  81. function loadExample(index) {
  82. var e = examples[index]
  83. viewer.loadPdbId(e.id, e.props)
  84. }
  85. var examples = [
  86. {
  87. id: '1CRN',
  88. info: 'small: only polymer',
  89. props: {
  90. kind: 'validation'
  91. }
  92. },
  93. {
  94. id: '3CUP',
  95. info: 'small',
  96. props: {
  97. kind: 'density'
  98. }
  99. },
  100. {
  101. id: '6JI7',
  102. info: 'small: NMR structure with RCI'
  103. },
  104. {
  105. id: '3PQR',
  106. info: 'medium: polymer, carbs, ligands',
  107. props: {
  108. kind: 'feature',
  109. assemblyId: '2',
  110. target: {
  111. label_comp_id: 'RET'
  112. }
  113. }
  114. },
  115. {
  116. id: '1NMR',
  117. info: 'medium: nmr models',
  118. props: {
  119. kind: 'standard',
  120. modelIndex: 2
  121. }
  122. },
  123. {
  124. id: '4HHB',
  125. info: 'medium: classic, lots of validation geometry problems',
  126. props: {
  127. kind: 'standard',
  128. assemblyId: '1'
  129. }
  130. },
  131. {
  132. id: '1A6D',
  133. info: 'medium: dihedral symmetry (D8)',
  134. props: {
  135. kind: 'symmetry',
  136. assemblyId: '1',
  137. symmetryIndex: 1
  138. }
  139. },
  140. {
  141. id: '1LTI',
  142. info: 'medium: local symmetry (C5)'
  143. },
  144. {
  145. id: '1QO1',
  146. info: 'medium: C-alpha only, local symmetries (C10, C3)'
  147. },
  148. {
  149. id: '6V9Q',
  150. info: 'medium: local symmetries (H, C2)'
  151. },
  152. {
  153. id: '6R6B',
  154. info: 'medium: local symmetries (H x2)'
  155. },
  156. {
  157. id: '2VTU',
  158. info: 'medium: octahedral symmetry (O)'
  159. },
  160. {
  161. id: '4NWP',
  162. info: 'medium: tetrahedral symmetry (T)'
  163. },
  164. {
  165. id: '1RB8',
  166. info: 'medium-large: small virus capsid, icosahedral symmetry (I)'
  167. },
  168. {
  169. id: '6QVK',
  170. info: 'large: The cryo-EM structure of bacteriophage phi29 prohead (C5)'
  171. },
  172. {
  173. id: '5Y6P',
  174. info: 'large: Structure of the phycobilisome from the red alga Griffithsia pacifica'
  175. },
  176. {
  177. id: '6O2S',
  178. info: 'large: Deacetylated Microtubules (H)'
  179. },
  180. {
  181. id: '5MQ7',
  182. info: 'large: Structure of AaLS-13'
  183. },
  184. {
  185. id: '5IV5',
  186. info: 'large: Cryo-electron microscopy structure of the hexagonal pre-attachment T4 baseplate-tail tube complex'
  187. },
  188. {
  189. id: '3JC8',
  190. info: 'large: Architectural model of the type IVa pilus machine in a piliated state'
  191. },
  192. {
  193. id: '4V99',
  194. info: 'large: The Crystallographic Structure of Panicum Mosaic Virus'
  195. },
  196. {
  197. id: '3J3Q',
  198. info: 'large: Atomic-level structure of the entire HIV-1 capsid'
  199. },
  200. {
  201. id: '6NCL',
  202. info: 'large: Near-atomic structure of icosahedrally averaged PBCV-1 capsid'
  203. },
  204. {
  205. id: '6EKC',
  206. info: 'large: Crystal structure of the BSD2 homolog of Arabidopsis thaliana bound to the octameric assembly of RbcL from Thermosynechococcus elongatus'
  207. },
  208. {
  209. id: '1M4X',
  210. info: 'large: PBCV-1 virus capsid, quasi-atomic model'
  211. },
  212. {
  213. id: '4V5A',
  214. info: 'large: Structure of the Ribosome Recycling Factor bound to the Thermus thermophilus 70S ribosome with mRNA, ASL-Phe and tRNA-fMet'
  215. },
  216. {
  217. id: '4UDF',
  218. info: 'large: STRUCTURAL BASIS OF HUMAN PARECHOVIRUS NEUTRALIZATION BY HUMAN MONOCLONAL ANTIBODIES'
  219. },
  220. {
  221. id: '6J5K',
  222. info: 'Cryo-EM structure of the mammalian ATP synthase tetramer bound with inhibitory protein IF1'
  223. },
  224. {
  225. id: '6RVV',
  226. info: 'Structure of left-handed protein cage consisting of 24 eleven-membered ring proteins held together by gold (I) bridges.'
  227. },
  228. {
  229. id: '6EK5',
  230. info: 'Near-atomic resolution structure of a plant geminivirus determined by electron cryo-microscopy'
  231. },
  232. {
  233. id: '4V93',
  234. info: 'Fitted coordinates for Lumbricus terrestris hemoglobin cryo-EM complex'
  235. },
  236. {
  237. id: '5VLZ',
  238. info: 'Backbone model for phage Qbeta capsid'
  239. },
  240. {
  241. id: '5XTI',
  242. info: 'Cryo-EM architecture of human respiratory chain megacomplex-I2III2IV2'
  243. },
  244. {
  245. id: '6BY7',
  246. info: 'Folding DNA into a lipid-conjugated nano-barrel for controlled reconstitution of membrane proteins'
  247. },
  248. {
  249. id: '6C50',
  250. info: 'Cross-alpha Amyloid-like Structure alphaAmS'
  251. },
  252. {
  253. id: '6K3I',
  254. info: 'Salmonella hook in curved state - 66 subunit models'
  255. },
  256. {
  257. id: '1UNO',
  258. info: 'Crystal structure of a d,l-alternating peptide. Double-starnded helix from beta-sheets.'
  259. },
  260. {
  261. id: '1GRM',
  262. info: 'REFINEMENT OF THE SPATIAL STRUCTURE OF THE GRAMICIDIN A TRANSMEMBRANE ION-CHANNEL. Single-starnded helix from beta-sheet. NMR structure.'
  263. },
  264. {
  265. id: '1B5F',
  266. info: 'oligosaccharide: NATIVE CARDOSIN A FROM CYNARA CARDUNCULUS L.',
  267. props: {
  268. kind: 'feature',
  269. target: {
  270. label_asym_id: 'E'
  271. }
  272. }
  273. },
  274. {
  275. id: '1BRR',
  276. info: 'membrane: X-RAY STRUCTURE OF THE BACTERIORHODOPSIN TRIMER/LIPID COMPLEX',
  277. props: {
  278. kind: 'membrane'
  279. }
  280. },
  281. {
  282. id: '3SN6',
  283. info: 'membrane: Crystal structure of the beta2 adrenergic receptor-Gs protein complex with ANVIL membrane prediction',
  284. props: {
  285. kind: 'membrane'
  286. }
  287. }
  288. ];
  289. var examplesSelect = document.getElementById('examples');
  290. for (var i = 0, il = examples.length; i < il; ++i) {
  291. var e = examples[i]
  292. var option = document.createElement('option')
  293. Object.assign(option, { text: '[' + e.id + '] ' + e.info, value: i })
  294. examplesSelect.appendChild(option)
  295. }
  296. //
  297. function superposed() {
  298. viewer.clear()
  299. .then(function() {
  300. return viewer.loadPdbId('3pqr', { kind: 'standard', assemblyId: '1' })
  301. })
  302. .then(function() {
  303. return viewer.loadPdbId('1u19', { kind: 'standard', assemblyId: '1' }, [
  304. -0.67160917400372, 0.28222298510688404, 0.6850488398834855, 0,
  305. 0.13262098666685063, 0.9554691407700946, -0.26361033961856695, 0,
  306. -0.7289399153866256, -0.08619120567473626, -0.6791305379047228, 0,
  307. -7.602670654900173, -30.317901981509067, 24.605855585357773, 1
  308. ])
  309. })
  310. .then(function() {
  311. viewer.resetCamera(0)
  312. });
  313. }
  314. function ligandAssembly() {
  315. viewer.clear()
  316. .then(function() {
  317. // UR7 is not present in assembly 1
  318. return viewer.loadPdbId('5RL9', { kind: 'feature', assemblyId: '1', target: { label_comp_id: 'UR7' } });
  319. });
  320. }
  321. </script>
  322. </body>
  323. </html>