jbrowse-plugin-msaview 2.4.3 → 2.4.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 (170) hide show
  1. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +2 -2
  2. package/dist/AddHighlightModel/HighlightComponents.js +0 -1
  3. package/dist/AddHighlightModel/MsaToGenomeHighlight.js +5 -3
  4. package/dist/AddHighlightModel/index.js +2 -2
  5. package/dist/AddHighlightModel/util.d.ts +1 -6
  6. package/dist/AddHighlightModel/util.js +1 -7
  7. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +0 -1
  8. package/dist/BgzipFastaMsaAdapter/configSchema.js +0 -1
  9. package/dist/BgzipFastaMsaAdapter/index.js +0 -1
  10. package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +0 -1
  11. package/dist/LaunchMsaView/components/LaunchPanelContent.js +0 -1
  12. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +0 -1
  13. package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js +0 -1
  14. package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js +0 -1
  15. package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +0 -1
  16. package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js +0 -1
  17. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +0 -1
  18. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +0 -1
  19. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js +0 -1
  20. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js +0 -1
  21. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js +0 -1
  22. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js +0 -1
  23. package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js +0 -1
  24. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js +0 -1
  25. package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js +0 -1
  26. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +0 -1
  27. package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js +0 -1
  28. package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.js +0 -1
  29. package/dist/LaunchMsaView/components/PreLoadedMSA/types.js +0 -1
  30. package/dist/LaunchMsaView/components/SubmitCancelActions.js +0 -1
  31. package/dist/LaunchMsaView/components/TabPanel.js +1 -2
  32. package/dist/LaunchMsaView/components/TranscriptSelector.js +0 -1
  33. package/dist/LaunchMsaView/components/calculateProteinSequence.js +0 -1
  34. package/dist/LaunchMsaView/components/fetchSeq.js +0 -1
  35. package/dist/LaunchMsaView/components/types.js +0 -1
  36. package/dist/LaunchMsaView/components/useFeatureSequence.js +0 -1
  37. package/dist/LaunchMsaView/components/useSWRFeatureSequence.js +0 -1
  38. package/dist/LaunchMsaView/components/useTranscriptSelection.js +0 -1
  39. package/dist/LaunchMsaView/components/util.js +0 -1
  40. package/dist/LaunchMsaView/index.js +0 -1
  41. package/dist/LaunchMsaView/util.js +0 -1
  42. package/dist/LaunchMsaViewExtensionPoint/index.js +0 -1
  43. package/dist/MsaViewPanel/afterCreateAutoruns.d.ts +0 -1
  44. package/dist/MsaViewPanel/afterCreateAutoruns.js +4 -22
  45. package/dist/MsaViewPanel/blosum62.js +0 -1
  46. package/dist/MsaViewPanel/components/ConnectStructureDialog.js +0 -1
  47. package/dist/MsaViewPanel/components/ErrorBoundary.d.ts +1 -1
  48. package/dist/MsaViewPanel/components/ErrorBoundary.js +0 -1
  49. package/dist/MsaViewPanel/components/LoadingBLAST.js +0 -1
  50. package/dist/MsaViewPanel/components/MsaViewPanel.js +0 -1
  51. package/dist/MsaViewPanel/components/RIDLink.js +0 -1
  52. package/dist/MsaViewPanel/doLaunchBlast.js +0 -1
  53. package/dist/MsaViewPanel/genomeToMSA.d.ts +0 -6
  54. package/dist/MsaViewPanel/genomeToMSA.js +8 -30
  55. package/dist/MsaViewPanel/genomeToMSA.test.js +0 -1
  56. package/dist/MsaViewPanel/index.js +0 -1
  57. package/dist/MsaViewPanel/model.d.ts +9 -18
  58. package/dist/MsaViewPanel/model.js +21 -32
  59. package/dist/MsaViewPanel/msaCoordToGenomeCoord.js +5 -22
  60. package/dist/MsaViewPanel/msaCoordToGenomeCoord.test.js +0 -1
  61. package/dist/MsaViewPanel/msaDataStore.js +0 -1
  62. package/dist/MsaViewPanel/pairwiseAlignment.js +0 -1
  63. package/dist/MsaViewPanel/pairwiseAlignment.test.js +0 -1
  64. package/dist/MsaViewPanel/structureConnection.js +0 -1
  65. package/dist/MsaViewPanel/structureConnection.test.js +0 -1
  66. package/dist/MsaViewPanel/types.js +0 -1
  67. package/dist/MsaViewPanel/util.d.ts +1 -3
  68. package/dist/MsaViewPanel/util.js +1 -3
  69. package/dist/components/ExternalLink.js +0 -1
  70. package/dist/components/ReadOnlyTextField2.js +0 -1
  71. package/dist/components/TextField2.js +0 -1
  72. package/dist/index.js +0 -1
  73. package/dist/jbrowse-plugin-msaview.umd.production.min.js +38 -37
  74. package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
  75. package/dist/utils/blastCache.js +2 -5
  76. package/dist/utils/fetch.js +0 -1
  77. package/dist/utils/msa.js +0 -1
  78. package/dist/utils/ncbiBlast.js +0 -1
  79. package/dist/utils/swrConfig.js +0 -1
  80. package/dist/utils/taxonomyNames.js +0 -1
  81. package/dist/utils/types.js +0 -1
  82. package/dist/version.d.ts +1 -1
  83. package/dist/version.js +1 -2
  84. package/package.json +13 -13
  85. package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +4 -1
  86. package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +5 -8
  87. package/src/AddHighlightModel/index.tsx +4 -1
  88. package/src/AddHighlightModel/util.ts +1 -10
  89. package/src/LaunchMsaView/components/TabPanel.tsx +1 -1
  90. package/src/MsaViewPanel/afterCreateAutoruns.ts +4 -23
  91. package/src/MsaViewPanel/genomeToMSA.ts +10 -29
  92. package/src/MsaViewPanel/model.ts +26 -33
  93. package/src/MsaViewPanel/msaCoordToGenomeCoord.ts +5 -21
  94. package/src/MsaViewPanel/util.ts +3 -7
  95. package/src/utils/blastCache.ts +2 -4
  96. package/src/version.ts +1 -1
  97. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +0 -1
  98. package/dist/AddHighlightModel/HighlightComponents.js.map +0 -1
  99. package/dist/AddHighlightModel/MsaToGenomeHighlight.js.map +0 -1
  100. package/dist/AddHighlightModel/index.js.map +0 -1
  101. package/dist/AddHighlightModel/util.js.map +0 -1
  102. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js.map +0 -1
  103. package/dist/BgzipFastaMsaAdapter/configSchema.js.map +0 -1
  104. package/dist/BgzipFastaMsaAdapter/index.js.map +0 -1
  105. package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +0 -1
  106. package/dist/LaunchMsaView/components/LaunchPanelContent.js.map +0 -1
  107. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +0 -1
  108. package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js.map +0 -1
  109. package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js.map +0 -1
  110. package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +0 -1
  111. package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js.map +0 -1
  112. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +0 -1
  113. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +0 -1
  114. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js.map +0 -1
  115. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js.map +0 -1
  116. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js.map +0 -1
  117. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js.map +0 -1
  118. package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +0 -1
  119. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js.map +0 -1
  120. package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js.map +0 -1
  121. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +0 -1
  122. package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js.map +0 -1
  123. package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.js.map +0 -1
  124. package/dist/LaunchMsaView/components/PreLoadedMSA/types.js.map +0 -1
  125. package/dist/LaunchMsaView/components/SubmitCancelActions.js.map +0 -1
  126. package/dist/LaunchMsaView/components/TabPanel.js.map +0 -1
  127. package/dist/LaunchMsaView/components/TranscriptSelector.js.map +0 -1
  128. package/dist/LaunchMsaView/components/calculateProteinSequence.js.map +0 -1
  129. package/dist/LaunchMsaView/components/fetchSeq.js.map +0 -1
  130. package/dist/LaunchMsaView/components/types.js.map +0 -1
  131. package/dist/LaunchMsaView/components/useFeatureSequence.js.map +0 -1
  132. package/dist/LaunchMsaView/components/useSWRFeatureSequence.js.map +0 -1
  133. package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +0 -1
  134. package/dist/LaunchMsaView/components/util.js.map +0 -1
  135. package/dist/LaunchMsaView/index.js.map +0 -1
  136. package/dist/LaunchMsaView/util.js.map +0 -1
  137. package/dist/LaunchMsaViewExtensionPoint/index.js.map +0 -1
  138. package/dist/MsaViewPanel/afterCreateAutoruns.js.map +0 -1
  139. package/dist/MsaViewPanel/blosum62.js.map +0 -1
  140. package/dist/MsaViewPanel/components/ConnectStructureDialog.js.map +0 -1
  141. package/dist/MsaViewPanel/components/ErrorBoundary.js.map +0 -1
  142. package/dist/MsaViewPanel/components/LoadingBLAST.js.map +0 -1
  143. package/dist/MsaViewPanel/components/MsaViewPanel.js.map +0 -1
  144. package/dist/MsaViewPanel/components/RIDLink.js.map +0 -1
  145. package/dist/MsaViewPanel/doLaunchBlast.js.map +0 -1
  146. package/dist/MsaViewPanel/genomeToMSA.js.map +0 -1
  147. package/dist/MsaViewPanel/genomeToMSA.test.js.map +0 -1
  148. package/dist/MsaViewPanel/index.js.map +0 -1
  149. package/dist/MsaViewPanel/model.js.map +0 -1
  150. package/dist/MsaViewPanel/msaCoordToGenomeCoord.js.map +0 -1
  151. package/dist/MsaViewPanel/msaCoordToGenomeCoord.test.js.map +0 -1
  152. package/dist/MsaViewPanel/msaDataStore.js.map +0 -1
  153. package/dist/MsaViewPanel/pairwiseAlignment.js.map +0 -1
  154. package/dist/MsaViewPanel/pairwiseAlignment.test.js.map +0 -1
  155. package/dist/MsaViewPanel/structureConnection.js.map +0 -1
  156. package/dist/MsaViewPanel/structureConnection.test.js.map +0 -1
  157. package/dist/MsaViewPanel/types.js.map +0 -1
  158. package/dist/MsaViewPanel/util.js.map +0 -1
  159. package/dist/components/ExternalLink.js.map +0 -1
  160. package/dist/components/ReadOnlyTextField2.js.map +0 -1
  161. package/dist/components/TextField2.js.map +0 -1
  162. package/dist/index.js.map +0 -1
  163. package/dist/utils/blastCache.js.map +0 -1
  164. package/dist/utils/fetch.js.map +0 -1
  165. package/dist/utils/msa.js.map +0 -1
  166. package/dist/utils/ncbiBlast.js.map +0 -1
  167. package/dist/utils/swrConfig.js.map +0 -1
  168. package/dist/utils/taxonomyNames.js.map +0 -1
  169. package/dist/utils/types.js.map +0 -1
  170. package/dist/version.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { lazy } from 'react';
