@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,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;
@@ -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) {
package/esm/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PluginManager from '@jbrowse/core/PluginManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class ComparativeAdaptersPlugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
package/esm/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PAFAdapterF from './PAFAdapter';
3
- import PairwiseIndexedPAFAdapterF from './PairwiseIndexedPAFAdapter';
2
+ import { getFileName } from '@jbrowse/core/util/tracks';
3
+ import BlastTabularAdapter from './BlastTabularAdapter';
4
+ import ChainAdapterF from './ChainAdapter';
5
+ import DeltaAdapterF from './DeltaAdapter';
4
6
  import MCScanAnchorsAdapterF from './MCScanAnchorsAdapter';
5
7
  import MCScanSimpleAnchorsAdapterF from './MCScanSimpleAnchorsAdapter';
6
8
  import MashMapAdapterF from './MashMapAdapter';
7
- import DeltaAdapterF from './DeltaAdapter';
8
- import ChainAdapterF from './ChainAdapter';
9
- import { getFileName, } from '@jbrowse/core/util/tracks';
9
+ import PAFAdapterF from './PAFAdapter';
10
+ import PairwiseIndexedPAFAdapterF from './PairwiseIndexedPAFAdapter';
10
11
  export default class ComparativeAdaptersPlugin extends Plugin {
11
12
  constructor() {
12
13
  super(...arguments);
@@ -20,6 +21,7 @@ export default class ComparativeAdaptersPlugin extends Plugin {
20
21
  MCScanAnchorsAdapterF(pluginManager);
21
22
  MCScanSimpleAnchorsAdapterF(pluginManager);
22
23
  MashMapAdapterF(pluginManager);
24
+ BlastTabularAdapter(pluginManager);
23
25
  pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
24
26
  return (file, index, adapterHint) => {
25
27
  const regexGuess = /\.paf/i;
package/esm/util.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { GenericFilehandle } from 'generic-filehandle';
1
+ import type { PAFRecord } from './PAFAdapter/util';
2
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
3
3
  import type { Buffer } from 'buffer';
4
- import { PAFRecord } from './PAFAdapter/util';
4
+ import type { GenericFilehandle } from 'generic-filehandle';
5
5
  export declare function parseBed(text: string): Map<string | undefined, {
6
6
  refName: string | undefined;
7
7
  start: number;
@@ -12,7 +12,7 @@ export declare function parseBed(text: string): Map<string | undefined, {
12
12
  }>;
13
13
  export declare function readFile(file: GenericFilehandle, opts?: BaseOptions): Promise<string>;
14
14
  export declare function zip(a: number[], b: number[]): [number, number][];
15
- export declare function parseLineByLine(buffer: Buffer, cb: (line: string) => PAFRecord): PAFRecord[];
15
+ export declare function parseLineByLine<T>(buffer: Buffer, cb: (line: string) => T | undefined): T[];
16
16
  export declare function parsePAFLine(line: string): PAFRecord;
17
17
  export declare function flipCigar(cigar: string[]): (string | undefined)[];
18
18
  export declare function swapIndelCigar(cigar: string): string;
package/esm/util.js CHANGED
@@ -1,5 +1,4 @@
1
- import { unzip } from '@gmod/bgzf-filehandle';
2
- import { isGzip } from '@jbrowse/core/util';
1
+ import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
3
2
  export function parseBed(text) {
4
3
  return new Map(text
5
4
  .split(/\n|\r\n|\r/)
@@ -20,25 +19,29 @@ export function parseBed(text) {
20
19
  }));
21
20
  }
22
21
  export async function readFile(file, opts) {
23
- const buffer = (await file.readFile(opts));
24
- return new TextDecoder('utf8', { fatal: true }).decode(isGzip(buffer) ? await unzip(buffer) : buffer);
22
+ const buf = await fetchAndMaybeUnzip(file, opts);
23
+ const decoder = new TextDecoder('utf8');
24
+ return decoder.decode(buf);
25
25
  }
26
26
  export function zip(a, b) {
27
27
  return a.map((e, i) => [e, b[i]]);
28
28
  }
29
- const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
30
29
  export function parseLineByLine(buffer, cb) {
31
30
  let blockStart = 0;
32
31
  const entries = [];
32
+ const decoder = new TextDecoder('utf8');
33
33
  while (blockStart < buffer.length) {
34
34
  const n = buffer.indexOf('\n', blockStart);
35
35
  if (n === -1) {
36
36
  break;
37
37
  }
38
38
  const b = buffer.subarray(blockStart, n);
39
- const line = ((decoder === null || decoder === void 0 ? void 0 : decoder.decode(b)) || b.toString()).trim();
39
+ const line = decoder.decode(b).trim();
40
40
  if (line) {
41
- entries.push(cb(line));
41
+ const entry = cb(line);
42
+ if (entry) {
43
+ entries.push(entry);
44
+ }
42
45
  }
43
46
  blockStart = n + 1;
44
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-comparative-adapters",
3
- "version": "2.16.1",
3
+ "version": "2.18.0",
4
4
  "description": "JBrowse 2 comparative adapters",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "c6a658d2344989895543f0456b1cf7dd3b937769"
61
+ "gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
62
62
  }