@jbrowse/plugin-comparative-adapters 2.17.0 → 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 (95) hide show
  1. package/dist/BlastTabularAdapter/BlastTabularAdapter.d.ts +3 -57
  2. package/dist/BlastTabularAdapter/BlastTabularAdapter.js +3 -10
  3. package/dist/BlastTabularAdapter/configSchema.d.ts +0 -15
  4. package/dist/BlastTabularAdapter/configSchema.js +1 -19
  5. package/dist/BlastTabularAdapter/index.d.ts +1 -1
  6. package/dist/ChainAdapter/ChainAdapter.d.ts +1 -1
  7. package/dist/ChainAdapter/ChainAdapter.js +2 -3
  8. package/dist/ChainAdapter/configSchema.d.ts +0 -14
  9. package/dist/ChainAdapter/configSchema.js +1 -19
  10. package/dist/ChainAdapter/index.d.ts +1 -1
  11. package/dist/ChainAdapter/util.js +1 -48
  12. package/dist/DeltaAdapter/DeltaAdapter.d.ts +1 -1
  13. package/dist/DeltaAdapter/DeltaAdapter.js +2 -3
  14. package/dist/DeltaAdapter/configSchema.d.ts +0 -14
  15. package/dist/DeltaAdapter/configSchema.js +1 -19
  16. package/dist/DeltaAdapter/index.d.ts +1 -1
  17. package/dist/DeltaAdapter/util.js +2 -29
  18. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
  19. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +2 -15
  20. package/dist/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
  21. package/dist/MCScanAnchorsAdapter/configSchema.js +1 -16
  22. package/dist/MCScanAnchorsAdapter/index.d.ts +1 -1
  23. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
  24. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +2 -13
  25. package/dist/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
  26. package/dist/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
  27. package/dist/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
  28. package/dist/MashMapAdapter/MashMapAdapter.d.ts +1 -1
  29. package/dist/MashMapAdapter/MashMapAdapter.js +1 -2
  30. package/dist/MashMapAdapter/configSchema.d.ts +0 -12
  31. package/dist/MashMapAdapter/configSchema.js +1 -16
  32. package/dist/MashMapAdapter/index.d.ts +1 -1
  33. package/dist/PAFAdapter/PAFAdapter.d.ts +6 -5
  34. package/dist/PAFAdapter/PAFAdapter.js +4 -15
  35. package/dist/PAFAdapter/configSchema.d.ts +0 -12
  36. package/dist/PAFAdapter/configSchema.js +1 -16
  37. package/dist/PAFAdapter/index.d.ts +1 -1
  38. package/dist/PAFAdapter/util.js +0 -35
  39. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
  40. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +5 -6
  41. package/dist/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
  42. package/dist/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
  43. package/dist/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
  44. package/dist/SyntenyFeature/index.js +0 -1
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +6 -6
  47. package/dist/util.d.ts +3 -3
  48. package/esm/BlastTabularAdapter/BlastTabularAdapter.d.ts +3 -57
  49. package/esm/BlastTabularAdapter/BlastTabularAdapter.js +5 -12
  50. package/esm/BlastTabularAdapter/configSchema.d.ts +0 -15
  51. package/esm/BlastTabularAdapter/configSchema.js +1 -19
  52. package/esm/BlastTabularAdapter/index.d.ts +1 -1
  53. package/esm/ChainAdapter/ChainAdapter.d.ts +1 -1
  54. package/esm/ChainAdapter/ChainAdapter.js +2 -3
  55. package/esm/ChainAdapter/configSchema.d.ts +0 -14
  56. package/esm/ChainAdapter/configSchema.js +1 -19
  57. package/esm/ChainAdapter/index.d.ts +1 -1
  58. package/esm/ChainAdapter/util.js +1 -48
  59. package/esm/DeltaAdapter/DeltaAdapter.d.ts +1 -1
  60. package/esm/DeltaAdapter/DeltaAdapter.js +2 -3
  61. package/esm/DeltaAdapter/configSchema.d.ts +0 -14
  62. package/esm/DeltaAdapter/configSchema.js +1 -19
  63. package/esm/DeltaAdapter/index.d.ts +1 -1
  64. package/esm/DeltaAdapter/util.js +2 -29
  65. package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
  66. package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +4 -17
  67. package/esm/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
  68. package/esm/MCScanAnchorsAdapter/configSchema.js +1 -16
  69. package/esm/MCScanAnchorsAdapter/index.d.ts +1 -1
  70. package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
  71. package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +4 -15
  72. package/esm/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
  73. package/esm/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
  74. package/esm/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
  75. package/esm/MashMapAdapter/MashMapAdapter.d.ts +1 -1
  76. package/esm/MashMapAdapter/MashMapAdapter.js +1 -2
  77. package/esm/MashMapAdapter/configSchema.d.ts +0 -12
  78. package/esm/MashMapAdapter/configSchema.js +1 -16
  79. package/esm/MashMapAdapter/index.d.ts +1 -1
  80. package/esm/PAFAdapter/PAFAdapter.d.ts +6 -5
  81. package/esm/PAFAdapter/PAFAdapter.js +6 -17
  82. package/esm/PAFAdapter/configSchema.d.ts +0 -12
  83. package/esm/PAFAdapter/configSchema.js +1 -16
  84. package/esm/PAFAdapter/index.d.ts +1 -1
  85. package/esm/PAFAdapter/util.js +0 -35
  86. package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
  87. package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +6 -7
  88. package/esm/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
  89. package/esm/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
  90. package/esm/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
  91. package/esm/SyntenyFeature/index.js +0 -1
  92. package/esm/index.d.ts +1 -1
  93. package/esm/index.js +6 -6
  94. package/esm/util.d.ts +3 -3
  95. package/package.json +2 -2
