jbrowse-plugin-protein3d 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +3 -9
  2. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
  3. package/dist/AddHighlightModel/HighlightComponents.d.ts +1 -2
  4. package/dist/AddHighlightModel/HighlightComponents.js.map +1 -1
  5. package/dist/AddHighlightModel/ProteinToGenomeClickHighlight.js +4 -3
  6. package/dist/AddHighlightModel/ProteinToGenomeClickHighlight.js.map +1 -1
  7. package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.d.ts +1 -2
  8. package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.js +4 -3
  9. package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.js.map +1 -1
  10. package/dist/AddHighlightModel/util.js +1 -1
  11. package/dist/AddHighlightModel/util.js.map +1 -1
  12. package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.d.ts +16 -0
  13. package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.js +43 -0
  14. package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.js.map +1 -0
  15. package/dist/AlphaFoldConfidenceAdapter/configSchema.d.ts +13 -0
  16. package/dist/AlphaFoldConfidenceAdapter/configSchema.js +16 -0
  17. package/dist/AlphaFoldConfidenceAdapter/configSchema.js.map +1 -0
  18. package/dist/AlphaFoldConfidenceAdapter/index.d.ts +2 -0
  19. package/dist/AlphaFoldConfidenceAdapter/index.js +11 -0
  20. package/dist/AlphaFoldConfidenceAdapter/index.js.map +1 -0
  21. package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.d.ts +30 -0
  22. package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.js +78 -0
  23. package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.js.map +1 -0
  24. package/dist/AlphaMissensePathogenicityAdapter/configSchema.d.ts +13 -0
  25. package/dist/AlphaMissensePathogenicityAdapter/configSchema.js +16 -0
  26. package/dist/AlphaMissensePathogenicityAdapter/configSchema.js.map +1 -0
  27. package/dist/AlphaMissensePathogenicityAdapter/index.d.ts +2 -0
  28. package/dist/AlphaMissensePathogenicityAdapter/index.js +11 -0
  29. package/dist/AlphaMissensePathogenicityAdapter/index.js.map +1 -0
  30. package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js +162 -13
  31. package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js.map +1 -1
  32. package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js +8 -6
  33. package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js.map +1 -1
  34. package/dist/LaunchProteinView/components/HelpButton.js +6 -2
  35. package/dist/LaunchProteinView/components/HelpButton.js.map +1 -1
  36. package/dist/LaunchProteinView/components/HelpDialog.js +3 -1
  37. package/dist/LaunchProteinView/components/HelpDialog.js.map +1 -1
  38. package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js +12 -4
  39. package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js.map +1 -1
  40. package/dist/LaunchProteinView/components/MSATable.js +3 -1
  41. package/dist/LaunchProteinView/components/MSATable.js.map +1 -1
  42. package/dist/LaunchProteinView/components/ManualUniProtIDEntry.d.ts +8 -0
  43. package/dist/LaunchProteinView/components/ManualUniProtIDEntry.js +225 -0
  44. package/dist/LaunchProteinView/components/ManualUniProtIDEntry.js.map +1 -0
  45. package/dist/LaunchProteinView/components/TranscriptSelector.js +3 -1
  46. package/dist/LaunchProteinView/components/TranscriptSelector.js.map +1 -1
  47. package/dist/LaunchProteinView/components/UserProvidedStructure.js +19 -12
  48. package/dist/LaunchProteinView/components/UserProvidedStructure.js.map +1 -1
  49. package/dist/LaunchProteinView/components/calculateProteinSequence.js +5 -3
  50. package/dist/LaunchProteinView/components/calculateProteinSequence.js.map +1 -1
  51. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.d.ts +1 -1
  52. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js +29 -9
  53. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js.map +1 -1
  54. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.d.ts +1 -1
  55. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js +25 -8
  56. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js.map +1 -1
  57. package/dist/LaunchProteinView/components/util.js +1 -1
  58. package/dist/LaunchProteinView/index.js +7 -3
  59. package/dist/LaunchProteinView/index.js.map +1 -1
  60. package/dist/ProteinView/{loadStructureFromData.d.ts → addStructureFromData.d.ts} +2 -2
  61. package/dist/ProteinView/{loadStructureFromData.js → addStructureFromData.js} +3 -8
  62. package/dist/ProteinView/addStructureFromData.js.map +1 -0
  63. package/dist/ProteinView/{loadStructureFromURL.d.ts → addStructureFromURL.d.ts} +2 -2
  64. package/dist/ProteinView/{loadStructureFromURL.js → addStructureFromURL.js} +11 -9
  65. package/dist/ProteinView/addStructureFromURL.js.map +1 -0
  66. package/dist/ProteinView/clearSelection.js +1 -1
  67. package/dist/ProteinView/clearSelection.js.map +1 -1
  68. package/dist/ProteinView/components/ProteinAlignment.d.ts +2 -2
  69. package/dist/ProteinView/components/ProteinAlignment.js +37 -26
  70. package/dist/ProteinView/components/ProteinAlignment.js.map +1 -1
  71. package/dist/ProteinView/components/ProteinAlignmentHelpButton.d.ts +2 -2
  72. package/dist/ProteinView/components/ProteinAlignmentHelpButton.js +6 -4
  73. package/dist/ProteinView/components/ProteinAlignmentHelpButton.js.map +1 -1
  74. package/dist/ProteinView/components/ProteinAlignmentHelpDialog.js +6 -5
  75. package/dist/ProteinView/components/ProteinAlignmentHelpDialog.js.map +1 -1
  76. package/dist/ProteinView/components/ProteinView.js +18 -60
  77. package/dist/ProteinView/components/ProteinView.js.map +1 -1
  78. package/dist/ProteinView/components/{Header.js → ProteinViewHeader.js} +29 -12
  79. package/dist/ProteinView/components/ProteinViewHeader.js.map +1 -0
  80. package/dist/ProteinView/components/SplitString.d.ts +4 -4
  81. package/dist/ProteinView/components/SplitString.js +3 -3
  82. package/dist/ProteinView/components/SplitString.js.map +1 -1
  83. package/dist/ProteinView/genomeToProtein.d.ts +2 -2
  84. package/dist/ProteinView/genomeToProtein.js +4 -5
  85. package/dist/ProteinView/genomeToProtein.js.map +1 -1
  86. package/dist/ProteinView/highlightResidue.js +2 -2
  87. package/dist/ProteinView/highlightResidue.js.map +1 -1
  88. package/dist/ProteinView/launchRemotePairwiseAlignment.d.ts +2 -5
  89. package/dist/ProteinView/launchRemotePairwiseAlignment.js +7 -3
  90. package/dist/ProteinView/launchRemotePairwiseAlignment.js.map +1 -1
  91. package/dist/ProteinView/model.d.ts +492 -160
  92. package/dist/ProteinView/model.js +62 -246
  93. package/dist/ProteinView/model.js.map +1 -1
  94. package/dist/ProteinView/proteinToGenomeMapping.d.ts +6 -6
  95. package/dist/ProteinView/proteinToGenomeMapping.js +29 -28
  96. package/dist/ProteinView/proteinToGenomeMapping.js.map +1 -1
  97. package/dist/ProteinView/selectResidue.js +1 -1
  98. package/dist/ProteinView/selectResidue.js.map +1 -1
  99. package/dist/ProteinView/structureModel.d.ts +183 -0
  100. package/dist/ProteinView/structureModel.js +407 -0
  101. package/dist/ProteinView/structureModel.js.map +1 -0
  102. package/dist/ProteinView/useProteinView.d.ts +1 -4
  103. package/dist/ProteinView/useProteinView.js +3 -15
  104. package/dist/ProteinView/useProteinView.js.map +1 -1
  105. package/dist/ProteinView/util.d.ts +3 -3
  106. package/dist/ProteinView/util.js +8 -6
  107. package/dist/ProteinView/util.js.map +1 -1
  108. package/dist/UniProtVariationAdapter/UniProtVariationAdapter.d.ts +15 -0
  109. package/dist/UniProtVariationAdapter/UniProtVariationAdapter.js +55 -0
  110. package/dist/UniProtVariationAdapter/UniProtVariationAdapter.js.map +1 -0
  111. package/dist/UniProtVariationAdapter/configSchema.d.ts +17 -0
  112. package/dist/UniProtVariationAdapter/configSchema.js +20 -0
  113. package/dist/UniProtVariationAdapter/configSchema.js.map +1 -0
  114. package/dist/UniProtVariationAdapter/index.d.ts +2 -0
  115. package/dist/UniProtVariationAdapter/index.js +11 -0
  116. package/dist/UniProtVariationAdapter/index.js.map +1 -0
  117. package/dist/genomeToTranscriptMapping.d.ts +2 -2
  118. package/dist/genomeToTranscriptMapping.js +3 -3
  119. package/dist/genomeToTranscriptMapping.js.map +1 -1
  120. package/dist/index.js +6 -0
  121. package/dist/index.js.map +1 -1
  122. package/dist/jbrowse-plugin-protein3d.umd.production.min.js +2506 -1658
  123. package/dist/jbrowse-plugin-protein3d.umd.production.min.js.map +4 -4
  124. package/dist/mappings.d.ts +12 -10
  125. package/dist/mappings.js +7 -7
  126. package/dist/mappings.js.map +1 -1
  127. package/dist/mappings.test.js +7 -5
  128. package/dist/mappings.test.js.map +1 -1
  129. package/dist/test_data/gene.d.ts +577 -64
  130. package/dist/test_data/gene.js +1 -1
  131. package/dist/test_data/gene.js.map +1 -1
  132. package/package.json +20 -19
  133. package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +4 -17
  134. package/src/AddHighlightModel/HighlightComponents.tsx +1 -3
  135. package/src/AddHighlightModel/ProteinToGenomeClickHighlight.tsx +17 -14
  136. package/src/AddHighlightModel/ProteinToGenomeHoverHighlight.tsx +18 -17
  137. package/src/AddHighlightModel/util.ts +1 -1
  138. package/src/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.ts +63 -0
  139. package/src/AlphaFoldConfidenceAdapter/configSchema.ts +21 -0
  140. package/src/AlphaFoldConfidenceAdapter/index.ts +19 -0
  141. package/src/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.ts +109 -0
  142. package/src/AlphaMissensePathogenicityAdapter/configSchema.ts +21 -0
  143. package/src/AlphaMissensePathogenicityAdapter/index.ts +19 -0
  144. package/src/LaunchProteinView/components/AlphaFoldDBSearch.tsx +173 -12
  145. package/src/LaunchProteinView/components/AlphaFoldDBSearchStatus.tsx +8 -6
  146. package/src/LaunchProteinView/components/HelpButton.tsx +10 -2
  147. package/src/LaunchProteinView/components/HelpDialog.tsx +6 -1
  148. package/src/LaunchProteinView/components/LaunchProteinViewDialog.tsx +20 -4
  149. package/src/LaunchProteinView/components/MSATable.tsx +3 -1
  150. package/src/LaunchProteinView/components/ManualUniProtIDEntry.tsx +332 -0
  151. package/src/LaunchProteinView/components/TranscriptSelector.tsx +9 -7
  152. package/src/LaunchProteinView/components/UserProvidedStructure.tsx +18 -13
  153. package/src/LaunchProteinView/components/calculateProteinSequence.ts +6 -4
  154. package/src/LaunchProteinView/components/useLocalStructureFileSequence.ts +28 -9
  155. package/src/LaunchProteinView/components/useRemoteStructureFileSequence.ts +23 -8
  156. package/src/LaunchProteinView/components/util.ts +1 -1
  157. package/src/LaunchProteinView/index.ts +36 -26
  158. package/src/ProteinView/{loadStructureFromData.ts → addStructureFromData.ts} +2 -8
  159. package/src/ProteinView/{loadStructureFromURL.ts → addStructureFromURL.ts} +11 -11
  160. package/src/ProteinView/clearSelection.ts +1 -1
  161. package/src/ProteinView/components/ProteinAlignment.tsx +51 -35
  162. package/src/ProteinView/components/ProteinAlignmentHelpButton.tsx +4 -4
  163. package/src/ProteinView/components/ProteinAlignmentHelpDialog.tsx +15 -11
  164. package/src/ProteinView/components/ProteinView.tsx +22 -82
  165. package/src/ProteinView/components/{Header.tsx → ProteinViewHeader.tsx} +44 -23
  166. package/src/ProteinView/components/SplitString.tsx +8 -8
  167. package/src/ProteinView/genomeToProtein.ts +5 -9
  168. package/src/ProteinView/highlightResidue.ts +2 -2
  169. package/src/ProteinView/launchRemotePairwiseAlignment.ts +6 -3
  170. package/src/ProteinView/model.ts +75 -287
  171. package/src/ProteinView/proteinToGenomeMapping.ts +40 -38
  172. package/src/ProteinView/selectResidue.ts +1 -1
  173. package/src/ProteinView/structureModel.ts +512 -0
  174. package/src/ProteinView/useProteinView.ts +2 -19
  175. package/src/ProteinView/util.ts +20 -9
  176. package/src/UniProtVariationAdapter/UniProtVariationAdapter.ts +99 -0
  177. package/src/UniProtVariationAdapter/configSchema.ts +25 -0
  178. package/src/UniProtVariationAdapter/index.ts +17 -0
  179. package/src/__snapshots__/mappings.test.ts.snap +224 -224
  180. package/src/genomeToTranscriptMapping.ts +9 -9
  181. package/src/index.ts +6 -0
  182. package/src/mappings.test.ts +7 -5
  183. package/src/mappings.ts +25 -23
  184. package/src/test_data/gene.ts +3 -3
  185. package/dist/ProteinView/components/Header.js.map +0 -1
  186. package/dist/ProteinView/loadStructureFromData.js.map +0 -1
  187. package/dist/ProteinView/loadStructureFromURL.js.map +0 -1
  188. package/dist/ProteinView/useProteinViewClickBehavior.d.ts +0 -8
  189. package/dist/ProteinView/useProteinViewClickBehavior.js +0 -34
  190. package/dist/ProteinView/useProteinViewClickBehavior.js.map +0 -1
  191. package/dist/ProteinView/useProteinViewHoverBehavior.d.ts +0 -6
  192. package/dist/ProteinView/useProteinViewHoverBehavior.js +0 -31
  193. package/dist/ProteinView/useProteinViewHoverBehavior.js.map +0 -1
  194. package/src/ProteinView/useProteinViewClickBehavior.ts +0 -48
  195. package/src/ProteinView/useProteinViewHoverBehavior.ts +0 -44
  196. /package/dist/ProteinView/components/{Header.d.ts → ProteinViewHeader.d.ts} +0 -0
