@jbrowse/plugin-comparative-adapters 2.17.0 → 3.0.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 (141) 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/BlastTabularAdapter/index.js +18 -8
  7. package/dist/ChainAdapter/ChainAdapter.d.ts +1 -1
  8. package/dist/ChainAdapter/ChainAdapter.js +2 -3
  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/index.js +18 -8
  13. package/dist/ChainAdapter/util.d.ts +1 -2
  14. package/dist/ChainAdapter/util.js +2 -49
  15. package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.d.ts +2 -0
  16. package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +31 -0
  17. package/dist/ComparativeAddTrackComponent/index.d.ts +2 -0
  18. package/dist/ComparativeAddTrackComponent/index.js +46 -0
  19. package/dist/DeltaAdapter/DeltaAdapter.d.ts +1 -1
  20. package/dist/DeltaAdapter/DeltaAdapter.js +2 -3
  21. package/dist/DeltaAdapter/configSchema.d.ts +0 -14
  22. package/dist/DeltaAdapter/configSchema.js +1 -19
  23. package/dist/DeltaAdapter/index.d.ts +1 -1
  24. package/dist/DeltaAdapter/index.js +18 -8
  25. package/dist/DeltaAdapter/util.d.ts +1 -2
  26. package/dist/DeltaAdapter/util.js +3 -30
  27. package/dist/GuessAdapter/index.d.ts +2 -0
  28. package/dist/GuessAdapter/index.js +74 -0
  29. package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +2 -0
  30. package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.js +39 -0
  31. package/dist/MCScanAddTrackComponent/index.d.ts +2 -0
  32. package/dist/MCScanAddTrackComponent/index.js +46 -0
  33. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
  34. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +2 -15
  35. package/dist/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
  36. package/dist/MCScanAnchorsAdapter/configSchema.js +1 -16
  37. package/dist/MCScanAnchorsAdapter/index.d.ts +1 -1
  38. package/dist/MCScanAnchorsAdapter/index.js +18 -8
  39. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
  40. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +2 -13
  41. package/dist/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
  42. package/dist/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
  43. package/dist/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
  44. package/dist/MCScanSimpleAnchorsAdapter/index.js +18 -8
  45. package/dist/MashMapAdapter/MashMapAdapter.d.ts +1 -1
  46. package/dist/MashMapAdapter/MashMapAdapter.js +1 -2
  47. package/dist/MashMapAdapter/configSchema.d.ts +0 -12
  48. package/dist/MashMapAdapter/configSchema.js +1 -16
  49. package/dist/MashMapAdapter/index.d.ts +1 -1
  50. package/dist/MashMapAdapter/index.js +18 -8
  51. package/dist/PAFAdapter/PAFAdapter.d.ts +6 -5
  52. package/dist/PAFAdapter/PAFAdapter.js +4 -15
  53. package/dist/PAFAdapter/configSchema.d.ts +0 -12
  54. package/dist/PAFAdapter/configSchema.js +1 -16
  55. package/dist/PAFAdapter/index.d.ts +1 -1
  56. package/dist/PAFAdapter/index.js +18 -8
  57. package/dist/PAFAdapter/util.js +0 -35
  58. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
  59. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +5 -6
  60. package/dist/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
  61. package/dist/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
  62. package/dist/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
  63. package/dist/PairwiseIndexedPAFAdapter/index.js +18 -8
  64. package/dist/SyntenyFeature/index.js +0 -1
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +11 -25
  67. package/dist/syntenyTypes.d.ts +3 -0
  68. package/dist/syntenyTypes.js +25 -0
  69. package/dist/util.d.ts +4 -5
  70. package/dist/util.js +2 -4
  71. package/esm/BlastTabularAdapter/BlastTabularAdapter.d.ts +3 -57
  72. package/esm/BlastTabularAdapter/BlastTabularAdapter.js +5 -12
  73. package/esm/BlastTabularAdapter/configSchema.d.ts +0 -15
  74. package/esm/BlastTabularAdapter/configSchema.js +1 -19
  75. package/esm/BlastTabularAdapter/index.d.ts +1 -1
  76. package/esm/BlastTabularAdapter/index.js +1 -1
  77. package/esm/ChainAdapter/ChainAdapter.d.ts +1 -1
  78. package/esm/ChainAdapter/ChainAdapter.js +2 -3
  79. package/esm/ChainAdapter/configSchema.d.ts +0 -14
  80. package/esm/ChainAdapter/configSchema.js +1 -19
  81. package/esm/ChainAdapter/index.d.ts +1 -1
  82. package/esm/ChainAdapter/index.js +1 -1
  83. package/esm/ChainAdapter/util.d.ts +1 -2
  84. package/esm/ChainAdapter/util.js +2 -49
  85. package/esm/ComparativeAddTrackComponent/ComparativeAddTrackComponent.d.ts +2 -0
  86. package/esm/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +29 -0
  87. package/esm/ComparativeAddTrackComponent/index.d.ts +2 -0
  88. package/esm/ComparativeAddTrackComponent/index.js +10 -0
  89. package/esm/DeltaAdapter/DeltaAdapter.d.ts +1 -1
  90. package/esm/DeltaAdapter/DeltaAdapter.js +2 -3
  91. package/esm/DeltaAdapter/configSchema.d.ts +0 -14
  92. package/esm/DeltaAdapter/configSchema.js +1 -19
  93. package/esm/DeltaAdapter/index.d.ts +1 -1
  94. package/esm/DeltaAdapter/index.js +1 -1
  95. package/esm/DeltaAdapter/util.d.ts +1 -2
  96. package/esm/DeltaAdapter/util.js +3 -30
  97. package/esm/GuessAdapter/index.d.ts +2 -0
  98. package/esm/GuessAdapter/index.js +71 -0
  99. package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +2 -0
  100. package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.js +37 -0
  101. package/esm/MCScanAddTrackComponent/index.d.ts +2 -0
  102. package/esm/MCScanAddTrackComponent/index.js +10 -0
  103. package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
  104. package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +4 -17
  105. package/esm/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
  106. package/esm/MCScanAnchorsAdapter/configSchema.js +1 -16
  107. package/esm/MCScanAnchorsAdapter/index.d.ts +1 -1
  108. package/esm/MCScanAnchorsAdapter/index.js +1 -1
  109. package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
  110. package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +4 -15
  111. package/esm/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
  112. package/esm/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
  113. package/esm/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
  114. package/esm/MCScanSimpleAnchorsAdapter/index.js +1 -1
  115. package/esm/MashMapAdapter/MashMapAdapter.d.ts +1 -1
  116. package/esm/MashMapAdapter/MashMapAdapter.js +1 -2
  117. package/esm/MashMapAdapter/configSchema.d.ts +0 -12
  118. package/esm/MashMapAdapter/configSchema.js +1 -16
  119. package/esm/MashMapAdapter/index.d.ts +1 -1
  120. package/esm/MashMapAdapter/index.js +1 -1
  121. package/esm/PAFAdapter/PAFAdapter.d.ts +6 -5
  122. package/esm/PAFAdapter/PAFAdapter.js +6 -17
  123. package/esm/PAFAdapter/configSchema.d.ts +0 -12
  124. package/esm/PAFAdapter/configSchema.js +1 -16
  125. package/esm/PAFAdapter/index.d.ts +1 -1
  126. package/esm/PAFAdapter/index.js +1 -1
  127. package/esm/PAFAdapter/util.js +0 -35
  128. package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
  129. package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +6 -7
  130. package/esm/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
  131. package/esm/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
  132. package/esm/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
  133. package/esm/PairwiseIndexedPAFAdapter/index.js +1 -1
  134. package/esm/SyntenyFeature/index.js +0 -1
  135. package/esm/index.d.ts +1 -1
  136. package/esm/index.js +11 -25
  137. package/esm/syntenyTypes.d.ts +3 -0
  138. package/esm/syntenyTypes.js +22 -0
  139. package/esm/util.d.ts +4 -5
  140. package/esm/util.js +3 -5
  141. package/package.json +5 -5
