index.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@rcsb/rcsb-saguaro-3d</title><meta name="description" content="Documentation for @rcsb/rcsb-saguaro-3d"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@rcsb/rcsb-saguaro-3d</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1> @rcsb/rcsb-saguaro-3d </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography">
  2. <a href="#rcsb-saguaro-3d" id="rcsb-saguaro-3d" style="color: inherit; text-decoration: none;">
  3. <h1>rcsb-saguaro-3D</h1>
  4. </a>
  5. <p>RCSB Saguaro Web 3D is an open-source library built on the top of the <a href="https://rcsb.github.io/rcsb-saguaro">RCSB Saguaro 1D Feature Viewer</a>
  6. and <a href="https://github.com/rcsb/rcsb-Molstar">RCSB Molstar</a> designed to display protein features at the <a href="https://www.rcsb.org">RCSB Web Site</a>.
  7. The package collects protein annotations from the <a href="https://1d-coordinates.rcsb.org">1D Coordinate Server</a>
  8. and the main <a href="https://data.rcsb.org">RCSB Data API</a> and generates Protein Feature Summaries.
  9. The package allows access to RCSB Saguaro and Molstar methods to add or change the displayed data. </p>
  10. <div id="pfv"></div>
  11. <script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
  12. <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
  13. <script crossorigin src="https://cdn.jsdelivr.net/npm/@rcsb/rcsb-saguaro-3d/build/dist/app.js"></script>
  14. <script type="text/javascript">
  15. var __assign = (this && this.__assign) || function () {
  16. __assign = Object.assign || function(t) {
  17. for (var s, i = 1, n = arguments.length; i < n; i++) {
  18. s = arguments[i];
  19. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  20. t[p] = s[p];
  21. }
  22. return t;
  23. };
  24. return __assign.apply(this, arguments);
  25. };
  26. var rowConfigChainA = [
  27. {
  28. trackId: "sequenceTrack",
  29. trackHeight: 20,
  30. trackColor: "#F9F9F9",
  31. displayType: "sequence" /* SEQUENCE */,
  32. nonEmptyDisplay: true,
  33. rowTitle: "CHAIN A",
  34. trackData: [
  35. {
  36. begin: 1,
  37. value: "CGVPAIQPVLSGLSRIVNGEEAVPGSWPWQVSLQDKTGFHFCGGSLINENWVVTAAHCGVTTSDVVVAGEFDQGSSSEKIQKLKIAKVFKNSKYNSLTINNDITLLKLSTAASFSQTVSAVCLPSASDDFAAGTTCVTTGWGLTRYTNANTPDRLQQASLPLLSNTNCKKYWGTKIKDAMICAGASGVSSCMGDSGGPLVCKKNGAWTLVGIVSWGSSTCSTSTPGVYARVTALVNWVQQTLAAN"
  38. }
  39. ]
  40. }, {
  41. trackId: "blockTrack",
  42. trackHeight: 20,
  43. trackColor: "#F9F9F9",
  44. displayType: "block" /* BLOCK */,
  45. displayColor: "#76ae91",
  46. rowTitle: "FEATURE",
  47. trackData: [{
  48. begin: 20,
  49. end: 25
  50. }, {
  51. begin: 150,
  52. end: 160
  53. }]
  54. }
  55. ];
  56. var rowConfigChainB = [
  57. {
  58. trackId: "sequenceTrack",
  59. trackHeight: 20,
  60. trackColor: "#F9F9F9",
  61. displayType: "sequence" /* SEQUENCE */,
  62. nonEmptyDisplay: true,
  63. rowTitle: "CHAIN B",
  64. trackData: [
  65. {
  66. begin: 1,
  67. value: "TEFGSELKSFPEVVGKTVDQAREYFTLHYPQYDVYFLPEGSPVTLDLRYNRVRVFYNPGTNVVNHVPHVG"
  68. }
  69. ]
  70. }, {
  71. trackId: "blockTrack",
  72. trackHeight: 20,
  73. trackColor: "#F9F9F9",
  74. displayType: "block" /* BLOCK */,
  75. displayColor: "#f17070",
  76. rowTitle: "FEATURE",
  77. trackData: [{
  78. begin: 20,
  79. end: 50
  80. }]
  81. }
  82. ];
  83. var fvConfigChainA = {
  84. boardId: "1acb.A_board",
  85. boardConfig: {
  86. range: {
  87. min: 1,
  88. max: 245
  89. },
  90. disableMenu:true,
  91. rowTitleWidth: 80,
  92. trackWidth: 670,
  93. includeAxis: true
  94. },
  95. rowConfig: rowConfigChainA,
  96. sequenceSelectionChangeCallback: function (plugin, selectorManager, sequenceRegion) {
  97. selectorManager.clearSelection("select", { modelId: "1acb_board", labelAsymId: "A" });
  98. plugin.clearSelection("select", { modelId: "1acb_board", labelAsymId: "A" });
  99. if (sequenceRegion.length > 0) {
  100. var regions = sequenceRegion.map(function (r) {
  101. var _a;
  102. return ({
  103. modelId: "1acb_board",
  104. labelAsymId: "A",
  105. region: { begin: r.begin, end: (_a = r.end) !== null && _a !== void 0 ? _a : r.begin, source: "sequence" }
  106. });
  107. });
  108. selectorManager.addSelectionFromMultipleRegions(regions, "select");
  109. plugin.select(regions.map(function (r) { return (__assign(__assign({}, r), { begin: r.region.begin, end: r.region.end })); }), "select", "add");
  110. }
  111. else {
  112. plugin.resetCamera();
  113. }
  114. },
  115. sequenceElementClickCallback: function (plugin, selectorManager, d) {
  116. var _a;
  117. if (d != null)
  118. plugin.cameraFocus("1acb_board", "A", d.begin, (_a = d.end) !== null && _a !== void 0 ? _a : d.begin);
  119. },
  120. sequenceHoverCallback: function (plugin, selectorManager, elements) {
  121. if (elements == null || elements.length == 0)
  122. plugin.clearSelection("hover");
  123. else
  124. plugin.select(elements.map(function (e) {
  125. var _a;
  126. return ({
  127. modelId: "1acb_board",
  128. labelAsymId: "A",
  129. begin: e.begin,
  130. end: (_a = e.end) !== null && _a !== void 0 ? _a : e.begin
  131. });
  132. }), "hover", "set");
  133. },
  134. structureSelectionCallback: function (plugin, pfv, selection) {
  135. var sel = selection.getSelectionWithCondition("1acb_board", "A", "select");
  136. if (sel == null) {
  137. pfv.clearSelection("select");
  138. plugin.resetCamera();
  139. }
  140. else {
  141. pfv.setSelection({ elements: sel.regions, mode: "select" });
  142. }
  143. },
  144. structureHoverCallback: function (plugin, pfv, selection) {
  145. var sel = selection.getSelectionWithCondition("1acb_board", "A", "hover");
  146. if (sel == null)
  147. pfv.clearSelection("hover");
  148. else
  149. pfv.setSelection({ elements: sel.regions, mode: "hover" });
  150. }
  151. };
  152. var fvConfigChainB = {
  153. boardId: "1acb.B_board",
  154. boardConfig: {
  155. range: {
  156. min: 1,
  157. max: 70
  158. },
  159. disableMenu:true,
  160. rowTitleWidth: 80,
  161. trackWidth: 670,
  162. includeAxis: true
  163. },
  164. rowConfig: rowConfigChainB,
  165. sequenceSelectionChangeCallback: function (plugin, selectorManager, sequenceRegion) {
  166. selectorManager.clearSelection("select", { modelId: "1acb_board", labelAsymId: "B" });
  167. plugin.clearSelection("select", { modelId: "1acb_board", labelAsymId: "B" });
  168. if (sequenceRegion.length > 0) {
  169. var regions = sequenceRegion.map(function (r) {
  170. var _a;
  171. return ({
  172. modelId: "1acb_board",
  173. labelAsymId: "B",
  174. region: { begin: r.begin, end: (_a = r.end) !== null && _a !== void 0 ? _a : r.begin, source: "sequence" }
  175. });
  176. });
  177. selectorManager.addSelectionFromMultipleRegions(regions, "select");
  178. plugin.select(regions.map(function (r) { return (__assign(__assign({}, r), { begin: r.region.begin, end: r.region.end })); }), "select", "add");
  179. }
  180. else {
  181. plugin.resetCamera();
  182. }
  183. },
  184. sequenceElementClickCallback: function (plugin, selectorManager, d) {
  185. var _a;
  186. if (d != null)
  187. plugin.cameraFocus("1acb_board", "B", d.begin, (_a = d.end) !== null && _a !== void 0 ? _a : d.begin);
  188. },
  189. sequenceHoverCallback: function (plugin, selectorManager, elements) {
  190. if (elements == null || elements.length == 0)
  191. plugin.clearSelection("hover");
  192. else
  193. plugin.select(elements.map(function (e) {
  194. var _a;
  195. return ({
  196. modelId: "1acb_board",
  197. labelAsymId: "B",
  198. begin: e.begin,
  199. end: (_a = e.end) !== null && _a !== void 0 ? _a : e.begin
  200. });
  201. }), "hover", "set");
  202. },
  203. structureSelectionCallback: function (plugin, pfv, selection) {
  204. var sel = selection.getSelectionWithCondition("1acb_board", "B", "select");
  205. if (sel == null) {
  206. pfv.clearSelection("select");
  207. plugin.resetCamera();
  208. }
  209. else {
  210. pfv.setSelection({ elements: sel.regions, mode: "select" });
  211. }
  212. },
  213. structureHoverCallback: function (plugin, pfv, selection) {
  214. var sel = selection.getSelectionWithCondition("1acb_board", "B", "hover");
  215. if (sel == null)
  216. pfv.clearSelection("hover");
  217. else
  218. pfv.setSelection({ elements: sel.regions, mode: "hover" });
  219. }
  220. };
  221. var blockChainA = {
  222. blockId: "chainA",
  223. featureViewConfig: [fvConfigChainA]
  224. };
  225. var blockChainB = {
  226. blockId: "chainB",
  227. featureViewConfig: [fvConfigChainB]
  228. };
  229. var blockSelectorElement = function (blockSelectorManager) {
  230. return (React.createElement("div", null,
  231. React.createElement("select", { onChange: function (e) {
  232. blockSelectorManager.setActiveBlock(e.target.value);
  233. } },
  234. React.createElement("option", { value: "chainA" }, "Chain A"),
  235. React.createElement("option", { value: "chainB" }, "Chain B"))));
  236. };
  237. var customConfig = {
  238. blockConfig: [blockChainA, blockChainB],
  239. blockSelectorElement: blockSelectorElement
  240. };
  241. var sequenceConfig = {
  242. title: undefined,
  243. subtitle: undefined,
  244. config: customConfig
  245. };
  246. var MolstarConfig = {
  247. loadConfig: {
  248. loadMethod: "loadPdbIds",
  249. loadParams: [{
  250. pdbId: "1acb",
  251. id: "1acb_board"
  252. }]
  253. },
  254. pluginConfig: {
  255. showImportControls: true,
  256. showSessionControls: false
  257. },
  258. };
  259. document.addEventListener("DOMContentLoaded", function (event) {
  260. var panel3d = new RcsbFv3D.custom({
  261. elementId: "pfv",
  262. structurePanelConfig: MolstarConfig,
  263. sequencePanelConfig: sequenceConfig,
  264. cssConfig: {
  265. overwriteCss:true,
  266. rootPanel:{
  267. display:"flex",
  268. flexDirection:"column-reverse"
  269. },
  270. structurePanel:{
  271. width: 750,
  272. height: 700
  273. },
  274. sequencePanel:{
  275. width:750,
  276. marginBottom:5
  277. }
  278. },
  279. });
  280. panel3d.render();
  281. });
  282. </script>
  283. <a href="#cdn-javascript" id="cdn-javascript" style="color: inherit; text-decoration: none;">
  284. <h3>CDN JavaScript</h3>
  285. </a>
  286. <p><code>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@rcsb/rcsb-saguaro-3d/build/dist/app.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</code></p>
  287. <a href="#node-module-instalation" id="node-module-instalation" style="color: inherit; text-decoration: none;">
  288. <h3>Node Module Instalation</h3>
  289. </a>
  290. <p><code>npm install @rcsb/rcsb-saguaro-3d</code></p>
  291. <a href="#building-amp-running" id="building-amp-running" style="color: inherit; text-decoration: none;">
  292. <h2>Building &amp; Running</h2>
  293. </a>
  294. <a href="#build-app" id="build-app" style="color: inherit; text-decoration: none;">
  295. <h3>Build app</h3>
  296. </a>
  297. <pre><code><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">install</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">run</span><span class="hl-1"> </span><span class="hl-0">buildApp</span>
  298. </code></pre>
  299. <a href="#build-examples" id="build-examples" style="color: inherit; text-decoration: none;">
  300. <h3>Build examples</h3>
  301. </a>
  302. <pre><code><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">run</span><span class="hl-1"> </span><span class="hl-0">buildExamples</span>
  303. </code></pre>
  304. <p>From the root of the project:</p>
  305. <pre><code><span class="hl-0">npx</span><span class="hl-1"> </span><span class="hl-0">http</span><span class="hl-1">-</span><span class="hl-0">server</span><span class="hl-1"> -</span><span class="hl-0">p</span><span class="hl-1"> </span><span class="hl-2">PORT</span><span class="hl-1">-</span><span class="hl-2">NUMBER</span>
  306. </code></pre>
  307. <p>and navigate to <code>localhost:PORT-NUMBER/build/examples/</code></p>
  308. <a href="#library-documentation" id="library-documentation" style="color: inherit; text-decoration: none;">
  309. <h3>Library Documentation</h3>
  310. </a>
  311. <p>TypeScript full classes documentation can be found <a href="https://rcsb.github.io/rcsb-saguaro-3d/globals.html">here</a>.</p>
  312. <a href="#main-classes-and-interfaces" id="main-classes-and-interfaces" style="color: inherit; text-decoration: none;">
  313. <h3>Main Classes and Interfaces</h3>
  314. </a>
  315. <a href="#assembly-view" id="assembly-view" style="color: inherit; text-decoration: none;">
  316. <h4>Assembly view</h4>
  317. </a>
  318. <p>Class <strong><code>RcsbFv3DAssembly</code></strong> (<code>src/RcsbFv3D/RcsbFv3DAssembly.tsx</code>) builds a predefined 1D/3D view for PDB assemblies. This method is used in the RCSB PDB web portal
  319. to display 1D positional features of PDB models (ex: <a href="https://www.rcsb.org/3d-sequence/4HHB">4hhb</a>). Its configuration requires a single PDB Id.
  320. In addition, <code>additionalConfig</code> allows to configure the feature viewer as describe in rcsb-saguaro-app <a href="https://rcsb.github.io/rcsb-saguaro-app/interfaces/rcsbfvadditionalconfig.html">API</a>.
  321. This parameter exposes the board configuration through the attribute <code>boardConfig</code> (<a href="https://rcsb.github.io/rcsb-saguaro/interfaces/rcsbfvboardconfiginterface.html">ref</a>).
  322. The component will be mounted in the html element with id <code>elementId</code>. If there is no html element in the current document,
  323. a new div element will be added, and the component will be displayed in full screen mode. </p>
  324. <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DAssemblyInterface</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DAbstractInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">elementId</span><span class="hl-1">: </span><span class="hl-5">&quot;htmlElement&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">config</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-0">entryId</span><span class="hl-1">: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">title</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">subtitle</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-0">additionalConfig</span><span class="hl-1">?: </span><span class="hl-4">RcsbFvAdditionalConfig</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
  325. </code></pre>
  326. <p>Source code example can be found in <code>src/examples/assembly/index.ts</code>.</p>
  327. <a href="#custom-view" id="custom-view" style="color: inherit; text-decoration: none;">
  328. <h4>Custom view</h4>
  329. </a>
  330. <p>Class <strong><code>RcsbFv3DCustom</code></strong> file <code>src/RcsbFv3D/RcsbFv3DCustom.tsx</code> builds a customized view between one or more feature viewers and a single Molstar plugin.
  331. The configuration interface encodes the parameters for the feature viewers (<code>sequencePanelConfig</code>), the Molstar plugin (<code>structurePanelConfig</code>) and
  332. their dynamic interaction.</p>
  333. <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DCustomInterface</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DAbstractInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">elementId</span><span class="hl-1">: </span><span class="hl-5">&quot;htmlElement&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">structurePanelConfig</span><span class="hl-1">: </span><span class="hl-4">RcsbFvStructureInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">sequencePanelConfig</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-0">config</span><span class="hl-1">: </span><span class="hl-4">CustomViewInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">title</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">subtitle</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> };</span><br/><span class="hl-1">}</span>
  334. </code></pre>
  335. <p><img src="https://raw.githubusercontent.com/rcsb/rcsb-saguaro-3d/master/.github/img/config_img.png" alt="Alt text" title="Custom config schema"></p>
  336. <a href="#structural-panel" id="structural-panel" style="color: inherit; text-decoration: none;">
  337. <h5>Structural Panel</h5>
  338. </a>
  339. <p>The structural panel configuration <code>structurePanelConfig: RcsbFvStructureInterface</code> includes the loading configuration for the 3D structural data
  340. and the Molstar plugin. A full description of the structural panel configuration can be found <a href="https://rcsb.github.io/rcsb-saguaro-3d/interfaces/rcsbfvstructureinterface.html">here</a>. </p>
  341. <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">RcsbFvStructureInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">loadConfig</span><span class="hl-1">: </span><span class="hl-4">LoadMolstarInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">pluginConfig</span><span class="hl-1">?: </span><span class="hl-4">Partial</span><span class="hl-1">&lt;</span><span class="hl-4">ViewerProps</span><span class="hl-1">&gt;;</span><br/><span class="hl-1">}</span>
  342. </code></pre>
  343. <p>The attribute <code>loadConfig: LoadMolstarInterface</code> encodes the configuration for loading the 3D structural data. </p>
  344. <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">LoadMolstarInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">loadMethod</span><span class="hl-1">: </span><span class="hl-4">LoadMethod</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">loadParams</span><span class="hl-1">: </span><span class="hl-4">LoadParams</span><span class="hl-1"> | </span><span class="hl-4">Array</span><span class="hl-1">&lt;</span><span class="hl-4">LoadParams</span><span class="hl-1">&gt;;</span><br/><span class="hl-1">}</span>
  345. </code></pre>
  346. <ul>
  347. <li><code>loadMethod: LoadMethod</code> is an enumerated value that indicates the source of the structural models<pre><code class="language-typescript"><span class="hl-3">enum</span><span class="hl-1"> </span><span class="hl-4">LoadMethod</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">loadPdbId</span><span class="hl-1"> = </span><span class="hl-5">&quot;loadPdbId&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">loadPdbIds</span><span class="hl-1"> = </span><span class="hl-5">&quot;loadPdbIds&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">loadStructureFromUrl</span><span class="hl-1"> = </span><span class="hl-5">&quot;loadStructureFromUrl&quot;</span><br/><span class="hl-1">}</span>
  348. </code></pre>
  349. </li>
  350. <li><code>loadParams: LoadParams | Array&lt;LoadParams&gt;</code> encode the parameters needed to collect and load the data. If <code>id</code> is provided, it can be used to identify the 3D models
  351. in the methods defined by <code>SaguaroPluginPublicInterface</code></li>
  352. </ul>
  353. <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">LoadParams</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">id</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">pdbId</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">url</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">isBinary</span><span class="hl-1">?: </span><span class="hl-4">boolean</span><br/><span class="hl-1">}</span>
  354. </code></pre>
  355. <a href="#sequence-panel" id="sequence-panel" style="color: inherit; text-decoration: none;">
  356. <h5>Sequence panel</h5>
  357. </a>
  358. <p>The sequence panel organizes information in different blocks where each block encodes the configuration
  359. (<code>blockConfig</code>) to display one or more feature viewers. Only a single block can be displayed at a time. The optional parameter <code>blockSelectorElement</code> defines a React component
  360. that renders the html element used to change the displayed block. The class <code>BlockSelectorManager</code> is used to select which block is
  361. displayed are those that are hidden. For example, <code>blockSelectorManager.setActiveBlock(&quot;myBlock&quot;)</code> will display the feature viewers defined in the block
  362. with <code>blockId</code> <code>&quot;myBlock&quot;</code> (see <code>FeatureBlockInterface</code>) and hide the others. Additionally, <code>blockChangeCallback</code> defines a function that will be executed
  363. when the displayed block changes.</p>
  364. <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">CustomViewInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">blockConfig</span><span class="hl-1">: </span><span class="hl-4">FeatureBlockInterface</span><span class="hl-1"> | </span><span class="hl-4">Array</span><span class="hl-1">&lt;</span><span class="hl-4">FeatureBlockInterface</span><span class="hl-1">&gt;;</span><br/><span class="hl-1"> </span><span class="hl-6">blockSelectorElement</span><span class="hl-1">?: (</span><span class="hl-0">blockSelector</span><span class="hl-1">: </span><span class="hl-4">BlockSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-4">JSX</span><span class="hl-1">.</span><span class="hl-4">Element</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">blockChangeCallback</span><span class="hl-1">?: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">pfvList</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1">&lt;</span><span class="hl-4">RcsbFv</span><span class="hl-1">&gt;, </span><span class="hl-0">selection</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
  365. </code></pre>
  366. <p>Source code example can be found in <code>src/examples/multiple-chain/index.ts</code>.</p>
  367. <p>Each block must contain a unique block identifier (<code>blockId</code>) and the configuration for all the feature viewers that will be rendered
  368. when the block is activated (<code>featureViewConfig</code>).</p>
  369. <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">FeatureBlockInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">blockId</span><span class="hl-1">:</span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">featureViewConfig</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1">&lt;</span><span class="hl-4">FeatureViewInterface</span><span class="hl-1">&gt; | </span><span class="hl-4">FeatureViewInterface</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
  370. </code></pre>
  371. <p>The interface for each feature viewer defines its dynamic interaction with the Molstar plugin through different event callbacks functions</p>
  372. <ul>
  373. <li><code>sequenceSelectionChangeCallback</code> defines how the Molstar plugin reacts when the feature viewer selection changes</li>
  374. <li><code>sequenceElementClickCallback</code> defines how the Molstar plugin reacts when a feature viewer element (positional annotation) is clicked</li>
  375. <li><code>sequenceHoverCallback</code> defines how the Molstar plugin reacts when the mouse hovers the feature viewer or any of its elements</li>
  376. <li><code>structureSelectionCallback</code> defines how the protein feature viewer reacts when the Molstar plugin selection changes</li>
  377. <li><code>structureHoverCallback</code> defines how the protein feature viewer reacts when displayed models on the Molstar plugin are hovered</li>
  378. </ul>
  379. <pre><code class="language-typescript"><span class="hl-7">export</span><span class="hl-1"> </span><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">FeatureViewInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">boardId</span><span class="hl-1">?:</span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">boardConfig</span><span class="hl-1">: </span><span class="hl-4">RcsbFvBoardConfigInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">rowConfig</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1">&lt;</span><span class="hl-4">RcsbFvRowConfigInterface</span><span class="hl-1">&gt;;</span><br/><span class="hl-1"> </span><span class="hl-6">sequenceSelectionChangeCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">, </span><span class="hl-0">sequenceRegion</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1">&lt;</span><span class="hl-4">RcsbFvTrackDataElementInterface</span><span class="hl-1">&gt;) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">sequenceElementClickCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">, </span><span class="hl-0">d</span><span class="hl-1">: </span><span class="hl-4">RcsbFvTrackDataElementInterface</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">sequenceHoverCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">, </span><span class="hl-0">hoverRegion</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1">&lt;</span><span class="hl-4">RcsbFvTrackDataElementInterface</span><span class="hl-1">&gt;) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">structureSelectionCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">pfv</span><span class="hl-1">: </span><span class="hl-4">RcsbFv</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">structureHoverCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">pfv</span><span class="hl-1">: </span><span class="hl-4">RcsbFv</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
  380. </code></pre>
  381. <p><code>plugin: SaguaroPluginPublicInterface</code> exposes the interface to interact with the Molstar plugin
  382. and change model representations (<a href="https://rcsb.github.io/rcsb-saguaro-3d/interfaces/saguaropluginpublicinterface.html">ref</a>).
  383. It provides multiple methods such as hide, display or select to modify how structural data is displayed. The parameter <code>pfv: RcsbFv</code>
  384. allows to access the feature viewer API (<a href="https://rcsb.github.io/rcsb-saguaro/classes/rcsbfv.html">ref</a>). It exposes methods to modify
  385. selections, change board configuration, zoom or adding new tracks.</p>
  386. <p>Source code example can be found in <code>src/examples/single-chain/index.tsx</code></p>
  387. <a href="#contributing" id="contributing" style="color: inherit; text-decoration: none;">
  388. <h2>Contributing</h2>
  389. </a>
  390. <p>All contributions are welcome. Please, make a pull request or open an issue.</p>
  391. <a href="#license" id="license" style="color: inherit; text-decoration: none;">
  392. <h2>License</h2>
  393. </a>
  394. <p>The MIT License</p>
  395. <pre><code><span class="hl-6">Copyright</span><span class="hl-1"> (</span><span class="hl-0">c</span><span class="hl-1">) </span><span class="hl-8">2021</span><span class="hl-1"> - </span><span class="hl-0">now</span><span class="hl-1">, </span><span class="hl-2">RCSB</span><span class="hl-1"> </span><span class="hl-2">PDB</span><span class="hl-1"> </span><span class="hl-0">and</span><span class="hl-1"> </span><span class="hl-0">contributors</span>
  396. </code></pre>
  397. <p>Permission is hereby granted, free of charge, to any person obtaining a copy
  398. of this software and associated documentation files (the &quot;Software&quot;), to deal
  399. in the Software without restriction, including without limitation the rights
  400. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  401. copies of the Software, and to permit persons to whom the Software is
  402. furnished to do so, subject to the following conditions:</p>
  403. <p>The above copyright notice and this permission notice shall be included in
  404. all copies or substantial portions of the Software.</p>
  405. <p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  406. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  407. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  408. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  409. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  410. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  411. THE SOFTWARE.</p>
  412. </div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/RcsbFv3DAssembly.html">Rcsb<wbr/>Fv3DAssembly</a></li><li class=" tsd-kind-module"><a href="modules/RcsbFv3DCustom.html">Rcsb<wbr/>Fv3DCustom</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>