@jbrowse/plugin-comparative-adapters 2.16.1 → 2.18.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 (101) hide show
  1. package/dist/BlastTabularAdapter/BlastTabularAdapter.d.ts +66 -0
  2. package/dist/BlastTabularAdapter/BlastTabularAdapter.js +200 -0
  3. package/dist/BlastTabularAdapter/configSchema.d.ts +30 -0
  4. package/dist/BlastTabularAdapter/configSchema.js +34 -0
  5. package/dist/BlastTabularAdapter/index.d.ts +2 -0
  6. package/dist/BlastTabularAdapter/index.js +42 -0
  7. package/dist/ChainAdapter/ChainAdapter.d.ts +1 -1
  8. package/dist/ChainAdapter/ChainAdapter.js +3 -6
  9. package/dist/ChainAdapter/configSchema.d.ts +0 -14
  10. package/dist/ChainAdapter/configSchema.js +1 -19
  11. package/dist/ChainAdapter/index.d.ts +1 -1
  12. package/dist/ChainAdapter/util.js +3 -50
  13. package/dist/DeltaAdapter/DeltaAdapter.d.ts +1 -1
  14. package/dist/DeltaAdapter/DeltaAdapter.js +3 -6
  15. package/dist/DeltaAdapter/configSchema.d.ts +0 -14
  16. package/dist/DeltaAdapter/configSchema.js +1 -19
  17. package/dist/DeltaAdapter/index.d.ts +1 -1
  18. package/dist/DeltaAdapter/util.js +4 -31
  19. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
  20. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +2 -15
  21. package/dist/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
  22. package/dist/MCScanAnchorsAdapter/configSchema.js +1 -16
  23. package/dist/MCScanAnchorsAdapter/index.d.ts +1 -1
  24. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
  25. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +2 -13
  26. package/dist/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
  27. package/dist/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
  28. package/dist/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
  29. package/dist/MashMapAdapter/MashMapAdapter.d.ts +13 -2
  30. package/dist/MashMapAdapter/MashMapAdapter.js +2 -5
  31. package/dist/MashMapAdapter/configSchema.d.ts +0 -12
  32. package/dist/MashMapAdapter/configSchema.js +1 -16
  33. package/dist/MashMapAdapter/index.d.ts +1 -1
  34. package/dist/PAFAdapter/PAFAdapter.d.ts +6 -5
  35. package/dist/PAFAdapter/PAFAdapter.js +5 -18
  36. package/dist/PAFAdapter/configSchema.d.ts +0 -12
  37. package/dist/PAFAdapter/configSchema.js +1 -16
  38. package/dist/PAFAdapter/index.d.ts +1 -1
  39. package/dist/PAFAdapter/util.d.ts +1 -1
  40. package/dist/PAFAdapter/util.js +1 -36
  41. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
  42. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +5 -6
  43. package/dist/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
  44. package/dist/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
  45. package/dist/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
  46. package/dist/SyntenyFeature/index.js +0 -1
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +7 -5
  49. package/dist/util.d.ts +4 -4
  50. package/dist/util.js +9 -6
  51. package/esm/BlastTabularAdapter/BlastTabularAdapter.d.ts +66 -0
  52. package/esm/BlastTabularAdapter/BlastTabularAdapter.js +195 -0
  53. package/esm/BlastTabularAdapter/configSchema.d.ts +30 -0
  54. package/esm/BlastTabularAdapter/configSchema.js +32 -0
  55. package/esm/BlastTabularAdapter/index.d.ts +2 -0
  56. package/esm/BlastTabularAdapter/index.js +13 -0
  57. package/esm/ChainAdapter/ChainAdapter.d.ts +1 -1
  58. package/esm/ChainAdapter/ChainAdapter.js +3 -6
  59. package/esm/ChainAdapter/configSchema.d.ts +0 -14
  60. package/esm/ChainAdapter/configSchema.js +1 -19
  61. package/esm/ChainAdapter/index.d.ts +1 -1
  62. package/esm/ChainAdapter/util.js +3 -50
  63. package/esm/DeltaAdapter/DeltaAdapter.d.ts +1 -1
  64. package/esm/DeltaAdapter/DeltaAdapter.js +3 -6
  65. package/esm/DeltaAdapter/configSchema.d.ts +0 -14
  66. package/esm/DeltaAdapter/configSchema.js +1 -19
  67. package/esm/DeltaAdapter/index.d.ts +1 -1
  68. package/esm/DeltaAdapter/util.js +4 -31
  69. package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
  70. package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +4 -17
  71. package/esm/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
  72. package/esm/MCScanAnchorsAdapter/configSchema.js +1 -16
  73. package/esm/MCScanAnchorsAdapter/index.d.ts +1 -1
  74. package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
  75. package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +4 -15
  76. package/esm/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
  77. package/esm/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
  78. package/esm/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
  79. package/esm/MashMapAdapter/MashMapAdapter.d.ts +13 -2
  80. package/esm/MashMapAdapter/MashMapAdapter.js +2 -5
  81. package/esm/MashMapAdapter/configSchema.d.ts +0 -12
  82. package/esm/MashMapAdapter/configSchema.js +1 -16
  83. package/esm/MashMapAdapter/index.d.ts +1 -1
  84. package/esm/PAFAdapter/PAFAdapter.d.ts +6 -5
  85. package/esm/PAFAdapter/PAFAdapter.js +7 -20
  86. package/esm/PAFAdapter/configSchema.d.ts +0 -12
  87. package/esm/PAFAdapter/configSchema.js +1 -16
  88. package/esm/PAFAdapter/index.d.ts +1 -1
  89. package/esm/PAFAdapter/util.d.ts +1 -1
  90. package/esm/PAFAdapter/util.js +1 -36
  91. package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
  92. package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +6 -7
  93. package/esm/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
  94. package/esm/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
  95. package/esm/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
  96. package/esm/SyntenyFeature/index.js +0 -1
  97. package/esm/index.d.ts +1 -1
  98. package/esm/index.js +7 -5
  99. package/esm/util.d.ts +4 -4
  100. package/esm/util.js +10 -7
  101. package/package.json +2 -2
