jbrowse-plugin-mafviewer 1.2.3 → 1.2.4

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 (71) hide show
  1. package/dist/BgzipTaffyAdapter/BgzipTaffyAdapter.d.ts +1 -1
  2. package/dist/BigMafAdapter/BigMafAdapter.d.ts +1 -1
  3. package/dist/BigMafAdapter/BigMafAdapter.js +50 -49
  4. package/dist/BigMafAdapter/BigMafAdapter.js.map +1 -1
  5. package/dist/LinearMafDisplay/components/ColorLegend.d.ts +2 -4
  6. package/dist/LinearMafDisplay/components/ColorLegend.js +2 -3
  7. package/dist/LinearMafDisplay/components/ColorLegend.js.map +1 -1
  8. package/dist/LinearMafDisplay/components/{ReactComponent.d.ts → LinearMafDisplayComponent.d.ts} +1 -1
  9. package/dist/LinearMafDisplay/components/{ReactComponent.js → LinearMafDisplayComponent.js} +2 -2
  10. package/dist/LinearMafDisplay/components/LinearMafDisplayComponent.js.map +1 -0
  11. package/dist/LinearMafDisplay/components/SetRowHeightDialog.js +38 -0
  12. package/dist/LinearMafDisplay/components/SetRowHeightDialog.js.map +1 -0
  13. package/dist/LinearMafDisplay/components/SvgWrapper.d.ts +1 -1
  14. package/dist/LinearMafDisplay/components/SvgWrapper.js.map +1 -1
  15. package/dist/LinearMafDisplay/components/Tree.d.ts +2 -1
  16. package/dist/LinearMafDisplay/components/Tree.js +2 -0
  17. package/dist/LinearMafDisplay/components/Tree.js.map +1 -1
  18. package/dist/LinearMafDisplay/components/YScaleBars.d.ts +1 -1
  19. package/dist/LinearMafDisplay/components/YScaleBars.js +1 -10
  20. package/dist/LinearMafDisplay/components/YScaleBars.js.map +1 -1
  21. package/dist/LinearMafDisplay/index.js +1 -1
  22. package/dist/LinearMafDisplay/index.js.map +1 -1
  23. package/dist/LinearMafDisplay/stateModel.d.ts +20 -19
  24. package/dist/LinearMafDisplay/stateModel.js +42 -7
  25. package/dist/LinearMafDisplay/stateModel.js.map +1 -1
  26. package/dist/LinearMafDisplay/types.d.ts +5 -3
  27. package/dist/LinearMafDisplay/types.js +1 -15
  28. package/dist/LinearMafDisplay/types.js.map +1 -1
  29. package/dist/LinearMafDisplay/util.d.ts +4 -0
  30. package/dist/LinearMafDisplay/util.js +16 -0
  31. package/dist/LinearMafDisplay/util.js.map +1 -0
  32. package/dist/LinearMafRenderer/LinearMafRenderer.d.ts +4 -4
  33. package/dist/LinearMafRenderer/LinearMafRenderer.js +8 -10
  34. package/dist/LinearMafRenderer/LinearMafRenderer.js.map +1 -1
  35. package/dist/LinearMafRenderer/makeImageData.js +18 -16
  36. package/dist/LinearMafRenderer/makeImageData.js.map +1 -1
  37. package/dist/MafAddTrackWorkflow/index.js +0 -1
  38. package/dist/MafAddTrackWorkflow/index.js.map +1 -1
  39. package/dist/MafTabixAdapter/MafTabixAdapter.d.ts +1 -1
  40. package/dist/MafTabixAdapter/MafTabixAdapter.js +6 -7
  41. package/dist/MafTabixAdapter/MafTabixAdapter.js.map +1 -1
  42. package/dist/MafTabixAdapter/configSchema.js +29 -1
  43. package/dist/MafTabixAdapter/configSchema.js.map +1 -1
  44. package/dist/jbrowse-plugin-mafviewer.umd.production.min.js +7 -20
  45. package/dist/jbrowse-plugin-mafviewer.umd.production.min.js.map +4 -4
  46. package/dist/util.d.ts +2 -2
  47. package/dist/util.js +5 -1
  48. package/dist/util.js.map +1 -1
  49. package/package.json +10 -10
  50. package/src/BigMafAdapter/BigMafAdapter.ts +52 -49
  51. package/src/LinearMafDisplay/components/ColorLegend.tsx +11 -7
  52. package/src/LinearMafDisplay/components/{ReactComponent.tsx → LinearMafDisplayComponent.tsx} +2 -2
  53. package/src/LinearMafDisplay/components/SetRowHeightDialog.tsx +83 -0
  54. package/src/LinearMafDisplay/components/SvgWrapper.tsx +1 -2
  55. package/src/LinearMafDisplay/components/Tree.tsx +5 -1
  56. package/src/LinearMafDisplay/components/YScaleBars.tsx +3 -21
  57. package/src/LinearMafDisplay/index.ts +1 -1
  58. package/src/LinearMafDisplay/stateModel.ts +49 -18
  59. package/src/LinearMafDisplay/types.ts +4 -24
  60. package/src/LinearMafDisplay/util.ts +27 -0
  61. package/src/LinearMafRenderer/LinearMafRenderer.ts +9 -14
  62. package/src/LinearMafRenderer/makeImageData.ts +18 -17
  63. package/src/MafAddTrackWorkflow/index.ts +0 -1
  64. package/src/MafTabixAdapter/MafTabixAdapter.ts +9 -7
  65. package/src/MafTabixAdapter/configSchema.ts +29 -1
  66. package/src/util.ts +6 -2
  67. package/dist/LinearMafDisplay/components/ReactComponent.js.map +0 -1
  68. package/dist/LinearMafDisplay/components/SetRowHeight.js +0 -36
  69. package/dist/LinearMafDisplay/components/SetRowHeight.js.map +0 -1
  70. package/src/LinearMafDisplay/components/SetRowHeight.tsx +0 -83
  71. /package/dist/LinearMafDisplay/components/{SetRowHeight.d.ts → SetRowHeightDialog.d.ts} +0 -0
