index.html 11 KB

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