@@ -1,41 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
- /**
5
- * #config DeltaAdapter
6
- * #category adapter
7
- */
8
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ function x() { }
9
5
  const DeltaAdapter = (0, configuration_1.ConfigurationSchema)('DeltaAdapter', {
10
- /**
11
- * #slot
12
- */
13
6
  assemblyNames: {
14
7
  type: 'stringArray',
15
8
  defaultValue: [],
16
9
  description: 'Array of assembly names to use for this file. The query assembly name is the first value in the array, target assembly name is the second',
17
10
  },
18
- /**
19
- * #slot
20
- * alternative to assembly names
21
- */
22
11
  targetAssembly: {
23
12
  type: 'string',
24
13
  defaultValue: '',
25
14
  description: 'Alternative to assemblyNames: the target assembly name',
26
15
  },
27
- /**
28
- * #slot
29
- * alternative to assembly names
30
- */
31
16
  queryAssembly: {
32
17
  type: 'string',
33
18
  defaultValue: '',
34
19
  description: 'Alternative to assemblyNames: the query assembly name',
35
20
  },
36
- /**
37
- * #slot
38
- */
39
21
  deltaLocation: {
40
22
  type: 'fileLocation',
41
23
  defaultValue: {
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function DeltaAdapterF(pluginManager: PluginManager): void;
@@ -1,34 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paf_delta2paf = paf_delta2paf;
4
- const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
5
- /* paf2delta from paftools.js in the minimap2 repository, license reproduced below
6
- *
7
- * The MIT License
8
- *
9
- * Copyright (c) 2018- Dana-Farber Cancer Institute
10
- * 2017-2018 Broad Institute, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining
13
- * a copy of this software and associated documentation files (the
14
- * "Software"), to deal in the Software without restriction, including
15
- * without limitation the rights to use, copy, modify, merge, publish,
16
- * distribute, sublicense, and/or sell copies of the Software, and to
17
- * permit persons to whom the Software is furnished to do so, subject to
18
- * the following conditions:
19
- *
20
- * The above copyright notice and this permission notice shall be
21
- * included in all copies or substantial portions of the Software.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
4
  function paf_delta2paf(buffer) {
33
5
  let rname = '';
34
6
  let qname = '';
@@ -46,13 +18,14 @@ function paf_delta2paf(buffer) {
46
18
  const regex = new RegExp(/^>(\S+)\s+(\S+)\s+(\d+)\s+(\d+)/);
47
19
  let blockStart = 0;
48
20
  let i = 0;
21
+ const decoder = new TextDecoder('utf8');
49
22
  while (blockStart < buffer.length) {
50
23
  const n = buffer.indexOf('\n', blockStart);
51
24
  if (n === -1) {
52
25
  break;
53
26
  }
54
27
  const b = buffer.subarray(blockStart, n);
55
- const line = ((decoder === null || decoder === void 0 ? void 0 : decoder.decode(b)) || b.toString()).trim();
28
+ const line = decoder.decode(b).trim();
56
29
  blockStart = n + 1;
57
30
  i++;
58
31
  if (line) {
@@ -125,7 +98,7 @@ function paf_delta2paf(buffer) {
125
98
  }
126
99
  else {
127
100
  cigar.push((1 << 4) | 2);
128
- } // deletion
101
+ }
129
102
  }
130
103
  else {
131
104
  const l = -d - 1;
@@ -139,7 +112,7 @@ function paf_delta2paf(buffer) {
139
112
  }
140
113
  else {
141
114
  cigar.push((1 << 4) | 1);
142
- } // insertion
115
+ }
143
116
  }
144
117
  }
145
118
  }
@@ -1,5 +1,6 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { Feature, Region } from '@jbrowse/core/util';
1
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type { Feature, Region } from '@jbrowse/core/util';
3
4
  interface BareFeature {
4
5
  strand: number;
5
6
  refName: string;
@@ -24,11 +25,6 @@ export default class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
24
25
  getAssemblyNames(): string[];
25
26
  getRefNames(opts?: BaseOptions): Promise<string[]>;
26
27
  getFeatures(region: Region, opts?: BaseOptions): import("rxjs").Observable<Feature>;
27
- /**
28
- * called to provide a hint that data tied to a certain region
29
- * will not be needed for the foreseeable future and can be purged
30
- * from caches, etc
31
- */
32
28
  freeResources(): void;
33
29
  }
34
30
  export {};
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
4
- const io_1 = require("@jbrowse/core/util/io");
5
4
  const util_1 = require("@jbrowse/core/util");
5
+ const io_1 = require("@jbrowse/core/util/io");
6
6
  const rxjs_1 = require("@jbrowse/core/util/rxjs");
7
7
  const util_2 = require("../util");
8
8
  class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
@@ -42,9 +42,6 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
42
42
  };
43
43
  }
44
44
  async hasDataForRefName() {
45
- // determining this properly is basically a call to getFeatures so is not
46
- // really that important, and has to be true or else getFeatures is never
47
- // called (BaseFeatureDataAdapter filters it out)
48
45
  return true;
49
46
  }
50
47
  getAssemblyNames() {
@@ -53,7 +50,6 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
53
50
  }
54
51
  async getRefNames(opts = {}) {
55
52
  var _a;
56
- // @ts-expect-error
57
53
  const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
58
54
  const { feats } = await this.setup(opts);
59
55
  const idx = this.getAssemblyNames().indexOf(r1);
@@ -70,8 +66,6 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
70
66
  getFeatures(region, opts = {}) {
71
67
  return (0, rxjs_1.ObservableCreate)(async (observer) => {
72
68
  const { assemblyNames, feats } = await this.setup(opts);
73
- // The index of the assembly name in the region list corresponds to
74
- // the adapter in the subadapters list
75
69
  const index = assemblyNames.indexOf(region.assemblyName);
76
70
  if (index !== -1) {
77
71
  const flip = index === 0;
@@ -84,8 +78,6 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
84
78
  ...f1,
85
79
  uniqueId: `${index}-${rowNum}`,
86
80
  syntenyId: rowNum,
87
- // note: strand would be -1 if the two features are on opposite
88
- // strands, indicating inverted alignment
89
81
  strand: f1.strand * f2.strand,
90
82
  assemblyName: assemblyNames[+!flip],
91
83
  score,
@@ -100,12 +92,7 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
100
92
  observer.complete();
101
93
  });
102
94
  }
103
- /**
104
- * called to provide a hint that data tied to a certain region
105
- * will not be needed for the foreseeable future and can be purged
106
- * from caches, etc
107
- */
108
- freeResources( /* { region } */) { }
95
+ freeResources() { }
109
96
  }
110
97
  MCScanAnchorsAdapter.capabilities = ['getFeatures', 'getRefNames'];
111
98
  exports.default = MCScanAnchorsAdapter;
@@ -1,7 +1,4 @@
1
1
  declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  mcscanAnchorsLocation: {
6
3
  type: string;
7
4
  defaultValue: {
@@ -9,9 +6,6 @@ declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configur
9
6
  locationType: string;
10
7
  };
11
8
  };
12
- /**
13
- * #slot
14
- */
15
9
  bed1Location: {
16
10
  type: string;
17
11
  defaultValue: {
@@ -19,9 +13,6 @@ declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configur
19
13
  locationType: string;
20
14
  };
21
15
  };
22
- /**
23
- * #slot
24
- */
25
16
  bed2Location: {
26
17
  type: string;
27
18
  defaultValue: {
@@ -29,9 +20,6 @@ declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configur
29
20
  locationType: string;
30
21
  };
31
22
  };
32
- /**
33
- * #slot
34
- */
35
23
  assemblyNames: {
36
24
  type: string;
37
25
  defaultValue: never[];
@@ -1,14 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
- /**
5
- * #config MCScanAnchorsAdapter
6
- */
7
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ function x() { }
8
5
  const MCScanAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCScanAnchorsAdapter', {
9
- /**
10
- * #slot
11
- */
12
6
  mcscanAnchorsLocation: {
13
7
  type: 'fileLocation',
14
8
  defaultValue: {
@@ -16,9 +10,6 @@ const MCScanAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCScanAnc
16
10
  locationType: 'UriLocation',
17
11
  },
18
12
  },
19
- /**
20
- * #slot
21
- */
22
13
  bed1Location: {
23
14
  type: 'fileLocation',
24
15
  defaultValue: {
@@ -26,9 +17,6 @@ const MCScanAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCScanAnc
26
17
  locationType: 'UriLocation',
27
18
  },
28
19
  },
29
- /**
30
- * #slot
31
- */
32
20
  bed2Location: {
33
21
  type: 'fileLocation',
34
22
  defaultValue: {
@@ -36,9 +24,6 @@ const MCScanAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCScanAnc
36
24
  locationType: 'UriLocation',
37
25
  },
38
26
  },
39
- /**
40
- * #slot
41
- */
42
27
  assemblyNames: {
43
28
  type: 'stringArray',
44
29
  defaultValue: [],
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function MCScanAnchorsAdapterF(pluginManager: PluginManager): void;
@@ -1,6 +1,7 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { Region } from '@jbrowse/core/util/types';
3
- import { Feature } from '@jbrowse/core/util/simpleFeature';
1
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type { Feature } from '@jbrowse/core/util/simpleFeature';
4
+ import type { Region } from '@jbrowse/core/util/types';
4
5
  interface BareFeature {
5
6
  refName: string;
6
7
  start: number;
@@ -32,11 +33,6 @@ export default class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
32
33
  getAssemblyNames(): string[];
33
34
  getRefNames(opts?: BaseOptions): Promise<string[]>;
34
35
  getFeatures(region: Region, opts?: BaseOptions): import("rxjs").Observable<Feature>;
35
- /**
36
- * called to provide a hint that data tied to a certain region
37
- * will not be needed for the foreseeable future and can be purged
38
- * from caches, etc
39
- */
40
36
  freeResources(): void;
41
37
  }
42
38
  export {};
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
7
- const io_1 = require("@jbrowse/core/util/io");
8
7
  const util_1 = require("@jbrowse/core/util");
8
+ const io_1 = require("@jbrowse/core/util/io");
9
9
  const rxjs_1 = require("@jbrowse/core/util/rxjs");
10
10
  const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
11
11
  const util_2 = require("../util");
@@ -56,9 +56,6 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
56
56
  };
57
57
  }
58
58
  async hasDataForRefName() {
59
- // determining this properly is basically a call to getFeatures
60
- // so is not really that important, and has to be true or else
61
- // getFeatures is never called (BaseFeatureDataAdapter filters it out)
62
59
  return true;
63
60
  }
64
61
  getAssemblyNames() {
@@ -67,7 +64,6 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
67
64
  }
68
65
  async getRefNames(opts = {}) {
69
66
  var _a;
70
- // @ts-expect-error
71
67
  const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
72
68
  const { feats } = await this.setup(opts);
73
69
  const idx = this.getAssemblyNames().indexOf(r1);
@@ -91,8 +87,6 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
91
87
  getFeatures(region, opts = {}) {
92
88
  return (0, rxjs_1.ObservableCreate)(async (observer) => {
93
89
  const { assemblyNames, feats } = await this.setup(opts);
94
- // The index of the assembly name in the region list corresponds to
95
- // the adapter in the subadapters list
96
90
  const index = assemblyNames.indexOf(region.assemblyName);
97
91
  if (index !== -1) {
98
92
  const flip = index === 0;
@@ -132,12 +126,7 @@ class MCScanAnchorsAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
132
126
  observer.complete();
133
127
  });
134
128
  }
135
- /**
136
- * called to provide a hint that data tied to a certain region
137
- * will not be needed for the foreseeable future and can be purged
138
- * from caches, etc
139
- */
140
- freeResources( /* { region } */) { }
129
+ freeResources() { }
141
130
  }
142
131
  MCScanAnchorsAdapter.capabilities = ['getFeatures', 'getRefNames'];
143
132
  exports.default = MCScanAnchorsAdapter;
@@ -1,7 +1,4 @@
1
1
  declare const MCScanSimpleAnchorsAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  mcscanSimpleAnchorsLocation: {
6
3
  type: string;
7
4
  defaultValue: {
@@ -9,9 +6,6 @@ declare const MCScanSimpleAnchorsAdapter: import("@jbrowse/core/configuration/co
9
6
  locationType: string;
10
7
  };
11
8
  };
12
- /**
13
- * #slot
14
- */
15
9
  bed1Location: {
16
10
  type: string;
17
11
  defaultValue: {
@@ -19,9 +13,6 @@ declare const MCScanSimpleAnchorsAdapter: import("@jbrowse/core/configuration/co
19
13
  locationType: string;
20
14
  };
21
15
  };
22
- /**
23
- * #slot
24
- */
25
16
  bed2Location: {
26
17
  type: string;
27
18
  defaultValue: {
@@ -29,9 +20,6 @@ declare const MCScanSimpleAnchorsAdapter: import("@jbrowse/core/configuration/co
29
20
  locationType: string;
30
21
  };
31
22
  };
32
- /**
33
- * #slot
34
- */
35
23
  assemblyNames: {
36
24
  type: string;
37
25
  defaultValue: never[];
@@ -1,14 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
- /**
5
- * #config MCScanSimpleAnchorsAdapter
6
- */
7
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ function x() { }
8
5
  const MCScanSimpleAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCScanSimpleAnchorsAdapter', {
9
- /**
10
- * #slot
11
- */
12
6
  mcscanSimpleAnchorsLocation: {
13
7
  type: 'fileLocation',
14
8
  defaultValue: {
@@ -16,9 +10,6 @@ const MCScanSimpleAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCS
16
10
  locationType: 'UriLocation',
17
11
  },
18
12
  },
19
- /**
20
- * #slot
21
- */
22
13
  bed1Location: {
23
14
  type: 'fileLocation',
24
15
  defaultValue: {
@@ -26,9 +17,6 @@ const MCScanSimpleAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCS
26
17
  locationType: 'UriLocation',
27
18
  },
28
19
  },
29
- /**
30
- * #slot
31
- */
32
20
  bed2Location: {
33
21
  type: 'fileLocation',
34
22
  defaultValue: {
@@ -36,9 +24,6 @@ const MCScanSimpleAnchorsAdapter = (0, configuration_1.ConfigurationSchema)('MCS
36
24
  locationType: 'UriLocation',
37
25
  },
38
26
  },
39
- /**
40
- * #slot
41
- */
42
27
  assemblyNames: {
43
28
  type: 'stringArray',
44
29
  defaultValue: [],
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function MCScanSimpleAnchorsAdapterF(pluginManager: PluginManager): void;
@@ -1,5 +1,16 @@
1
- import { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
1
  import PAFAdapter from '../PAFAdapter/PAFAdapter';
2
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
3
3
  export default class MashMapAdapter extends PAFAdapter {
4
- setupPre(opts?: BaseOptions): Promise<import("../PAFAdapter/util").PAFRecord[]>;
4
+ setupPre(opts?: BaseOptions): Promise<{
5
+ tname: string;
6
+ tstart: number;
7
+ tend: number;
8
+ qname: string;
9
+ qstart: number;
10
+ qend: number;
11
+ strand: number;
12
+ extra: {
13
+ mappingQual: number;
14
+ };
15
+ }[]>;
5
16
  }
@@ -3,16 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const io_1 = require("@jbrowse/core/util/io");
7
- const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
8
6
  const util_1 = require("@jbrowse/core/util");
7
+ const io_1 = require("@jbrowse/core/util/io");
9
8
  const PAFAdapter_1 = __importDefault(require("../PAFAdapter/PAFAdapter"));
10
9
  const util_2 = require("../util");
11
10
  class MashMapAdapter extends PAFAdapter_1.default {
12
11
  async setupPre(opts) {
13
12
  const outLoc = (0, io_1.openLocation)(this.getConf('outLocation'), this.pluginManager);
14
- const buffer = (await outLoc.readFile(opts));
15
- const buf = (0, util_1.isGzip)(buffer) ? await (0, bgzf_filehandle_1.unzip)(buffer) : buffer;
13
+ const buf = await (0, util_1.fetchAndMaybeUnzip)(outLoc, opts);
16
14
  return (0, util_2.parseLineByLine)(buf, parseMashMapLine);
17
15
  }
18
16
  }
@@ -20,7 +18,6 @@ exports.default = MashMapAdapter;
20
18
  function parseMashMapLine(line) {
21
19
  const fields = line.split(' ');
22
20
  if (fields.length < 9) {
23
- // xref https://github.com/marbl/MashMap/issues/38
24
21
  throw new Error(`improperly formatted line: ${line}`);
25
22
  }
26
23
  const [qname, , qstart, qend, strand, tname, , tstart, tend, mq] = fields;
@@ -1,31 +1,19 @@
1
1
  declare const MashMapAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  assemblyNames: {
6
3
  type: string;
7
4
  defaultValue: never[];
8
5
  description: string;
9
6
  };
10
- /**
11
- * #slot
12
- */
13
7
  targetAssembly: {
14
8
  type: string;
15
9
  defaultValue: string;
16
10
  description: string;
17
11
  };
18
- /**
19
- * #slot
20
- */
21
12
  queryAssembly: {
22
13
  type: string;
23
14
  defaultValue: string;
24
15
  description: string;
25
16
  };
26
- /**
27
- * #slot
28
- */
29
17
  outLocation: {
30
18
  type: string;
31
19
  defaultValue: {
@@ -1,38 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
- /**
5
- * #config MashMapAdapter
6
- */
7
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ function x() { }
8
5
  const MashMapAdapter = (0, configuration_1.ConfigurationSchema)('MashMapAdapter', {
9
- /**
10
- * #slot
11
- */
12
6
  assemblyNames: {
13
7
  type: 'stringArray',
14
8
  defaultValue: [],
15
9
  description: 'Array of assembly names to use for this file. The query assembly name is the first value in the array, target assembly name is the second',
16
10
  },
17
- /**
18
- * #slot
19
- */
20
11
  targetAssembly: {
21
12
  type: 'string',
22
13
  defaultValue: '',
23
14
  description: 'Alternative to assemblyNames array: the target assembly',
24
15
  },
25
- /**
26
- * #slot
27
- */
28
16
  queryAssembly: {
29
17
  type: 'string',
30
18
  defaultValue: '',
31
19
  description: 'Alternative to assemblyNames array: the query assembly',
32
20
  },
33
- /**
34
- * #slot
35
- */
36
21
  outLocation: {
37
22
  type: 'fileLocation',
38
23
  defaultValue: {
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function MashMapAdapterF(pluginManager: PluginManager): void;
@@ -1,8 +1,9 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { Region } from '@jbrowse/core/util/types';
3
- import { Feature } from '@jbrowse/core/util';
4
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
5
- import { PAFRecord } from './util';
1
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
+ import type { PAFRecord } from './util';
3
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
5
+ import type { Feature } from '@jbrowse/core/util';
6
+ import type { Region } from '@jbrowse/core/util/types';
6
7
  interface PAFOptions extends BaseOptions {
7
8
  config?: AnyConfigurationModel;
8
9
  }
@@ -3,15 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const configuration_1 = require("@jbrowse/core/configuration");
6
7
  const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
7
- const range_1 = require("@jbrowse/core/util/range");
8
+ const util_1 = require("@jbrowse/core/util");
8
9
  const io_1 = require("@jbrowse/core/util/io");
10
+ const range_1 = require("@jbrowse/core/util/range");
9
11
  const rxjs_1 = require("@jbrowse/core/util/rxjs");
10
- const util_1 = require("@jbrowse/core/util");
11
- const configuration_1 = require("@jbrowse/core/configuration");
12
- const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
13
12
  const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
14
- // locals
15
13
  const SyntenyFeature_1 = __importDefault(require("../SyntenyFeature"));
16
14
  const util_2 = require("../util");
17
15
  const util_3 = require("./util");
@@ -29,14 +27,10 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
29
27
  async setupPre(opts) {
30
28
  const pm = this.pluginManager;
31
29
  const pafLocation = (0, io_1.openLocation)(this.getConf('pafLocation'), pm);
32
- const buffer = (await pafLocation.readFile(opts));
33
- const buf = (0, util_1.isGzip)(buffer) ? await (0, bgzf_filehandle_1.unzip)(buffer) : buffer;
30
+ const buf = await (0, util_1.fetchAndMaybeUnzip)(pafLocation, opts);
34
31
  return (0, util_2.parseLineByLine)(buf, util_2.parsePAFLine);
35
32
  }
36
33
  async hasDataForRefName() {
37
- // determining this properly is basically a call to getFeatures
38
- // so is not really that important, and has to be true or else
39
- // getFeatures is never called (BaseAdapter filters it out)
40
34
  return true;
41
35
  }
42
36
  getAssemblyNames() {
@@ -50,7 +44,6 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
50
44
  }
51
45
  async getRefNames(opts = {}) {
52
46
  var _a;
53
- // @ts-expect-error
54
47
  const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
55
48
  const feats = await this.setup(opts);
56
49
  const idx = this.getAssemblyNames().indexOf(r1);
@@ -68,18 +61,12 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
68
61
  return (0, rxjs_1.ObservableCreate)(async (observer) => {
69
62
  let pafRecords = await this.setup(opts);
70
63
  const { config } = opts;
71
- // note: this is not the adapter config, it is responding to a display
72
- // setting passed in via the opts parameter
73
64
  if (config && (0, configuration_1.readConfObject)(config, 'colorBy') === 'meanQueryIdentity') {
74
65
  pafRecords = (0, util_3.getWeightedMeans)(pafRecords);
75
66
  }
76
67
  const assemblyNames = this.getAssemblyNames();
77
- // The index of the assembly name in the query list corresponds to the
78
- // adapter in the subadapters list
79
68
  const { start: qstart, end: qend, refName: qref, assemblyName } = query;
80
69
  const index = assemblyNames.indexOf(assemblyName);
81
- // if the getFeatures::query is on the query assembly, flip orientation
82
- // of data
83
70
  const flip = index === 0;
84
71
  if (index === -1) {
85
72
  console.warn(`${assemblyName} not found in this adapter`);
@@ -147,7 +134,7 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
147
134
  observer.complete();
148
135
  });
149
136
  }
150
- freeResources( /* { query } */) { }
137
+ freeResources() { }
151
138
  }
152
139
  PAFAdapter.capabilities = ['getFeatures', 'getRefNames'];
153
140
  exports.default = PAFAdapter;