@jbrowse/plugin-alignments 3.5.0 → 3.5.1

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.
@@ -1,5 +1,4 @@
1
1
  import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
2
- import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
3
2
  import type { ColorBy, FilterBy } from '../shared/types';
4
3
  import type { AnyConfigurationModel, AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
5
4
  import type { Feature } from '@jbrowse/core/util';
@@ -192,6 +191,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
192
191
  readonly renderDelay: number;
193
192
  readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
194
193
  readonly selectedFeatureId: string | undefined;
194
+ copyInfoToClipboard(feature: Feature): void;
195
195
  } & {
196
196
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
197
197
  readonly featureUnderMouse: Feature | undefined;
@@ -234,12 +234,12 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
234
234
  updateColorTagMap(uniqueTag: string[]): void;
235
235
  setFeatureUnderMouse(feat?: Feature): void;
236
236
  selectFeature(feature: Feature): void;
237
- copyFeatureToClipboard(feature: Feature): void;
238
237
  setConfig(conf: AnyConfigurationModel): void;
239
238
  setFilterBy(filter: FilterBy): void;
240
239
  setJexlFilters(filters: string[]): void;
241
240
  setHideSmallIndels(arg: boolean): void;
242
241
  } & {
242
+ copyFeatureToClipboard(feature: Feature): void;
243
243
  readonly rendererConfig: {
244
244
  [x: string]: any;
245
245
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
@@ -259,17 +259,13 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
259
259
  readonly filters: SerializableFilterChain;
260
260
  } & {
261
261
  readonly rendererTypeName: string;
262
- contextMenuItems(): ({
262
+ contextMenuItems(): {
263
263
  label: string;
264
264
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
265
265
  muiName: string;
266
266
  };
267
267
  onClick: () => void;
268
- } | {
269
- label: string;
270
- icon: typeof ContentCopyIcon;
271
- onClick: () => void;
272
- })[];
268
+ }[];
273
269
  readonly DisplayBlurb: ({ model, }: {
274
270
  model: {
275
271
  sortedBy?: import("../shared/types").SortedBy;
@@ -40,11 +40,11 @@ exports.SharedLinearPileupDisplayMixin = SharedLinearPileupDisplayMixin;
40
40
  const react_1 = require("react");
41
41
  const configuration_1 = require("@jbrowse/core/configuration");
42
42
  const serializableFilterChain_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain"));
43
- const Icons_1 = require("@jbrowse/core/ui/Icons");
44
43
  const util_1 = require("@jbrowse/core/util");
45
44
  const tracks_1 = require("@jbrowse/core/util/tracks");
46
45
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
47
46
  const ClearAll_1 = __importDefault(require("@mui/icons-material/ClearAll"));
47
+ const ContentCopy_1 = __importDefault(require("@mui/icons-material/ContentCopy"));
48
48
  const MenuOpen_1 = __importDefault(require("@mui/icons-material/MenuOpen"));
49
49
  const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
50
50
  const mobx_1 = require("mobx");
@@ -154,12 +154,6 @@ function SharedLinearPileupDisplayMixin(configSchema) {
154
154
  }
155
155
  session.setSelection(feature);
156
156
  },
157
- copyFeatureToClipboard(feature) {
158
- const { uniqueId, ...rest } = feature.toJSON();
159
- const session = (0, util_1.getSession)(self);
160
- (0, copy_to_clipboard_1.default)(JSON.stringify(rest, null, 4));
161
- session.notify('Copied to clipboard', 'success');
162
- },
163
157
  setConfig(conf) {
164
158
  self.configuration = conf;
165
159
  },
@@ -176,6 +170,12 @@ function SharedLinearPileupDisplayMixin(configSchema) {
176
170
  },
177
171
  }))