@@ -1,9 +1,9 @@
1
- import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { openLocation } from '@jbrowse/core/util/io';
1
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
2
  import { doesIntersect2 } from '@jbrowse/core/util';
3
+ import { openLocation } from '@jbrowse/core/util/io';
4
4
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
5
5
  import SimpleFeature from '@jbrowse/core/util/simpleFeature';
6
- import { readFile, parseBed } from '../util';
6
+ import { parseBed, readFile } from '../util';
7
7
  class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
8
8
  async setup(opts) {
9
9
  if (!this.setupP) {
@@ -51,9 +51,6 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
51
51
  };
52
52
  }
53
53
  async hasDataForRefName() {
54
- // determining this properly is basically a call to getFeatures
55
- // so is not really that important, and has to be true or else
56
- // getFeatures is never called (BaseFeatureDataAdapter filters it out)
57
54
  return true;
58
55
  }
59
56
  getAssemblyNames() {
@@ -62,7 +59,6 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
62
59
  }
63
60
  async getRefNames(opts = {}) {
64
61
  var _a;
65
- // @ts-expect-error
66
62
  const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
67
63
  const { feats } = await this.setup(opts);
68
64
  const idx = this.getAssemblyNames().indexOf(r1);
@@ -86,8 +82,6 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
86
82
  getFeatures(region, opts = {}) {
87
83
  return ObservableCreate(async (observer) => {
88
84
  const { assemblyNames, feats } = await this.setup(opts);
89
- // The index of the assembly name in the region list corresponds to
90
- // the adapter in the subadapters list
91
85
  const index = assemblyNames.indexOf(region.assemblyName);
92
86
  if (index !== -1) {
93
87
  const flip = index === 0;
@@ -127,12 +121,7 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
127
121
  observer.complete();
128
122
  });
129
123
  }
130
- /**
131
- * called to provide a hint that data tied to a certain region
132
- * will not be needed for the foreseeable future and can be purged
133
- * from caches, etc
134
- */
135
- freeResources( /* { region } */) { }
124
+ freeResources() { }
136
125
  }
137
126
  MCScanAnchorsAdapter.capabilities = ['getFeatures', 'getRefNames'];
138
127
  export 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,12 +1,6 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- /**
3
- * #config MCScanSimpleAnchorsAdapter
4
- */
5
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ function x() { }
6
3
  const MCScanSimpleAnchorsAdapter = ConfigurationSchema('MCScanSimpleAnchorsAdapter', {
7
- /**
8
- * #slot
9
- */
10
4
  mcscanSimpleAnchorsLocation: {
11
5
  type: 'fileLocation',
12
6
  defaultValue: {
@@ -14,9 +8,6 @@ const MCScanSimpleAnchorsAdapter = ConfigurationSchema('MCScanSimpleAnchorsAdapt
14
8
  locationType: 'UriLocation',
15
9
  },
16
10
  },
17
- /**
18
- * #slot
19
- */
20
11
  bed1Location: {
21
12
  type: 'fileLocation',
22
13
  defaultValue: {
@@ -24,9 +15,6 @@ const MCScanSimpleAnchorsAdapter = ConfigurationSchema('MCScanSimpleAnchorsAdapt
24
15
  locationType: 'UriLocation',
25
16
  },
26
17
  },
27
- /**
28
- * #slot
29
- */
30
18
  bed2Location: {
31
19
  type: 'fileLocation',
32
20
  defaultValue: {
@@ -34,9 +22,6 @@ const MCScanSimpleAnchorsAdapter = ConfigurationSchema('MCScanSimpleAnchorsAdapt
34
22
  locationType: 'UriLocation',
35
23
  },
36
24
  },
37
- /**
38
- * #slot
39
- */
40
25
  assemblyNames: {
41
26
  type: 'stringArray',
42
27
  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;
@@ -6,7 +6,7 @@ export default function MCScanSimpleAnchorsAdapterF(pluginManager) {
6
6
  displayName: 'MCScan anchors.simple adapter',
7
7
  configSchema,
8
8
  adapterMetadata: {
9
- hiddenFromGUI: true,
9
+ category: 'Synteny adapters',
10
10
  },
11
11
  getAdapterClass: () => import('./MCScanSimpleAnchorsAdapter').then(r => r.default),
12
12
  }));
@@ -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;
@@ -1,5 +1,5 @@
1
- import { openLocation } from '@jbrowse/core/util/io';
2
1
  import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
2
+ import { openLocation } from '@jbrowse/core/util/io';
3
3
  import PAFAdapter from '../PAFAdapter/PAFAdapter';
4
4
  import { parseLineByLine } from '../util';
5
5
  export default class MashMapAdapter extends PAFAdapter {
@@ -12,7 +12,6 @@ export default class MashMapAdapter extends PAFAdapter {
12
12
  function parseMashMapLine(line) {
13
13
  const fields = line.split(' ');
14
14
  if (fields.length < 9) {
15
- // xref https://github.com/marbl/MashMap/issues/38
16
15
  throw new Error(`improperly formatted line: ${line}`);
17
16
  }
18
17
  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,36 +1,21 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- /**
3
- * #config MashMapAdapter
4
- */
5
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ function x() { }
6
3
  const MashMapAdapter = ConfigurationSchema('MashMapAdapter', {
7
- /**
8
- * #slot
9
- */
10
4
  assemblyNames: {
11
5
  type: 'stringArray',
12
6
  defaultValue: [],
13
7
  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',
14
8
  },
15
- /**
16
- * #slot
17
- */
18
9
  targetAssembly: {
19
10
  type: 'string',
20
11
  defaultValue: '',
21
12
  description: 'Alternative to assemblyNames array: the target assembly',
22
13
  },
23
- /**
24
- * #slot
25
- */
26
14
  queryAssembly: {
27
15
  type: 'string',
28
16
  defaultValue: '',
29
17
  description: 'Alternative to assemblyNames array: the query assembly',
30
18
  },
31
- /**
32
- * #slot
33
- */
34
19
  outLocation: {
35
20
  type: 'fileLocation',
36
21
  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;
@@ -6,7 +6,7 @@ export default function MashMapAdapterF(pluginManager) {
6
6
  displayName: 'MashMap adapter',
7
7
  configSchema,
8
8
  adapterMetadata: {
9
- hiddenFromGUI: true,
9
+ category: 'Synteny adapters',
10
10
  },
11
11
  getAdapterClass: () => import('./MashMapAdapter').then(r => r.default),
12
12
  }));
@@ -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
  }
@@ -1,13 +1,12 @@
1
- import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { doesIntersect2 } from '@jbrowse/core/util/range';
1
+ import { readConfObject } from '@jbrowse/core/configuration';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
3
4
  import { openLocation } from '@jbrowse/core/util/io';
5
+ import { doesIntersect2 } from '@jbrowse/core/util/range';
4
6
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
5
- import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
6
- import { readConfObject, } from '@jbrowse/core/configuration';
7
7
  import { MismatchParser } from '@jbrowse/plugin-alignments';
8
- // locals
9
8
  import SyntenyFeature from '../SyntenyFeature';
10
- import { flipCigar, swapIndelCigar, parsePAFLine, parseLineByLine, } from '../util';
9
+ import { flipCigar, parseLineByLine, parsePAFLine, swapIndelCigar, } from '../util';
11
10
  import { getWeightedMeans } from './util';
12
11
  const { parseCigar } = MismatchParser;
13
12
  class PAFAdapter extends BaseFeatureDataAdapter {
@@ -27,9 +26,6 @@ class PAFAdapter extends BaseFeatureDataAdapter {
27
26
  return parseLineByLine(buf, parsePAFLine);
28
27
  }
29
28
  async hasDataForRefName() {
30
- // determining this properly is basically a call to getFeatures so is not
31
- // really that important, and has to be true or else getFeatures is never
32
- // called (BaseAdapter filters it out)
33
29
  return true;
34
30
  }
35
31
  getAssemblyNames() {
@@ -43,7 +39,6 @@ class PAFAdapter extends BaseFeatureDataAdapter {
43
39
  }
44
40
  async getRefNames(opts = {}) {
45
41
  var _a;
46
- // @ts-expect-error
47
42
  const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
48
43
  const feats = await this.setup(opts);
49
44
  const idx = this.getAssemblyNames().indexOf(r1);
@@ -61,18 +56,12 @@ class PAFAdapter extends BaseFeatureDataAdapter {
61
56
  return ObservableCreate(async (observer) => {
62
57
  let pafRecords = await this.setup(opts);
63
58
  const { config } = opts;
64
- // note: this is not the adapter config, it is responding to a display
65
- // setting passed in via the opts parameter
66
59
  if (config && readConfObject(config, 'colorBy') === 'meanQueryIdentity') {
67
60
  pafRecords = getWeightedMeans(pafRecords);
68
61
  }
69
62
  const assemblyNames = this.getAssemblyNames();
70
- // The index of the assembly name in the query list corresponds to the
71
- // adapter in the subadapters list
72
63
  const { start: qstart, end: qend, refName: qref, assemblyName } = query;
73
64
  const index = assemblyNames.indexOf(assemblyName);
74
- // if the getFeatures::query is on the query assembly, flip orientation
75
- // of data
76
65
  const flip = index === 0;
77
66
  if (index === -1) {
78
67
  console.warn(`${assemblyName} not found in this adapter`);
@@ -140,7 +129,7 @@ class PAFAdapter extends BaseFeatureDataAdapter {
140
129
  observer.complete();
141
130
  });
142
131
  }
143
- freeResources( /* { query } */) { }
132
+ freeResources() { }
144
133
  }
145
134
  PAFAdapter.capabilities = ['getFeatures', 'getRefNames'];
146
135
  export 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,36 +1,21 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- /**
3
- * #config PAFAdapter
4
- */
5
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ function x() { }
6
3
  const PAFAdapter = ConfigurationSchema('PAFAdapter', {
7
- /**
8
- * #slot
9
- */
10
4
  assemblyNames: {
11
5
  type: 'stringArray',
12
6
  defaultValue: [],
13
7
  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',
14
8
  },
15
- /**
16
- * #slot
17
- */
18
9
  targetAssembly: {
19
10
  type: 'string',
20
11
  defaultValue: '',
21
12
  description: 'Alternative to assemblyNames: the target assembly name',
22
13
  },
23
- /**
24
- * #slot
25
- */
26
14
  queryAssembly: {
27
15
  type: 'string',
28
16
  defaultValue: '',
29
17
  description: 'Alternative to assemblyNames: the query assembly name',
30
18
  },
31
- /**
32
- * #slot
33
- */
34
19
  pafLocation: {
35
20
  type: 'fileLocation',
36
21
  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;
@@ -6,7 +6,7 @@ export default function PAFAdapterF(pluginManager) {
6
6
  displayName: 'PAF adapter',
7
7
  configSchema,
8
8
  adapterMetadata: {
9
- hiddenFromGUI: true,
9
+ category: 'Synteny adapters',
10
10
  },
11
11
  getAdapterClass: () => import('./PAFAdapter').then(r => r.default),
12
12
  }));
@@ -1,38 +1,4 @@
1
1
  import { zip } from '../util';
2
- // based on "weighted mean" method from https://github.com/tpoorten/dotPlotly
3
- // License reproduced here
4
- //
5
- // MIT License
6
- // Copyright (c) 2017 Tom Poorten
7
- // Permission is hereby granted, free of charge, to any person obtaining a copy
8
- // of this software and associated documentation files (the "Software"), to deal
9
- // in the Software without restriction, including without limitation the rights
10
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- // copies of the Software, and to permit persons to whom the Software is
12
- // furnished to do so, subject to the following conditions:
13
- // The above copyright notice and this permission notice shall be included in all
14
- // copies or substantial portions of the Software.
15
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- // SOFTWARE.
22
- //
23
- // Notes: in the weighted mean longer alignments factor in more heavily of all
24
- // the fragments of a query vs the reference that it mapped to
25
- //
26
- // this uses a combined key query+'-'+ref to iteratively map all the alignments
27
- // that match a particular ref from a particular query (so 1d array of what
28
- // could be a 2d map)
29
- //
30
- // the result is a single number that says e.g. chr5 from human mapped to chr5
31
- // on mouse with 0.8 quality, and that0.8 is then attached to all the pieces of
32
- // chr5 on human that mapped to chr5 on mouse. if chr5 on human also more
33
- // weakly mapped to chr6 on mouse, then it would have another value e.g. 0.6.
34
- // this can show strong and weak levels of synteny, especially in polyploidy
35
- // situations
36
2
  export function getWeightedMeans(ret) {
37
3
  const scoreMap = {};
38
4
  for (const entry of ret) {
@@ -67,7 +33,6 @@ export function getWeightedMeans(ret) {
67
33
  }
68
34
  return ret;
69
35
  }
70
- // https://gist.github.com/stekhn/a12ed417e91f90ecec14bcfa4c2ae16a
71
36
  function weightedMean(tuples) {
72
37
  const [valueSum, weightSum] = tuples.reduce(([valueSum, weightSum], [value, weight]) => [
73
38
  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
  }
@@ -1,10 +1,9 @@
1
- import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { ObservableCreate } from '@jbrowse/core/util/rxjs';
3
- import { openLocation } from '@jbrowse/core/util/io';
4
1
  import { TabixIndexedFile } from '@gmod/tabix';
5
- // locals
6
- import { parsePAFLine } from '../util';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import { openLocation } from '@jbrowse/core/util/io';
4
+ import { ObservableCreate } from '@jbrowse/core/util/rxjs';
7
5
  import SyntenyFeature from '../SyntenyFeature';
6
+ import { parsePAFLine } from '../util';
8
7
  class PAFAdapter extends BaseFeatureDataAdapter {
9
8
  constructor(config, getSubAdapter, pluginManager) {
10
9
  super(config, getSubAdapter, pluginManager);
@@ -93,12 +92,12 @@ class PAFAdapter extends BaseFeatureDataAdapter {
93
92
  },
94
93
  }));
95
94
  },
96
- signal: opts.signal,
95
+ stopToken: opts.stopToken,
97
96
  });
98
97
  observer.complete();
99
98
  });
100
99
  }
101
- freeResources( /* { query } */) { }
100
+ freeResources() { }
102
101
  }
103
102
  PAFAdapter.capabilities = ['getFeatures', 'getRefNames'];
104
103
  export default PAFAdapter;
@@ -1,31 +1,19 @@
1
1
  declare const PairwiseIndexedPAFAdapter: 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
  pifGzLocation: {
30
18
  type: string;
31
19
  description: string;
@@ -34,21 +22,12 @@ declare const PairwiseIndexedPAFAdapter: import("@jbrowse/core/configuration/con
34
22
  locationType: string;
35
23
  };
36
24
  };
37
- /**
38
- * #slot
39
- */
40
25
  index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
41
- /**
42
- * #slot index.indexType
43
- */
44
26
  indexType: {
45
27
  model: import("mobx-state-tree").ISimpleType<string>;
46
28
  type: string;
47
29
  defaultValue: string;
48
30
  };
49
- /**
50
- * #slot index.location
51
- */
52
31
  location: {
53
32
  type: string;
54
33
  defaultValue: {
@@ -1,37 +1,22 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import { types } from 'mobx-state-tree';
3
- /**
4
- * #config PairwiseIndexedPAFAdapter
5
- */
6
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ function x() { }
7
4
  const PairwiseIndexedPAFAdapter = ConfigurationSchema('PairwiseIndexedPAFAdapter', {
8
- /**
9
- * #slot
10
- */
11
5
  assemblyNames: {
12
6
  type: 'stringArray',
13
7
  defaultValue: [],
14
8
  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',
15
9
  },
16
- /**
17
- * #slot
18
- */
19
10
  targetAssembly: {
20
11
  type: 'string',
21
12
  defaultValue: '',
22
13
  description: 'Alternative to assemblyNames: the target assembly name',
23
14
  },
24
- /**
25
- * #slot
26
- */
27
15
  queryAssembly: {
28
16
  type: 'string',
29
17
  defaultValue: '',
30
18
  description: 'Alternative to assemblyNames: the query assembly name',
31
19
  },
32
- /**
33
- * #slot
34
- */
35
20
  pifGzLocation: {
36
21
  type: 'fileLocation',
37
22
  description: 'location of pairwise tabix indexed PAF (pif)',
@@ -40,21 +25,12 @@ const PairwiseIndexedPAFAdapter = ConfigurationSchema('PairwiseIndexedPAFAdapter
40
25
  locationType: 'UriLocation',
41
26
  },
42
27
  },
43
- /**
44
- * #slot
45
- */
46
28
  index: ConfigurationSchema('TabixIndex', {
47
- /**
48
- * #slot index.indexType
49
- */
50
29
  indexType: {
51
30
  model: types.enumeration('IndexType', ['TBI', 'CSI']),
52
31
  type: 'stringEnum',
53
32
  defaultValue: 'TBI',
54
33
  },
55
- /**
56
- * #slot index.location
57
- */
58
34
  location: {
59
35
  type: 'fileLocation',
60
36
  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 PairwiseIndexedPAFAdapterF(pluginManager: PluginManager): void;
@@ -6,7 +6,7 @@ export default function PairwiseIndexedPAFAdapterF(pluginManager) {
6
6
  displayName: 'Pairwise indexed PAF adapter',
7
7
  configSchema,
8
8
  adapterMetadata: {
9
- hiddenFromGUI: true,
9
+ category: 'Synteny adapters',
10
10
  },
11
11
  getAdapterClass: () => import('./PairwiseIndexedPAFAdapter').then(r => r.default),
12
12
  }));
@@ -1,6 +1,5 @@
1
1
  import { SimpleFeature } from '@jbrowse/core/util';
2
2
  import { MismatchParser } from '@jbrowse/plugin-alignments';
3
- // locals
4
3
  const { getMismatches } = MismatchParser;
5
4
  export default class SyntenyFeature extends SimpleFeature {
6
5
  get(arg) {