@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.
- package/dist/BlastTabularAdapter/BlastTabularAdapter.d.ts +3 -57
- package/dist/BlastTabularAdapter/BlastTabularAdapter.js +3 -10
- package/dist/BlastTabularAdapter/configSchema.d.ts +0 -15
- package/dist/BlastTabularAdapter/configSchema.js +1 -19
- package/dist/BlastTabularAdapter/index.d.ts +1 -1
- package/dist/BlastTabularAdapter/index.js +18 -8
- package/dist/ChainAdapter/ChainAdapter.d.ts +1 -1
- package/dist/ChainAdapter/ChainAdapter.js +2 -3
- package/dist/ChainAdapter/configSchema.d.ts +0 -14
- package/dist/ChainAdapter/configSchema.js +1 -19
- package/dist/ChainAdapter/index.d.ts +1 -1
- package/dist/ChainAdapter/index.js +18 -8
- package/dist/ChainAdapter/util.d.ts +1 -2
- package/dist/ChainAdapter/util.js +2 -49
- package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.d.ts +2 -0
- package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +31 -0
- package/dist/ComparativeAddTrackComponent/index.d.ts +2 -0
- package/dist/ComparativeAddTrackComponent/index.js +46 -0
- package/dist/DeltaAdapter/DeltaAdapter.d.ts +1 -1
- package/dist/DeltaAdapter/DeltaAdapter.js +2 -3
- package/dist/DeltaAdapter/configSchema.d.ts +0 -14
- package/dist/DeltaAdapter/configSchema.js +1 -19
- package/dist/DeltaAdapter/index.d.ts +1 -1
- package/dist/DeltaAdapter/index.js +18 -8
- package/dist/DeltaAdapter/util.d.ts +1 -2
- package/dist/DeltaAdapter/util.js +3 -30
- package/dist/GuessAdapter/index.d.ts +2 -0
- package/dist/GuessAdapter/index.js +74 -0
- package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +2 -0
- package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.js +39 -0
- package/dist/MCScanAddTrackComponent/index.d.ts +2 -0
- package/dist/MCScanAddTrackComponent/index.js +46 -0
- package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
- package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +2 -15
- package/dist/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
- package/dist/MCScanAnchorsAdapter/configSchema.js +1 -16
- package/dist/MCScanAnchorsAdapter/index.d.ts +1 -1
- package/dist/MCScanAnchorsAdapter/index.js +18 -8
- package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
- package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +2 -13
- package/dist/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
- package/dist/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
- package/dist/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
- package/dist/MCScanSimpleAnchorsAdapter/index.js +18 -8
- package/dist/MashMapAdapter/MashMapAdapter.d.ts +1 -1
- package/dist/MashMapAdapter/MashMapAdapter.js +1 -2
- package/dist/MashMapAdapter/configSchema.d.ts +0 -12
- package/dist/MashMapAdapter/configSchema.js +1 -16
- package/dist/MashMapAdapter/index.d.ts +1 -1
- package/dist/MashMapAdapter/index.js +18 -8
- package/dist/PAFAdapter/PAFAdapter.d.ts +6 -5
- package/dist/PAFAdapter/PAFAdapter.js +4 -15
- package/dist/PAFAdapter/configSchema.d.ts +0 -12
- package/dist/PAFAdapter/configSchema.js +1 -16
- package/dist/PAFAdapter/index.d.ts +1 -1
- package/dist/PAFAdapter/index.js +18 -8
- package/dist/PAFAdapter/util.js +0 -35
- package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
- package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +5 -6
- package/dist/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
- package/dist/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
- package/dist/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
- package/dist/PairwiseIndexedPAFAdapter/index.js +18 -8
- package/dist/SyntenyFeature/index.js +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -25
- package/dist/syntenyTypes.d.ts +3 -0
- package/dist/syntenyTypes.js +25 -0
- package/dist/util.d.ts +4 -5
- package/dist/util.js +2 -4
- package/esm/BlastTabularAdapter/BlastTabularAdapter.d.ts +3 -57
- package/esm/BlastTabularAdapter/BlastTabularAdapter.js +5 -12
- package/esm/BlastTabularAdapter/configSchema.d.ts +0 -15
- package/esm/BlastTabularAdapter/configSchema.js +1 -19
- package/esm/BlastTabularAdapter/index.d.ts +1 -1
- package/esm/BlastTabularAdapter/index.js +1 -1
- package/esm/ChainAdapter/ChainAdapter.d.ts +1 -1
- package/esm/ChainAdapter/ChainAdapter.js +2 -3
- package/esm/ChainAdapter/configSchema.d.ts +0 -14
- package/esm/ChainAdapter/configSchema.js +1 -19
- package/esm/ChainAdapter/index.d.ts +1 -1
- package/esm/ChainAdapter/index.js +1 -1
- package/esm/ChainAdapter/util.d.ts +1 -2
- package/esm/ChainAdapter/util.js +2 -49
- package/esm/ComparativeAddTrackComponent/ComparativeAddTrackComponent.d.ts +2 -0
- package/esm/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +29 -0
- package/esm/ComparativeAddTrackComponent/index.d.ts +2 -0
- package/esm/ComparativeAddTrackComponent/index.js +10 -0
- package/esm/DeltaAdapter/DeltaAdapter.d.ts +1 -1
- package/esm/DeltaAdapter/DeltaAdapter.js +2 -3
- package/esm/DeltaAdapter/configSchema.d.ts +0 -14
- package/esm/DeltaAdapter/configSchema.js +1 -19
- package/esm/DeltaAdapter/index.d.ts +1 -1
- package/esm/DeltaAdapter/index.js +1 -1
- package/esm/DeltaAdapter/util.d.ts +1 -2
- package/esm/DeltaAdapter/util.js +3 -30
- package/esm/GuessAdapter/index.d.ts +2 -0
- package/esm/GuessAdapter/index.js +71 -0
- package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +2 -0
- package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.js +37 -0
- package/esm/MCScanAddTrackComponent/index.d.ts +2 -0
- package/esm/MCScanAddTrackComponent/index.js +10 -0
- package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +3 -7
- package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +4 -17
- package/esm/MCScanAnchorsAdapter/configSchema.d.ts +0 -12
- package/esm/MCScanAnchorsAdapter/configSchema.js +1 -16
- package/esm/MCScanAnchorsAdapter/index.d.ts +1 -1
- package/esm/MCScanAnchorsAdapter/index.js +1 -1
- package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +4 -8
- package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +4 -15
- package/esm/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -12
- package/esm/MCScanSimpleAnchorsAdapter/configSchema.js +1 -16
- package/esm/MCScanSimpleAnchorsAdapter/index.d.ts +1 -1
- package/esm/MCScanSimpleAnchorsAdapter/index.js +1 -1
- package/esm/MashMapAdapter/MashMapAdapter.d.ts +1 -1
- package/esm/MashMapAdapter/MashMapAdapter.js +1 -2
- package/esm/MashMapAdapter/configSchema.d.ts +0 -12
- package/esm/MashMapAdapter/configSchema.js +1 -16
- package/esm/MashMapAdapter/index.d.ts +1 -1
- package/esm/MashMapAdapter/index.js +1 -1
- package/esm/PAFAdapter/PAFAdapter.d.ts +6 -5
- package/esm/PAFAdapter/PAFAdapter.js +6 -17
- package/esm/PAFAdapter/configSchema.d.ts +0 -12
- package/esm/PAFAdapter/configSchema.js +1 -16
- package/esm/PAFAdapter/index.d.ts +1 -1
- package/esm/PAFAdapter/index.js +1 -1
- package/esm/PAFAdapter/util.js +0 -35
- package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +7 -6
- package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +6 -7
- package/esm/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -21
- package/esm/PairwiseIndexedPAFAdapter/configSchema.js +1 -25
- package/esm/PairwiseIndexedPAFAdapter/index.d.ts +1 -1
- package/esm/PairwiseIndexedPAFAdapter/index.js +1 -1
- package/esm/SyntenyFeature/index.js +0 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +11 -25
- package/esm/syntenyTypes.d.ts +3 -0
- package/esm/syntenyTypes.js +22 -0
- package/esm/util.d.ts +4 -5
- package/esm/util.js +3 -5
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
9
|
+
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
11
|
getAdapterClass: () => import('./MashMapAdapter').then(r => r.default),
|
|
12
12
|
}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
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,
|
|
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(
|
|
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;
|
package/esm/PAFAdapter/index.js
CHANGED
package/esm/PAFAdapter/util.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
import {
|
|
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
|
-
|
|
95
|
+
stopToken: opts.stopToken,
|
|
97
96
|
});
|
|
98
97
|
observer.complete();
|
|
99
98
|
});
|
|
100
99
|
}
|
|
101
|
-
freeResources(
|
|
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
|
-
|
|
9
|
+
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
11
|
getAdapterClass: () => import('./PairwiseIndexedPAFAdapter').then(r => r.default),
|
|
12
12
|
}));
|