178
172
  .views(self => ({
173
+ copyFeatureToClipboard(feature) {
174
+ const { uniqueId, ...rest } = feature.toJSON();
175
+ const session = (0, util_1.getSession)(self);
176
+ (0, copy_to_clipboard_1.default)(JSON.stringify(rest, null, 4));
177
+ session.notify('Copied to clipboard', 'success');
178
+ },
179
179
  get rendererConfig() {
180
180
  const { featureHeight: height, noSpacing, hideSmallIndels, trackMaxHeight: maxHeight, rendererTypeName, } = self;
181
181
  const configBlob = (0, configuration_1.getConf)(self, ['renderers', rendererTypeName]) || {};
@@ -230,7 +230,7 @@ function SharedLinearPileupDisplayMixin(configSchema) {
230
230
  },
231
231
  {
232
232
  label: 'Copy info to clipboard',
233
- icon: Icons_1.ContentCopy,
233
+ icon: ContentCopy_1.default,
234
234
  onClick: () => {
235
235
  self.copyFeatureToClipboard(feat);
236
236
  },
@@ -196,6 +196,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
196
196
  readonly renderDelay: number;
197
197
  readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
198
198
  readonly selectedFeatureId: string | undefined;
199
+ copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
199
200
  } & {
200
201
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
201
202
  readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
@@ -238,12 +239,12 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
238
239
  updateColorTagMap(uniqueTag: string[]): void;
239
240
  setFeatureUnderMouse(feat?: import("@jbrowse/core/util").Feature): void;
240
241
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
241
- copyFeatureToClipboard(feature: import("@jbrowse/core/util").Feature): void;
242
242
  setConfig(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
243
243
  setFilterBy(filter: import("../shared/types").FilterBy): void;
244
244
  setJexlFilters(filters: string[]): void;
245
245
  setHideSmallIndels(arg: boolean): void;
246
246
  } & {
247
+ copyFeatureToClipboard(feature: import("@jbrowse/core/util").Feature): void;
247
248
  readonly rendererConfig: {
248
249
  [x: string]: any;
249
250
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
@@ -263,17 +264,13 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
263
264
  readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
264
265
  } & {
265
266
  readonly rendererTypeName: string;
266
- contextMenuItems(): ({
267
+ contextMenuItems(): {
267
268
  label: string;
268
269
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
269
270
  muiName: string;
270
271
  };
271
272
  onClick: () => void;
272
- } | {
273
- label: string;
274
- icon: typeof import("@jbrowse/core/ui/Icons").ContentCopy;
275
- onClick: () => void;
276
- })[];
273
+ }[];
277
274
  readonly DisplayBlurb: ({ model, }: {
278
275
  model: {
279
276
  sortedBy?: SortedBy;
@@ -1,6 +1,6 @@
1
1
  import type { Mismatch } from '../shared/types';
2
2
  import type { Feature } from '@jbrowse/core/util';
3
- export declare function parseCigar(cigar?: string): string[];
3
+ export declare function parseCigar(s?: string): string[];
4
4
  export declare function getMismatches(cigar?: string, md?: string, seq?: string, ref?: string, qual?: Uint8Array): Mismatch[];
5
5
  export declare function getOrientedCigar(flip: boolean, cigar: string[]): string[];
6
6
  export declare function getOrientedMismatches(flip: boolean, cigar: string): Mismatch[];
@@ -13,11 +13,26 @@ exports.getTag = getTag;
13
13
  exports.featurizeSA = featurizeSA;
14
14
  const cigarToMismatches_1 = require("./cigarToMismatches");
15
15
  const mdToMismatches_1 = require("./mdToMismatches");
16
- const cigarRegex = new RegExp(/([MIDNSHPX=])/);
17
16
  const startClip = new RegExp(/(\d+)[SH]$/);
18
17
  const endClip = new RegExp(/^(\d+)([SH])/);
19
- function parseCigar(cigar = '') {
20
- return cigar.split(cigarRegex).slice(0, -1);
18
+ function parseCigar(s = '') {
19
+ let currLen = '';
20
+ let len;
21
+ let op;
22
+ const ret = [];
23
+ for (let i = 0, l = s.length; i < l; i++) {
24
+ const c = s[i];
25
+ if (c >= '0' && c <= '9') {
26
+ currLen = currLen + c;
27
+ }
28
+ else {
29
+ len = currLen;
30
+ op = c;
31
+ currLen = '';
32
+ ret.push(len, op);
33
+ }
34
+ }
35
+ return ret;
21
36
  }
22
37
  function getMismatches(cigar, md, seq, ref, qual) {
23
38
  let mismatches = [];
@@ -1,5 +1,4 @@
1
1
  import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
2
- import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
3
2
  import type { ColorBy, FilterBy } from '../shared/types';
4
3
  import type { AnyConfigurationModel, AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
5
4
  import type { Feature } from '@jbrowse/core/util';
@@ -192,6 +191,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
192
191
  readonly renderDelay: number;
193
192
  readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
194
193
  readonly selectedFeatureId: string | undefined;
194
+ copyInfoToClipboard(feature: Feature): void;
195
195
  } & {
196
196
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
197
197
  readonly featureUnderMouse: Feature | undefined;
@@ -234,12 +234,12 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
234
234
  updateColorTagMap(uniqueTag: string[]): void;
235
235
  setFeatureUnderMouse(feat?: Feature): void;
236
236
  selectFeature(feature: Feature): void;
237
- copyFeatureToClipboard(feature: Feature): void;
238
237
  setConfig(conf: AnyConfigurationModel): void;
239
238
  setFilterBy(filter: FilterBy): void;
240
239
  setJexlFilters(filters: string[]): void;
241
240
  setHideSmallIndels(arg: boolean): void;
242
241
  } & {
242
+ copyFeatureToClipboard(feature: Feature): void;
243
243
  readonly rendererConfig: {
244
244
  [x: string]: any;
245
245
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
@@ -259,17 +259,13 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
259
259
  readonly filters: SerializableFilterChain;
260
260
  } & {
261
261
  readonly rendererTypeName: string;
262
- contextMenuItems(): ({
262
+ contextMenuItems(): {
263
263
  label: string;
264
264
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
265
265
  muiName: string;
266
266
  };
267
267
  onClick: () => void;
268
- } | {
269
- label: string;
270
- icon: typeof ContentCopyIcon;
271
- onClick: () => void;
272
- })[];
268
+ }[];
273
269
  readonly DisplayBlurb: ({ model, }: {
274
270
  model: {
275
271
  sortedBy?: import("../shared/types").SortedBy;
@@ -1,11 +1,11 @@
1
1
  import { lazy } from 'react';
2
2
  import { ConfigurationReference, getConf, readConfObject, } from '@jbrowse/core/configuration';
3
3
  import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
4
- import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
5
4
  import { SimpleFeature, getContainingTrack, getContainingView, getEnv, getSession, isSessionModelWithWidgets, } from '@jbrowse/core/util';
6
5
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
7
6
  import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view';
8
7
  import FilterListIcon from '@mui/icons-material/ClearAll';
8
+ import ContentCopyIcon from '@mui/icons-material/ContentCopy';
9
9
  import MenuOpenIcon from '@mui/icons-material/MenuOpen';
10
10
  import copy from 'copy-to-clipboard';
11
11
  import { autorun, observable } from 'mobx';
@@ -115,12 +115,6 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
115
115
  }
116
116
  session.setSelection(feature);
117
117
  },
118
- copyFeatureToClipboard(feature) {
119
- const { uniqueId, ...rest } = feature.toJSON();
120
- const session = getSession(self);
121
- copy(JSON.stringify(rest, null, 4));
122
- session.notify('Copied to clipboard', 'success');
123
- },
124
118
  setConfig(conf) {
125
119
  self.configuration = conf;
126
120
  },
@@ -137,6 +131,12 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
137
131
  },
138
132
  }))
139
133
  .views(self => ({
134
+ copyFeatureToClipboard(feature) {
135
+ const { uniqueId, ...rest } = feature.toJSON();
136
+ const session = getSession(self);
137
+ copy(JSON.stringify(rest, null, 4));
138
+ session.notify('Copied to clipboard', 'success');
139
+ },
140
140
  get rendererConfig() {
141
141
  const { featureHeight: height, noSpacing, hideSmallIndels, trackMaxHeight: maxHeight, rendererTypeName, } = self;
142
142
  const configBlob = getConf(self, ['renderers', rendererTypeName]) || {};
@@ -196,6 +196,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
196
196
  readonly renderDelay: number;
197
197
  readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
198
198
  readonly selectedFeatureId: string | undefined;
199
+ copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
199
200
  } & {
200
201
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
201
202
  readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
@@ -238,12 +239,12 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
238
239
  updateColorTagMap(uniqueTag: string[]): void;
239
240
  setFeatureUnderMouse(feat?: import("@jbrowse/core/util").Feature): void;
240
241
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
241
- copyFeatureToClipboard(feature: import("@jbrowse/core/util").Feature): void;
242
242
  setConfig(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
243
243
  setFilterBy(filter: import("../shared/types").FilterBy): void;
244
244
  setJexlFilters(filters: string[]): void;
245
245
  setHideSmallIndels(arg: boolean): void;
246
246
  } & {
247
+ copyFeatureToClipboard(feature: import("@jbrowse/core/util").Feature): void;
247
248
  readonly rendererConfig: {
248
249
  [x: string]: any;
249
250
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
@@ -263,17 +264,13 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
263
264
  readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
264
265
  } & {
265
266
  readonly rendererTypeName: string;
266
- contextMenuItems(): ({
267
+ contextMenuItems(): {
267
268
  label: string;
268
269
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
269
270
  muiName: string;
270
271
  };
271
272
  onClick: () => void;
272
- } | {
273
- label: string;
274
- icon: typeof import("@jbrowse/core/ui/Icons").ContentCopy;
275
- onClick: () => void;
276
- })[];
273
+ }[];
277
274
  readonly DisplayBlurb: ({ model, }: {
278
275
  model: {
279
276
  sortedBy?: SortedBy;
@@ -1,6 +1,6 @@
1
1
  import type { Mismatch } from '../shared/types';
2
2
  import type { Feature } from '@jbrowse/core/util';
3
- export declare function parseCigar(cigar?: string): string[];
3
+ export declare function parseCigar(s?: string): string[];
4
4
  export declare function getMismatches(cigar?: string, md?: string, seq?: string, ref?: string, qual?: Uint8Array): Mismatch[];
5
5
  export declare function getOrientedCigar(flip: boolean, cigar: string[]): string[];
6
6
  export declare function getOrientedMismatches(flip: boolean, cigar: string): Mismatch[];
@@ -1,10 +1,25 @@
1
1
  import { cigarToMismatches } from './cigarToMismatches';
2
2
  import { mdToMismatches } from './mdToMismatches';
3
- const cigarRegex = new RegExp(/([MIDNSHPX=])/);
4
3
  const startClip = new RegExp(/(\d+)[SH]$/);
5
4
  const endClip = new RegExp(/^(\d+)([SH])/);
6
- export function parseCigar(cigar = '') {
7
- return cigar.split(cigarRegex).slice(0, -1);
5
+ export function parseCigar(s = '') {
6
+ let currLen = '';
7
+ let len;
8
+ let op;
9
+ const ret = [];
10
+ for (let i = 0, l = s.length; i < l; i++) {
11
+ const c = s[i];
12
+ if (c >= '0' && c <= '9') {
13
+ currLen = currLen + c;
14
+ }
15
+ else {
16
+ len = currLen;
17
+ op = c;
18
+ currLen = '';
19
+ ret.push(len, op);
20
+ }
21
+ }
22
+ return ret;
8
23
  }
9
24
  export function getMismatches(cigar, md, seq, ref, qual) {
10
25
  let mismatches = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-alignments",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "JBrowse 2 alignments adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -38,10 +38,10 @@
38
38
  "dependencies": {
39
39
  "@gmod/bam": "^6.0.1",
40
40
  "@gmod/cram": "^5.0.4",
41
- "@jbrowse/core": "^3.5.0",
42
- "@jbrowse/plugin-linear-genome-view": "^3.5.0",
43
- "@jbrowse/plugin-wiggle": "^3.5.0",
44
- "@jbrowse/sv-core": "^3.5.0",
41
+ "@jbrowse/core": "^3.5.1",
42
+ "@jbrowse/plugin-linear-genome-view": "^3.5.1",
43
+ "@jbrowse/plugin-wiggle": "^3.5.1",
44
+ "@jbrowse/sv-core": "^3.5.1",
45
45
  "@mui/icons-material": "^7.0.0",
46
46
  "@mui/material": "^7.0.0",
47
47
  "canvas2svg": "^1.0.16",
@@ -63,5 +63,5 @@
63
63
  "distModule": "esm/index.js",
64
64
  "srcModule": "src/index.ts",
65
65
  "module": "esm/index.js",
66
- "gitHead": "8a8aa0aab2229dece106a5715a767e649e2fe92b"
66
+ "gitHead": "cb8859da9d838ad2594964777c5c54f385d98f5e"
67
67
  }