jbrowse-plugin-msaview 2.2.2 → 2.2.3
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.
- package/dist/MsaViewPanel/model.d.ts +10 -0
- package/dist/MsaViewPanel/model.js +36 -20
- package/dist/MsaViewPanel/model.js.map +1 -1
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.d.ts +6 -3
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +21 -21
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +3 -3
- package/dist/out.js +32 -18
- package/package.json +1 -1
- package/src/MsaViewPanel/model.ts +39 -27
- package/src/MsaViewPanel/msaCoordToGenomeCoord.ts +1 -3
package/dist/out.js
CHANGED
|
@@ -55142,8 +55142,39 @@ ${seq}`)
|
|
|
55142
55142
|
*/
|
|
55143
55143
|
setBlastParams(args) {
|
|
55144
55144
|
self2.blastParams = args;
|
|
55145
|
+
},
|
|
55146
|
+
/**
|
|
55147
|
+
* #action
|
|
55148
|
+
*/
|
|
55149
|
+
handleMsaClick(coord) {
|
|
55150
|
+
const { connectedView, zoomToBaseLevel } = self2;
|
|
55151
|
+
const { assemblyManager } = (0, import_util45.getSession)(self2);
|
|
55152
|
+
const r2 = msaCoordToGenomeCoord({ model: self2, coord });
|
|
55153
|
+
if (!r2 || !connectedView) {
|
|
55154
|
+
return;
|
|
55155
|
+
}
|
|
55156
|
+
if (zoomToBaseLevel) {
|
|
55157
|
+
connectedView.navTo(r2);
|
|
55158
|
+
} else {
|
|
55159
|
+
const r3 = assemblyManager.get(connectedView.assemblyNames[0])?.getCanonicalRefName(r2.refName) ?? r2.refName;
|
|
55160
|
+
connectedView.centerAt(r2.start, r3);
|
|
55161
|
+
}
|
|
55145
55162
|
}
|
|
55146
|
-
})).
|
|
55163
|
+
})).actions((self2) => {
|
|
55164
|
+
const superSetMouseClickPos = self2.setMouseClickPos;
|
|
55165
|
+
return {
|
|
55166
|
+
/**
|
|
55167
|
+
* #action
|
|
55168
|
+
* overrides base setMouseClickPos to trigger navigation
|
|
55169
|
+
*/
|
|
55170
|
+
setMouseClickPos(col, row) {
|
|
55171
|
+
superSetMouseClickPos(col, row);
|
|
55172
|
+
if (col !== void 0) {
|
|
55173
|
+
self2.handleMsaClick(col);
|
|
55174
|
+
}
|
|
55175
|
+
}
|
|
55176
|
+
};
|
|
55177
|
+
}).views((self2) => ({
|
|
55147
55178
|
/**
|
|
55148
55179
|
* #method
|
|
55149
55180
|
* overrides base
|
|
@@ -55205,23 +55236,6 @@ ${seq}`)
|
|
|
55205
55236
|
self2.setConnectedHighlights([r1, r2].filter((f2) => !!f2));
|
|
55206
55237
|
})
|
|
55207
55238
|
);
|
|
55208
|
-
(0, import_mobx_state_tree8.addDisposer)(
|
|
55209
|
-
self2,
|
|
55210
|
-
(0, import_mobx7.autorun)(() => {
|
|
55211
|
-
const { connectedView, zoomToBaseLevel, mouseClickCol } = self2;
|
|
55212
|
-
const { assemblyManager } = (0, import_util45.getSession)(self2);
|
|
55213
|
-
const r2 = mouseClickCol === void 0 ? void 0 : msaCoordToGenomeCoord({ model: self2, coord: mouseClickCol });
|
|
55214
|
-
if (!r2 || !connectedView) {
|
|
55215
|
-
return;
|
|
55216
|
-
}
|
|
55217
|
-
if (zoomToBaseLevel) {
|
|
55218
|
-
connectedView.navTo(r2);
|
|
55219
|
-
} else {
|
|
55220
|
-
const r3 = assemblyManager.get(connectedView.assemblyNames[0])?.getCanonicalRefName(r2.refName) ?? r2.refName;
|
|
55221
|
-
connectedView.centerAt(r2.start, r3);
|
|
55222
|
-
}
|
|
55223
|
-
})
|
|
55224
|
-
);
|
|
55225
55239
|
}
|
|
55226
55240
|
}));
|
|
55227
55241
|
}
|
package/package.json
CHANGED
|
@@ -202,7 +202,46 @@ export default function stateModelFactory() {
|
|
|
202
202
|
setBlastParams(args?: BlastParams) {
|
|
203
203
|
self.blastParams = args
|
|
204
204
|
},
|
|
205
|
+
/**
|
|
206
|
+
* #action
|
|
207
|
+
*/
|
|
208
|
+
handleMsaClick(coord: number) {
|
|
209
|
+
const { connectedView, zoomToBaseLevel } = self
|
|
210
|
+
const { assemblyManager } = getSession(self)
|
|
211
|
+
const r2 = msaCoordToGenomeCoord({ model: self, coord })
|
|
212
|
+
|
|
213
|
+
if (!r2 || !connectedView) {
|
|
214
|
+
return
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (zoomToBaseLevel) {
|
|
218
|
+
connectedView.navTo(r2)
|
|
219
|
+
} else {
|
|
220
|
+
const r =
|
|
221
|
+
assemblyManager
|
|
222
|
+
.get(connectedView.assemblyNames[0]!)
|
|
223
|
+
?.getCanonicalRefName(r2.refName) ?? r2.refName
|
|
224
|
+
connectedView.centerAt(r2.start, r)
|
|
225
|
+
}
|
|
226
|
+
},
|
|
205
227
|
}))
|
|
228
|
+
.actions(self => {
|
|
229
|
+
// store reference to the original action from react-msaview
|
|
230
|
+
const superSetMouseClickPos = self.setMouseClickPos
|
|
231
|
+
|
|
232
|
+
return {
|
|
233
|
+
/**
|
|
234
|
+
* #action
|
|
235
|
+
* overrides base setMouseClickPos to trigger navigation
|
|
236
|
+
*/
|
|
237
|
+
setMouseClickPos(col?: number, row?: number) {
|
|
238
|
+
superSetMouseClickPos(col, row)
|
|
239
|
+
if (col !== undefined) {
|
|
240
|
+
self.handleMsaClick(col)
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
}
|
|
244
|
+
})
|
|
206
245
|
|
|
207
246
|
.views(self => ({
|
|
208
247
|
/**
|
|
@@ -277,33 +316,6 @@ export default function stateModelFactory() {
|
|
|
277
316
|
self.setConnectedHighlights([r1, r2].filter(f => !!f))
|
|
278
317
|
}),
|
|
279
318
|
)
|
|
280
|
-
|
|
281
|
-
// nav to genome position after click
|
|
282
|
-
addDisposer(
|
|
283
|
-
self,
|
|
284
|
-
autorun(() => {
|
|
285
|
-
const { connectedView, zoomToBaseLevel, mouseClickCol } = self
|
|
286
|
-
const { assemblyManager } = getSession(self)
|
|
287
|
-
const r2 =
|
|
288
|
-
mouseClickCol === undefined
|
|
289
|
-
? undefined
|
|
290
|
-
: msaCoordToGenomeCoord({ model: self, coord: mouseClickCol })
|
|
291
|
-
|
|
292
|
-
if (!r2 || !connectedView) {
|
|
293
|
-
return
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (zoomToBaseLevel) {
|
|
297
|
-
connectedView.navTo(r2)
|
|
298
|
-
} else {
|
|
299
|
-
const r =
|
|
300
|
-
assemblyManager
|
|
301
|
-
.get(connectedView.assemblyNames[0]!)
|
|
302
|
-
?.getCanonicalRefName(r2.refName) ?? r2.refName
|
|
303
|
-
connectedView.centerAt(r2.start, r)
|
|
304
|
-
}
|
|
305
|
-
}),
|
|
306
|
-
)
|
|
307
319
|
},
|
|
308
320
|
}))
|
|
309
321
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { JBrowsePluginMsaViewModel } from './model'
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Convert gapped MSA column coordinate to ungapped sequence coordinate
|
|
5
3
|
* This is the inverse of ungappedCoordMap
|
|
@@ -18,7 +16,7 @@ export function msaCoordToGenomeCoord({
|
|
|
18
16
|
model,
|
|
19
17
|
coord: mouseCol,
|
|
20
18
|
}: {
|
|
21
|
-
model:
|
|
19
|
+
model: { querySeqName: string; transcriptToMsaMap: any; rows: string[][] }
|
|
22
20
|
coord: number
|
|
23
21
|
}) {
|
|
24
22
|
const { querySeqName, transcriptToMsaMap } = model
|