@jbrowse/plugin-alignments 2.11.1 → 2.12.0

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 (27) hide show
  1. package/dist/AlignmentsFeatureDetail/LaunchBreakpointSplitViewPanel.js +1 -8
  2. package/dist/AlignmentsFeatureDetail/SuppAlignmentsLocStrings.js +1 -1
  3. package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +26 -0
  4. package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +8 -1
  5. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +13 -6
  6. package/dist/LinearPileupDisplay/configSchema.d.ts +11 -2
  7. package/dist/LinearPileupDisplay/model.d.ts +8 -6
  8. package/dist/LinearReadArcsDisplay/configSchema.d.ts +5 -0
  9. package/dist/LinearReadArcsDisplay/model.d.ts +1 -3
  10. package/dist/LinearReadCloudDisplay/configSchema.d.ts +7 -1
  11. package/dist/LinearSNPCoverageDisplay/models/configSchema.d.ts +6 -3
  12. package/dist/LinearSNPCoverageDisplay/models/model.d.ts +9 -0
  13. package/dist/PileupRenderer/renderSoftClipping.js +29 -13
  14. package/esm/AlignmentsFeatureDetail/LaunchBreakpointSplitViewPanel.js +1 -8
  15. package/esm/AlignmentsFeatureDetail/SuppAlignmentsLocStrings.js +1 -1
  16. package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +26 -0
  17. package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +8 -1
  18. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +13 -6
  19. package/esm/LinearPileupDisplay/configSchema.d.ts +11 -2
  20. package/esm/LinearPileupDisplay/model.d.ts +8 -6
  21. package/esm/LinearReadArcsDisplay/configSchema.d.ts +5 -0
  22. package/esm/LinearReadArcsDisplay/model.d.ts +1 -3
  23. package/esm/LinearReadCloudDisplay/configSchema.d.ts +7 -1
  24. package/esm/LinearSNPCoverageDisplay/models/configSchema.d.ts +6 -3
  25. package/esm/LinearSNPCoverageDisplay/models/model.d.ts +9 -0
  26. package/esm/PileupRenderer/renderSoftClipping.js +29 -13
  27. package/package.json +2 -2
@@ -26,18 +26,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const react_1 = __importStar(require("react"));
27
27
  const material_1 = require("@mui/material");
28
28
  const util_1 = require("@jbrowse/core/util");
29
- const mui_1 = require("tss-react/mui");
30
29
  const ui_1 = require("@jbrowse/core/ui");
31
30
  const getSAFeatures_1 = require("./getSAFeatures");
32
31
  // lazies
33
32
  const BreakendOptionDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./BreakendOptionDialog'))));
