jbrowse-plugin-mafviewer 1.3.1 → 1.3.2

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 (81) hide show
  1. package/README.md +1 -1
  2. package/dist/BigMafAdapter/BigMafAdapter.js +39 -28
  3. package/dist/BigMafAdapter/BigMafAdapter.js.map +1 -1
  4. package/dist/LinearMafDisplay/components/Crosshairs.js +1 -1
  5. package/dist/LinearMafDisplay/components/Crosshairs.js.map +1 -1
  6. package/dist/LinearMafDisplay/components/MAFTooltip.d.ts +2 -3
  7. package/dist/LinearMafDisplay/components/MAFTooltip.js +6 -19
  8. package/dist/LinearMafDisplay/components/MAFTooltip.js.map +1 -1
  9. package/dist/LinearMafDisplay/stateModel.d.ts +8 -0
  10. package/dist/LinearMafDisplay/stateModel.js +10 -0
  11. package/dist/LinearMafDisplay/stateModel.js.map +1 -1
  12. package/dist/LinearMafDisplay/util.d.ts +20 -0
  13. package/dist/LinearMafDisplay/util.js +29 -0
  14. package/dist/LinearMafDisplay/util.js.map +1 -1
  15. package/dist/LinearMafRenderer/LinearMafRenderer.d.ts +3 -0
  16. package/dist/LinearMafRenderer/LinearMafRenderer.js +1 -2
  17. package/dist/LinearMafRenderer/LinearMafRenderer.js.map +1 -1
  18. package/dist/LinearMafRenderer/components/ReactComponent.d.ts +3 -0
  19. package/dist/LinearMafRenderer/components/ReactComponent.js +41 -2
  20. package/dist/LinearMafRenderer/components/ReactComponent.js.map +1 -1
  21. package/dist/LinearMafRenderer/components/util.d.ts +1 -0
  22. package/dist/LinearMafRenderer/components/util.js +13 -0
  23. package/dist/LinearMafRenderer/components/util.js.map +1 -0
  24. package/dist/LinearMafRenderer/makeImageData.d.ts +4 -5
  25. package/dist/LinearMafRenderer/makeImageData.js +28 -146
  26. package/dist/LinearMafRenderer/makeImageData.js.map +1 -1
  27. package/dist/LinearMafRenderer/rendering/features.d.ts +21 -0
  28. package/dist/LinearMafRenderer/rendering/features.js +58 -0
  29. package/dist/LinearMafRenderer/rendering/features.js.map +1 -0
  30. package/dist/LinearMafRenderer/rendering/gaps.d.ts +12 -0
  31. package/dist/LinearMafRenderer/rendering/gaps.js +35 -0
  32. package/dist/LinearMafRenderer/rendering/gaps.js.map +1 -0
  33. package/dist/LinearMafRenderer/rendering/index.d.ts +8 -0
  34. package/dist/LinearMafRenderer/rendering/index.js +10 -0
  35. package/dist/LinearMafRenderer/rendering/index.js.map +1 -0
  36. package/dist/LinearMafRenderer/rendering/insertions.d.ts +14 -0
  37. package/dist/LinearMafRenderer/rendering/insertions.js +84 -0
  38. package/dist/LinearMafRenderer/rendering/insertions.js.map +1 -0
  39. package/dist/LinearMafRenderer/rendering/matches.d.ts +13 -0
  40. package/dist/LinearMafRenderer/rendering/matches.js +41 -0
  41. package/dist/LinearMafRenderer/rendering/matches.js.map +1 -0
  42. package/dist/LinearMafRenderer/rendering/mismatches.d.ts +13 -0
  43. package/dist/LinearMafRenderer/rendering/mismatches.js +47 -0
  44. package/dist/LinearMafRenderer/rendering/mismatches.js.map +1 -0
  45. package/dist/LinearMafRenderer/rendering/spatialIndex.d.ts +60 -0
  46. package/dist/LinearMafRenderer/rendering/spatialIndex.js +99 -0
  47. package/dist/LinearMafRenderer/rendering/spatialIndex.js.map +1 -0
  48. package/dist/LinearMafRenderer/rendering/text.d.ts +12 -0
  49. package/dist/LinearMafRenderer/rendering/text.js +42 -0
  50. package/dist/LinearMafRenderer/rendering/text.js.map +1 -0
  51. package/dist/LinearMafRenderer/rendering/types.d.ts +67 -0
  52. package/dist/LinearMafRenderer/rendering/types.js +15 -0
  53. package/dist/LinearMafRenderer/rendering/types.js.map +1 -0
  54. package/dist/MafTabixAdapter/MafTabixAdapter.js +48 -22
  55. package/dist/MafTabixAdapter/MafTabixAdapter.js.map +1 -1
  56. package/dist/jbrowse-plugin-mafviewer.umd.production.min.js +7 -8
  57. package/dist/jbrowse-plugin-mafviewer.umd.production.min.js.map +4 -4
  58. package/dist/out.js +34520 -0
  59. package/dist/out.js.map +7 -0
  60. package/dist/util/fastaUtils.js.map +1 -1
  61. package/package.json +5 -3
  62. package/src/BigMafAdapter/BigMafAdapter.ts +49 -28
  63. package/src/LinearMafDisplay/components/Crosshairs.tsx +1 -7
  64. package/src/LinearMafDisplay/components/MAFTooltip.tsx +14 -33
  65. package/src/LinearMafDisplay/stateModel.ts +10 -0
  66. package/src/LinearMafDisplay/util.ts +57 -0
  67. package/src/LinearMafRenderer/LinearMafRenderer.ts +1 -2
  68. package/src/LinearMafRenderer/components/ReactComponent.tsx +70 -2
  69. package/src/LinearMafRenderer/components/util.ts +13 -0
  70. package/src/LinearMafRenderer/makeImageData.ts +49 -196
  71. package/src/LinearMafRenderer/rendering/features.ts +138 -0
  72. package/src/LinearMafRenderer/rendering/gaps.ts +71 -0
  73. package/src/LinearMafRenderer/rendering/index.ts +9 -0
  74. package/src/LinearMafRenderer/rendering/insertions.ts +170 -0
  75. package/src/LinearMafRenderer/rendering/matches.ts +79 -0
  76. package/src/LinearMafRenderer/rendering/mismatches.ts +125 -0
  77. package/src/LinearMafRenderer/rendering/spatialIndex.ts +136 -0
  78. package/src/LinearMafRenderer/rendering/text.ts +72 -0
  79. package/src/LinearMafRenderer/rendering/types.ts +81 -0
  80. package/src/MafTabixAdapter/MafTabixAdapter.ts +77 -22
  81. package/src/util/fastaUtils.ts +2 -1