@@ -7,7 +7,7 @@ function isDisplay(elt) {
7
7
  return elt.name === 'LinearBasicDisplay';
8
8
  }
9
9
  function extendStateModel(stateModel) {
10
- return stateModel.views(self => {
10
+ return stateModel.views((self) => {
11
11
  const superContextMenuItems = self.contextMenuItems;
12
12
  return {
13
13
  contextMenuItems() {
@@ -18,12 +18,16 @@ function extendStateModel(stateModel) {
18
18
  ...(feature
19
19
  ? [
20
20
  {
21
- label: 'Launch 3-D protein view',
21
+ label: 'Launch protein view',
22
22
  icon: AddIcon,
23
23
  onClick: () => {
24
24
  getSession(track).queueDialog(handleClose => [
25
25
  LaunchProteinViewDialog,
26
- { model: track, handleClose, feature },
26
+ {
27
+ model: track,
28
+ handleClose,
29
+ feature,
30
+ },
27
31
  ]);
28
32
  },
29
33
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/LaunchProteinView/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEnE,QAAQ;AACR,OAAO,OAAO,MAAM,yBAAyB,CAAA;AAE7C,SAAS;AACT,OAAO,uBAAuB,MAAM,sCAAsC,CAAA;AAE1E,SAAS,SAAS,CAAC,GAAqB;IACtC,OAAO,GAAG,CAAC,IAAI,KAAK,oBAAoB,CAAA;AAC1C,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAyB;IACjD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;QAC7B,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAA;QACnD,OAAO;YACL,gBAAgB;gBACd,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAA;gBACvC,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;gBACtC,OAAO;oBACL,GAAG,qBAAqB,EAAE;oBAC1B,GAAG,CAAC,OAAO;wBACT,CAAC,CAAC;4BACE;gCACE,KAAK,EAAE,yBAAyB;gCAChC,IAAI,EAAE,OAAO;gCACb,OAAO,EAAE,GAAG,EAAE;oCACZ,UAAU,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;wCAC3C,uBAAuB;wCACvB,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE;qCACvC,CAAC,CAAA;gCACJ,CAAC;6BACF;yBACF;wBACH,CAAC,CAAC,EAAE,CAAC;iBACR,CAAA;YACH,CAAC;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,C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AAC,CAAA;gCACJ,CAAC;6BACF;yBACF;wBACH,CAAC,CAAC,EAAE,CAAC;iBACR,CAAA;YACH,CAAC;SACF,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,aAA4B;IACrE,aAAa,CAAC,mBAAmB,CAC/B,6BAA6B,EAC7B,CAAC,GAAyB,EAAE,EAAE;QAC5B,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,GAAG,CAAC,UAAU,GAAG,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QACnD,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -4,7 +4,7 @@ import { StructureRepresentationPresetProvider } from 'molstar/lib/mol-plugin-st
4
4
  export interface LoadStructureOptions {
5
5
  representationParams?: StructureRepresentationPresetProvider.CommonParams;
6
6
  }
7
- export declare function loadStructureFromData({ data, format, options, plugin, }: {
7
+ export declare function addStructureFromData({ data, format, options, plugin, }: {
8
8
  data: string;
9
9
  format?: BuiltInTrajectoryFormat;
10
10
  options?: LoadStructureOptions & {
@@ -13,5 +13,5 @@ export declare function loadStructureFromData({ data, format, options, plugin, }
13
13
  };
14
14
  plugin: PluginContext;
15
15
  }): Promise<{
16
- seq: string;
16
+ model: import("molstar/lib/mol-state").StateObjectSelector<import("molstar/lib/mol-plugin-state/objects").PluginStateObject.Molecule.Model, import("molstar/lib/mol-state").StateTransformer<import("molstar/lib/mol-state").StateObject<any, import("molstar/lib/mol-state").StateObject.Type<any>>, import("molstar/lib/mol-state").StateObject<any, import("molstar/lib/mol-state").StateObject.Type<any>>, any>>;
17
17
  }>;
@@ -1,20 +1,15 @@
1
1
  // adapted from https://github.com/molstar/molstar/blob/ab4130d42d0ab2591f62460292ade0203207d4d2/src/apps/viewer/app.ts#L255C1-L259C6
2
- export async function loadStructureFromData({ data, format = 'pdb', options, plugin, }) {
3
- await plugin.clear();
2
+ export async function addStructureFromData({ data, format = 'pdb', options, plugin, }) {
4
3
  const _data = await plugin.builders.data.rawData({
5
4
  data,
6
5
  label: options?.dataLabel,
7
6
  });
8
7
  const trajectory = await plugin.builders.structure.parseTrajectory(_data, format);
9
8
  const model = await plugin.builders.structure.createModel(trajectory);
10
- const seq = model.obj?.data.sequence.sequences[0].sequence.label
11
- .toArray()
12
- // @ts-expect-error
13
- .join('');
14
9
  await plugin.builders.structure.hierarchy.applyPreset(trajectory, 'all-models', {
15
10
  useDefaultIfSingleModel: true,
16
11
  representationPresetParams: options?.representationParams,
17
12
  });
18
- return { seq: seq };
13
+ return { model };
19
14
  }
20
- //# sourceMappingURL=loadStructureFromData.js.map
15
+ //# sourceMappingURL=addStructureFromData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addStructureFromData.js","sourceRoot":"","sources":["../../src/ProteinView/addStructureFromData.ts"],"names":[],"mappings":"AAQA,qIAAqI;AACrI,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,IAAI,EACJ,MAAM,GAAG,KAAK,EACd,OAAO,EACP,MAAM,GAMP;IACC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;QAC/C,IAAI;QACJ,KAAK,EAAE,OAAO,EAAE,SAAS;KAC1B,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,eAAe,CAChE,KAAK,EACL,MAAM,CACP,CAAA;IACD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;IAErE,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CACnD,UAAU,EACV,YAAY,EACZ;QACE,uBAAuB,EAAE,IAAI;QAC7B,0BAA0B,EAAE,OAAO,EAAE,oBAAoB;KAC1D,CACF,CAAA;IAED,OAAO,EAAE,KAAK,EAAE,CAAA;AAClB,CAAC"}
@@ -4,7 +4,7 @@ import { StructureRepresentationPresetProvider } from 'molstar/lib/mol-plugin-st
4
4
  export interface LoadStructureOptions {
5
5
  representationParams?: StructureRepresentationPresetProvider.CommonParams;
6
6
  }
7
- export declare function loadStructureFromURL({ url, format, isBinary, options, plugin, }: {
7
+ export declare function addStructureFromURL({ url, format, isBinary, options, plugin, }: {
8
8
  url: string;
9
9
  format?: BuiltInTrajectoryFormat;
10
10
  isBinary?: boolean;
@@ -13,5 +13,5 @@ export declare function loadStructureFromURL({ url, format, isBinary, options, p
13
13
  };
14
14
  plugin: PluginContext;
15
15
  }): Promise<{
16
- seq: string;
16
+ model: import("molstar/lib/mol-state").StateObjectSelector<import("molstar/lib/mol-plugin-state/objects").PluginStateObject.Molecule.Model, import("molstar/lib/mol-state").StateTransformer<import("molstar/lib/mol-state").StateObject<any, import("molstar/lib/mol-state").StateObject.Type<any>>, import("molstar/lib/mol-state").StateObject<any, import("molstar/lib/mol-state").StateObject.Type<any>>, any>>;
17
17
  }>;
@@ -1,17 +1,19 @@
1
1
  // adapted from https://github.com/molstar/molstar/blob/ab4130d42d0ab2591f62460292ade0203207d4d2/src/apps/viewer/app.ts#L230
2
- export async function loadStructureFromURL({ url, format = 'mmcif', isBinary, options, plugin, }) {
3
- await plugin.clear();
4
- const data = await plugin.builders.data.download({ url, isBinary }, { state: { isGhost: true } });
2
+ export async function addStructureFromURL({ url, format = 'mmcif', isBinary, options, plugin, }) {
3
+ const data = await plugin.builders.data.download({
4
+ url,
5
+ isBinary,
6
+ }, {
7
+ state: {
8
+ isGhost: true,
9
+ },
10
+ });
5
11
  const trajectory = await plugin.builders.structure.parseTrajectory(data, format);
6
12
  const model = await plugin.builders.structure.createModel(trajectory);
7
- const seq = model.obj?.data.sequence.sequences[0].sequence.label
8
- .toArray()
9
- // @ts-expect-error
10
- .join('');
11
13
  await plugin.builders.structure.hierarchy.applyPreset(trajectory, 'all-models', {
12
14
  useDefaultIfSingleModel: true,
13
15
  representationPresetParams: options?.representationParams,
14
16
  });
15
- return { seq: seq };
17
+ return { model };
16
18
  }
17
- //# sourceMappingURL=loadStructureFromURL.js.map
19
+ //# sourceMappingURL=addStructureFromURL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addStructureFromURL.js","sourceRoot":"","sources":["../../src/ProteinView/addStructureFromURL.ts"],"names":[],"mappings":"AAQA,4HAA4H;AAC5H,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,GAAG,EACH,MAAM,GAAG,OAAO,EAChB,QAAQ,EACR,OAAO,EACP,MAAM,GAOP;IACC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAC9C;QACE,GAAG;QACH,QAAQ;KACT,EACD;QACE,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;SACd;KACF,CACF,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,eAAe,CAChE,IAAI,EACJ,MAAM,CACP,CAAA;IACD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;IAErE,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CACnD,UAAU,EACV,YAAY,EACZ;QACE,uBAAuB,EAAE,IAAI;QAC7B,0BAA0B,EAAE,OAAO,EAAE,oBAAoB;KAC1D,CACF,CAAA;IACD,OAAO,EAAE,KAAK,EAAE,CAAA;AAClB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export default function clearSelection({ plugin }) {
2
- plugin?.managers.interactivity.lociSelects.deselectAll();
2
+ plugin.managers.interactivity.lociSelects.deselectAll();
3
3
  }
4
4
  //# sourceMappingURL=clearSelection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clearSelection.js","sourceRoot":"","sources":["../../src/ProteinView/clearSelection.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,MAAM,EAA6B;IAC1E,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,CAAA;AAC1D,CAAC"}
1
+ {"version":3,"file":"clearSelection.js","sourceRoot":"","sources":["../../src/ProteinView/clearSelection.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,MAAM,EAA6B;IAC1E,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,CAAA;AACzD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { JBrowsePluginProteinViewModel } from '../model';
2
+ import { JBrowsePluginProteinStructureModel } from '../model';
3
3
  declare const ProteinAlignment: ({ model, }: {
4
- model: JBrowsePluginProteinViewModel;
4
+ model: JBrowsePluginProteinStructureModel;
5
5
  }) => React.JSX.Element;
6
6
  export default ProteinAlignment;
@@ -1,35 +1,46 @@
1
- import React from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import { observer } from 'mobx-react';
3
3
  import { Tooltip, Typography } from '@mui/material';
4
4
  import ProteinAlignmentHelpButton from './ProteinAlignmentHelpButton';
5
5
  import { clickProteinToGenome, hoverProteinToGenome, } from '../proteinToGenomeMapping';
6
6
  import SplitString from './SplitString';
7
7
  const ProteinAlignment = observer(function ({ model, }) {
8
- const { structureSeqHoverPos, alignment, structurePositionToAlignmentMap, alignmentToStructurePosition, showHighlight, } = model;
9
- const a0 = alignment.alns[0].seq;
10
- const a1 = alignment.alns[1].seq;
11
- const con = alignment.consensus;
12
- const set = new Set();
8
+ const { pairwiseAlignment, pairwiseAlignmentToStructurePosition, structurePositionToAlignmentMap, structureSeqHoverPos, showHighlight, } = model;
9
+ const [pairwiseAlignmentHoverPos, setPairwiseAlignmentHoverPos] = useState();
10
+ useEffect(() => {
11
+ setPairwiseAlignmentHoverPos(structureSeqHoverPos === undefined
12
+ ? undefined
13
+ : structurePositionToAlignmentMap?.[structureSeqHoverPos]);
14
+ }, [structurePositionToAlignmentMap, structureSeqHoverPos]);
15
+ if (!pairwiseAlignment) {
16
+ return React.createElement("div", null, "No pairwiseAlignment");
17
+ }
18
+ const a0 = pairwiseAlignment.alns[0].seq;
19
+ const a1 = pairwiseAlignment.alns[1].seq;
20
+ const con = pairwiseAlignment.consensus;
21
+ const gapSet = new Set();
13
22
  // eslint-disable-next-line unicorn/no-for-loop
14
23
  for (let i = 0; i < con.length; i++) {
15
24
  const letter = con[i];
16
25
  if (letter === '|') {
17
- set.add(i);
26
+ gapSet.add(i);
18
27
  }
19
28
  }
20
- const alignmentHoverPos = structureSeqHoverPos !== undefined
21
- ? structurePositionToAlignmentMap?.[structureSeqHoverPos]
22
- : undefined;
23
- function onMouseOver(alignmentPos) {
24
- const structureSeqPos = alignmentToStructurePosition[alignmentPos];
25
- model.setHoveredPosition({ structureSeqPos });
26
- hoverProteinToGenome({ model, structureSeqPos });
29
+ function onMouseOver(p) {
30
+ setPairwiseAlignmentHoverPos(p);
31
+ if (pairwiseAlignmentToStructurePosition) {
32
+ const structureSeqPos = pairwiseAlignmentToStructurePosition[p];
33
+ model.setHoveredPosition({ structureSeqPos });
34
+ hoverProteinToGenome({ model, structureSeqPos });
35
+ }
27
36
  }
28
- function onClick(alignmentPos) {
29
- const structureSeqPos = alignmentToStructurePosition[alignmentPos];
30
- clickProteinToGenome({ model, structureSeqPos }).catch(e => {
31
- console.error(e);
32
- });
37
+ function onClick(pairwiseAlignmentPos) {
38
+ if (pairwiseAlignmentToStructurePosition) {
39
+ const structureSeqPos = pairwiseAlignmentToStructurePosition[pairwiseAlignmentPos];
40
+ clickProteinToGenome({ model, structureSeqPos }).catch((e) => {
41
+ console.error(e);
42
+ });
43
+ }
33
44
  }
34
45
  return (React.createElement("div", null,
35
46
  React.createElement(ProteinAlignmentHelpButton, { model: model }),
@@ -47,16 +58,16 @@ const ProteinAlignment = observer(function ({ model, }) {
47
58
  model.clearHoverGenomeHighlights();
48
59
  } },
49
60
  React.createElement("div", null,
50
- React.createElement(Tooltip, { title: "This is the sequence of the protein from the structure file" },
51
- React.createElement("span", null, "STRUCT\u00A0")),
52
- React.createElement(SplitString, { str: a0, showHighlight: showHighlight, col: alignmentHoverPos, set: set, onMouseOver: onMouseOver, onClick: onClick })),
61
+ React.createElement(Tooltip, { title: "This is the sequence of the protein from the reference genome transcript" },
62
+ React.createElement("span", null, "GENOME\u00A0")),
63
+ React.createElement(SplitString, { str: a0, showHighlight: showHighlight, hoveredPosition: pairwiseAlignmentHoverPos, gapSet: gapSet, onMouseOver: onMouseOver, onClick: onClick })),
53
64
  React.createElement("div", null,
54
65
  React.createElement("span", null, "\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0"),
55
- React.createElement(SplitString, { showHighlight: showHighlight, str: con, col: alignmentHoverPos, set: set, onMouseOver: onMouseOver, onClick: onClick })),
66
+ React.createElement(SplitString, { showHighlight: showHighlight, str: con, hoveredPosition: pairwiseAlignmentHoverPos, gapSet: gapSet, onMouseOver: onMouseOver, onClick: onClick })),
56
67
  React.createElement("div", null,
57
- React.createElement(Tooltip, { title: "This is the sequence of the protein from the reference genome transcript" },
58
- React.createElement("span", null, "GENOME\u00A0")),
59
- React.createElement(SplitString, { str: a1, col: alignmentHoverPos, showHighlight: showHighlight, set: set, onMouseOver: onMouseOver, onClick: onClick })))));
68
+ React.createElement(Tooltip, { title: "This is the sequence of the protein from the structure file" },
69
+ React.createElement("span", null, "STRUCT\u00A0")),
70
+ React.createElement(SplitString, { str: a1, hoveredPosition: pairwiseAlignmentHoverPos, showHighlight: showHighlight, gapSet: gapSet, onMouseOver: onMouseOver, onClick: onClick })))));
60
71
  });
61
72
  export default ProteinAlignment;
62
73
  //# sourceMappingURL=ProteinAlignment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProteinAlignment.js","sourceRoot":"","sources":["../../../src/ProteinView/components/Pro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,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,GAChB,CACE;YACN;gBACE,oBAAC,OAAO,IAAC,KAAK,EAAC,0EAA0E;oBACvF,iDAAyB,CACjB;gBACV,oBAAC,WAAW,IACV,GAAG,EAAE,EAAE,EACP,GAAG,EAAE,iBAAiB,EACtB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,GAChB,CACE,CACF,CACF,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"ProteinAlignment.js","sourceRoot":"","sources":["../../../src/ProteinView/components/ProteinAlignment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAInD,OAAO,0BAA0B,MAAM,8BAA8B,CAAA;AACrE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,UAAU,EAC1C,KAAK,GAGN;IACC,MAAM,EACJ,iBAAiB,EACjB,oCAAoC,EACpC,+BAA+B,EAC/B,oBAAoB,EACpB,aAAa,GACd,GAAG,KAAK,CAAA;IAET,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,GAC7D,QAAQ,EAAU,CAAA;IAEpB,SAAS,CAAC,GAAG,EAAE;QACb,4BAA4B,CAC1B,oBAAoB,KAAK,SAAS;YAChC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,+BAA+B,EAAE,CAAC,oBAAoB,CAAC,CAC5D,CAAA;IACH,CAAC,EAAE,CAAC,+BAA+B,EAAE,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,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { JBrowsePluginProteinViewModel } from '../model';
2
+ import { JBrowsePluginProteinStructureModel } from '../model';
3
3
  export default function ProteinAlignmentHelpButton({ model, }: {
4
- model: JBrowsePluginProteinViewModel;
4
+ model: JBrowsePluginProteinStructureModel;
5
5
  }): React.JSX.Element;
@@ -5,10 +5,12 @@ import { getSession } from '@jbrowse/core/util';
5
5
  import Help from '@mui/icons-material/Help';
6
6
  const ProteinAlignmentHelpDialog = lazy(() => import('./ProteinAlignmentHelpDialog'));
7
7
  export default function ProteinAlignmentHelpButton({ model, }) {
8
- return (React.createElement(IconButton, { style: { float: 'right' }, onClick: () => getSession(model).queueDialog(handleClose => [
9
- ProteinAlignmentHelpDialog,
10
- { handleClose },
11
- ]) },
8
+ return (React.createElement(IconButton, { style: { float: 'right' }, onClick: () => {
9
+ getSession(model).queueDialog(handleClose => [
10
+ ProteinAlignmentHelpDialog,
11
+ { handleClose },
12
+ ]);
13
+ } },
12
14
  React.createElement(Help, null)));
13
15
  }
14
16
  //# sourceMappingURL=ProteinAlignmentHelpButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProteinAlignmentHelpButton.js","sourceRoot":"","sources":["../../../src/ProteinView/components/ProteinAlignmentHelpButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAK/C,QAAQ;AACR,OAAO,IAAI,MAAM,0BAA0B,CAAA;AAE3C,MAAM,0BAA0B,GAAG,IAAI,CACrC,GAAG,EAAE,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAC7C,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,KAAK,GAGN;IACC,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EACzB,OAAO,EAAE,GAAG,EAAE,CACZ,UAAU,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;YAC3C,0BAA0B;YAC1B,EAAE,WAAW,EAAE;SAChB,CAAC;QAGJ,oBAAC,IAAI,OAAG,CACG,CACd,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"ProteinAlignmentHelpButton.js","sourceRoot":"","sources":["../../../src/ProteinView/components/ProteinAlignmentHelpButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAK/C,QAAQ;AACR,OAAO,IAAI,MAAM,0BAA0B,CAAA;AAE3C,MAAM,0BAA0B,GAAG,IAAI,CACrC,GAAG,EAAE,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAC7C,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,KAAK,GAGN;IACC,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EACzB,OAAO,EAAE,GAAG,EAAE;YACZ,UAAU,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC3C,0BAA0B;gBAC1B,EAAE,WAAW,EAAE;aAChB,CAAC,CAAA;QACJ,CAAC;QAED,oBAAC,IAAI,OAAG,CACG,CACd,CAAA;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Button, DialogActions, DialogContent, Divider, Typography, } from '@mui/material';
2
+ import { Button, DialogActions, DialogContent, Typography, } from '@mui/material';
3
3
  import { Dialog } from '@jbrowse/core/ui';
4
4
  function Typography2({ children }) {
5
5
  return (React.createElement(Typography, { style: {
@@ -10,11 +10,12 @@ function Typography2({ children }) {
10
10
  export default function ProteinAlignmentHelpDialog({ handleClose, }) {
11
11
  return (React.createElement(Dialog, { open: true, maxWidth: "lg", onClose: handleClose, title: "Protein alignment" },
12
12
  React.createElement(DialogContent, null,
13
- React.createElement(Typography2, null, "This panel shows the computed alignment of the reference genome sequence to the structure sequence. The structure file (PDB file, mmCIF file, etc) has a stored representation of the e.g. amino acid sequence but the sequence in the structure file can differ from the sequence from the gene on the genome browser"),
14
- React.createElement(Typography2, null, "In order to resolve this, we align the two sequences together (using EMBOSS needle) to get alignment of the genome's representation of the protein and the structure file's representation of the protein."),
13
+ React.createElement(Typography2, null, "This panel shows the computed pairwise alignment of the reference genome sequence to the structure sequence. The structure file (PDB file, mmCIF file, etc) has a stored representation of the e.g. amino acid sequence but the sequence in the structure file can differ from the sequence from the gene on the genome browser"),
14
+ React.createElement(Typography2, null, "In order to resolve this, we align the two sequences together (using EMBOSS needle) to get pairwise alignment of the genome's representation of the protein and the structure file's representation of the protein."),
15
15
  React.createElement(Typography2, null, "If you need a 100% fidelity protein, you can do a folding with e.g. AlphaFold to make sure the structure you are using matches exactly the sequence of the transcript")),
16
- React.createElement(Divider, null),
17
16
  React.createElement(DialogActions, null,
18
- React.createElement(Button, { onClick: () => handleClose(), color: "primary" }, "Close"))));
17
+ React.createElement(Button, { onClick: () => {
18
+ handleClose();
19
+ }, variant: "contained", color: "primary" }, "Close"))));
19
20
  }
20
21
  //# sourceMappingURL=ProteinAlignmentHelpDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProteinAlignmentHelpDialog.js","sourceRoot":"","sources":["../../../src/ProteinView/components/ProteinAlignmentHelpDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,OAAO,EACP,UAAU,GAEX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAmB;IAChD,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,YAAY,EAAE,EAAE;SACjB,IAEA,QAAQ,CACE,CACd,CAAA;AACH,CAAC;AACD,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,WAAW,GAGZ;IACC,OAAO,CACL,oBAAC,MAAM,IAAC,IAAI,QAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,mBAAmB;QACxE,oBAAC,aAAa;YACZ,oBAAC,WAAW,iUAME;YACd,oBAAC,WAAW,qNAKE;YACd,oBAAC,WAAW,gLAIE,CACA;QAChB,oBAAC,OAAO,OAAG;QACX,oBAAC,aAAa;YACZ,oBAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,EAAC,SAAS,YAE5C,CACK,CACT,CACV,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"ProteinAlignmentHelpDialog.js","sourceRoot":"","sources":["../../../src/ProteinView/components/ProteinAlignmentHelpDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,GAEX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAmB;IAChD,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,YAAY,EAAE,EAAE;SACjB,IAEA,QAAQ,CACE,CACd,CAAA;AACH,CAAC;AACD,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,WAAW,GAGZ;IACC,OAAO,CACL,oBAAC,MAAM,IAAC,IAAI,QAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,mBAAmB;QACxE,oBAAC,aAAa;YACZ,oBAAC,WAAW,0UAME;YACd,oBAAC,WAAW,8NAKE;YACd,oBAAC,WAAW,gLAIE,CACA;QAChB,oBAAC,aAAa;YACZ,oBAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;oBACZ,WAAW,EAAE,CAAA;gBACf,CAAC,EACD,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,YAGR,CACK,CACT,CACV,CAAA;AACH,CAAC"}
@@ -1,78 +1,36 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { observer } from 'mobx-react';
3
- import { ErrorMessage } from '@jbrowse/core/ui';
4
- import Header from './Header';
3
+ import { ErrorMessage, ResizeHandle } from '@jbrowse/core/ui';
4
+ import ProteinViewHeader from './ProteinViewHeader';
5
5
  // hooks
6
6
  import useProteinView from '../useProteinView';
7
- import useProteinViewClickBehavior from '../useProteinViewClickBehavior';
8
- import useProteinViewHoverBehavior from '../useProteinViewHoverBehavior';
9
- // utils
10
- import selectResidue from '../selectResidue';
11
- import highlightResidue from '../highlightResidue';
12
- import clearSelection from '../clearSelection';
13
7
  // css
14
8
  import css from '../css/molstar';
15
- if (document?.head) {
16
- const style = document.createElement('style');
17
- style.append(css);
18
- document.head?.append(style);
19
- }
9
+ const style = document.createElement('style');
10
+ style.append(css);
11
+ document.head.append(style);
20
12
  const ProteinView = observer(function ({ model, }) {
21
- const { url, data, showControls } = model;
22
- const { plugin, seq, parentRef, error } = useProteinView({
23
- url,
24
- data,
13
+ const { showControls } = model;
14
+ const { plugin, parentRef, error } = useProteinView({
25
15
  showControls,
26
16
  });
27
- return error ? (React.createElement(ErrorMessage, { error: error })) : (React.createElement(ProteinViewContainer, { model: model, plugin: plugin, seq: seq, parentRef: parentRef }));
28
- });
29
- const ProteinViewContainer = observer(function ({ model, plugin, seq, parentRef, }) {
30
- const { width, height, structureSeqToTranscriptSeqPosition, seq2, structureSeqHoverPos, showHighlight, alignment, } = model;
31
- const { error } = useProteinViewClickBehavior({ plugin, model });
32
- useProteinViewHoverBehavior({ plugin, model });
33
- const structure = plugin?.managers.structure.hierarchy.current.structures[0]?.cell.obj?.data;
34
- useEffect(() => {
35
- model.setSeqs(seq, seq2);
36
- }, [seq, model, seq2]);
37
17
  useEffect(() => {
38
- if (!plugin || !structureSeqToTranscriptSeqPosition || !structure) {
39
- return;
40
- }
41
- if (showHighlight) {
42
- for (const coord of Object.keys(structureSeqToTranscriptSeqPosition)) {
43
- selectResidue({
44
- structure,
45
- plugin,
46
- selectedResidue: +coord + 1,
47
- });
48
- }
49
- }
50
- else {
51
- clearSelection({ plugin });
52
- }
53
- }, [plugin, structure, showHighlight, structureSeqToTranscriptSeqPosition]);
54
- useEffect(() => {
55
- if (!plugin || !structure || structureSeqHoverPos === undefined) {
56
- return;
57
- }
58
- if (structureSeqHoverPos !== undefined) {
59
- highlightResidue({
60
- structure,
61
- plugin,
62
- selectedResidue: structureSeqHoverPos,
63
- });
64
- }
65
- else {
66
- console.warn('not found');
67
- }
68
- }, [plugin, structure, structureSeqHoverPos]);
69
- return (React.createElement("div", { style: { background: !alignment ? '#ccc' : undefined } },
18
+ model.setMolstarPluginContext(plugin);
19
+ }, [plugin, model]);
20
+ return error ? (React.createElement(ErrorMessage, { error: error })) : (React.createElement(ProteinViewContainer, { model: model, parentRef: parentRef }));
21
+ });
22
+ const ProteinViewContainer = observer(function ({ model, parentRef, }) {
23
+ const { width, height, error } = model;
24
+ return (React.createElement("div", { style: { background: '#ccc' } },
70
25
  error ? React.createElement(ErrorMessage, { error: error }) : null,
71
- React.createElement(Header, { model: model }),
26
+ React.createElement(ProteinViewHeader, { model: model }),
72
27
  React.createElement("div", { ref: parentRef, style: {
73
28
  position: 'relative',
74
29
  width,
75
30
  height,
31
+ } }),
32
+ React.createElement(ResizeHandle, { style: { height: 4, background: 'grey' }, onDrag: delta => {
33
+ return model.setHeight(model.height + delta);
76
34
  } })));
77
35
  });
78
36
  export default ProteinView;
@@ -1 +1 @@
1
- {"version":3,"file":"ProteinView.js","sourceRoot":"","sources":["../../../src/ProteinView/components/ProteinView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAK/C,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,QAAQ;AACR,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,2BAA2B,MAAM,gCAAgC,CAAA;AACxE,OAAO,2BAA2B,MAAM,gCAAgC,CAAA;AAExE,QAAQ;AACR,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAC5C,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAE9C,MAAM;AACN,OAAO,GAAG,MAAM,gBAAgB,CAAA;AAEhC,IAAI,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnB,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC7C,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAED,MAAM,WAAW,GAAG,QAAQ,CAAC,UAAU,EACrC,KAAK,GAGN;IACC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,KAAK,CAAA;IACzC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC;QACvD,GAAG;QACH,IAAI;QACJ,YAAY;KACb,CAAC,CAAA;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CAC/B,CAAC,CAAC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IAAI;QAC9C,oBAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,GAAI;QACnC,6BACE,GAAG,EAAE,SAAS,EACd,KAAK,EAAE;gBACL,QAAQ,EAAE,UAAU;gBACpB,KAAK;gBACL,MAAM;aACP,GACD;QACF,oBAAC,YAAY,IACX,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EACxC,MAAM,EAAE,KAAK,CAAC,EAAE;gBACd,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAA;YAC9C,CAAC,GACD,CACE,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,WAAW,CAAA"}
@@ -1,24 +1,35 @@
1
1
  import React from 'react';
2
2
  import { observer } from 'mobx-react';
3
+ import { LoadingEllipses } from '@jbrowse/core/ui';
3
4
  import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
4
5
  // icons
5
6
  import MenuIcon from '@mui/icons-material/Menu';
6
7
  import Visibility from '@mui/icons-material/Visibility';
7
8
  import ProteinAlignment from './ProteinAlignment';
8
- import { LoadingEllipses } from '@jbrowse/core/ui';
9
9
  const ProteinViewHeader = observer(function ({ model, }) {
10
- const { alignment, showAlignment } = model;
10
+ const { structures, showAlignment } = model;
11
11
  return (React.createElement("div", null,
12
12
  React.createElement(InformativeHeaderArea, { model: model }),
13
- showAlignment ? (alignment ? (React.createElement(ProteinAlignment, { model: model })) : (React.createElement(LoadingEllipses, { message: "Loading pairwise alignment" }))) : null));
13
+ showAlignment
14
+ ? structures.map((structure, idx) => {
15
+ const { pairwiseAlignment } = structure;
16
+ return (React.createElement("div", { key: idx }, pairwiseAlignment ? (React.createElement(ProteinAlignment, { key: idx, model: structure })) : (React.createElement(LoadingEllipses, { message: "Loading pairwise alignment" }))));
17
+ })
18
+ : null));
14
19
  });
15
- const InformativeHeaderArea = observer(function ({ model, }) {
16
- const { showAlignment, clickString, hoverString, showHighlight, zoomToBaseLevel, } = model;
17
- return (React.createElement("div", { style: { display: 'flex' } },
18
- React.createElement("span", null, [
20
+ const StructureInfoHeaderArea = observer(function ({ model, }) {
21
+ return model.structures.map((s, id) => {
22
+ const { clickString, hoverString } = s;
23
+ return (React.createElement("span", { key: id }, [
19
24
  clickString ? `Click: ${clickString}` : '',
20
25
  hoverString ? `Hover: ${hoverString}` : '',
21
- ].join(' ')),
26
+ ].join(' ')));
27
+ });
28
+ });
29
+ const InformativeHeaderArea = observer(function ({ model, }) {
30
+ const { showAlignment, showHighlight, zoomToBaseLevel } = model;
31
+ return (React.createElement("div", { style: { display: 'flex' } },
32
+ React.createElement(StructureInfoHeaderArea, { model: model }),
22
33
  React.createElement("span", { style: { flexGrow: 1 } }),
23
34
  React.createElement(CascadingMenuButton, { menuItems: [
24
35
  {
@@ -26,24 +37,30 @@ const InformativeHeaderArea = observer(function ({ model, }) {
26
37
  type: 'checkbox',
27
38
  checked: showAlignment,
28
39
  icon: Visibility,
29
- onClick: () => model.setShowAlignment(!showAlignment),
40
+ onClick: () => {
41
+ model.setShowAlignment(!showAlignment);
42
+ },
30
43
  },
31
44
  {
32
45
  label: 'Show pairwise alignment as highlight',
33
46
  type: 'checkbox',
34
47
  checked: showHighlight,
35
48
  icon: Visibility,
36
- onClick: () => model.setShowHighlight(!showHighlight),
49
+ onClick: () => {
50
+ model.setShowHighlight(!showHighlight);
51
+ },
37
52
  },
38
53
  {
39
54
  label: 'Zoom to base level on click',
40
55
  type: 'checkbox',
41
56
  checked: zoomToBaseLevel,
42
57
  icon: Visibility,
43
- onClick: () => model.setZoomToBaseLevel(!zoomToBaseLevel),
58
+ onClick: () => {
59
+ model.setZoomToBaseLevel(!zoomToBaseLevel);
60
+ },
44
61
  },
45
62
  ] },
46
63
  React.createElement(MenuIcon, null))));
47
64
  });
48
65
  export default ProteinViewHeader;
49
- //# sourceMappingURL=Header.js.map
66
+ //# sourceMappingURL=ProteinViewHeader.js.map
@@ -0,0 +1 @@
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AAU;oBAChB,OAAO,EAAE,GAAG,EAAE;wBACZ,KAAK,CAAC,kBAAkB,CAAC,CAAC,eAAe,CAAC,CAAA;oBAC5C,CAAC;iBACF;aACF;YAED,oBAAC,QAAQ,OAAG,CACQ,CAClB,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,iBAAiB,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- export default function SplitString({ str, col, set, onMouseOver, onClick, showHighlight, }: {
2
+ export default function SplitString({ str, gapSet, hoveredPosition, showHighlight, onMouseOver, onClick, }: {
3
3
  str: string;
4
- col?: number;
5
- set?: Set<number>;
4
+ gapSet?: Set<number>;
5
+ hoveredPosition?: number;
6
+ showHighlight: boolean;
6
7
  onMouseOver?: (arg: number) => void;
7
8
  onClick?: (arg: number) => void;
8
- showHighlight: boolean;
9
9
  }): React.JSX.Element[];
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- export default function SplitString({ str, col, set, onMouseOver, onClick, showHighlight, }) {
2
+ export default function SplitString({ str, gapSet, hoveredPosition, showHighlight, onMouseOver, onClick, }) {
3
3
  return str.split('').map((d, i) => (React.createElement("span", { key: `${d}-${i}`, onMouseOver: () => onMouseOver?.(i), onClick: () => onClick?.(i), style: {
4
- background: col !== undefined && i === col
4
+ background: hoveredPosition !== undefined && i === hoveredPosition
5
5
  ? '#f698'
6
- : set?.has(i) && showHighlight
6
+ : gapSet?.has(i) && showHighlight
7
7
  ? '#33ff19'
8
8
  : undefined,
9
9
  } }, d === ' ' ? React.createElement(React.Fragment, null, "\u00A0") : d)));
@@ -1 +1 @@
1
- {"version":3,"file":"SplitString.js","sourceRoot":"","sources":["../../../src/ProteinView/components/SplitString.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,GAAG,EACH,GAAG,EACH,GAAG,EACH,WAAW,EACX,OAAO,EACP,aAAa,GAQd;IACC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BACpD,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,aAAa;oBAC/B,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,SAAS;SAClB,IAEA,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,mDAAW,CAAC,CAAC,CAAC,CAAC,CACvB,CACR,CAAC,CAAA;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { JBrowsePluginProteinViewModel } from './model';
1
+ import { JBrowsePluginProteinStructureModel } from './model';
2
2
  export declare function genomeToProtein({ model, }: {
3
- model: JBrowsePluginProteinViewModel;
3
+ model: JBrowsePluginProteinStructureModel;
4
4
  }): number | undefined;
@@ -3,11 +3,10 @@ import { checkHovered } from './util';
3
3
  export function genomeToProtein({ model, }) {
4
4
  const { hovered } = getSession(model);
5
5
  const { genomeToTranscriptSeqMapping, connectedView } = model;
6
- if (!connectedView?.initialized ||
6
+ return !connectedView?.initialized ||
7
7
  !genomeToTranscriptSeqMapping ||
8
- !checkHovered(hovered)) {
9
- return undefined;
10
- }
11
- return genomeToTranscriptSeqMapping.g2p[hovered.hoverPosition.coord];
8
+ !checkHovered(hovered)
9
+ ? undefined
10
+ : genomeToTranscriptSeqMapping.g2p[hovered.hoverPosition.coord];
12
11
  }
13
12
  //# sourceMappingURL=genomeToProtein.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"genomeToProtein.js","sourceRoot":"","sources":["../../src/ProteinView/genomeToProtein.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAGrC,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,GAGN;IACC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACrC,MAAM,EAAE,4BAA4B,EAAE,aAAa,EAAE,GAAG,KAAK,CAAA;IAC7D,IACE,CAAC,aAAa,EAAE,WAAW;QAC3B,CAAC,4BAA4B;QAC7B,CAAC,YAAY,CAAC,OAAO,CAAC,EACtB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO,4BAA4B,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;AACtE,CAAC"}
1
+ {"version":3,"file":"genomeToProtein.js","sourceRoot":"","sources":["../../src/ProteinView/genomeToProtein.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAGrC,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,GAGN;IACC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACrC,MAAM,EAAE,4BAA4B,EAAE,aAAa,EAAE,GAAG,KAAK,CAAA;IAC7D,OAAO,CAAC,aAAa,EAAE,WAAW;QAChC,CAAC,4BAA4B;QAC7B,CAAC,YAAY,CAAC,OAAO,CAAC;QACtB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;AACnE,CAAC"}