34
- const useStyles = (0, mui_1.makeStyles)()({
35
- cursor: {
36
- cursor: 'pointer',
37
- },
38
- });
39
33
  function LaunchBreakpointSplitViewPanel({ model, feature, viewType, }) {
40
- const { classes } = useStyles();
41
34
  const session = (0, util_1.getSession)(model);
42
35
  const { view } = model;
43
36
  const [res, setRes] = (0, react_1.useState)();
@@ -72,7 +65,7 @@ function LaunchBreakpointSplitViewPanel({ model, feature, viewType, }) {
72
65
  const [f1, f2] = arg;
73
66
  return (react_1.default.createElement("li", { key: `${JSON.stringify(arg)}-${index}` },
74
67
  react_1.default.createElement(material_1.Tooltip, { title: "Top panel->Bottom panel" },
75
- react_1.default.createElement(material_1.Link, { href: "#", className: classes.cursor, onClick: event => {
68
+ react_1.default.createElement(material_1.Link, { href: "#", onClick: event => {
76
69
  event.preventDefault();
77
70
  session.queueDialog(handleClose => [
78
71
  BreakendOptionDialog,
@@ -27,7 +27,7 @@ function SuppAlignmentsLocStrings({ tag, model, }) {
27
27
  const displayEnd = end.toLocaleString('en-US');
28
28
  const displayString = `${saRef}:${displayStart}-${displayEnd} (${saStrand}) [${saLength}bp]`;
29
29
  return (react_1.default.createElement("li", { key: `${locString}-${index}` },
30
- react_1.default.createElement(material_1.Link, { onClick: async (event) => {
30
+ react_1.default.createElement(material_1.Link, { href: "#", onClick: async (event) => {
31
31
  event.preventDefault();
32
32
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
33
33
  (0, util_1.navToLoc)(locString, model);
@@ -12,13 +12,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
12
12
  trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
13
13
  maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
14
14
  sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
15
+ showCoordinatesSetting: string;
15
16
  intronBp: number;
16
17
  upDownBp: number;
17
18
  upperCaseCDS: boolean;
19
+ charactersPerRow: number;
20
+ feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
21
+ mode: string;
18
22
  } & {
23
+ setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
19
24
  setUpDownBp(f: number): void;
20
25
  setIntronBp(f: number): void;
21
26
  setUpperCaseCDS(f: boolean): void;
27
+ setShowCoordinates(f: "none" | "relative" | "genomic"): void;
28
+ setMode(mode: string): void;
29
+ } & {
30
+ readonly showCoordinates: boolean;
31
+ readonly showGenomicCoordsOption: boolean;
32
+ readonly hasCDS: boolean | undefined;
33
+ readonly hasExon: boolean | undefined;
34
+ readonly hasExonOrCDS: boolean | undefined;
22
35
  } & {
23
36
  afterAttach(): void;
24
37
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
@@ -48,13 +61,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
48
61
  trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
49
62
  maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
50
63
  sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
64
+ showCoordinatesSetting: string;
51
65
  intronBp: number;
52
66
  upDownBp: number;
53
67
  upperCaseCDS: boolean;
68
+ charactersPerRow: number;
69
+ feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
70
+ mode: string;
54
71
  } & {
72
+ setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
55
73
  setUpDownBp(f: number): void;
56
74
  setIntronBp(f: number): void;
57
75
  setUpperCaseCDS(f: boolean): void;
76
+ setShowCoordinates(f: "none" | "relative" | "genomic"): void;
77
+ setMode(mode: string): void;
78
+ } & {
79
+ readonly showCoordinates: boolean;
80
+ readonly showGenomicCoordsOption: boolean;
81
+ readonly hasCDS: boolean | undefined;
82
+ readonly hasExon: boolean | undefined;
83
+ readonly hasExonOrCDS: boolean | undefined;
58
84
  } & {
59
85
  afterAttach(): void;
60
86
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
@@ -25,7 +25,9 @@ export default function configModelFactory(pm: PluginManager): import("@jbrowse/
25
25
  type: string;
26
26
  description: string;
27
27
  defaultValue: number;
28
- };
28
+ }; /**
29
+ * #slot
30
+ */
29
31
  fetchSizeLimit: {
30
32
  type: string;
31
33
  defaultValue: number;
@@ -42,4 +44,9 @@ export default function configModelFactory(pm: PluginManager): import("@jbrowse/
42
44
  defaultValue: string;
43
45
  contextVariable: string[];
44
46
  };
47
+ jexlFilters: {
48
+ type: string;
49
+ description: string;
50
+ defaultValue: never[];
51
+ };
45
52
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
@@ -97,6 +97,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
97
97
  defaultValue: string;
98
98
  contextVariable: string[];
99
99
  };
100
+ jexlFilters: {
101
+ type: string;
102
+ description: string;
103
+ defaultValue: never[];
104
+ };
100
105
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
101
106
  } & {
102
107
  /**
@@ -247,22 +252,19 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
247
252
  } & {
248
253
  readonly renderDelay: number;
249
254
  readonly TooltipComponent: import("react").FC<any>;
250
- readonly selectedFeatureId: string | undefined; /**
251
- * #action
252
- */
255
+ readonly selectedFeatureId: string | undefined;
253
256
  readonly DisplayMessageComponent: import("react").FC<any> | undefined;
254
257
  } & {
255
258
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
256
259
  readonly featureUnderMouse: Feature | undefined;
257
260
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
258
- getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined; /**
259
- * #action
260
- */
261
+ getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
261
262
  searchFeatureByID(id: string): [number, number, number, number] | undefined;
262
263
  } & {
263
264
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
264
265
  deleteBlock(key: string): void;
265
266
  selectFeature(feature: Feature): void;
267
+ navToFeature(feature: Feature): void;
266
268
  clearFeatureSelection(): void;
267
269
  setFeatureIdUnderMouse(feature?: string | undefined): void;
268
270
  setContextMenuFeature(feature?: Feature | undefined): void;
@@ -511,6 +513,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
511
513
  defaultValue: string;
512
514
  contextVariable: string[];
513
515
  };
516
+ jexlFilters: {
517
+ type: string;
518
+ description: string;
519
+ defaultValue: never[];
520
+ };
514
521
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
515
522
  }>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
516
523
  type: string;
@@ -36,7 +36,9 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
36
36
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
37
37
  maxFeatureScreenDensity: {
38
38
  type: string;
39
- description: string;
39
+ description: string; /**
40
+ * #slot
41
+ */
40
42
  defaultValue: number;
41
43
  };
42
44
  fetchSizeLimit: {
@@ -48,12 +50,19 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
48
50
  type: string;
49
51
  defaultValue: number;
50
52
  description: string;
51
- };
53
+ }; /**
54
+ * #slot
55
+ */
52
56
  mouseover: {
53
57
  type: string;
54
58
  description: string;
55
59
  defaultValue: string;
56
60
  contextVariable: string[];
57
61
  };
62
+ jexlFilters: {
63
+ type: string;
64
+ description: string;
65
+ defaultValue: never[];
66
+ };
58
67
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
59
68
  export default configSchemaF;
@@ -92,6 +92,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
92
92
  defaultValue: string;
93
93
  contextVariable: string[];
94
94
  };
95
+ jexlFilters: {
96
+ type: string;
97
+ description: string;
98
+ defaultValue: never[];
99
+ };
95
100
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
96
101
  } & {
97
102
  configuration: AnyConfigurationSchemaType;
@@ -234,9 +239,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
234
239
  readonly DisplayMessageComponent: import("react").FC<any> | undefined;
235
240
  } & {
236
241
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
237
- readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined; /**
238
- * #getter
239
- */
242
+ readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
240
243
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
241
244
  getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
242
245
  searchFeatureByID(id: string): [number, number, number, number] | undefined;
@@ -244,10 +247,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
244
247
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
245
248
  deleteBlock(key: string): void;
246
249
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
250
+ navToFeature(feature: import("@jbrowse/core/util").Feature): void;
247
251
  clearFeatureSelection(): void;
248
- setFeatureIdUnderMouse(feature?: string | undefined): void; /**
249
- * #method
250
- */
252
+ setFeatureIdUnderMouse(feature?: string | undefined): void;
251
253
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
252
254
  } & {
253
255
  reload(): Promise<void>;
@@ -60,5 +60,10 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
60
60
  defaultValue: string;
61
61
  contextVariable: string[];
62
62
  };
63
+ jexlFilters: {
64
+ type: string;
65
+ description: string;
66
+ defaultValue: never[];
67
+ };
63
68
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
64
69
  export default configSchemaF;
@@ -103,9 +103,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
103
103
  regionCannotBeRendered(): null;
104
104
  } & {
105
105
  setMessage(arg?: string | undefined): void;
106
- setError(error?: unknown): void; /**
107
- * #getter
108
- */
106
+ setError(error?: unknown): void;
109
107
  setRpcDriverName(rpcDriverName: string): void;
110
108
  reload(): void;
111
109
  } & {
@@ -33,9 +33,10 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
33
33
  maxFeatureScreenDensity: {
34
34
  type: string;
35
35
  description: string;
36
- defaultValue: number; /**
36
+ /**
37
37
  * #slot
38
38
  */
39
+ defaultValue: number;
39
40
  };
40
41
  fetchSizeLimit: {
41
42
  type: string;
@@ -53,5 +54,10 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
53
54
  defaultValue: string;
54
55
  contextVariable: string[];
55
56
  };
57
+ jexlFilters: {
58
+ type: string;
59
+ description: string;
60
+ defaultValue: never[];
61
+ };
56
62
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
57
63
  export default configSchemaF;
@@ -67,9 +67,7 @@ export default function SNPCoverageConfigFactory(pluginManager: PluginManager):
67
67
  description: string;
68
68
  };
69
69
  height: {
70
- type: string; /**
71
- * #slot
72
- */
70
+ type: string;
73
71
  defaultValue: number;
74
72
  description: string;
75
73
  };
@@ -79,4 +77,9 @@ export default function SNPCoverageConfigFactory(pluginManager: PluginManager):
79
77
  defaultValue: string;
80
78
  contextVariable: string[];
81
79
  };
80
+ jexlFilters: {
81
+ type: string;
82
+ description: string;
83
+ defaultValue: never[];
84
+ };
82
85
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
@@ -92,6 +92,15 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
92
92
  description: string;
93
93
  defaultValue: string;
94
94
  contextVariable: string[];
95
+ }; /**
96
+ * #property
97
+ */
98
+ jexlFilters: {
99
+ type: string;
100
+ description: string; /**
101
+ * #property
102
+ */
103
+ defaultValue: never[];
95
104
  };
96
105
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
97
106
  } & {
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderSoftClipping = void 0;
4
4
  const configuration_1 = require("@jbrowse/core/configuration");
5
5
  const util_1 = require("@jbrowse/core/util");
6
+ // locals
7
+ const MismatchParser_1 = require("../MismatchParser");
6
8
  const util_2 = require("./util");
7
9
  function renderSoftClipping({ ctx, feat, renderArgs, config, theme, colorForBase, canvasWidth, }) {
8
10
  const { feature, topPx, heightPx } = feat;
@@ -17,19 +19,16 @@ function renderSoftClipping({ ctx, feat, renderArgs, config, theme, colorForBase
17
19
  return;
18
20
  }
19
21
  const heightLim = charHeight - 2;
20
- for (const mismatch of mismatches) {
21
- if (mismatch.type === 'softclip') {
22
- const len = mismatch.cliplen || 0;
23
- const s = feature.get('start');
24
- const start = mismatch.start === 0 ? s - len : s + mismatch.start;
25
- for (let k = 0; k < len; k += 1) {
26
- const base = seq.charAt(k + mismatch.start);
27
- // If softclip length+start is longer than sequence, no need to
28
- // continue showing base
29
- if (!base) {
30
- return;
31
- }
32
- const s0 = start + k;
22
+ const CIGAR = (0, MismatchParser_1.parseCigar)(feature.get('CIGAR'));
23
+ let seqOffset = 0;
24
+ let refOffset = 0;
25
+ for (let i = 0; i < CIGAR.length; i += 2) {
26
+ const op = CIGAR[i + 1];
27
+ const len = +CIGAR[i];
28
+ if (op === 'S') {
29
+ for (let k = 0; k < len; k++) {
30
+ const base = seq[seqOffset + k];
31
+ const s0 = feature.get('start') - (i === 0 ? len : 0) + refOffset + k;
33
32
  const [leftPx, rightPx] = (0, util_1.bpSpanPx)(s0, s0 + 1, region, bpPerPx);
34
33
  const widthPx = Math.max(minFeatWidth, rightPx - leftPx);
35
34
  // Black accounts for IUPAC ambiguity code bases such as N that
@@ -42,6 +41,23 @@ function renderSoftClipping({ ctx, feat, renderArgs, config, theme, colorForBase
42
41
  ctx.fillText(base, leftPx + (widthPx - charWidth) / 2 + 1, topPx + heightPx);
43
42
  }
44
43
  }
44
+ seqOffset += len;
45
+ }
46
+ if (op === 'N') {
47
+ refOffset += len;
48
+ }
49
+ if (op === 'M' || op === '=' || op === 'X') {
50
+ refOffset += len;
51
+ seqOffset += len;
52
+ }
53
+ if (op === 'H') {
54
+ // do nothing
55
+ }
56
+ if (op === 'D') {
57
+ refOffset += len;
58
+ }
59
+ if (op === 'I') {
60
+ seqOffset += len;
45
61
  }
46
62
  }
47
63
  }
@@ -1,18 +1,11 @@
1
1
  import React, { lazy, useEffect, useState } from 'react';
2
2
  import { Typography, Link, Tooltip } from '@mui/material';
3
3
  import { SimpleFeature, getSession, toLocale, } from '@jbrowse/core/util';
4
- import { makeStyles } from 'tss-react/mui';
5
4
  import { ErrorMessage } from '@jbrowse/core/ui';
6
5
  import { getSAFeatures } from './getSAFeatures';
7
6
  // lazies
8
7
  const BreakendOptionDialog = lazy(() => import('./BreakendOptionDialog'));
9
- const useStyles = makeStyles()({
10
- cursor: {
11
- cursor: 'pointer',
12
- },
13
- });
14
8
  export default function LaunchBreakpointSplitViewPanel({ model, feature, viewType, }) {
15
- const { classes } = useStyles();
16
9
  const session = getSession(model);
17
10
  const { view } = model;
18
11
  const [res, setRes] = useState();
@@ -47,7 +40,7 @@ export default function LaunchBreakpointSplitViewPanel({ model, feature, viewTyp
47
40
  const [f1, f2] = arg;
48
41
  return (React.createElement("li", { key: `${JSON.stringify(arg)}-${index}` },
49
42
  React.createElement(Tooltip, { title: "Top panel->Bottom panel" },
50
- React.createElement(Link, { href: "#", className: classes.cursor, onClick: event => {
43
+ React.createElement(Link, { href: "#", onClick: event => {
51
44
  event.preventDefault();
52
45
  session.queueDialog(handleClose => [
53
46
  BreakendOptionDialog,
@@ -22,7 +22,7 @@ export default function SuppAlignmentsLocStrings({ tag, model, }) {
22
22
  const displayEnd = end.toLocaleString('en-US');
23
23
  const displayString = `${saRef}:${displayStart}-${displayEnd} (${saStrand}) [${saLength}bp]`;
24
24
  return (React.createElement("li", { key: `${locString}-${index}` },
25
- React.createElement(Link, { onClick: async (event) => {
25
+ React.createElement(Link, { href: "#", onClick: async (event) => {
26
26
  event.preventDefault();
27
27
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
28
28
  navToLoc(locString, model);
@@ -12,13 +12,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
12
12
  trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
13
13
  maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
14
14
  sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
15
+ showCoordinatesSetting: string;
15
16
  intronBp: number;
16
17
  upDownBp: number;
17
18
  upperCaseCDS: boolean;
19
+ charactersPerRow: number;
20
+ feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
21
+ mode: string;
18
22
  } & {
23
+ setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
19
24
  setUpDownBp(f: number): void;
20
25
  setIntronBp(f: number): void;
21
26
  setUpperCaseCDS(f: boolean): void;
27
+ setShowCoordinates(f: "none" | "relative" | "genomic"): void;
28
+ setMode(mode: string): void;
29
+ } & {
30
+ readonly showCoordinates: boolean;
31
+ readonly showGenomicCoordsOption: boolean;
32
+ readonly hasCDS: boolean | undefined;
33
+ readonly hasExon: boolean | undefined;
34
+ readonly hasExonOrCDS: boolean | undefined;
22
35
  } & {
23
36
  afterAttach(): void;
24
37
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
@@ -48,13 +61,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
48
61
  trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
49
62
  maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
50
63
  sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
64
+ showCoordinatesSetting: string;
51
65
  intronBp: number;
52
66
  upDownBp: number;
53
67
  upperCaseCDS: boolean;
68
+ charactersPerRow: number;
69
+ feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
70
+ mode: string;
54
71
  } & {
72
+ setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
55
73
  setUpDownBp(f: number): void;
56
74
  setIntronBp(f: number): void;
57
75
  setUpperCaseCDS(f: boolean): void;
76
+ setShowCoordinates(f: "none" | "relative" | "genomic"): void;
77
+ setMode(mode: string): void;
78
+ } & {
79
+ readonly showCoordinates: boolean;
80
+ readonly showGenomicCoordsOption: boolean;
81
+ readonly hasCDS: boolean | undefined;
82
+ readonly hasExon: boolean | undefined;
83
+ readonly hasExonOrCDS: boolean | undefined;
58
84
  } & {
59
85
  afterAttach(): void;
60
86
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
@@ -25,7 +25,9 @@ export default function configModelFactory(pm: PluginManager): import("@jbrowse/
25
25
  type: string;
26
26
  description: string;
27
27
  defaultValue: number;
28
- };
28
+ }; /**
29
+ * #slot
30
+ */
29
31
  fetchSizeLimit: {
30
32
  type: string;
31
33
  defaultValue: number;
@@ -42,4 +44,9 @@ export default function configModelFactory(pm: PluginManager): import("@jbrowse/
42
44
  defaultValue: string;
43
45
  contextVariable: string[];
44
46
  };
47
+ jexlFilters: {
48
+ type: string;
49
+ description: string;
50
+ defaultValue: never[];
51
+ };
45
52
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
@@ -97,6 +97,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
97
97
  defaultValue: string;
98
98
  contextVariable: string[];
99
99
  };
100
+ jexlFilters: {
101
+ type: string;
102
+ description: string;
103
+ defaultValue: never[];
104
+ };
100
105
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
101
106
  } & {
102
107
  /**
@@ -247,22 +252,19 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
247
252
  } & {
248
253
  readonly renderDelay: number;
249
254
  readonly TooltipComponent: import("react").FC<any>;
250
- readonly selectedFeatureId: string | undefined; /**
251
- * #action
252
- */
255
+ readonly selectedFeatureId: string | undefined;
253
256
  readonly DisplayMessageComponent: import("react").FC<any> | undefined;
254
257
  } & {
255
258
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
256
259
  readonly featureUnderMouse: Feature | undefined;
257
260
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
258
- getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined; /**
259
- * #action
260
- */
261
+ getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
261
262
  searchFeatureByID(id: string): [number, number, number, number] | undefined;
262
263
  } & {
263
264
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
264
265
  deleteBlock(key: string): void;
265
266
  selectFeature(feature: Feature): void;
267
+ navToFeature(feature: Feature): void;
266
268
  clearFeatureSelection(): void;
267
269
  setFeatureIdUnderMouse(feature?: string | undefined): void;
268
270
  setContextMenuFeature(feature?: Feature | undefined): void;
@@ -511,6 +513,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
511
513
  defaultValue: string;
512
514
  contextVariable: string[];
513
515
  };
516
+ jexlFilters: {
517
+ type: string;
518
+ description: string;
519
+ defaultValue: never[];
520
+ };
514
521
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
515
522
  }>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
516
523
  type: string;
@@ -36,7 +36,9 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
36
36
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
37
37
  maxFeatureScreenDensity: {
38
38
  type: string;
39
- description: string;
39
+ description: string; /**
40
+ * #slot
41
+ */
40
42
  defaultValue: number;
41
43
  };
42
44
  fetchSizeLimit: {
@@ -48,12 +50,19 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
48
50
  type: string;
49
51
  defaultValue: number;
50
52
  description: string;
51
- };
53
+ }; /**
54
+ * #slot
55
+ */
52
56
  mouseover: {
53
57
  type: string;
54
58
  description: string;
55
59
  defaultValue: string;
56
60
  contextVariable: string[];
57
61
  };
62
+ jexlFilters: {
63
+ type: string;
64
+ description: string;
65
+ defaultValue: never[];
66
+ };
58
67
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
59
68
  export default configSchemaF;
@@ -92,6 +92,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
92
92
  defaultValue: string;
93
93
  contextVariable: string[];
94
94
  };
95
+ jexlFilters: {
96
+ type: string;
97
+ description: string;
98
+ defaultValue: never[];
99
+ };
95
100
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
96
101
  } & {
97
102
  configuration: AnyConfigurationSchemaType;
@@ -234,9 +239,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
234
239
  readonly DisplayMessageComponent: import("react").FC<any> | undefined;
235
240
  } & {
236
241
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
237
- readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined; /**
238
- * #getter
239
- */
242
+ readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
240
243
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
241
244
  getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
242
245
  searchFeatureByID(id: string): [number, number, number, number] | undefined;
@@ -244,10 +247,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
244
247
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
245
248
  deleteBlock(key: string): void;
246
249
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
250
+ navToFeature(feature: import("@jbrowse/core/util").Feature): void;
247
251
  clearFeatureSelection(): void;
248
- setFeatureIdUnderMouse(feature?: string | undefined): void; /**
249
- * #method
250
- */
252
+ setFeatureIdUnderMouse(feature?: string | undefined): void;
251
253
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
252
254
  } & {
253
255
  reload(): Promise<void>;
@@ -60,5 +60,10 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
60
60
  defaultValue: string;
61
61
  contextVariable: string[];
62
62
  };
63
+ jexlFilters: {
64
+ type: string;
65
+ description: string;
66
+ defaultValue: never[];
67
+ };
63
68
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
64
69
  export default configSchemaF;
@@ -103,9 +103,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
103
103
  regionCannotBeRendered(): null;
104
104
  } & {
105
105
  setMessage(arg?: string | undefined): void;
106
- setError(error?: unknown): void; /**
107
- * #getter
108
- */
106
+ setError(error?: unknown): void;
109
107
  setRpcDriverName(rpcDriverName: string): void;
110
108
  reload(): void;
111
109
  } & {
@@ -33,9 +33,10 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
33
33
  maxFeatureScreenDensity: {
34
34
  type: string;
35
35
  description: string;
36
- defaultValue: number; /**
36
+ /**
37
37
  * #slot
38
38
  */
39
+ defaultValue: number;
39
40
  };
40
41
  fetchSizeLimit: {
41
42
  type: string;
@@ -53,5 +54,10 @@ declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/c
53
54
  defaultValue: string;
54
55
  contextVariable: string[];
55
56
  };
57
+ jexlFilters: {
58
+ type: string;
59
+ description: string;
60
+ defaultValue: never[];
61
+ };
56
62
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
57
63
  export default configSchemaF;
@@ -67,9 +67,7 @@ export default function SNPCoverageConfigFactory(pluginManager: PluginManager):
67
67
  description: string;
68
68
  };
69
69
  height: {
70
- type: string; /**
71
- * #slot
72
- */
70
+ type: string;
73
71
  defaultValue: number;
74
72
  description: string;
75
73
  };
@@ -79,4 +77,9 @@ export default function SNPCoverageConfigFactory(pluginManager: PluginManager):
79
77
  defaultValue: string;
80
78
  contextVariable: string[];
81
79
  };
80
+ jexlFilters: {
81
+ type: string;
82
+ description: string;
83
+ defaultValue: never[];
84
+ };
82
85
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
@@ -92,6 +92,15 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
92
92
  description: string;
93
93
  defaultValue: string;
94
94
  contextVariable: string[];
95
+ }; /**
96
+ * #property
97
+ */
98
+ jexlFilters: {
99
+ type: string;
100
+ description: string; /**
101
+ * #property
102
+ */
103
+ defaultValue: never[];
95
104
  };
96
105
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
97
106
  } & {
@@ -1,5 +1,7 @@
1
1
  import { readConfObject, } from '@jbrowse/core/configuration';
2
2
  import { bpSpanPx } from '@jbrowse/core/util';
3
+ // locals
4
+ import { parseCigar } from '../MismatchParser';
3
5
  import { fillRect, getCharWidthHeight } from './util';
4
6
  export function renderSoftClipping({ ctx, feat, renderArgs, config, theme, colorForBase, canvasWidth, }) {
5
7
  const { feature, topPx, heightPx } = feat;
@@ -14,19 +16,16 @@ export function renderSoftClipping({ ctx, feat, renderArgs, config, theme, color
14
16
  return;
15
17
  }
16
18
  const heightLim = charHeight - 2;
17
- for (const mismatch of mismatches) {
18
- if (mismatch.type === 'softclip') {
19
- const len = mismatch.cliplen || 0;
20
- const s = feature.get('start');
21
- const start = mismatch.start === 0 ? s - len : s + mismatch.start;
22
- for (let k = 0; k < len; k += 1) {
23
- const base = seq.charAt(k + mismatch.start);
24
- // If softclip length+start is longer than sequence, no need to
25
- // continue showing base
26
- if (!base) {
27
- return;
28
- }
29
- const s0 = start + k;
19
+ const CIGAR = parseCigar(feature.get('CIGAR'));
20
+ let seqOffset = 0;
21
+ let refOffset = 0;
22
+ for (let i = 0; i < CIGAR.length; i += 2) {
23
+ const op = CIGAR[i + 1];
24
+ const len = +CIGAR[i];
25
+ if (op === 'S') {
26
+ for (let k = 0; k < len; k++) {
27
+ const base = seq[seqOffset + k];
28
+ const s0 = feature.get('start') - (i === 0 ? len : 0) + refOffset + k;
30
29
  const [leftPx, rightPx] = bpSpanPx(s0, s0 + 1, region, bpPerPx);
31
30
  const widthPx = Math.max(minFeatWidth, rightPx - leftPx);
32
31
  // Black accounts for IUPAC ambiguity code bases such as N that
@@ -39,6 +38,23 @@ export function renderSoftClipping({ ctx, feat, renderArgs, config, theme, color
39
38
  ctx.fillText(base, leftPx + (widthPx - charWidth) / 2 + 1, topPx + heightPx);
40
39
  }
41
40
  }
41
+ seqOffset += len;
42
+ }
43
+ if (op === 'N') {
44
+ refOffset += len;
45
+ }
46
+ if (op === 'M' || op === '=' || op === 'X') {
47
+ refOffset += len;
48
+ seqOffset += len;
49
+ }
50
+ if (op === 'H') {
51
+ // do nothing
52
+ }
53
+ if (op === 'D') {
54
+ refOffset += len;
55
+ }
56
+ if (op === 'I') {
57
+ seqOffset += len;
42
58
  }
43
59
  }
44
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-alignments",
3
- "version": "2.11.1",
3
+ "version": "2.12.0",
4
4
  "description": "JBrowse 2 alignments adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -63,5 +63,5 @@
63
63
  "distModule": "esm/index.js",
64
64
  "srcModule": "src/index.ts",
65
65
  "module": "esm/index.js",
66
- "gitHead": "11b28d66d782eb06f92ccb993108bb6c3c82819e"
66
+ "gitHead": "935f2602d29abc737bb1f493a922b6218d023ae2"
67
67
  }