@jbrowse/plugin-comparative-adapters 2.17.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/util.js +1 -48
- 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/util.js +2 -29
- 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/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/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/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/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/SyntenyFeature/index.js +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/util.d.ts +3 -3
- 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/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/util.js +1 -48
- 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/util.js +2 -29
- 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/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/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/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/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/SyntenyFeature/index.js +0 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +6 -6
- package/esm/util.d.ts +3 -3
- package/package.json +2 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { openLocation } from '@jbrowse/core/util/io';
|
|
2
1
|
import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
|
|
3
|
-
|
|
4
|
-
import PAFAdapter from '../PAFAdapter/PAFAdapter';
|
|
2
|
+
import { openLocation } from '@jbrowse/core/util/io';
|
|
5
3
|
import { paf_delta2paf } from './util';
|
|
4
|
+
import PAFAdapter from '../PAFAdapter/PAFAdapter';
|
|
6
5
|
export default class DeltaAdapter extends PAFAdapter {
|
|
7
6
|
async setupPre(opts) {
|
|
8
7
|
const loc = openLocation(this.getConf('deltaLocation'), this.pluginManager);
|
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
declare const DeltaAdapter: 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
|
-
* alternative to assembly names
|
|
13
|
-
*/
|
|
14
7
|
targetAssembly: {
|
|
15
8
|
type: string;
|
|
16
9
|
defaultValue: string;
|
|
17
10
|
description: string;
|
|
18
11
|
};
|
|
19
|
-
/**
|
|
20
|
-
* #slot
|
|
21
|
-
* alternative to assembly names
|
|
22
|
-
*/
|
|
23
12
|
queryAssembly: {
|
|
24
13
|
type: string;
|
|
25
14
|
defaultValue: string;
|
|
26
15
|
description: string;
|
|
27
16
|
};
|
|
28
|
-
/**
|
|
29
|
-
* #slot
|
|
30
|
-
*/
|
|
31
17
|
deltaLocation: {
|
|
32
18
|
type: string;
|
|
33
19
|
defaultValue: {
|
|
@@ -1,39 +1,21 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config DeltaAdapter
|
|
4
|
-
* #category adapter
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
7
3
|
const DeltaAdapter = ConfigurationSchema('DeltaAdapter', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
4
|
assemblyNames: {
|
|
12
5
|
type: 'stringArray',
|
|
13
6
|
defaultValue: [],
|
|
14
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',
|
|
15
8
|
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
* alternative to assembly names
|
|
19
|
-
*/
|
|
20
9
|
targetAssembly: {
|
|
21
10
|
type: 'string',
|
|
22
11
|
defaultValue: '',
|
|
23
12
|
description: 'Alternative to assemblyNames: the target assembly name',
|
|
24
13
|
},
|
|
25
|
-
/**
|
|
26
|
-
* #slot
|
|
27
|
-
* alternative to assembly names
|
|
28
|
-
*/
|
|
29
14
|
queryAssembly: {
|
|
30
15
|
type: 'string',
|
|
31
16
|
defaultValue: '',
|
|
32
17
|
description: 'Alternative to assemblyNames: the query assembly name',
|
|
33
18
|
},
|
|
34
|
-
/**
|
|
35
|
-
* #slot
|
|
36
|
-
*/
|
|
37
19
|
deltaLocation: {
|
|
38
20
|
type: 'fileLocation',
|
|
39
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 DeltaAdapterF(pluginManager: PluginManager): void;
|
package/esm/DeltaAdapter/util.js
CHANGED
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
/* paf2delta from paftools.js in the minimap2 repository, license reproduced below
|
|
2
|
-
*
|
|
3
|
-
* The MIT License
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2018- Dana-Farber Cancer Institute
|
|
6
|
-
* 2017-2018 Broad Institute, Inc.
|
|
7
|
-
*
|
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
9
|
-
* a copy of this software and associated documentation files (the
|
|
10
|
-
* "Software"), to deal in the Software without restriction, including
|
|
11
|
-
* without limitation the rights to use, copy, modify, merge, publish,
|
|
12
|
-
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
-
* permit persons to whom the Software is furnished to do so, subject to
|
|
14
|
-
* the following conditions:
|
|
15
|
-
*
|
|
16
|
-
* The above copyright notice and this permission notice shall be
|
|
17
|
-
* included in all copies or substantial portions of the Software.
|
|
18
|
-
*
|
|
19
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
20
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
21
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22
|
-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
23
|
-
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
24
|
-
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
* SOFTWARE.
|
|
27
|
-
*/
|
|
28
1
|
export function paf_delta2paf(buffer) {
|
|
29
2
|
let rname = '';
|
|
30
3
|
let qname = '';
|
|
@@ -122,7 +95,7 @@ export function paf_delta2paf(buffer) {
|
|
|
122
95
|
}
|
|
123
96
|
else {
|
|
124
97
|
cigar.push((1 << 4) | 2);
|
|
125
|
-
}
|
|
98
|
+
}
|
|
126
99
|
}
|
|
127
100
|
else {
|
|
128
101
|
const l = -d - 1;
|
|
@@ -136,7 +109,7 @@ export function paf_delta2paf(buffer) {
|
|
|
136
109
|
}
|
|
137
110
|
else {
|
|
138
111
|
cigar.push((1 << 4) | 1);
|
|
139
|
-
}
|
|
112
|
+
}
|
|
140
113
|
}
|
|
141
114
|
}
|
|
142
115
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter
|
|
2
|
-
import {
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
3
4
|
interface BareFeature {
|
|
4
5
|
strand: number;
|
|
5
6
|
refName: string;
|
|
@@ -24,11 +25,6 @@ export default class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
24
25
|
getAssemblyNames(): string[];
|
|
25
26
|
getRefNames(opts?: BaseOptions): Promise<string[]>;
|
|
26
27
|
getFeatures(region: Region, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
27
|
-
/**
|
|
28
|
-
* called to provide a hint that data tied to a certain region
|
|
29
|
-
* will not be needed for the foreseeable future and can be purged
|
|
30
|
-
* from caches, etc
|
|
31
|
-
*/
|
|
32
28
|
freeResources(): void;
|
|
33
29
|
}
|
|
34
30
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import { SimpleFeature, doesIntersect2 } from '@jbrowse/core/util';
|
|
2
3
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
|
-
import { doesIntersect2, SimpleFeature, } from '@jbrowse/core/util';
|
|
4
4
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
5
|
-
import {
|
|
5
|
+
import { parseBed, readFile } from '../util';
|
|
6
6
|
class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
7
7
|
async setup(opts) {
|
|
8
8
|
if (!this.setupP) {
|
|
@@ -40,9 +40,6 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
async hasDataForRefName() {
|
|
43
|
-
// determining this properly is basically a call to getFeatures so is not
|
|
44
|
-
// really that important, and has to be true or else getFeatures is never
|
|
45
|
-
// called (BaseFeatureDataAdapter filters it out)
|
|
46
43
|
return true;
|
|
47
44
|
}
|
|
48
45
|
getAssemblyNames() {
|
|
@@ -51,7 +48,6 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
51
48
|
}
|
|
52
49
|
async getRefNames(opts = {}) {
|
|
53
50
|
var _a;
|
|
54
|
-
// @ts-expect-error
|
|
55
51
|
const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
|
|
56
52
|
const { feats } = await this.setup(opts);
|
|
57
53
|
const idx = this.getAssemblyNames().indexOf(r1);
|
|
@@ -68,8 +64,6 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
68
64
|
getFeatures(region, opts = {}) {
|
|
69
65
|
return ObservableCreate(async (observer) => {
|
|
70
66
|
const { assemblyNames, feats } = await this.setup(opts);
|
|
71
|
-
// The index of the assembly name in the region list corresponds to
|
|
72
|
-
// the adapter in the subadapters list
|
|
73
67
|
const index = assemblyNames.indexOf(region.assemblyName);
|
|
74
68
|
if (index !== -1) {
|
|
75
69
|
const flip = index === 0;
|
|
@@ -82,8 +76,6 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
82
76
|
...f1,
|
|
83
77
|
uniqueId: `${index}-${rowNum}`,
|
|
84
78
|
syntenyId: rowNum,
|
|
85
|
-
// note: strand would be -1 if the two features are on opposite
|
|
86
|
-
// strands, indicating inverted alignment
|
|
87
79
|
strand: f1.strand * f2.strand,
|
|
88
80
|
assemblyName: assemblyNames[+!flip],
|
|
89
81
|
score,
|
|
@@ -98,12 +90,7 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
98
90
|
observer.complete();
|
|
99
91
|
});
|
|
100
92
|
}
|
|
101
|
-
|
|
102
|
-
* called to provide a hint that data tied to a certain region
|
|
103
|
-
* will not be needed for the foreseeable future and can be purged
|
|
104
|
-
* from caches, etc
|
|
105
|
-
*/
|
|
106
|
-
freeResources( /* { region } */) { }
|
|
93
|
+
freeResources() { }
|
|
107
94
|
}
|
|
108
95
|
MCScanAnchorsAdapter.capabilities = ['getFeatures', 'getRefNames'];
|
|
109
96
|
export default MCScanAnchorsAdapter;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
mcscanAnchorsLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,9 +6,6 @@ declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configur
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
*/
|
|
15
9
|
bed1Location: {
|
|
16
10
|
type: string;
|
|
17
11
|
defaultValue: {
|
|
@@ -19,9 +13,6 @@ declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configur
|
|
|
19
13
|
locationType: string;
|
|
20
14
|
};
|
|
21
15
|
};
|
|
22
|
-
/**
|
|
23
|
-
* #slot
|
|
24
|
-
*/
|
|
25
16
|
bed2Location: {
|
|
26
17
|
type: string;
|
|
27
18
|
defaultValue: {
|
|
@@ -29,9 +20,6 @@ declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configur
|
|
|
29
20
|
locationType: string;
|
|
30
21
|
};
|
|
31
22
|
};
|
|
32
|
-
/**
|
|
33
|
-
* #slot
|
|
34
|
-
*/
|
|
35
23
|
assemblyNames: {
|
|
36
24
|
type: string;
|
|
37
25
|
defaultValue: never[];
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config MCScanAnchorsAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const MCScanAnchorsAdapter = ConfigurationSchema('MCScanAnchorsAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
mcscanAnchorsLocation: {
|
|
11
5
|
type: 'fileLocation',
|
|
12
6
|
defaultValue: {
|
|
@@ -14,9 +8,6 @@ const MCScanAnchorsAdapter = ConfigurationSchema('MCScanAnchorsAdapter', {
|
|
|
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 MCScanAnchorsAdapter = ConfigurationSchema('MCScanAnchorsAdapter', {
|
|
|
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 MCScanAnchorsAdapter = ConfigurationSchema('MCScanAnchorsAdapter', {
|
|
|
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 MCScanAnchorsAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter
|
|
2
|
-
import {
|
|
3
|
-
import { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
4
|
+
import type { Region } from '@jbrowse/core/util/types';
|
|
4
5
|
interface BareFeature {
|
|
5
6
|
refName: string;
|
|
6
7
|
start: number;
|
|
@@ -32,11 +33,6 @@ export default class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
32
33
|
getAssemblyNames(): string[];
|
|
33
34
|
getRefNames(opts?: BaseOptions): Promise<string[]>;
|
|
34
35
|
getFeatures(region: Region, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
35
|
-
/**
|
|
36
|
-
* called to provide a hint that data tied to a certain region
|
|
37
|
-
* will not be needed for the foreseeable future and can be purged
|
|
38
|
-
* from caches, etc
|
|
39
|
-
*/
|
|
40
36
|
freeResources(): void;
|
|
41
37
|
}
|
|
42
38
|
export {};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|