@jbrowse/plugin-alignments 1.6.5 → 1.6.8

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 (52) hide show
  1. package/dist/AlignmentsFeatureDetail/index.d.ts +1 -1
  2. package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +2 -10
  3. package/dist/BamAdapter/MismatchParser.d.ts +3 -5
  4. package/dist/BamAdapter/configSchema.d.ts +1 -1
  5. package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +1 -2
  6. package/dist/CramAdapter/configSchema.d.ts +1 -1
  7. package/dist/HtsgetBamAdapter/configSchema.d.ts +1 -1
  8. package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +1 -1
  9. package/dist/LinearAlignmentsDisplay/models/model.d.ts +1 -1
  10. package/dist/LinearPileupDisplay/configSchema.d.ts +1 -1
  11. package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
  12. package/dist/LinearSNPCoverageDisplay/models/configSchema.d.ts +1 -1
  13. package/dist/LinearSNPCoverageDisplay/models/model.d.ts +2 -2
  14. package/dist/PileupRenderer/PileupRenderer.d.ts +20 -6
  15. package/dist/PileupRenderer/configSchema.d.ts +1 -1
  16. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +3 -11
  17. package/dist/SNPCoverageAdapter/configSchema.d.ts +1 -1
  18. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +1 -1
  19. package/dist/SNPCoverageRenderer/configSchema.d.ts +1 -1
  20. package/dist/SNPCoverageRenderer/index.d.ts +1 -1
  21. package/dist/plugin-alignments.cjs.development.js +795 -682
  22. package/dist/plugin-alignments.cjs.development.js.map +1 -1
  23. package/dist/plugin-alignments.cjs.production.min.js +1 -1
  24. package/dist/plugin-alignments.cjs.production.min.js.map +1 -1
  25. package/dist/plugin-alignments.esm.js +797 -684
  26. package/dist/plugin-alignments.esm.js.map +1 -1
  27. package/dist/util.d.ts +4 -0
  28. package/package.json +4 -4
  29. package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +23 -14
  30. package/src/BamAdapter/BamAdapter.ts +10 -7
  31. package/src/BamAdapter/BamSlightlyLazyFeature.ts +11 -75
  32. package/src/BamAdapter/MismatchParser.test.ts +53 -297
  33. package/src/BamAdapter/MismatchParser.ts +54 -116
  34. package/src/BamAdapter/configSchema.ts +0 -4
  35. package/src/CramAdapter/CramSlightlyLazyFeature.ts +3 -10
  36. package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +38 -30
  37. package/src/LinearAlignmentsDisplay/models/model.tsx +10 -9
  38. package/src/LinearPileupDisplay/components/ColorByModifications.tsx +76 -80
  39. package/src/LinearPileupDisplay/components/ColorByTag.tsx +24 -23
  40. package/src/LinearPileupDisplay/components/FilterByTag.tsx +73 -68
  41. package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +28 -26
  42. package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +24 -13
  43. package/src/LinearPileupDisplay/components/SortByTag.tsx +29 -21
  44. package/src/LinearPileupDisplay/model.ts +12 -6
  45. package/src/LinearSNPCoverageDisplay/components/Tooltip.tsx +5 -3
  46. package/src/LinearSNPCoverageDisplay/models/configSchema.ts +4 -5
  47. package/src/PileupRenderer/PileupRenderer.tsx +202 -70
  48. package/src/PileupRenderer/components/PileupRendering.tsx +5 -3
  49. package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +192 -237
  50. package/src/SNPCoverageRenderer/SNPCoverageRenderer.ts +91 -60
  51. package/src/SNPCoverageRenderer/configSchema.js +1 -1
  52. package/src/util.ts +25 -0
@@ -1,5 +1,5 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
2
+ declare const configSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
3
3
  export declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
4
4
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
5
5
  type: import("mobx-state-tree").ISimpleType<"AlignmentsFeatureWidget">;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util/simpleFeature';
3
3
  import { BamRecord } from '@gmod/bam';
4
- import { Mismatch } from './MismatchParser';
5
4
  import BamAdapter from './BamAdapter';