@@ -0,0 +1,60 @@
1
+ import type { RenderedBase, RenderingContext } from './types';
2
+ /**
3
+ * Creates a RenderedBase object for spatial indexing
4
+ * @param xPos - X coordinate of the base
5
+ * @param rowTop - Y coordinate of the row top
6
+ * @param context - Rendering context with dimensions
7
+ * @param pos - Genomic coordinate
8
+ * @param chr - Chromosome/sequence name
9
+ * @param sampleId - Sample identifier
10
+ * @param base - The base character
11
+ * @param isMatch - Whether this base matches the reference
12
+ * @param isMismatch - Whether this base is a mismatch
13
+ * @param isGap - Whether this is a gap
14
+ * @param isInsertion - Whether this is an insertion
15
+ * @param featureId - Feature identifier
16
+ */
17
+ export declare function createRenderedBase(xPos: number, rowTop: number, context: RenderingContext, pos: number, chr: string, sampleId: string, base: string, isMatch: boolean, isMismatch: boolean, isGap: boolean, isInsertion: boolean, featureId: string): RenderedBase;
18
+ /**
19
+ * Creates a RenderedBase object for insertions with custom width
20
+ * Uses the actual rendered width instead of the standard scale-based width
21
+ * This ensures accurate spatial queries for different insertion rendering types:
22
+ * - Small insertions: INSERTION_LINE_WIDTH (1px) or INSERTION_BORDER_HEIGHT (5px) with borders
23
+ * - Large insertions (text): measured text width + padding
24
+ * - Large insertions (line): INSERTION_BORDER_WIDTH (2px)
25
+ *
26
+ * @param xPos - X coordinate of the insertion
27
+ * @param rowTop - Y coordinate of the row top
28
+ * @param width - Actual rendered width of the insertion
29
+ * @param context - Rendering context with dimensions
30
+ * @param pos - Genomic coordinate
31
+ * @param chr - Chromosome/sequence name
32
+ * @param sampleId - Sample identifier
33
+ * @param insertionSequence - The insertion sequence
34
+ * @param featureId - Feature identifier
35
+ */
36
+ export declare function createRenderedInsertion(xPos: number, rowTop: number, width: number, context: RenderingContext, pos: number, chr: string, sampleId: string, insertionSequence: string, featureId: string): RenderedBase;
37
+ /**
38
+ * Checks if an item should be added to the spatial index based on distance filtering
39
+ * Only returns true if the X position is >0.5px away from the last inserted item
40
+ * This reduces spatial index density while maintaining useful spatial queries
41
+ *
42
+ * @param xPos - X position to check
43
+ * @param context - Rendering context with lastInsertedX tracking
44
+ * @param bypassDistanceFilter - If true, always return true (e.g., for insertions)
45
+ * @returns Whether the item should be added to spatial index
46
+ *
47
+ * @example
48
+ * // Items at X positions: 100.0, 100.3, 100.8, 101.5
49
+ * // Only items at 100.0, 100.8, 101.5 would return true (>0.5px apart)
50
+ * // Unless bypassDistanceFilter=true, then all would return true
51
+ */
52
+ export declare function shouldAddToSpatialIndex(xPos: number, context: RenderingContext, bypassDistanceFilter?: boolean): boolean;
53
+ /**
54
+ * Adds a rendered base directly to the RBush spatial index
55
+ * Updates the lastInsertedX tracking for distance filtering
56
+ *
57
+ * @param context - Rendering context with spatial index
58
+ * @param renderedBase - The base to add to the spatial index
59
+ */
60
+ export declare function addToSpatialIndex(context: RenderingContext, renderedBase: RenderedBase): void;
@@ -0,0 +1,99 @@
1
+ import { GAP_STROKE_OFFSET, MIN_X_DISTANCE } from './types';
2
+ /**
3
+ * Creates a RenderedBase object for spatial indexing
4
+ * @param xPos - X coordinate of the base
5
+ * @param rowTop - Y coordinate of the row top
6
+ * @param context - Rendering context with dimensions
7
+ * @param pos - Genomic coordinate
8
+ * @param chr - Chromosome/sequence name
9
+ * @param sampleId - Sample identifier
10
+ * @param base - The base character
11
+ * @param isMatch - Whether this base matches the reference
12
+ * @param isMismatch - Whether this base is a mismatch
13
+ * @param isGap - Whether this is a gap
14
+ * @param isInsertion - Whether this is an insertion
15
+ * @param featureId - Feature identifier
16
+ */
17
+ export function createRenderedBase(xPos, rowTop, context, pos, chr, sampleId, base, isMatch, isMismatch, isGap, isInsertion, featureId) {
18
+ return {
19
+ minX: xPos,
20
+ minY: rowTop,
21
+ maxX: xPos + context.scale + GAP_STROKE_OFFSET,
22
+ maxY: rowTop + context.h,
23
+ pos,
24
+ chr,
25
+ sampleId,
26
+ base,
27
+ isMatch,
28
+ isMismatch,
29
+ isGap,
30
+ isInsertion,
31
+ featureId,
32
+ };
33
+ }
34
+ /**
35
+ * Creates a RenderedBase object for insertions with custom width
36
+ * Uses the actual rendered width instead of the standard scale-based width
37
+ * This ensures accurate spatial queries for different insertion rendering types:
38
+ * - Small insertions: INSERTION_LINE_WIDTH (1px) or INSERTION_BORDER_HEIGHT (5px) with borders
39
+ * - Large insertions (text): measured text width + padding
40
+ * - Large insertions (line): INSERTION_BORDER_WIDTH (2px)
41
+ *
42
+ * @param xPos - X coordinate of the insertion
43
+ * @param rowTop - Y coordinate of the row top
44
+ * @param width - Actual rendered width of the insertion
45
+ * @param context - Rendering context with dimensions
46
+ * @param pos - Genomic coordinate
47
+ * @param chr - Chromosome/sequence name
48
+ * @param sampleId - Sample identifier
49
+ * @param insertionSequence - The insertion sequence
50
+ * @param featureId - Feature identifier
51
+ */
52
+ export function createRenderedInsertion(xPos, rowTop, width, context, pos, chr, sampleId, insertionSequence, featureId) {
53
+ return {
54
+ minX: xPos,
55
+ minY: rowTop,
56
+ maxX: xPos + width,
57
+ maxY: rowTop + context.h,
58
+ pos,
59
+ chr,
60
+ sampleId,
61
+ base: insertionSequence,
62
+ isMatch: false,
63
+ isMismatch: false,
64
+ isGap: false,
65
+ isInsertion: true,
66
+ featureId,
67
+ };
68
+ }
69
+ /**
70
+ * Checks if an item should be added to the spatial index based on distance filtering
71
+ * Only returns true if the X position is >0.5px away from the last inserted item
72
+ * This reduces spatial index density while maintaining useful spatial queries
73
+ *
74
+ * @param xPos - X position to check
75
+ * @param context - Rendering context with lastInsertedX tracking
76
+ * @param bypassDistanceFilter - If true, always return true (e.g., for insertions)
77
+ * @returns Whether the item should be added to spatial index
78
+ *
79
+ * @example
80
+ * // Items at X positions: 100.0, 100.3, 100.8, 101.5
81
+ * // Only items at 100.0, 100.8, 101.5 would return true (>0.5px apart)
82
+ * // Unless bypassDistanceFilter=true, then all would return true
83
+ */
84
+ export function shouldAddToSpatialIndex(xPos, context, bypassDistanceFilter = false) {
85
+ return (bypassDistanceFilter ||
86
+ Math.abs(xPos - context.lastInsertedX) > MIN_X_DISTANCE);
87
+ }
88
+ /**
89
+ * Adds a rendered base directly to the RBush spatial index
90
+ * Updates the lastInsertedX tracking for distance filtering
91
+ *
92
+ * @param context - Rendering context with spatial index
93
+ * @param renderedBase - The base to add to the spatial index
94
+ */
95
+ export function addToSpatialIndex(context, renderedBase) {
96
+ context.spatialIndex.insert(renderedBase);
97
+ context.lastInsertedX = renderedBase.minX;
98
+ }
99
+ //# sourceMappingURL=spatialIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialIndex.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/spatialIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EA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AAC,GAAG,cAAc,CACxD,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAyB,EACzB,YAA0B;IAE1B,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IACzC,OAAO,CAAC,aAAa,GAAG,YAAY,CAAC,IAAI,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { RenderingContext } from './types';
2
+ /**
3
+ * Renders text labels for bases when zoom level is sufficient
4
+ * Only shows text for mismatches (or all letters when showAllLetters is true)
5
+ * @param context - Rendering context with canvas and styling info
6
+ * @param alignment - The aligned sequence for this sample (lowercase)
7
+ * @param origAlignment - Original alignment preserving case
8
+ * @param seq - The reference sequence
9
+ * @param leftPx - Left pixel position of the feature
10
+ * @param rowTop - Top pixel position of the row
11
+ */
12
+ export declare function renderText(context: RenderingContext, alignment: string, origAlignment: string, seq: string, leftPx: number, rowTop: number, _sampleId: string, _featureId: string): void;
@@ -0,0 +1,42 @@
1
+ import { getCharWidthHeight } from '../util';
2
+ import { CHAR_SIZE_WIDTH, VERTICAL_TEXT_OFFSET } from './types';
3
+ function getLetter(a, showAsUpperCase) {
4
+ return showAsUpperCase ? a.toUpperCase() : a;
5
+ }
6
+ /**
7
+ * Renders text labels for bases when zoom level is sufficient
8
+ * Only shows text for mismatches (or all letters when showAllLetters is true)
9
+ * @param context - Rendering context with canvas and styling info
10
+ * @param alignment - The aligned sequence for this sample (lowercase)
11
+ * @param origAlignment - Original alignment preserving case
12
+ * @param seq - The reference sequence
13
+ * @param leftPx - Left pixel position of the feature
14
+ * @param rowTop - Top pixel position of the row
15
+ */
16
+ export function renderText(context, alignment, origAlignment, seq, leftPx, rowTop, _sampleId, _featureId) {
17
+ const { ctx, scale, hp2, rowHeight, showAllLetters, mismatchRendering, contrastForBase, showAsUpperCase, } = context;
18
+ const { charHeight } = getCharWidthHeight();
19
+ // Render text labels when zoomed in enough and row is tall enough
20
+ if (scale >= CHAR_SIZE_WIDTH) {
21
+ for (let i = 0, genomicOffset = 0, seqLength = alignment.length; i < seqLength; i++) {
22
+ if (seq[i] !== '-') {
23
+ // Only process non-gap positions in reference
24
+ const xPos = leftPx + scale * genomicOffset;
25
+ const textOffset = (scale - CHAR_SIZE_WIDTH) / 2 + 1; // Center text in available space
26
+ const currentChar = alignment[i];
27
+ // Show text for mismatches or all letters (depending on setting)
28
+ if ((showAllLetters || seq[i] !== currentChar) && currentChar !== '-') {
29
+ ctx.fillStyle = mismatchRendering
30
+ ? (contrastForBase[currentChar] ?? 'white') // Use contrasting color for readability
31
+ : 'black';
32
+ if (rowHeight > charHeight) {
33
+ // Only render if row is tall enough
34
+ ctx.fillText(getLetter(origAlignment[i] || '', showAsUpperCase), xPos + textOffset, hp2 + rowTop + VERTICAL_TEXT_OFFSET);
35
+ }
36
+ }
37
+ genomicOffset++;
38
+ }
39
+ }
40
+ }
41
+ }
42
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAI/D,SAAS,SAAS,CAAC,CAAS,EAAE,eAAwB;IACpD,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,OAAyB,EACzB,SAAiB,EACjB,aAAqB,EACrB,GAAW,EACX,MAAc,EACd,MAAc,EACd,SAAiB,EACjB,UAAkB;IAElB,MAAM,EACJ,GAAG,EACH,KAAK,EACL,GAAG,EACH,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,GAAG,OAAO,CAAA;I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,monospace";
3
+ export declare const CHAR_SIZE_WIDTH = 10;
4
+ export declare const GAP_STROKE_OFFSET = 0.4;
5
+ export declare const INSERTION_LINE_WIDTH = 1;
6
+ export declare const INSERTION_BORDER_WIDTH = 2;
7
+ export declare const INSERTION_PADDING = 2;
8
+ export declare const VERTICAL_TEXT_OFFSET = 3;
9
+ export declare const LARGE_INSERTION_THRESHOLD = 10;
10
+ export declare const HIGH_ZOOM_THRESHOLD = 0.2;
11
+ export declare const MIN_ROW_HEIGHT_FOR_BORDERS = 5;
12
+ export declare const HIGH_BP_PER_PX_THRESHOLD = 10;
13
+ export declare const INSERTION_BORDER_HEIGHT = 5;
14
+ export declare const MIN_X_DISTANCE = 0.5;
15
+ export interface Sample {
16
+ id: string;
17
+ color?: string;
18
+ }
19
+ export interface GenomicRegion {
20
+ start: number;
21
+ end: number;
22
+ refName: string;
23
+ }
24
+ /**
25
+ * Represents a rendered letter/base with its spatial and genomic coordinates
26
+ * This structure is designed for insertion into an RBush spatial index
27
+ */
28
+ export interface RenderedBase {
29
+ minX: number;
30
+ minY: number;
31
+ maxX: number;
32
+ maxY: number;
33
+ pos: number;
34
+ chr: string;
35
+ sampleId: string;
36
+ base: string;
37
+ isMatch: boolean;
38
+ isMismatch: boolean;
39
+ isGap: boolean;
40
+ isInsertion: boolean;
41
+ featureId: string;
42
+ }
43
+ /**
44
+ * Shared rendering context containing all necessary parameters for rendering operations
45
+ */
46
+ export interface RenderingContext {
47
+ ctx: CanvasRenderingContext2D;
48
+ scale: number;
49
+ canvasWidth: number;
50
+ rowHeight: number;
51
+ h: number;
52
+ hp2: number;
53
+ offset: number;
54
+ colorForBase: Record<string, string>;
55
+ contrastForBase: Record<string, string>;
56
+ showAllLetters: boolean;
57
+ mismatchRendering: boolean;
58
+ showAsUpperCase: boolean;
59
+ spatialIndex: RBush<RenderedBase>;
60
+ lastInsertedX: number;
61
+ }
62
+ export interface AlignmentRecord {
63
+ seq: string;
64
+ start: number;
65
+ strand: number;
66
+ chr: string;
67
+ }
@@ -0,0 +1,15 @@
1
+ // Rendering constants
2
+ export const FONT_CONFIG = 'bold 10px Courier New,monospace';
3
+ export const CHAR_SIZE_WIDTH = 10;
4
+ export const GAP_STROKE_OFFSET = 0.4;
5
+ export const INSERTION_LINE_WIDTH = 1;
6
+ export const INSERTION_BORDER_WIDTH = 2;
7
+ export const INSERTION_PADDING = 2;
8
+ export const VERTICAL_TEXT_OFFSET = 3;
9
+ export const LARGE_INSERTION_THRESHOLD = 10;
10
+ export const HIGH_ZOOM_THRESHOLD = 0.2;
11
+ export const MIN_ROW_HEIGHT_FOR_BORDERS = 5;
12
+ export const HIGH_BP_PER_PX_THRESHOLD = 10;
13
+ export const INSERTION_BORDER_HEIGHT = 5;
14
+ export const MIN_X_DISTANCE = 0.5;
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/types.ts"],"names":[],"mappings":"AAEA,sBAAsB;AACtB,MAAM,CAAC,MAAM,WAAW,GAAG,iCAAiC,CAAA;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;AACjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AACrC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAA;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AACrC,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAA;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAC3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAA;AAC1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA"}
@@ -51,35 +51,61 @@ export default class MafTabixAdapter extends BaseFeatureDataAdapter {
51
51
  for (const feature of features) {
52
52
  const data = feature.get('field5').split(',');
53
53
  const alignments = {};
54
- const len = data.length;
55
- for (let j = 0; j < len; j++) {
54
+ const dataLength = data.length;
55
+ for (let j = 0; j < dataLength; j++) {
56
56
  const elt = data[j];
57
- const seq = elt.split(':')[5];
58
- const ad = elt.split(':');
59
- const ag = ad[0].split('.');
60
- const [n1, n2 = '', ...rest] = ag;
61
- let assemblyName;
62
- let last = '';
63
- if (ag.length === 2) {
64
- assemblyName = n1;
65
- last = n2;
57
+ // Cache split result to avoid redundant operations
58
+ const parts = elt.split(':');
59
+ // Use destructuring for better performance than multiple array access
60
+ const [assemblyAndChr, startStr, srcSizeStr, strandStr, unknownStr, seq,] = parts;
61
+ // Skip if we don't have all required parts
62
+ if (!assemblyAndChr || !seq) {
63
+ continue;
66
64
  }
67
- else if (!Number.isNaN(+n2)) {
68
- assemblyName = `${n1}.${n2}`;
69
- last = rest.join('.');
65
+ // Optimized assembly name parsing with simplified logic
66
+ let assemblyName;
67
+ let chr;
68
+ const firstDotIndex = assemblyAndChr.indexOf('.');
69
+ if (firstDotIndex === -1) {
70
+ // No dot found, entire string is assembly name
71
+ assemblyName = assemblyAndChr;
72
+ chr = '';
70
73
  }
71
74
  else {
72
- assemblyName = n1;
73
- last = [n2, ...rest].join('.');
75
+ const secondDotIndex = assemblyAndChr.indexOf('.', firstDotIndex + 1);
76
+ if (secondDotIndex === -1) {
77
+ // Only one dot: assembly.chr
78
+ assemblyName = assemblyAndChr.slice(0, Math.max(0, firstDotIndex));
79
+ chr = assemblyAndChr.slice(Math.max(0, firstDotIndex + 1));
80
+ }
81
+ else {
82
+ // Multiple dots: check if second part is numeric (version number)
83
+ const secondPart = assemblyAndChr.slice(firstDotIndex + 1, secondDotIndex);
84
+ const isNumeric = secondPart.length > 0 && !Number.isNaN(+secondPart);
85
+ if (isNumeric) {
86
+ // assembly.version.chr format
87
+ assemblyName = assemblyAndChr.slice(0, Math.max(0, secondDotIndex));
88
+ chr = assemblyAndChr.slice(Math.max(0, secondDotIndex + 1));
89
+ }
90
+ else {
91
+ // assembly.chr.more format
92
+ assemblyName = assemblyAndChr.slice(0, Math.max(0, firstDotIndex));
93
+ chr = assemblyAndChr.slice(Math.max(0, firstDotIndex + 1));
94
+ }
95
+ }
74
96
  }
75
97
  if (assemblyName) {
76
- firstAssemblyNameFound = firstAssemblyNameFound || assemblyName;
98
+ // Set first assembly name found (only once)
99
+ if (!firstAssemblyNameFound) {
100
+ firstAssemblyNameFound = assemblyName;
101
+ }
102
+ // Create alignment record with optimized number conversion
77
103
  alignments[assemblyName] = {
78
- chr: last,
79
- start: +ad[1],
80
- srcSize: +ad[2],
81
- strand: ad[3] === '-' ? -1 : 1,
82
- unknown: +ad[4],
104
+ chr,
105
+ start: +startStr,
106
+ srcSize: +srcSizeStr,
107
+ strand: strandStr === '-' ? -1 : 1,
108
+ unknown: +unknownStr,
83
109
  seq,
84
110
  };
85
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MafTabixAdapter.js","sourceRoot":"","sources":["../../src/MafTabixAdapter/MafTabixAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAGL,aAAa,EACb,YAAY,GACb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9C,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAWnC,MAAM,CA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