2
2
  import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes';
3
3
  import { getSession } from '@jbrowse/core/util';
4
- import { addDisposer, cast, types } from '@jbrowse/mobx-state-tree';
4
+ import { addDisposer, types } from '@jbrowse/mobx-state-tree';
5
5
  import { genomeToTranscriptSeqMapping } from 'g2p_mapper';
6
6
  import { autorun } from 'mobx';
7
7
  import { MSAModelF } from 'react-msaview';
8
- import { autoConnectStructures, highlightConnectedStructures, launchBlastIfNeeded, loadStoredData, observeProteinHighlights, processInit, runCleanup, storeDataToIndexedDB, updateGenomeHighlights, } from './afterCreateAutoruns';
8
+ import { autoConnectStructures, highlightConnectedStructures, launchBlastIfNeeded, loadStoredData, observeProteinHighlights, processInit, runCleanup, storeDataToIndexedDB, } from './afterCreateAutoruns';
9
9
  import { genomeToMSA } from './genomeToMSA';
10
10
  import { msaCoordToGenomeCoord } from './msaCoordToGenomeCoord';
11
11
  import { buildAlignmentMaps, runPairwiseAlignment } from './pairwiseAlignment';
@@ -31,11 +31,6 @@ export default function stateModelFactory() {
31
31
  /**
32
32
  * #property
33
33
  */
34
- connectedHighlights: types.array(types.model({
35
- refName: types.string,
36
- start: types.number,
37
- end: types.number,
38
- })),
39
34
  /**
40
35
  * #property
41
36
  */
@@ -165,11 +160,22 @@ export default function stateModelFactory() {
165
160
  * #getter
166
161
  */
167
162
  get mouseCol2() {
168
- const structureCol = self.structureHoverCol;
169
- if (structureCol !== undefined) {
170
- return structureCol;
171
- }
172
- return genomeToMSA({ model: self });
163
+ return (self.structureHoverCol ??
164
+ genomeToMSA({ model: self }));
165
+ },
166
+ /**
167
+ * #getter
168
+ */
169
+ get connectedHighlights() {
170
+ const { mouseCol, mouseClickCol } = self;
171
+ return [
172
+ mouseCol === undefined
173
+ ? undefined
174
+ : msaCoordToGenomeCoord({ model: self, coord: mouseCol }),
175
+ mouseClickCol === undefined
176
+ ? undefined
177
+ : msaCoordToGenomeCoord({ model: self, coord: mouseClickCol }),
178
+ ].filter((r) => r !== undefined);
173
179
  },
174
180
  }))