6
5
  export default class BamSlightlyLazyFeature implements Feature {
7
6
  private record;
@@ -14,12 +13,11 @@ export default class BamSlightlyLazyFeature implements Feature {
14
13
  _get_flags(): string;
15
14
  _get_strand(): number;
16
15
  _get_pair_orientation(): string | null | undefined;
17
- _get_next_seq_id(): any;
16
+ _get_next_seq_id(): number;
18
17
  _get_seq_id(): number;
19
18
  _get_next_refName(): string | undefined;
20
19
  _get_next_segment_position(): string | undefined;
21
20
  _get_seq(): string;
22
- _get_MD(): string | undefined;
23
21
  qualRaw(): Buffer | undefined;
24
22
  set(): void;
25
23
  tags(): string[];
@@ -30,12 +28,6 @@ export default class BamSlightlyLazyFeature implements Feature {
30
28
  children(): undefined;
31
29
  pairedFeature(): boolean;
32
30
  toJSON(): SimpleFeatureSerialized;
33
- _get_skips_and_dels(opts?: {
34
- cigarAttributeName: string;
35
- }): Mismatch[];
36
- _get_mismatches({ cigarAttributeName, mdAttributeName, }?: {
37
- cigarAttributeName?: string;
38
- mdAttributeName?: string;
39
- }): Mismatch[];
31
+ _get_mismatches(): import("./MismatchParser").Mismatch[];
40
32
  _get_clipPos(): number;
41
33
  }
@@ -10,15 +10,13 @@ export interface Mismatch {
10
10
  cliplen?: number;
11
11
  }
12
12
  export declare function parseCigar(cigar: string): string[];
13
- export declare function cigarToMismatches(ops: string[], seq: string, qual?: Buffer): Mismatch[];
13
+ export declare function cigarToMismatches(ops: string[], seq: string, ref?: string, qual?: Buffer): Mismatch[];
14
14
  /**
15
15
  * parse a SAM MD tag to find mismatching bases of the template versus the reference
16
16
  * @returns array of mismatches and their positions
17
17
  */
18
- export declare function mdToMismatches(mdstring: string, cigarOps: string[], cigarMismatches: Mismatch[], seq: string, qual?: Buffer): Mismatch[];
19
- export declare function getTemplateCoord(refCoord: number, cigarOps: string[]): number;
20
- export declare function getMismatches(cigarString: string, mdString: string, seq: string, qual?: Buffer): Mismatch[];
21
- export declare function generateMD(target: string, query: string, cigar: string): string;
18
+ export declare function mdToMismatches(mdstring: string, ops: string[], cigarMismatches: Mismatch[], seq: string, qual?: Buffer): Mismatch[];
19
+ export declare function getMismatches(cigar: string, md: string, seq: string, ref?: string, qual?: Buffer): Mismatch[];
22
20
  export declare function getNextRefPos(cigarOps: string[], positions: number[]): Generator<number, void, unknown>;
23
21
  export declare function getModificationPositions(mm: string, fseq: string, fstrand: number): ({
24
22
  type: string;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
1
+ declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
2
2
  export default _default;
@@ -13,7 +13,7 @@ export interface Mismatch {
13
13
  export default class CramSlightlyLazyFeature implements Feature {
14
14
  private record;
15
15
  private _store;
16
- constructor(record: any, store: CramAdapter);
16
+ constructor(record: any, _store: CramAdapter);
17
17
  _get_name(): any;
18
18
  _get_start(): number;
19
19
  _get_end(): number;
@@ -46,5 +46,4 @@ export default class CramSlightlyLazyFeature implements Feature {
46
46
  _get_clipPos(): any;
47
47
  toJSON(): SimpleFeatureSerialized;
48
48
  _get_mismatches(): Mismatch[];
49
- _get_skips_and_dels(): Mismatch[];
50
49
  }
@@ -1,3 +1,3 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const _default: (pluginManager: PluginManager) => import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
2
+ declare const _default: (pluginManager: PluginManager) => import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
3
3
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
1
+ declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const configModelFactory: (pluginManager: PluginManager) => import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
2
+ declare const configModelFactory: (pluginManager: PluginManager) => import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
3
3
  export declare type AlignmentsConfigModel = ReturnType<typeof configModelFactory>;
4
4
  export default configModelFactory;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
2
+ import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
3
  import PluginManager from '@jbrowse/core/PluginManager';
4
4
  import { MenuItem } from '@jbrowse/core/ui';
5
5
  import { Instance } from 'mobx-state-tree';
@@ -1,6 +1,6 @@
1
1
  import { Instance } from 'mobx-state-tree';
2
2
  import PluginManager from '@jbrowse/core/PluginManager';
3
- declare function PileupConfigFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
3
+ declare function PileupConfigFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
4
4
  export declare type LinearPileupDisplayConfigModel = ReturnType<typeof PileupConfigFactory>;
5
5
  export declare type LinearPileupDisplayConfig = Instance<LinearPileupDisplayConfigModel>;
6
6
  export default PileupConfigFactory;
@@ -5,6 +5,6 @@ declare const SNPCoverageTooltip: (props: {
5
5
  height: number;
6
6
  offsetMouseCoord: Coord;
7
7
  clientMouseCoord: Coord;
8
- clientRect?: ClientRect;
8
+ clientRect?: DOMRect;
9
9
  }) => JSX.Element | null;
10
10
  export default SNPCoverageTooltip;
@@ -1,2 +1,2 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- export default function SNPCoverageConfigFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
2
+ export default function SNPCoverageConfigFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
@@ -26,7 +26,7 @@ declare const stateModelFactory: (pluginManager: PluginManager, configSchema: An
26
26
  renderInProgress: AbortController | undefined;
27
27
  filled: boolean;
28
28
  reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | undefined;
29
- features: Map<string, import("@jbrowse/core/util/simpleFeature").Feature> | undefined;
29
+ features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
30
30
  layout: any;
31
31
  status: string;
32
32
  error: unknown;
@@ -44,7 +44,7 @@ declare const stateModelFactory: (pluginManager: PluginManager, configSchema: An
44
44
  setMessage(messageText: string): void;
45
45
  setRendered(props: {
46
46
  reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
47
- features: Map<string, import("@jbrowse/core/util/simpleFeature").Feature>;
47
+ features: Map<string, import("@jbrowse/core/util").Feature>;
48
48
  layout: any;
49
49
  maxHeightReached: boolean;
50
50
  renderProps: any;
@@ -1,10 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
3
2
  import BoxRendererType, { RenderArgs, RenderArgsSerialized, RenderArgsDeserialized as BoxRenderArgsDeserialized, RenderResults, ResultsSerialized, ResultsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
4
3
  import { Theme } from '@material-ui/core';
5
- import { Feature } from '@jbrowse/core/util/simpleFeature';
6
- import { Region } from '@jbrowse/core/util/types';
4
+ import { Region, Feature } from '@jbrowse/core/util';
7
5
  import { BaseLayout } from '@jbrowse/core/util/layouts/BaseLayout';
6
+ import { AnyConfigurationModel } from '@jbrowse/core/configuration';
8
7
  import { PileupLayoutSession, PileupLayoutSessionProps } from './PileupLayoutSession';
9
8
  export interface RenderArgsDeserialized extends BoxRenderArgsDeserialized {
10
9
  colorBy?: {
@@ -66,16 +65,30 @@ export default class PileupRenderer extends BoxRendererType {
66
65
  getOrientation(feature: Feature, config: AnyConfigurationModel): string;
67
66
  colorByInsertSize(feature: Feature, _config: AnyConfigurationModel): string;
68
67
  colorByStranded(feature: Feature, _config: AnyConfigurationModel): "color_rev_strand" | "color_fwd_strand" | "color_rev_missing_mate" | "color_fwd_missing_mate" | "color_rev_strand_not_proper" | "color_fwd_strand_not_proper" | "color_fwd_diff_chr" | "color_rev_diff_chr";
68
+ colorByPerBaseLettering(ctx: CanvasRenderingContext2D, feat: LayoutFeature, _config: AnyConfigurationModel, region: Region, bpPerPx: number, props: {
69
+ colorForBase: Record<string, string>;
70
+ contrastForBase: Record<string, string>;
71
+ charWidth: number;
72
+ charHeight: number;
73
+ }): void;
69
74
  colorByPerBaseQuality(ctx: CanvasRenderingContext2D, feat: LayoutFeature, _config: AnyConfigurationModel, region: Region, bpPerPx: number): void;
70
75
  colorByModifications(ctx: CanvasRenderingContext2D, layoutFeature: LayoutFeature, _config: AnyConfigurationModel, region: Region, bpPerPx: number, props: RenderArgsDeserializedWithFeaturesAndLayout): void;
71
76
  colorByMethylation(ctx: CanvasRenderingContext2D, layoutFeature: LayoutFeature, _config: AnyConfigurationModel, region: Region, bpPerPx: number, props: RenderArgsDeserializedWithFeaturesAndLayout): void;
72
77
  drawRect(ctx: CanvasRenderingContext2D, feat: LayoutFeature, props: RenderArgsDeserialized): void;
73
78
  drawAlignmentRect(ctx: CanvasRenderingContext2D, feat: LayoutFeature, props: RenderArgsDeserializedWithFeaturesAndLayout & {
79
+ colorForBase: Record<string, string>;
80
+ contrastForBase: Record<string, string>;
81
+ charWidth: number;
82
+ charHeight: number;
74
83
  defaultColor: boolean;
75
84
  }): void;
76
- drawMismatches(ctx: CanvasRenderingContext2D, feat: LayoutFeature, props: RenderArgsDeserializedWithFeaturesAndLayout, theme: Theme, colorForBase: {
77
- [key: string]: string;
78
- }, opts: {
85
+ drawMismatches(ctx: CanvasRenderingContext2D, feat: LayoutFeature, props: RenderArgsDeserializedWithFeaturesAndLayout, opts: {
86
+ colorForBase: {
87
+ [key: string]: string;
88
+ };
89
+ contrastForBase: {
90
+ [key: string]: string;
91
+ };
79
92
  mismatchAlpha?: boolean;
80
93
  drawSNPs?: boolean;
81
94
  drawIndels?: boolean;
@@ -87,6 +100,7 @@ export default class PileupRenderer extends BoxRendererType {
87
100
  drawSoftClipping(ctx: CanvasRenderingContext2D, feat: LayoutFeature, props: RenderArgsDeserializedWithFeaturesAndLayout, config: AnyConfigurationModel, theme: Theme): void;
88
101
  makeImageData(ctx: CanvasRenderingContext2D, layoutRecords: (LayoutFeature | null)[], props: RenderArgsDeserializedWithFeaturesAndLayout): Promise<void>;
89
102
  layoutFeats(props: RenderArgsDeserializedWithFeaturesAndLayout): (LayoutRecord | null)[];
103
+ fetchSequence(renderProps: RenderArgsDeserialized): Promise<any>;
90
104
  render(renderProps: RenderArgsDeserialized): Promise<{
91
105
  features: Map<string, Feature>;
92
106
  layout: import("@jbrowse/core/util/layouts").GranularRectLayout<unknown>;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
1
+ declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
2
2
  export default _default;
@@ -2,7 +2,6 @@ import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters
2
2
  import { AugmentedRegion as Region } from '@jbrowse/core/util/types';
3
3
  import { Feature } from '@jbrowse/core/util/simpleFeature';
4
4
  import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
5
- import { Observable } from 'rxjs';
6
5
  interface SNPCoverageOptions extends BaseOptions {
7
6
  filters?: SerializableFilterChain;
8
7
  }
@@ -11,19 +10,12 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
11
10
  subadapter: BaseFeatureDataAdapter;
12
11
  sequenceAdapter: BaseFeatureDataAdapter | undefined;
13
12
  }>;
14
- getFeatures(region: Region, opts?: SNPCoverageOptions): Observable<Feature>;
13
+ fetchSequence(region: Region): Promise<any>;
14
+ getFeatures(region: Region, opts?: SNPCoverageOptions): import("rxjs").Observable<Feature>;
15
15
  estimateRegionsStats(regions: Region[], opts?: BaseOptions): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats>;
16
16
  getRefNames(opts?: BaseOptions): Promise<string[]>;
17
17
  freeResources(): void;
18
- /**
19
- * Generates coverage bins from features which details
20
- * the reference, mismatches, strands, and coverage info
21
- * @param features - Features of region to be passed in
22
- * @param region - Region
23
- * @param bpPerPx - base pairs per pixel
24
- * @returns Array of nested frequency tables
25
- */
26
- generateCoverageBins(features: Observable<Feature>, region: Region, opts: {
18
+ generateCoverageBins(features: Feature[], region: Region, opts: {
27
19
  bpPerPx?: number;
28
20
  colorBy?: {
29
21
  type: string;
@@ -1,3 +1,3 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const _default: (pluginManager: PluginManager) => import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
2
+ declare const _default: (pluginManager: PluginManager) => import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
3
3
  export default _default;
@@ -13,7 +13,7 @@ export interface RenderArgsDeserializedWithFeatures extends RenderArgsDeserializ
13
13
  values: number[];
14
14
  };
15
15
  displayCrossHatches: boolean;
16
- modificationTagMap: Record<string, string>;
16
+ modificationTagMap?: Record<string, string>;
17
17
  }
18
18
  export default class SNPCoverageRenderer extends WiggleBaseRenderer {
19
19
  draw(ctx: CanvasRenderingContext2D, props: RenderArgsDeserializedWithFeatures): void;
@@ -1,2 +1,2 @@
1
- declare var _default: import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
1
+ declare var _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- export declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").AnyConfigurationSchemaType;
2
+ export declare const configSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
3
3
  export default function register(pluginManager: PluginManager): void;