jbrowse-plugin-msaview 2.3.2 → 2.3.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 (43) hide show
  1. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +2 -11
  2. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js.map +1 -1
  3. package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +24 -47
  4. package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +1 -1
  5. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +5 -20
  6. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
  7. package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.d.ts +7 -0
  8. package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js +29 -0
  9. package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js.map +1 -0
  10. package/dist/LaunchMsaView/components/useTranscriptSelection.js +15 -14
  11. package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +1 -1
  12. package/dist/MsaViewPanel/afterCreateAutoruns.js +14 -9
  13. package/dist/MsaViewPanel/afterCreateAutoruns.js.map +1 -1
  14. package/dist/MsaViewPanel/components/ErrorBoundary.d.ts +19 -0
  15. package/dist/MsaViewPanel/components/ErrorBoundary.js +22 -0
  16. package/dist/MsaViewPanel/components/ErrorBoundary.js.map +1 -0
  17. package/dist/MsaViewPanel/components/MsaViewPanel.js +4 -2
  18. package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
  19. package/dist/MsaViewPanel/model.d.ts +0 -12
  20. package/dist/MsaViewPanel/model.js +1 -1
  21. package/dist/MsaViewPanel/model.js.map +1 -1
  22. package/dist/MsaViewPanel/pairwiseAlignment.js +9 -4
  23. package/dist/MsaViewPanel/pairwiseAlignment.js.map +1 -1
  24. package/dist/jbrowse-plugin-msaview.umd.production.min.js +26 -26
  25. package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
  26. package/dist/utils/blastCache.js +2 -3
  27. package/dist/utils/blastCache.js.map +1 -1
  28. package/dist/version.d.ts +1 -1
  29. package/dist/version.js +1 -1
  30. package/dist/version.js.map +1 -1
  31. package/package.json +35 -34
  32. package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +2 -11
  33. package/src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx +23 -49
  34. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +6 -20
  35. package/src/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.ts +49 -0
  36. package/src/LaunchMsaView/components/useTranscriptSelection.ts +25 -17
  37. package/src/MsaViewPanel/afterCreateAutoruns.ts +26 -9
  38. package/src/MsaViewPanel/components/ErrorBoundary.tsx +40 -0
  39. package/src/MsaViewPanel/components/MsaViewPanel.tsx +14 -11
  40. package/src/MsaViewPanel/model.ts +32 -21
  41. package/src/MsaViewPanel/pairwiseAlignment.ts +9 -4
  42. package/src/utils/blastCache.ts +2 -3
  43. package/src/version.ts +1 -1
@@ -123,24 +123,31 @@ export default function stateModelFactory() {
123
123
  }),
124
124
  )
125
125
 
126
- .volatile(() => ({
127
- /**
128
- * #volatile
129
- */
130
- rid: undefined as string | undefined,
131
- /**
132
- * #volatile
133
- */
134
- progress: '',
135
- /**
136
- * #volatile
137
- */
138
- error: undefined as unknown,
139
- /**
140
- * #volatile
141
- */
142
- loadingStoredData: false,
143
- }))
126
+ .volatile(
127
+ (): {
128
+ rid: string | undefined
129
+ progress: string
130
+ error: unknown
131
+ loadingStoredData: boolean
132
+ } => ({
133
+ /**
134
+ * #volatile
135
+ */
136
+ rid: undefined,
137
+ /**
138
+ * #volatile
139
+ */
140
+ progress: '',
141
+ /**
142
+ * #volatile
143
+ */
144
+ error: undefined,
145
+ /**
146
+ * #volatile
147
+ */
148
+ loadingStoredData: false,
149
+ }),
150
+ )
144
151
 
145
152
  .views(self => ({
146
153
  /**
@@ -191,11 +198,15 @@ export default function stateModelFactory() {
191
198
  return self.connectedStructures
192
199
  .map(conn => {
193
200
  const proteinView = views.find(
194
- (v: any) => v.id === conn.proteinViewId,
195
- ) as any
201
+ (v: unknown) =>
202
+ (v as Record<string, unknown>).id === conn.proteinViewId,
203
+ )
196
204
  return proteinView ? { ...conn, proteinView } : undefined
197
205
  })
198
- .filter((c): c is StructureConnection & { proteinView: any } => !!c)
206
+ .filter(
207
+ (c): c is StructureConnection & { proteinView: any } =>
208
+ c !== undefined,
209
+ )
199
210
  },
200
211
  }))
201
212
 
@@ -88,10 +88,11 @@ export function needlemanWunsch(
88
88
  const matchScore = getScore(seq1[i - 1]!, seq2[j - 1]!)
89
89
  const prevM = M[i - 1]![j - 1]!
90
90
  const prevIx = Ix[i - 1]![j - 1]!
91
+ const currentScore = M[i]![j]!
91
92
 
92
- if (M[i]![j]! === prevM + matchScore) {
93
+ if (currentScore === prevM + matchScore) {
93
94
  currentMatrix = 'M'
94
- } else if (M[i]![j]! === prevIx + matchScore) {
95
+ } else if (currentScore === prevIx + matchScore) {
95
96
  currentMatrix = 'Ix'
96
97
  } else {
97
98
  currentMatrix = 'Iy'
@@ -102,13 +103,17 @@ export function needlemanWunsch(
102
103
  alignedSeq1 = seq1[i - 1] + alignedSeq1
103
104
  alignedSeq2 = '-' + alignedSeq2
104
105
 
105
- currentMatrix = Ix[i]![j]! === M[i - 1]![j]! + gapOpen ? 'M' : 'Ix'
106
+ const ixScore = Ix[i]![j]!
107
+ const mScore = M[i - 1]![j]! + gapOpen
108
+ currentMatrix = ixScore === mScore ? 'M' : 'Ix'
106
109
  i--
107
110
  } else if (j > 0) {
108
111
  alignedSeq1 = '-' + alignedSeq1
109
112
  alignedSeq2 = seq2[j - 1] + alignedSeq2
110
113
 
111
- currentMatrix = Iy[i]![j]! === M[i]![j - 1]! + gapOpen ? 'M' : 'Iy'
114
+ const iyScore = Iy[i]![j]!
115
+ const mScore = M[i]![j - 1]! + gapOpen
116
+ currentMatrix = iyScore === mScore ? 'M' : 'Iy'
112
117
  j--
113
118
  } else {
114
119
  break
@@ -40,11 +40,10 @@ function createCacheKey(
40
40
  blastProgram: string,
41
41
  transcriptId?: string,
42
42
  ) {
43
- const seqKey = proteinSequence.slice(0, 100)
44
43
  if (transcriptId) {
45
- return `${blastDatabase}:${blastProgram}:${transcriptId}:${seqKey}`
44
+ return `${blastDatabase}:${blastProgram}:${transcriptId}:${proteinSequence}`
46
45
  }
47
- return `${blastDatabase}:${blastProgram}:${seqKey}`
46
+ return `${blastDatabase}:${blastProgram}:${proteinSequence}`
48
47
  }
49
48
 
50
49
  export async function getCachedBlastResult({
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.2.11'
1
+ export const version = '2.3.5'