175
181
  .actions(self => ({
@@ -197,24 +203,6 @@ export default function stateModelFactory() {
197
203
  setRid(arg) {
198
204
  self.rid = arg;
199
205
  },
200
- /**
201
- * #action
202
- */
203
- setConnectedHighlights(r) {
204
- self.connectedHighlights = cast(r);
205
- },
206
- /**
207
- * #action
208
- */
209
- addToConnectedHighlights(r) {
210
- self.connectedHighlights.push(r);
211
- },
212
- /**
213
- * #action
214
- */
215
- clearConnectedHighlights() {
216
- self.connectedHighlights = cast([]);
217
- },
218
206
  /**
219
207
  * #action
220
208
  */
@@ -396,7 +384,6 @@ export default function stateModelFactory() {
396
384
  storeDataToIndexedDB,
397
385
  launchBlastIfNeeded,
398
386
  processInit,
399
- updateGenomeHighlights,
400
387
  highlightConnectedStructures,
401
388
  autoConnectStructures,
402
389
  observeProteinHighlights,
@@ -408,4 +395,6 @@ export default function stateModelFactory() {
408
395
  },
409
396
  }));
410
397
  }
411
- //# sourceMappingURL=model.js.map
398
+ export function isMsaView(view) {
399
+ return view.type === 'MsaView';
400
+ }
@@ -1,44 +1,27 @@
1
1
  import { gappedToUngappedPosition } from './structureConnection';
2
2
  export function msaCoordToGenomeCoord({ model, coord: mouseCol, }) {
3
3
  const { querySeqName, transcriptToMsaMap, mafRegion } = model;
4
- // Get the query sequence
5
- const queryRow = model.rows.find(f => f[0] === querySeqName);
6
- const querySeq = queryRow?.[1];
4
+ const querySeq = model.rows.find(f => f[0] === querySeqName)?.[1];
7
5
  if (!querySeq) {
8
6
  return undefined;
9
7
  }
10
- // Convert gapped MSA column to ungapped sequence coordinate
11
- // Returns undefined if the position is a gap
12
8
  const ungappedPos = gappedToUngappedPosition(querySeq, mouseCol);
13
9
  if (ungappedPos === undefined) {
14
10
  return undefined;
15
11
  }
16
- // Handle MAF region mapping
17
12
  if (mafRegion) {
18
13
  const genomePos = mafRegion.start + ungappedPos;
19
- // Check if position is within the region
20
- if (genomePos >= mafRegion.end) {
21
- return undefined;
22
- }
23
- return {
24
- refName: mafRegion.refName,
25
- start: genomePos,
26
- end: genomePos + 1,
27
- };
14
+ return genomePos < mafRegion.end
15
+ ? { refName: mafRegion.refName, start: genomePos, end: genomePos + 1 }
16
+ : undefined;
28
17
  }
29
- // Handle transcript mapping (original behavior)
30
18
  if (transcriptToMsaMap) {
31
19
  const { refName, p2g } = transcriptToMsaMap;
32
20
  const s = p2g[ungappedPos];
33
21
  const e = p2g[ungappedPos + 1];
34
22
  return s !== undefined && e !== undefined
35
- ? {
36
- refName,
37
- start: Math.min(s, e),
38
- end: Math.max(s, e),
39
- }
23
+ ? { refName, start: Math.min(s, e), end: Math.max(s, e) }
40
24
  : undefined;
41
25
  }
42
26
  return undefined;
43
27
  }
44
- //# sourceMappingURL=msaCoordToGenomeCoord.js.map
@@ -237,4 +237,3 @@ describe('msaCoordToGenomeCoord', () => {
237
237
  });
238
238
  });