@@ -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,5 @@
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
4
  setupPre(opts?: BaseOptions): Promise<{
5
5
  tname: string;
@@ -3,8 +3,8 @@ 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
6
  const util_1 = require("@jbrowse/core/util");
7
+ const io_1 = require("@jbrowse/core/util/io");
8
8
  const PAFAdapter_1 = __importDefault(require("../PAFAdapter/PAFAdapter"));
9
9
  const util_2 = require("../util");
10
10
  class MashMapAdapter extends PAFAdapter_1.default {
@@ -18,7 +18,6 @@ exports.default = MashMapAdapter;
18
18
  function parseMashMapLine(line) {
19
19
  const fields = line.split(' ');
20
20
  if (fields.length < 9) {
21
- // xref https://github.com/marbl/MashMap/issues/38
22
21
  throw new Error(`improperly formatted line: ${line}`);
23
22
  }
24
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,14 +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
12
  const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
13
- // locals
14
13
  const SyntenyFeature_1 = __importDefault(require("../SyntenyFeature"));
15
14
  const util_2 = require("../util");
16
15
  const util_3 = require("./util");
@@ -32,9 +31,6 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
32
31
  return (0, util_2.parseLineByLine)(buf, util_2.parsePAFLine);
33
32
  }
34
33
  async hasDataForRefName() {
35
- // determining this properly is basically a call to getFeatures so is not
36
- // really that important, and has to be true or else getFeatures is never
37
- // called (BaseAdapter filters it out)
38
34
  return true;
39
35
  }
40
36
  getAssemblyNames() {
@@ -48,7 +44,6 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
48
44
  }
49
45
  async getRefNames(opts = {}) {
50
46
  var _a;
51
- // @ts-expect-error
52
47
  const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
53
48
  const feats = await this.setup(opts);
54
49
  const idx = this.getAssemblyNames().indexOf(r1);
@@ -66,18 +61,12 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
66
61
  return (0, rxjs_1.ObservableCreate)(async (observer) => {
67
62
  let pafRecords = await this.setup(opts);
68
63
  const { config } = opts;
69
- // note: this is not the adapter config, it is responding to a display
70
- // setting passed in via the opts parameter
71
64
  if (config && (0, configuration_1.readConfObject)(config, 'colorBy') === 'meanQueryIdentity') {
72
65
  pafRecords = (0, util_3.getWeightedMeans)(pafRecords);
73
66
  }
74
67
  const assemblyNames = this.getAssemblyNames();
75
- // The index of the assembly name in the query list corresponds to the
76
- // adapter in the subadapters list
77
68
  const { start: qstart, end: qend, refName: qref, assemblyName } = query;
78
69
  const index = assemblyNames.indexOf(assemblyName);
79
- // if the getFeatures::query is on the query assembly, flip orientation
80
- // of data
81
70
  const flip = index === 0;
82
71
  if (index === -1) {
83
72
  console.warn(`${assemblyName} not found in this adapter`);
@@ -145,7 +134,7 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
145
134
  observer.complete();
146
135
  });
147
136
  }
148
- freeResources( /* { query } */) { }
137
+ freeResources() { }
149
138
  }
150
139
  PAFAdapter.capabilities = ['getFeatures', 'getRefNames'];
151
140
  exports.default = PAFAdapter;
@@ -1,31 +1,19 @@
1
1
  declare const PAFAdapter: 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
  pafLocation: {
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 PAFAdapter
6
- */
7
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ function x() { }
8
5
  const PAFAdapter = (0, configuration_1.ConfigurationSchema)('PAFAdapter', {
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: the target assembly name',
24
15
  },
25
- /**
26
- * #slot
27
- */
28
16
  queryAssembly: {
29
17
  type: 'string',
30
18
  defaultValue: '',
31
19
  description: 'Alternative to assemblyNames: the query assembly name',
32
20
  },
33
- /**
34
- * #slot
35
- */
36
21
  pafLocation: {
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 PAFAdapterF(pluginManager: PluginManager): void;
@@ -2,40 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWeightedMeans = getWeightedMeans;
4
4
  const util_1 = require("../util");
5
- // based on "weighted mean" method from https://github.com/tpoorten/dotPlotly
6
- // License reproduced here
7
- //
8
- // MIT License
9
- // Copyright (c) 2017 Tom Poorten
10
- // Permission is hereby granted, free of charge, to any person obtaining a copy
11
- // of this software and associated documentation files (the "Software"), to deal
12
- // in the Software without restriction, including without limitation the rights
13
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- // copies of the Software, and to permit persons to whom the Software is
15
- // furnished to do so, subject to the following conditions:
16
- // The above copyright notice and this permission notice shall be included in all
17
- // copies or substantial portions of the Software.
18
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
- // SOFTWARE.
25
- //
26
- // Notes: in the weighted mean longer alignments factor in more heavily of all
27
- // the fragments of a query vs the reference that it mapped to
28
- //
29
- // this uses a combined key query+'-'+ref to iteratively map all the alignments
30
- // that match a particular ref from a particular query (so 1d array of what
31
- // could be a 2d map)
32
- //
33
- // the result is a single number that says e.g. chr5 from human mapped to chr5
34
- // on mouse with 0.8 quality, and that0.8 is then attached to all the pieces of
35
- // chr5 on human that mapped to chr5 on mouse. if chr5 on human also more
36
- // weakly mapped to chr6 on mouse, then it would have another value e.g. 0.6.
37
- // this can show strong and weak levels of synteny, especially in polyploidy
38
- // situations
39
5
  function getWeightedMeans(ret) {
40
6
  const scoreMap = {};
41
7
  for (const entry of ret) {
@@ -70,7 +36,6 @@ function getWeightedMeans(ret) {
70
36
  }
71
37
  return ret;
72
38
  }
73
- // https://gist.github.com/stekhn/a12ed417e91f90ecec14bcfa4c2ae16a
74
39
  function weightedMean(tuples) {
75
40
  const [valueSum, weightSum] = tuples.reduce(([valueSum, weightSum], [value, weight]) => [
76
41
  valueSum + value * weight,
@@ -1,10 +1,11 @@
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 { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
6
- import PluginManager from '@jbrowse/core/PluginManager';
7
1
  import { TabixIndexedFile } from '@gmod/tabix';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type PluginManager from '@jbrowse/core/PluginManager';
4
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
5
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
6
+ import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
7
+ import type { Feature } from '@jbrowse/core/util';
8
+ import type { Region } from '@jbrowse/core/util/types';
8
9
  interface PAFOptions extends BaseOptions {
9
10
  config?: AnyConfigurationModel;
10
11
  }