@jbrowse/plugin-linear-comparative-view 3.6.2 → 3.6.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.
@@ -60,16 +60,28 @@ async function navToSynteny({ feature, windowSize: ws, session, trackId, region,
60
60
  rMateStart = mateStart;
61
61
  rMateEnd = mateEnd;
62
62
  }
63
- const view2 = session.addView('LinearSyntenyView', {
63
+ const l1 = `${featRef}:${Math.floor(rFeatStart - ws)}-${Math.floor(rFeatEnd + ws)}`;
64
+ const m1 = Math.min(rMateStart, rMateEnd);
65
+ const m2 = Math.max(rMateStart, rMateEnd);
66
+ const l2 = `${mateRef}:${Math.floor(m1 - ws)}-${Math.floor(m2 + ws)}${horizontallyFlip ? '[rev]' : ''}`;
67
+ session.addView('LinearSyntenyView', {
64
68
  type: 'LinearSyntenyView',
65
69
  views: [
66
70
  {
67
71
  type: 'LinearGenomeView',
68
72
  hideHeader: true,
73
+ init: {
74
+ assembly: featAsm,
75
+ loc: l1,
76
+ },
69
77
  },
70
78
  {
71
79
  type: 'LinearGenomeView',
72
80
  hideHeader: true,
81
+ init: {
82
+ assembly: mateAsm,
83
+ loc: l2,
84
+ },
73
85
  },
74
86
  ],
75
87
  tracks: [
@@ -85,12 +97,4 @@ async function navToSynteny({ feature, windowSize: ws, session, trackId, region,
85
97
  },
86
98
  ],
87
99
  });
88
- const l1 = `${featRef}:${Math.floor(rFeatStart - ws)}-${Math.floor(rFeatEnd + ws)}`;
89
- const m1 = Math.min(rMateStart, rMateEnd);
90
- const m2 = Math.max(rMateStart, rMateEnd);
91
- const l2 = `${mateRef}:${Math.floor(m1 - ws)}-${Math.floor(m2 + ws)}${horizontallyFlip ? '[rev]' : ''}`;
92
- await Promise.all([
93
- view2.views[0].navToLocString(l1, featAsm),
94
- view2.views[1].navToLocString(l2, mateAsm),
95
- ]);
96
100
  }
@@ -1,11 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
+ const util_1 = require("@jbrowse/core/util");
4
5
  const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
5
6
  function configSchemaF(pluginManager) {
6
7
  pluginManager.jexl.addFunction('lgvSyntenyTooltip', (f) => {
7
- const m = f.get('mate');
8
- return [f.get('name') || f.get('id'), (m === null || m === void 0 ? void 0 : m.name) || (m === null || m === void 0 ? void 0 : m.id)]
8
+ const mate = f.get('mate');
9
+ const l1name = f.get('name') || f.get('id');
10
+ const l2name = (mate === null || mate === void 0 ? void 0 : mate.name) || (mate === null || mate === void 0 ? void 0 : mate.id);
11
+ return [
12
+ l1name ? `Name1: ${l1name}` : '',
13
+ l2name ? `Name1: ${l2name}` : '',
14
+ `Loc1: ${(0, util_1.assembleLocString)({
15
+ refName: f.get('refName'),
16
+ start: f.get('start'),
17
+ end: f.get('end'),
18
+ })} (${(0, util_1.toLocale)(f.get('end') - f.get('start'))}bp)`,
19
+ `Loc2: ${(0, util_1.assembleLocString)({
20
+ refName: mate.refName,
21
+ start: mate.start,
22
+ end: mate.end,
23
+ })} (${(0, util_1.toLocale)(mate.end - mate.start)}bp)`,
24
+ ]
9
25
  .filter(f => !!f)
10
26
  .join('<br/>');
11
27
  });
@@ -38,14 +38,16 @@ function SyntenyContextMenu({ model, onClose, anchorEl, }) {
38
38
  const mate = f.get('mate');
39
39
  const l1 = view.views[model.level];
40
40
  const l2 = view.views[model.level + 1];
41
+ const l1asm = l1.assemblyNames[0];
42
+ const l2asm = l2.assemblyNames[0];
41
43
  l1.navToLocString(`${refName}:${start}-${end}`).catch((e) => {
42
- const err = `${l1.assemblyNames[0]}:${e}`;
43
- console.error(err);
44
+ const err = `${l1asm}:${e}`;
45
+ console.error(l1asm, err);
44
46
  (0, util_1.getSession)(model).notifyError(err, e);
45
47
  });
46
48
  l2.navToLocString(`${mate.refName}:${mate.start}-${mate.end}`).catch((e) => {
47
- const err = `${l2.assemblyNames[0]}:${e}`;
48
- console.error(err);
49
+ const err = `${l2asm}:${e}`;
50
+ console.error(l2asm, err);
49
51
  (0, util_1.getSession)(model).notifyError(err, e);
50
52
  });
51
53
  },
@@ -57,16 +57,28 @@ export async function navToSynteny({ feature, windowSize: ws, session, trackId,
57
57
  rMateStart = mateStart;
58
58
  rMateEnd = mateEnd;
59
59
  }
60
- const view2 = session.addView('LinearSyntenyView', {
60
+ const l1 = `${featRef}:${Math.floor(rFeatStart - ws)}-${Math.floor(rFeatEnd + ws)}`;
61
+ const m1 = Math.min(rMateStart, rMateEnd);
62
+ const m2 = Math.max(rMateStart, rMateEnd);
63
+ const l2 = `${mateRef}:${Math.floor(m1 - ws)}-${Math.floor(m2 + ws)}${horizontallyFlip ? '[rev]' : ''}`;
64
+ session.addView('LinearSyntenyView', {
61
65
  type: 'LinearSyntenyView',
62
66
  views: [
63
67
  {
64
68
  type: 'LinearGenomeView',
65
69
  hideHeader: true,
70
+ init: {
71
+ assembly: featAsm,
72
+ loc: l1,
73
+ },
66
74
  },
67
75
  {
68
76
  type: 'LinearGenomeView',
69
77
  hideHeader: true,
78
+ init: {
79
+ assembly: mateAsm,
80
+ loc: l2,
81
+ },
70
82
  },
71
83
  ],
72
84
  tracks: [
@@ -82,12 +94,4 @@ export async function navToSynteny({ feature, windowSize: ws, session, trackId,
82
94
  },
83
95
  ],
84
96
  });
85
- const l1 = `${featRef}:${Math.floor(rFeatStart - ws)}-${Math.floor(rFeatEnd + ws)}`;
86
- const m1 = Math.min(rMateStart, rMateEnd);
87
- const m2 = Math.max(rMateStart, rMateEnd);
88
- const l2 = `${mateRef}:${Math.floor(m1 - ws)}-${Math.floor(m2 + ws)}${horizontallyFlip ? '[rev]' : ''}`;
89
- await Promise.all([
90
- view2.views[0].navToLocString(l1, featAsm),
91
- view2.views[1].navToLocString(l2, mateAsm),
92
- ]);
93
97
  }
@@ -1,9 +1,25 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
+ import { assembleLocString, toLocale } from '@jbrowse/core/util';
2
3
  import { linearPileupDisplayConfigSchemaFactory } from '@jbrowse/plugin-alignments';
3
4
  function configSchemaF(pluginManager) {
4
5
  pluginManager.jexl.addFunction('lgvSyntenyTooltip', (f) => {
5
- const m = f.get('mate');
6
- return [f.get('name') || f.get('id'), (m === null || m === void 0 ? void 0 : m.name) || (m === null || m === void 0 ? void 0 : m.id)]
6
+ const mate = f.get('mate');
7
+ const l1name = f.get('name') || f.get('id');
8
+ const l2name = (mate === null || mate === void 0 ? void 0 : mate.name) || (mate === null || mate === void 0 ? void 0 : mate.id);
9
+ return [
10
+ l1name ? `Name1: ${l1name}` : '',
11
+ l2name ? `Name1: ${l2name}` : '',
12
+ `Loc1: ${assembleLocString({
13
+ refName: f.get('refName'),
14
+ start: f.get('start'),
15
+ end: f.get('end'),
16
+ })} (${toLocale(f.get('end') - f.get('start'))}bp)`,
17
+ `Loc2: ${assembleLocString({
18
+ refName: mate.refName,
19
+ start: mate.start,
20
+ end: mate.end,
21
+ })} (${toLocale(mate.end - mate.start)}bp)`,
22
+ ]
7
23
  .filter(f => !!f)
8
24
  .join('<br/>');
9
25
  });
@@ -35,14 +35,16 @@ export default function SyntenyContextMenu({ model, onClose, anchorEl, }) {
35
35
  const mate = f.get('mate');
36
36
  const l1 = view.views[model.level];
37
37
  const l2 = view.views[model.level + 1];
38
+ const l1asm = l1.assemblyNames[0];
39
+ const l2asm = l2.assemblyNames[0];
38
40
  l1.navToLocString(`${refName}:${start}-${end}`).catch((e) => {
39
- const err = `${l1.assemblyNames[0]}:${e}`;
40
- console.error(err);
41
+ const err = `${l1asm}:${e}`;
42
+ console.error(l1asm, err);
41
43
  getSession(model).notifyError(err, e);
42
44
  });
43
45
  l2.navToLocString(`${mate.refName}:${mate.start}-${mate.end}`).catch((e) => {
44
- const err = `${l2.assemblyNames[0]}:${e}`;
45
- console.error(err);
46
+ const err = `${l2asm}:${e}`;
47
+ console.error(l2asm, err);
46
48
  getSession(model).notifyError(err, e);
47
49
  });
48
50
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-comparative-view",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "JBrowse 2 linear comparative view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -36,9 +36,9 @@
36
36
  "clean": "rimraf dist esm *.tsbuildinfo"
37
37
  },
38
38
  "dependencies": {
39
- "@jbrowse/core": "^3.6.2",
40
- "@jbrowse/plugin-alignments": "^3.6.2",
41
- "@jbrowse/plugin-linear-genome-view": "^3.6.2",
39
+ "@jbrowse/core": "^3.6.4",
40
+ "@jbrowse/plugin-alignments": "^3.6.4",
41
+ "@jbrowse/plugin-linear-genome-view": "^3.6.4",
42
42
  "@mui/icons-material": "^7.0.0",
43
43
  "@mui/material": "^7.0.0",
44
44
  "copy-to-clipboard": "^3.3.1",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "2a2c52face5f1b8fe899f48d5903e5c5f06dba63"
62
+ "gitHead": "3db8e50ce2bd9c081efbf6c2e7ae5f342380a25a"
63
63
  }