@@ -74,11 +74,12 @@ export function makeImageData({
74
74
  }
75
75
 
76
76
  const t = rowHeight * row
77
+ const t2 = offset + t
77
78
 
78
79
  // gaps
79
80
  ctx.beginPath()
80
81
  ctx.fillStyle = 'black'
81
- for (let i = 0, o = 0; i < alignment.length; i++) {
82
+ for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
82
83
  if (seq[i] !== '-') {
83
84
  if (alignment[i] === '-') {
84
85
  const l = leftPx + scale * o
@@ -93,12 +94,12 @@ export function makeImageData({
93
94
  if (!showAllLetters) {
94
95
  // matches
95
96
  ctx.fillStyle = 'lightgrey'
96
- for (let i = 0, o = 0; i < alignment.length; i++) {
97
+ for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
97
98
  if (seq[i] !== '-') {
98
99
  const c = alignment[i]
99
100
  const l = leftPx + scale * o
100
101
  if (seq[i] === c && c !== '-' && c !== ' ') {
101
- fillRect(ctx, l, offset + t, scale + f, h, canvasWidth)
102
+ fillRect(ctx, l, t2, scale + f, h, canvasWidth)
102
103
  }
103
104
  o++
104
105
  }
@@ -106,7 +107,7 @@ export function makeImageData({
106
107
  }
107
108
 
108
109
  // mismatches
109
- for (let i = 0, o = 0; i < alignment.length; i++) {
110
+ for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
110
111
  const c = alignment[i]
111
112
  if (seq[i] !== '-') {
112
113
  if (c !== '-') {
@@ -115,7 +116,7 @@ export function makeImageData({
115
116
  fillRect(
116
117
  ctx,
117
118
  l,
118
- offset + t,
119
+ t2,
119
120
  scale + f,
120
121
  h,
121
122
  canvasWidth,
@@ -128,7 +129,7 @@ export function makeImageData({
128
129
  fillRect(
129
130
  ctx,
130
131
  l,
131
- offset + t,
132
+ t2,
132
133
  scale + f,
133
134
  h,
134
135
  canvasWidth,
@@ -146,7 +147,7 @@ export function makeImageData({
146
147
  // font
147
148
  const charSizeW = 10
148
149
  if (scale >= charSizeW) {
149
- for (let i = 0, o = 0; i < alignment.length; i++) {
150
+ for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
150
151
  if (seq[i] !== '-') {
151
152
  const l = leftPx + scale * o
152
153
  const offset = (scale - charSizeW) / 2 + 1
@@ -182,8 +183,8 @@ export function makeImageData({
182
183
  }
183
184
 
184
185
  const t = rowHeight * row
185
-
186
- for (let i = 0, o = 0; i < alignment.length; i++) {
186
+ const t2 = offset + t
187
+ for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
187
188
  let ins = ''
188
189
  while (seq[i] === '-') {
189
190
  if (alignment[i] !== '-' && alignment[i] !== ' ') {
@@ -197,14 +198,14 @@ export function makeImageData({
197
198
  if (ins.length > 10) {
198
199
  const txt = `${ins.length}`
199
200
  if (bpPerPx > 10) {
200
- fillRect(ctx, l - 1, t, 2, h, canvasWidth, 'purple')
201
+ fillRect(ctx, l - 1, t2, 2, h, canvasWidth, 'purple')
201
202
  } else if (h > charHeight) {
202
- const rwidth = measureText(txt)
203
- const padding = 5
203
+ const rwidth = measureText(txt, 10)
204
+ const padding = 2
204
205
  fillRect(
205
206
  ctx,
206
207
  l - rwidth / 2 - padding,
207
- t,
208
+ t2,
208
209
  rwidth + 2 * padding,
209
210
  h,
210
211
  canvasWidth,
@@ -217,7 +218,7 @@ export function makeImageData({
217
218
  fillRect(
218
219
  ctx,
219
220
  l - padding,
220
- t,
221
+ t2,
221
222
  2 * padding,
222
223
  h,
223
224
  canvasWidth,
@@ -225,10 +226,10 @@ export function makeImageData({
225
226
  )
226
227
  }
227
228
  } else {
228
- fillRect(ctx, l, offset + t, 1, h, canvasWidth, 'purple')
229
+ fillRect(ctx, l, t2, 1, h, canvasWidth, 'purple')
229
230
  if (bpPerPx < 0.2 && rowHeight > 5) {
230
- fillRect(ctx, l - 2, offset + t, 5, 1, canvasWidth)
231
- fillRect(ctx, l - 2, offset + t + h - 1, 5, 1, canvasWidth)
231
+ fillRect(ctx, l - 2, t2, 5, 1, canvasWidth)
232
+ fillRect(ctx, l - 2, t2 + h - 1, 5, 1, canvasWidth)
232
233
  }
233
234
  }
234
235
  }
@@ -2,7 +2,6 @@ import PluginManager from '@jbrowse/core/PluginManager'
2
2
  import { AddTrackWorkflowType } from '@jbrowse/core/pluggableElementTypes'
3
3
  import { types } from 'mobx-state-tree'
4
4
 
5
- // locals
6
5
  import MultiMAFWidget from './AddTrackWorkflow'
7
6
 
8
7
  export default function MafAddTrackWorkflowF(pluginManager: PluginManager) {
@@ -29,16 +29,16 @@ export default class MafTabixAdapter extends BaseFeatureDataAdapter {
29
29
  public setupP?: Promise<{ adapter: BaseFeatureDataAdapter }>
30
30
 
31
31
  async setupPre() {
32
- const config = this.config
33
32
  if (!this.getSubAdapter) {
34
33
  throw new Error('no getSubAdapter available')
35
34
  }
36
- const adapter = await this.getSubAdapter({
37
- ...getSnapshot(config),
38
- type: 'BedTabixAdapter',
39
- })
40
35
  return {
41
- adapter: adapter.dataAdapter as BaseFeatureDataAdapter,
36
+ adapter: (
37
+ await this.getSubAdapter({
38
+ ...getSnapshot(this.config),
39
+ type: 'BedTabixAdapter',
40
+ })
41
+ ).dataAdapter as BaseFeatureDataAdapter,
42
42
  }
43
43
  }
44
44
  async setupPre2() {
@@ -86,7 +86,8 @@ export default class MafTabixAdapter extends BaseFeatureDataAdapter {
86
86
  const alignments = {} as Record<string, OrganismRecord>
87
87
 
88
88
  // eslint-disable-next-line @typescript-eslint/prefer-for-of
89
- for (let j = 0; j < data.length; j++) {
89
+ const len = data.length
90
+ for (let j = 0; j < len; j++) {
90
91
  const elt = data[j]!
91
92
  const seq = elt.split(':')[5]!
92
93
  const ad = elt.split(':')
@@ -106,6 +107,7 @@ export default class MafTabixAdapter extends BaseFeatureDataAdapter {
106
107
  }
107
108
  if (assemblyName) {
108
109
  firstAssemblyNameFound = firstAssemblyNameFound || assemblyName
110
+
109
111
  alignments[assemblyName] = {
110
112
  chr: last,
111
113
  start: +ad[1]!,
@@ -63,7 +63,35 @@ const configSchema = ConfigurationSchema(
63
63
  },
64
64
  },
65
65
  },
66
- { explicitlyTyped: true },
66
+ {
67
+ explicitlyTyped: true,
68
+ preProcessSnapshot: snap => {
69
+ // populate from just snap.uri
70
+ return snap.uri
71
+ ? {
72
+ ...snap,
73
+ ...(snap.nhUri
74
+ ? {
75
+ nhLocation: {
76
+ uri: snap.nhUri,
77
+ baseUri: snap.baseUri,
78
+ },
79
+ }
80
+ : {}),
81
+ bedGzLocation: {
82
+ uri: snap.uri,
83
+ baseUri: snap.baseUri,
84
+ },
85
+ index: {
86
+ location: {
87
+ uri: `${snap.uri}.tbi`,
88
+ baseUri: snap.baseUri,
89
+ },
90
+ },
91
+ }
92
+ : snap
93
+ },
94
+ },
67
95
  )
68
96
 
69
97
  export default configSchema
package/src/util.ts CHANGED
@@ -3,9 +3,13 @@ function isStrs(array: unknown[]): array is string[] {
3
3
  }
4
4
 
5
5
  export function normalize(
6
- r: string[] | { id: string; label: string; color?: string }[],
6
+ r: string[] | { id: string; label?: string; color?: string }[],
7
7
  ) {
8
8
  return isStrs(r)
9
- ? r.map(elt => ({ id: elt, label: elt, color: undefined }))
9
+ ? r.map(elt => ({
10
+ id: elt,
11
+ label: elt,
12
+ color: undefined,
13
+ }))
10
14
  : r
11
15
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactComponent.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/ReactComponent.tsx"],"names":[],"mappings":"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"}
@@ -1,36 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Dialog } from '@jbrowse/core/ui';
3
- import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
4
- import { observer } from 'mobx-react';
5
- import { makeStyles } from 'tss-react/mui';
6
- const useStyles = makeStyles()({
7
- root: {
8
- width: 500,
9
- },
10
- });
11
- const SetRowHeightDialog = observer(function (props) {
12
- const { model, handleClose } = props;
13
- const { classes } = useStyles();
14
- const [rowHeight, setRowHeight] = useState(`${model.rowHeight}`);
15
- const [rowProportion, setRowProportion] = useState(`${model.rowProportion}`);
16
- return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Set row height" },
17
- React.createElement(DialogContent, { className: classes.root },
18
- React.createElement(Typography, null, "Set row height and the proportion of the row height to use for drawing each row"),
19
- React.createElement(TextField, { value: rowHeight, helperText: "Enter row height", onChange: event => {
20
- setRowHeight(event.target.value);
21
- } }),
22
- React.createElement(TextField, { value: rowProportion, helperText: "Enter row proportion", onChange: event => {
23
- setRowProportion(event.target.value);
24
- } }),
25
- React.createElement(DialogActions, null,
26
- React.createElement(Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, onClick: () => {
27
- model.setRowProportion(+rowProportion);
28
- model.setRowHeight(+rowHeight);
29
- handleClose();
30
- } }, "Submit"),
31
- React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
32
- handleClose();
33
- } }, "Cancel")))));
34
- });
35
- export default SetRowHeightDialog;
36
- //# sourceMappingURL=SetRowHeight.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetRowHeight.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/SetRowHeight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG;KACX;CACF,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAAG,QAAQ,CAAC,UAAU,KAQ7C;IACC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IACpC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;IAC/B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,CAAA;IAChE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC,CAAA;IAE5E,OAAO,CACL,oBAAC,MAAM,IAAC,IAAI,QAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,gBAAgB;QACvD,oBAAC,aAAa,IAAC,SAAS,EAAE,OAAO,CAAC,IAAI;YACpC,oBAAC,UAAU,0FAGE;YACb,oBAAC,SAAS,IACR,KAAK,EAAE,SAAS,EAChB,UAAU,EAAC,kBAAkB,EAC7B,QAAQ,EAAE,KAAK,CAAC,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBAClC,CAAC,GACD;YACF,oBAAC,SAAS,IACR,KAAK,EAAE,aAAa,EACpB,UAAU,EAAC,sBAAsB,EACjC,QAAQ,EAAE,KAAK,CAAC,EAAE;oBAChB,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBACtC,CAAC,GACD;YACF,oBAAC,aAAa;gBACZ,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,IAAI,EAAC,QAAQ,EACb,SAAS,QACT,OAAO,EAAE,GAAG,EAAE;wBACZ,KAAK,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAA;wBACtC,KAAK,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAA;wBAC9B,WAAW,EAAE,CAAA;oBACf,CAAC,aAGM;gBACT,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,GAAG,EAAE;wBACZ,WAAW,EAAE,CAAA;oBACf,CAAC,aAGM,CACK,CACF,CACT,CACV,CAAA;AACH,CAAC,CAAC,CAAA;AACF,eAAe,kBAAkB,CAAA"}
@@ -1,83 +0,0 @@
1
- import React, { useState } from 'react'
2
-
3
- import { Dialog } from '@jbrowse/core/ui'
4
- import {
5
- Button,
6
- DialogActions,
7
- DialogContent,
8
- TextField,
9
- Typography,
10
- } from '@mui/material'
11
- import { observer } from 'mobx-react'
12
- import { makeStyles } from 'tss-react/mui'
13
-
14
- const useStyles = makeStyles()({
15
- root: {
16
- width: 500,
17
- },
18
- })
19
-
20
- const SetRowHeightDialog = observer(function (props: {
21
- model: {
22
- rowHeight?: number
23
- rowProportion?: number
24
- setRowHeight: (arg: number) => void
25
- setRowProportion: (arg: number) => void
26
- }
27
- handleClose: () => void
28
- }) {
29
- const { model, handleClose } = props
30
- const { classes } = useStyles()
31
- const [rowHeight, setRowHeight] = useState(`${model.rowHeight}`)
32
- const [rowProportion, setRowProportion] = useState(`${model.rowProportion}`)
33
-
34
- return (
35
- <Dialog open onClose={handleClose} title="Set row height">
36
- <DialogContent className={classes.root}>
37
- <Typography>
38
- Set row height and the proportion of the row height to use for drawing
39
- each row
40
- </Typography>
41
- <TextField
42
- value={rowHeight}
43
- helperText="Enter row height"
44
- onChange={event => {
45
- setRowHeight(event.target.value)
46
- }}
47
- />
48
- <TextField
49
- value={rowProportion}
50
- helperText="Enter row proportion"
51
- onChange={event => {
52
- setRowProportion(event.target.value)
53
- }}
54
- />
55
- <DialogActions>
56
- <Button
57
- variant="contained"
58
- color="primary"
59
- type="submit"
60
- autoFocus
61
- onClick={() => {
62
- model.setRowProportion(+rowProportion)
63
- model.setRowHeight(+rowHeight)
64
- handleClose()
65
- }}
66
- >
67
- Submit
68
- </Button>
69
- <Button
70
- variant="contained"
71
- color="secondary"
72
- onClick={() => {
73
- handleClose()
74
- }}
75
- >
76
- Cancel
77
- </Button>
78
- </DialogActions>
79
- </DialogContent>
80
- </Dialog>
81
- )
82
- })
83
- export default SetRowHeightDialog