239
239
  });
240
- //# sourceMappingURL=msaCoordToGenomeCoord.test.js.map
@@ -71,4 +71,3 @@ export async function cleanupOldData(maxAgeMs = 7 * 24 * 60 * 60 * 1000) {
71
71
  return 0;
72
72
  }
73
73
  }
74
- //# sourceMappingURL=msaDataStore.js.map
@@ -143,4 +143,3 @@ export function buildAlignmentMaps(pairwiseAlignment) {
143
143
  }
144
144
  return { seq1ToSeq2, seq2ToSeq1 };
145
145
  }
146
- //# sourceMappingURL=pairwiseAlignment.js.map
@@ -109,4 +109,3 @@ describe('buildAlignmentMaps', () => {
109
109
  expect(seq1ToSeq2.size).toBeLessThanOrEqual(structureSeq.length);
110
110
  });
111
111
  });
112
- //# sourceMappingURL=pairwiseAlignment.test.js.map
@@ -43,4 +43,3 @@ export function ungappedToGappedPosition(sequence, ungappedPosition) {
43
43
  }
44
44
  return undefined;
45
45
  }
46
- //# sourceMappingURL=structureConnection.js.map
@@ -101,4 +101,3 @@ describe('gappedToUngappedPosition and ungappedToGappedPosition are inverses', (
101
101
  }
102
102
  });
