@jbrowse/plugin-comparative-adapters 3.7.0 → 4.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 (115) hide show
  1. package/esm/BlastTabularAdapter/BlastTabularAdapter.js +8 -7
  2. package/esm/BlastTabularAdapter/configSchema.d.ts +2 -2
  3. package/esm/BlastTabularAdapter/index.js +2 -2
  4. package/esm/ChainAdapter/ChainAdapter.d.ts +2 -16
  5. package/esm/ChainAdapter/ChainAdapter.js +4 -3
  6. package/esm/ChainAdapter/configSchema.d.ts +2 -2
  7. package/esm/ChainAdapter/index.js +2 -2
  8. package/esm/ChainAdapter/util.js +2 -2
  9. package/esm/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +3 -4
  10. package/esm/ComparativeAddTrackComponent/index.js +2 -2
  11. package/esm/DeltaAdapter/DeltaAdapter.d.ts +2 -11
  12. package/esm/DeltaAdapter/DeltaAdapter.js +4 -3
  13. package/esm/DeltaAdapter/configSchema.d.ts +2 -2
  14. package/esm/DeltaAdapter/index.js +2 -2
  15. package/esm/DeltaAdapter/util.js +1 -1
  16. package/esm/GuessAdapter/index.js +1 -1
  17. package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +1 -1
  18. package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.js +3 -4
  19. package/esm/MCScanAddTrackComponent/index.js +2 -2
  20. package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +5 -6
  21. package/esm/MCScanAnchorsAdapter/configSchema.d.ts +2 -2
  22. package/esm/MCScanAnchorsAdapter/index.js +2 -2
  23. package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +5 -6
  24. package/esm/MCScanSimpleAnchorsAdapter/configSchema.d.ts +2 -2
  25. package/esm/MCScanSimpleAnchorsAdapter/index.js +2 -2
  26. package/esm/MashMapAdapter/MashMapAdapter.d.ts +2 -13
  27. package/esm/MashMapAdapter/MashMapAdapter.js +4 -3
  28. package/esm/MashMapAdapter/configSchema.d.ts +2 -2
  29. package/esm/MashMapAdapter/index.js +2 -2
  30. package/esm/PAFAdapter/PAFAdapter.d.ts +1 -1
  31. package/esm/PAFAdapter/PAFAdapter.js +10 -11
  32. package/esm/PAFAdapter/configSchema.d.ts +2 -2
  33. package/esm/PAFAdapter/index.js +2 -2
  34. package/esm/PAFAdapter/util.js +22 -32
  35. package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +13 -12
  36. package/esm/PairwiseIndexedPAFAdapter/configSchema.d.ts +5 -5
  37. package/esm/PairwiseIndexedPAFAdapter/configSchema.js +1 -1
  38. package/esm/PairwiseIndexedPAFAdapter/index.js +2 -2
  39. package/esm/SyntenyFeature/index.js +3 -4
  40. package/esm/index.js +12 -15
  41. package/esm/util.d.ts +1 -1
  42. package/esm/util.js +1 -1
  43. package/package.json +27 -34
  44. package/dist/BlastTabularAdapter/BlastTabularAdapter.d.ts +0 -65
  45. package/dist/BlastTabularAdapter/BlastTabularAdapter.js +0 -206
  46. package/dist/BlastTabularAdapter/configSchema.d.ts +0 -30
  47. package/dist/BlastTabularAdapter/configSchema.js +0 -34
  48. package/dist/BlastTabularAdapter/index.d.ts +0 -2
  49. package/dist/BlastTabularAdapter/index.js +0 -52
  50. package/dist/ChainAdapter/ChainAdapter.d.ts +0 -19
  51. package/dist/ChainAdapter/ChainAdapter.js +0 -15
  52. package/dist/ChainAdapter/configSchema.d.ts +0 -25
  53. package/dist/ChainAdapter/configSchema.js +0 -39
  54. package/dist/ChainAdapter/index.d.ts +0 -2
  55. package/dist/ChainAdapter/index.js +0 -52
  56. package/dist/ChainAdapter/util.d.ts +0 -16
  57. package/dist/ChainAdapter/util.js +0 -82
  58. package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.d.ts +0 -2
  59. package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +0 -31
  60. package/dist/ComparativeAddTrackComponent/index.d.ts +0 -2
  61. package/dist/ComparativeAddTrackComponent/index.js +0 -46
  62. package/dist/DeltaAdapter/DeltaAdapter.d.ts +0 -14
  63. package/dist/DeltaAdapter/DeltaAdapter.js +0 -15
  64. package/dist/DeltaAdapter/configSchema.d.ts +0 -25
  65. package/dist/DeltaAdapter/configSchema.js +0 -42
  66. package/dist/DeltaAdapter/index.d.ts +0 -2
  67. package/dist/DeltaAdapter/index.js +0 -52
  68. package/dist/DeltaAdapter/util.d.ts +0 -11
  69. package/dist/DeltaAdapter/util.js +0 -111
  70. package/dist/GuessAdapter/index.d.ts +0 -2
  71. package/dist/GuessAdapter/index.js +0 -74
  72. package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +0 -2
  73. package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.js +0 -39
  74. package/dist/MCScanAddTrackComponent/index.d.ts +0 -2
  75. package/dist/MCScanAddTrackComponent/index.js +0 -46
  76. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +0 -29
  77. package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +0 -98
  78. package/dist/MCScanAnchorsAdapter/configSchema.d.ts +0 -28
  79. package/dist/MCScanAnchorsAdapter/configSchema.js +0 -53
  80. package/dist/MCScanAnchorsAdapter/index.d.ts +0 -2
  81. package/dist/MCScanAnchorsAdapter/index.js +0 -52
  82. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +0 -37
  83. package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +0 -132
  84. package/dist/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -28
  85. package/dist/MCScanSimpleAnchorsAdapter/configSchema.js +0 -53
  86. package/dist/MCScanSimpleAnchorsAdapter/index.d.ts +0 -2
  87. package/dist/MCScanSimpleAnchorsAdapter/index.js +0 -52
  88. package/dist/MashMapAdapter/MashMapAdapter.d.ts +0 -16
  89. package/dist/MashMapAdapter/MashMapAdapter.js +0 -39
  90. package/dist/MashMapAdapter/configSchema.d.ts +0 -25
  91. package/dist/MashMapAdapter/configSchema.js +0 -42
  92. package/dist/MashMapAdapter/index.d.ts +0 -2
  93. package/dist/MashMapAdapter/index.js +0 -52
  94. package/dist/PAFAdapter/PAFAdapter.d.ts +0 -20
  95. package/dist/PAFAdapter/PAFAdapter.js +0 -137
  96. package/dist/PAFAdapter/configSchema.d.ts +0 -25
  97. package/dist/PAFAdapter/configSchema.js +0 -42
  98. package/dist/PAFAdapter/index.d.ts +0 -2
  99. package/dist/PAFAdapter/index.js +0 -52
  100. package/dist/PAFAdapter/util.d.ts +0 -17
  101. package/dist/PAFAdapter/util.js +0 -45
  102. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +0 -24
  103. package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +0 -109
  104. package/dist/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -40
  105. package/dist/PairwiseIndexedPAFAdapter/configSchema.js +0 -64
  106. package/dist/PairwiseIndexedPAFAdapter/index.d.ts +0 -2
  107. package/dist/PairwiseIndexedPAFAdapter/index.js +0 -52
  108. package/dist/SyntenyFeature/index.d.ts +0 -4
  109. package/dist/SyntenyFeature/index.js +0 -14
  110. package/dist/index.d.ts +0 -6
  111. package/dist/index.js +0 -37
  112. package/dist/syntenyTypes.d.ts +0 -3
  113. package/dist/syntenyTypes.js +0 -25
  114. package/dist/util.d.ts +0 -16
  115. package/dist/util.js +0 -79
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const configuration_1 = require("@jbrowse/core/configuration");
4
- function x() { }
5
- const PAFAdapter = (0, configuration_1.ConfigurationSchema)('PAFAdapter', {
6
- assemblyNames: {
7
- type: 'stringArray',
8
- defaultValue: [],
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',
10
- },
11
- targetAssembly: {
12
- type: 'string',
13
- defaultValue: '',
14
- description: 'Alternative to assemblyNames: the target assembly name',
15
- },
16
- queryAssembly: {
17
- type: 'string',
18
- defaultValue: '',
19
- description: 'Alternative to assemblyNames: the query assembly name',
20
- },
21
- pafLocation: {
22
- type: 'fileLocation',
23
- defaultValue: {
24
- uri: '/path/to/file.paf',
25
- locationType: 'UriLocation',
26
- },
27
- },
28
- }, {
29
- explicitlyTyped: true,
30
- preProcessSnapshot: snap => {
31
- return snap.uri
32
- ? {
33
- ...snap,
34
- pafLocation: {
35
- uri: snap.uri,
36
- baseUri: snap.baseUri,
37
- },
38
- }
39
- : snap;
40
- },
41
- });
42
- exports.default = PAFAdapter;
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function PAFAdapterF(pluginManager: PluginManager): void;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.default = PAFAdapterF;
40
- const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
41
- const configSchema_1 = __importDefault(require("./configSchema"));
42
- function PAFAdapterF(pluginManager) {
43
- pluginManager.addAdapterType(() => new AdapterType_1.default({
44
- name: 'PAFAdapter',
45
- displayName: 'PAF adapter',
46
- configSchema: configSchema_1.default,
47
- adapterMetadata: {
48
- category: 'Synteny adapters',
49
- },
50
- getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./PAFAdapter'))).then(r => r.default),
51
- }));
52
- }
@@ -1,17 +0,0 @@
1
- export interface PAFRecord {
2
- qname: string;
3
- qstart: number;
4
- qend: number;
5
- tname: string;
6
- tstart: number;
7
- tend: number;
8
- strand: number;
9
- extra: {
10
- cg?: string;
11
- blockLen?: number;
12
- mappingQual?: number;
13
- numMatches?: number;
14
- meanScore?: number;
15
- };
16
- }
17
- export declare function getWeightedMeans(ret: PAFRecord[]): PAFRecord[];
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWeightedMeans = getWeightedMeans;
4
- const util_1 = require("../util");
5
- function getWeightedMeans(ret) {
6
- const scoreMap = {};
7
- for (const entry of ret) {
8
- const query = entry.qname;
9
- const target = entry.tname;
10
- const key = `${query}-${target}`;
11
- if (!scoreMap[key]) {
12
- scoreMap[key] = { quals: [], len: [] };
13
- }
14
- scoreMap[key].quals.push(entry.extra.mappingQual || 1);
15
- scoreMap[key].len.push(entry.extra.blockLen || 1);
16
- }
17
- const meanScoreMap = Object.fromEntries(Object.entries(scoreMap).map(([key, val]) => {
18
- const vals = (0, util_1.zip)(val.quals, val.len);
19
- return [key, weightedMean(vals)];
20
- }));
21
- for (const entry of ret) {
22
- const query = entry.qname;
23
- const target = entry.tname;
24
- const key = `${query}-${target}`;
25
- entry.extra.meanScore = meanScoreMap[key];
26
- }
27
- let min = 10000;
28
- let max = 0;
29
- for (const entry of ret) {
30
- min = Math.min(entry.extra.meanScore || 0, min);
31
- max = Math.max(entry.extra.meanScore || 0, max);
32
- }
33
- for (const entry of ret) {
34
- const b = entry.extra.meanScore || 0;
35
- entry.extra.meanScore = (b - min) / (max - min);
36
- }
37
- return ret;
38
- }
39
- function weightedMean(tuples) {
40
- const [valueSum, weightSum] = tuples.reduce(([valueSum, weightSum], [value, weight]) => [
41
- valueSum + value * weight,
42
- weightSum + weight,
43
- ], [0, 0]);
44
- return valueSum / weightSum;
45
- }
@@ -1,24 +0,0 @@
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';
9
- interface PAFOptions extends BaseOptions {
10
- config?: AnyConfigurationModel;
11
- }
12
- export default class PAFAdapter extends BaseFeatureDataAdapter {
13
- static capabilities: string[];
14
- protected pif: TabixIndexedFile;
15
- constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
16
- getHeader(opts?: BaseOptions): Promise<string>;
17
- getAssemblyNames(): string[];
18
- hasDataForRefName(): Promise<boolean>;
19
- getRefNames(opts?: BaseOptions & {
20
- regions?: Region[];
21
- }): Promise<string[]>;
22
- getFeatures(query: Region, opts?: PAFOptions): import("rxjs").Observable<Feature>;
23
- }
24
- export {};
@@ -1,109 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const tabix_1 = require("@gmod/tabix");
7
- const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
8
- const util_1 = require("@jbrowse/core/util");
9
- const io_1 = require("@jbrowse/core/util/io");
10
- const rxjs_1 = require("@jbrowse/core/util/rxjs");
11
- const SyntenyFeature_1 = __importDefault(require("../SyntenyFeature"));
12
- const util_2 = require("../util");
13
- class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
14
- constructor(config, getSubAdapter, pluginManager) {
15
- super(config, getSubAdapter, pluginManager);
16
- const pifGzLoc = this.getConf('pifGzLocation');
17
- const type = this.getConf(['index', 'indexType']);
18
- const loc = this.getConf(['index', 'location']);
19
- const pm = this.pluginManager;
20
- this.pif = new tabix_1.TabixIndexedFile({
21
- filehandle: (0, io_1.openLocation)(pifGzLoc, pm),
22
- csiFilehandle: type === 'CSI' ? (0, io_1.openLocation)(loc, pm) : undefined,
23
- tbiFilehandle: type !== 'CSI' ? (0, io_1.openLocation)(loc, pm) : undefined,
24
- chunkCacheSize: 50 * 2 ** 20,
25
- });
26
- }
27
- async getHeader(opts) {
28
- const { statusCallback = () => { } } = opts || {};
29
- return (0, util_1.updateStatus)('Downloading header', statusCallback, () => this.pif.getHeader());
30
- }
31
- getAssemblyNames() {
32
- const assemblyNames = this.getConf('assemblyNames');
33
- return assemblyNames.length === 0
34
- ? [
35
- this.getConf('queryAssembly'),
36
- this.getConf('targetAssembly'),
37
- ]
38
- : assemblyNames;
39
- }
40
- async hasDataForRefName() {
41
- return true;
42
- }
43
- async getRefNames(opts = {}) {
44
- var _a, _b;
45
- const r1 = (_b = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.assemblyName;
46
- if (!r1) {
47
- throw new Error('no assembly name provided');
48
- }
49
- const idx = this.getAssemblyNames().indexOf(r1);
50
- const names = await this.pif.getReferenceSequenceNames(opts);
51
- if (idx === 0) {
52
- return names.filter(n => n.startsWith('q')).map(n => n.slice(1));
53
- }
54
- else if (idx === 1) {
55
- return names.filter(n => n.startsWith('t')).map(n => n.slice(1));
56
- }
57
- else {
58
- return [];
59
- }
60
- }
61
- getFeatures(query, opts = {}) {
62
- const { statusCallback = () => { } } = opts;
63
- return (0, rxjs_1.ObservableCreate)(async (observer) => {
64
- const { assemblyName } = query;
65
- const assemblyNames = this.getAssemblyNames();
66
- const index = assemblyNames.indexOf(assemblyName);
67
- const flip = index === 0;
68
- const letter = flip ? 'q' : 't';
69
- await (0, util_1.updateStatus)('Downloading features', statusCallback, () => this.pif.getLines(letter + query.refName, query.start, query.end, {
70
- lineCallback: (line, fileOffset) => {
71
- const r = (0, util_2.parsePAFLine)(line);
72
- const refName = r.qname.slice(1);
73
- const start = r.qstart;
74
- const end = r.qend;
75
- const mateName = r.tname;
76
- const mateStart = r.tstart;
77
- const mateEnd = r.tend;
78
- const { extra, strand } = r;
79
- const { numMatches = 0, blockLen = 1, cg, ...rest } = extra;
80
- observer.next(new SyntenyFeature_1.default({
81
- uniqueId: fileOffset + assemblyName,
82
- assemblyName,
83
- start,
84
- end,
85
- type: 'match',
86
- refName,
87
- strand,
88
- ...rest,
89
- CIGAR: extra.cg,
90
- syntenyId: fileOffset,
91
- identity: numMatches / blockLen,
92
- numMatches,
93
- blockLen,
94
- mate: {
95
- start: mateStart,
96
- end: mateEnd,
97
- refName: mateName,
98
- assemblyName: assemblyNames[+flip],
99
- },
100
- }));
101
- },
102
- stopToken: opts.stopToken,
103
- }));
104
- observer.complete();
105
- });
106
- }
107
- }
108
- PAFAdapter.capabilities = ['getFeatures', 'getRefNames'];
109
- exports.default = PAFAdapter;
@@ -1,40 +0,0 @@
1
- declare const PairwiseIndexedPAFAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- assemblyNames: {
3
- type: string;
4
- defaultValue: never[];
5
- description: string;
6
- };
7
- targetAssembly: {
8
- type: string;
9
- defaultValue: string;
10
- description: string;
11
- };
12
- queryAssembly: {
13
- type: string;
14
- defaultValue: string;
15
- description: string;
16
- };
17
- pifGzLocation: {
18
- type: string;
19
- description: string;
20
- defaultValue: {
21
- uri: string;
22
- locationType: string;
23
- };
24
- };
25
- index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
26
- indexType: {
27
- model: import("mobx-state-tree").ISimpleType<string>;
28
- type: string;
29
- defaultValue: string;
30
- };
31
- location: {
32
- type: string;
33
- defaultValue: {
34
- uri: string;
35
- locationType: string;
36
- };
37
- };
38
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
39
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
40
- export default PairwiseIndexedPAFAdapter;
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const configuration_1 = require("@jbrowse/core/configuration");
4
- const mobx_state_tree_1 = require("mobx-state-tree");
5
- function x() { }
6
- const PairwiseIndexedPAFAdapter = (0, configuration_1.ConfigurationSchema)('PairwiseIndexedPAFAdapter', {
7
- assemblyNames: {
8
- type: 'stringArray',
9
- defaultValue: [],
10
- 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',
11
- },
12
- targetAssembly: {
13
- type: 'string',
14
- defaultValue: '',
15
- description: 'Alternative to assemblyNames: the target assembly name',
16
- },
17
- queryAssembly: {
18
- type: 'string',
19
- defaultValue: '',
20
- description: 'Alternative to assemblyNames: the query assembly name',
21
- },
22
- pifGzLocation: {
23
- type: 'fileLocation',
24
- description: 'location of pairwise tabix indexed PAF (pif)',
25
- defaultValue: {
26
- uri: '/path/to/data/file.pif.gz',
27
- locationType: 'UriLocation',
28
- },
29
- },
30
- index: (0, configuration_1.ConfigurationSchema)('TabixIndex', {
31
- indexType: {
32
- model: mobx_state_tree_1.types.enumeration('IndexType', ['TBI', 'CSI']),
33
- type: 'stringEnum',
34
- defaultValue: 'TBI',
35
- },
36
- location: {
37
- type: 'fileLocation',
38
- defaultValue: {
39
- uri: '/path/to/my.paf.gz.tbi',
40
- locationType: 'UriLocation',
41
- },
42
- },
43
- }),
44
- }, {
45
- explicitlyTyped: true,
46
- preProcessSnapshot: snap => {
47
- return snap.uri
48
- ? {
49
- ...snap,
50
- pifGzLocation: {
51
- uri: snap.uri,
52
- baseUri: snap.baseUri,
53
- },
54
- index: {
55
- location: {
56
- uri: `${snap.uri}.tbi`,
57
- baseUri: snap.baseUri,
58
- },
59
- },
60
- }
61
- : snap;
62
- },
63
- });
64
- exports.default = PairwiseIndexedPAFAdapter;
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function PairwiseIndexedPAFAdapterF(pluginManager: PluginManager): void;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.default = PairwiseIndexedPAFAdapterF;
40
- const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
41
- const configSchema_1 = __importDefault(require("./configSchema"));
42
- function PairwiseIndexedPAFAdapterF(pluginManager) {
43
- pluginManager.addAdapterType(() => new AdapterType_1.default({
44
- name: 'PairwiseIndexedPAFAdapter',
45
- displayName: 'Pairwise indexed PAF adapter',
46
- configSchema: configSchema_1.default,
47
- adapterMetadata: {
48
- category: 'Synteny adapters',
49
- },
50
- getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./PairwiseIndexedPAFAdapter'))).then(r => r.default),
51
- }));
52
- }
@@ -1,4 +0,0 @@
1
- import { SimpleFeature } from '@jbrowse/core/util';
2
- export default class SyntenyFeature extends SimpleFeature {
3
- get(arg: string): any;
4
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const util_1 = require("@jbrowse/core/util");
4
- const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
5
- const { getMismatches } = plugin_alignments_1.MismatchParser;
6
- class SyntenyFeature extends util_1.SimpleFeature {
7
- get(arg) {
8
- if (arg === 'mismatches') {
9
- return getMismatches(this.get('CIGAR'));
10
- }
11
- return super.get(arg);
12
- }
13
- }
14
- exports.default = SyntenyFeature;
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import Plugin from '@jbrowse/core/Plugin';
2
- import type PluginManager from '@jbrowse/core/PluginManager';
3
- export default class ComparativeAdaptersPlugin extends Plugin {
4
- name: string;
5
- install(pluginManager: PluginManager): void;
6
- }
package/dist/index.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
7
- const BlastTabularAdapter_1 = __importDefault(require("./BlastTabularAdapter"));
8
- const ChainAdapter_1 = __importDefault(require("./ChainAdapter"));
9
- const ComparativeAddTrackComponent_1 = __importDefault(require("./ComparativeAddTrackComponent"));
10
- const DeltaAdapter_1 = __importDefault(require("./DeltaAdapter"));
11
- const GuessAdapter_1 = __importDefault(require("./GuessAdapter"));
12
- const MCScanAddTrackComponent_1 = __importDefault(require("./MCScanAddTrackComponent"));
13
- const MCScanAnchorsAdapter_1 = __importDefault(require("./MCScanAnchorsAdapter"));
14
- const MCScanSimpleAnchorsAdapter_1 = __importDefault(require("./MCScanSimpleAnchorsAdapter"));
15
- const MashMapAdapter_1 = __importDefault(require("./MashMapAdapter"));
16
- const PAFAdapter_1 = __importDefault(require("./PAFAdapter"));
17
- const PairwiseIndexedPAFAdapter_1 = __importDefault(require("./PairwiseIndexedPAFAdapter"));
18
- class ComparativeAdaptersPlugin extends Plugin_1.default {
19
- constructor() {
20
- super(...arguments);
21
- this.name = 'ComparativeAdaptersPlugin';
22
- }
23
- install(pluginManager) {
24
- (0, PAFAdapter_1.default)(pluginManager);
25
- (0, PairwiseIndexedPAFAdapter_1.default)(pluginManager);
26
- (0, DeltaAdapter_1.default)(pluginManager);
27
- (0, ChainAdapter_1.default)(pluginManager);
28
- (0, MCScanAnchorsAdapter_1.default)(pluginManager);
29
- (0, MCScanSimpleAnchorsAdapter_1.default)(pluginManager);
30
- (0, MashMapAdapter_1.default)(pluginManager);
31
- (0, BlastTabularAdapter_1.default)(pluginManager);
32
- (0, ComparativeAddTrackComponent_1.default)(pluginManager);
33
- (0, MCScanAddTrackComponent_1.default)(pluginManager);
34
- (0, GuessAdapter_1.default)(pluginManager);
35
- }
36
- }
37
- exports.default = ComparativeAdaptersPlugin;
@@ -1,3 +0,0 @@
1
- export declare const syntenyTypes: string[];
2
- export declare const pairwiseTypes: string[];
3
- export declare const mcscanTypes: string[];
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mcscanTypes = exports.pairwiseTypes = exports.syntenyTypes = void 0;
4
- exports.syntenyTypes = [
5
- 'PAFAdapter',
6
- 'ChainAdapter',
7
- 'DeltaAdapter',
8
- 'BlastTabularAdapter',
9
- 'MashMapAdapter',
10
- 'MCScanAnchorsAdapter',
11
- 'MCScanSimpleAnchorsAdapter',
12
- 'PairwiseIndexedPAFAdapter',
13
- ];
14
- exports.pairwiseTypes = [
15
- 'PAFAdapter',
16
- 'ChainAdapter',
17
- 'DeltaAdapter',
18
- 'MashMapAdapter',
19
- 'BlastTabularAdapter',
20
- 'PairwiseIndexedPAFAdapter',
21
- ];
22
- exports.mcscanTypes = [
23
- 'MCScanAnchorsAdapter',
24
- 'MCScanSimpleAnchorsAdapter',
25
- ];
package/dist/util.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { PAFRecord } from './PAFAdapter/util';
2
- import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
3
- import type { GenericFilehandle } from 'generic-filehandle2';
4
- export declare function parseBed(text: string): Map<string | undefined, {
5
- refName: string | undefined;
6
- start: number;
7
- end: number;
8
- score: number;
9
- name: string | undefined;
10
- strand: number;
11
- }>;
12
- export declare function readFile(file: GenericFilehandle, opts?: BaseOptions): Promise<string>;
13
- export declare function zip(a: number[], b: number[]): [number, number][];
14
- export declare function parsePAFLine(line: string): PAFRecord;
15
- export declare function flipCigar(cigar: string[]): (string | undefined)[];
16
- export declare function swapIndelCigar(cigar: string): string;
package/dist/util.js DELETED
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseBed = parseBed;
4
- exports.readFile = readFile;
5
- exports.zip = zip;
6
- exports.parsePAFLine = parsePAFLine;
7
- exports.flipCigar = flipCigar;
8
- exports.swapIndelCigar = swapIndelCigar;
9
- const util_1 = require("@jbrowse/core/util");
10
- function parseBed(text) {
11
- return new Map(text
12
- .split(/\n|\r\n|\r/)
13
- .filter(f => !!f || f.startsWith('#'))
14
- .map(line => {
15
- const [refName, start, end, name, score, strand] = line.split('\t');
16
- return [
17
- name,
18
- {
19
- refName,
20
- start: +start,
21
- end: +end,
22
- score: +score,
23
- name,
24
- strand: strand === '-' ? -1 : 1,
25
- },
26
- ];
27
- }));
28
- }
29
- async function readFile(file, opts) {
30
- return (0, util_1.fetchAndMaybeUnzipText)(file, opts);
31
- }
32
- function zip(a, b) {
33
- return a.map((e, i) => [e, b[i]]);
34
- }
35
- function parsePAFLine(line) {
36
- const parts = line.split('\t');
37
- const extraFields = parts.slice(12);
38
- const extra = {
39
- numMatches: +parts[9],
40
- blockLen: +parts[10],
41
- mappingQual: +parts[11],
42
- };
43
- if (extraFields.length) {
44
- for (const field of extraFields) {
45
- const colonIndex = field.indexOf(':');
46
- extra[field.slice(0, colonIndex)] = field.slice(colonIndex + 3);
47
- }
48
- }
49
- return {
50
- tname: parts[5],
51
- tstart: +parts[7],
52
- tend: +parts[8],
53
- qname: parts[0],
54
- qstart: +parts[2],
55
- qend: +parts[3],
56
- strand: parts[4] === '-' ? -1 : 1,
57
- extra,
58
- };
59
- }
60
- function flipCigar(cigar) {
61
- const arr = [];
62
- for (let i = cigar.length - 2; i >= 0; i -= 2) {
63
- arr.push(cigar[i]);
64
- const op = cigar[i + 1];
65
- if (op === 'D') {
66
- arr.push('I');
67
- }
68
- else if (op === 'I') {
69
- arr.push('D');
70
- }
71
- else {
72
- arr.push(op);
73
- }
74
- }
75
- return arr;
76
- }
77
- function swapIndelCigar(cigar) {
78
- return cigar.replaceAll('D', 'K').replaceAll('I', 'D').replaceAll('K', 'I');
79
- }