103
103
  });
104
- //# sourceMappingURL=structureConnection.test.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,6 +1,4 @@
1
- import type { Feature } from '@jbrowse/core/util';
2
- export declare function checkHovered(hovered: unknown): hovered is {
3
- hoverFeature: Feature;
1
+ export declare function hasHoverPosition(hovered: unknown): hovered is {
4
2
  hoverPosition: {
5
3
  coord: number;
6
4
  refName: string;
@@ -1,7 +1,6 @@
1
- export function checkHovered(hovered) {
1
+ export function hasHoverPosition(hovered) {
2
2
  return (!!hovered &&
3
3
  typeof hovered === 'object' &&
4
- 'hoverFeature' in hovered &&
5
4
  'hoverPosition' in hovered &&
6
5
  !!hovered.hoverPosition);
7
6
  }
@@ -22,4 +21,3 @@ export function getUniprotIdFromAlphaFoldUrl(url) {
22
21
  const match = /AF-([A-Z0-9]+)-F\d+/.exec(url);
23
22
  return match?.[1];
24
23
  }
25
- //# sourceMappingURL=util.js.map
@@ -8,4 +8,3 @@ export default function ExternalLink(props) {
8
8
  " ",
9
9
  React.createElement(OpenInNewIcon, { fontSize: "small" })));
10
10
  }
11
- //# sourceMappingURL=ExternalLink.js.map
@@ -17,4 +17,3 @@ export default function ReadOnlyTextField2({ value }) {
17
17
  },
18
18
  } }));
19
19
  }
20
- //# sourceMappingURL=ReadOnlyTextField2.js.map
@@ -5,4 +5,3 @@ function TextField2({ children, ...rest }) {
5
5
  React.createElement(TextField, { ...rest }, children)));
6
6
  }
7
7
  export default TextField2;
8
- //# sourceMappingURL=TextField2.js.map
package/dist/index.js CHANGED
@@ -55,4 +55,3 @@ export default class MsaViewPlugin extends Plugin {
55
55
  }
56
56
  }
57
57
  }
58
- //# sourceMappingURL=index.js.map