@jbrowse/plugin-comparative-adapters 3.6.5 → 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.
- package/esm/BlastTabularAdapter/BlastTabularAdapter.js +8 -7
- package/esm/BlastTabularAdapter/configSchema.d.ts +2 -2
- package/esm/BlastTabularAdapter/index.js +2 -2
- package/esm/ChainAdapter/ChainAdapter.d.ts +2 -16
- package/esm/ChainAdapter/ChainAdapter.js +4 -3
- package/esm/ChainAdapter/configSchema.d.ts +2 -2
- package/esm/ChainAdapter/index.js +2 -2
- package/esm/ChainAdapter/util.js +3 -3
- package/esm/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +3 -4
- package/esm/ComparativeAddTrackComponent/index.js +2 -2
- package/esm/DeltaAdapter/DeltaAdapter.d.ts +2 -11
- package/esm/DeltaAdapter/DeltaAdapter.js +4 -3
- package/esm/DeltaAdapter/configSchema.d.ts +2 -2
- package/esm/DeltaAdapter/index.js +2 -2
- package/esm/DeltaAdapter/util.js +5 -5
- package/esm/GuessAdapter/index.js +1 -1
- package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +1 -1
- package/esm/MCScanAddTrackComponent/MCScanAddTrackComponent.js +3 -4
- package/esm/MCScanAddTrackComponent/index.js +2 -2
- package/esm/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +5 -6
- package/esm/MCScanAnchorsAdapter/configSchema.d.ts +2 -2
- package/esm/MCScanAnchorsAdapter/index.js +2 -2
- package/esm/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +5 -6
- package/esm/MCScanSimpleAnchorsAdapter/configSchema.d.ts +2 -2
- package/esm/MCScanSimpleAnchorsAdapter/index.js +2 -2
- package/esm/MashMapAdapter/MashMapAdapter.d.ts +2 -13
- package/esm/MashMapAdapter/MashMapAdapter.js +4 -3
- package/esm/MashMapAdapter/configSchema.d.ts +2 -2
- package/esm/MashMapAdapter/index.js +2 -2
- package/esm/PAFAdapter/PAFAdapter.d.ts +1 -1
- package/esm/PAFAdapter/PAFAdapter.js +10 -16
- package/esm/PAFAdapter/configSchema.d.ts +2 -2
- package/esm/PAFAdapter/index.js +2 -2
- package/esm/PAFAdapter/util.js +22 -32
- package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +13 -12
- package/esm/PairwiseIndexedPAFAdapter/configSchema.d.ts +5 -5
- package/esm/PairwiseIndexedPAFAdapter/configSchema.js +1 -1
- package/esm/PairwiseIndexedPAFAdapter/index.js +2 -2
- package/esm/SyntenyFeature/index.js +3 -4
- package/esm/index.js +12 -15
- package/esm/util.d.ts +1 -1
- package/esm/util.js +1 -1
- package/package.json +27 -34
- package/dist/BlastTabularAdapter/BlastTabularAdapter.d.ts +0 -65
- package/dist/BlastTabularAdapter/BlastTabularAdapter.js +0 -206
- package/dist/BlastTabularAdapter/configSchema.d.ts +0 -30
- package/dist/BlastTabularAdapter/configSchema.js +0 -34
- package/dist/BlastTabularAdapter/index.d.ts +0 -2
- package/dist/BlastTabularAdapter/index.js +0 -52
- package/dist/ChainAdapter/ChainAdapter.d.ts +0 -19
- package/dist/ChainAdapter/ChainAdapter.js +0 -15
- package/dist/ChainAdapter/configSchema.d.ts +0 -25
- package/dist/ChainAdapter/configSchema.js +0 -39
- package/dist/ChainAdapter/index.d.ts +0 -2
- package/dist/ChainAdapter/index.js +0 -52
- package/dist/ChainAdapter/util.d.ts +0 -16
- package/dist/ChainAdapter/util.js +0 -82
- package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.d.ts +0 -2
- package/dist/ComparativeAddTrackComponent/ComparativeAddTrackComponent.js +0 -31
- package/dist/ComparativeAddTrackComponent/index.d.ts +0 -2
- package/dist/ComparativeAddTrackComponent/index.js +0 -46
- package/dist/DeltaAdapter/DeltaAdapter.d.ts +0 -14
- package/dist/DeltaAdapter/DeltaAdapter.js +0 -15
- package/dist/DeltaAdapter/configSchema.d.ts +0 -25
- package/dist/DeltaAdapter/configSchema.js +0 -42
- package/dist/DeltaAdapter/index.d.ts +0 -2
- package/dist/DeltaAdapter/index.js +0 -52
- package/dist/DeltaAdapter/util.d.ts +0 -11
- package/dist/DeltaAdapter/util.js +0 -111
- package/dist/GuessAdapter/index.d.ts +0 -2
- package/dist/GuessAdapter/index.js +0 -74
- package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.d.ts +0 -2
- package/dist/MCScanAddTrackComponent/MCScanAddTrackComponent.js +0 -39
- package/dist/MCScanAddTrackComponent/index.d.ts +0 -2
- package/dist/MCScanAddTrackComponent/index.js +0 -46
- package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.d.ts +0 -29
- package/dist/MCScanAnchorsAdapter/MCScanAnchorsAdapter.js +0 -98
- package/dist/MCScanAnchorsAdapter/configSchema.d.ts +0 -28
- package/dist/MCScanAnchorsAdapter/configSchema.js +0 -53
- package/dist/MCScanAnchorsAdapter/index.d.ts +0 -2
- package/dist/MCScanAnchorsAdapter/index.js +0 -52
- package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.d.ts +0 -37
- package/dist/MCScanSimpleAnchorsAdapter/MCScanSimpleAnchorsAdapter.js +0 -132
- package/dist/MCScanSimpleAnchorsAdapter/configSchema.d.ts +0 -28
- package/dist/MCScanSimpleAnchorsAdapter/configSchema.js +0 -53
- package/dist/MCScanSimpleAnchorsAdapter/index.d.ts +0 -2
- package/dist/MCScanSimpleAnchorsAdapter/index.js +0 -52
- package/dist/MashMapAdapter/MashMapAdapter.d.ts +0 -16
- package/dist/MashMapAdapter/MashMapAdapter.js +0 -39
- package/dist/MashMapAdapter/configSchema.d.ts +0 -25
- package/dist/MashMapAdapter/configSchema.js +0 -42
- package/dist/MashMapAdapter/index.d.ts +0 -2
- package/dist/MashMapAdapter/index.js +0 -52
- package/dist/PAFAdapter/PAFAdapter.d.ts +0 -20
- package/dist/PAFAdapter/PAFAdapter.js +0 -142
- package/dist/PAFAdapter/configSchema.d.ts +0 -25
- package/dist/PAFAdapter/configSchema.js +0 -42
- package/dist/PAFAdapter/index.d.ts +0 -2
- package/dist/PAFAdapter/index.js +0 -52
- package/dist/PAFAdapter/util.d.ts +0 -17
- package/dist/PAFAdapter/util.js +0 -45
- package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.d.ts +0 -24
- package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +0 -109
- package/dist/PairwiseIndexedPAFAdapter/configSchema.d.ts +0 -40
- package/dist/PairwiseIndexedPAFAdapter/configSchema.js +0 -64
- package/dist/PairwiseIndexedPAFAdapter/index.d.ts +0 -2
- package/dist/PairwiseIndexedPAFAdapter/index.js +0 -52
- package/dist/SyntenyFeature/index.d.ts +0 -4
- package/dist/SyntenyFeature/index.js +0 -14
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -37
- package/dist/syntenyTypes.d.ts +0 -3
- package/dist/syntenyTypes.js +0 -25
- package/dist/util.d.ts +0 -16
- package/dist/util.js +0 -79
|
@@ -4,7 +4,7 @@ import { doesIntersect2, fetchAndMaybeUnzip } from '@jbrowse/core/util';
|
|
|
4
4
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
5
5
|
import { parseLineByLine } from '@jbrowse/core/util/parseLineByLine';
|
|
6
6
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
7
|
-
import SyntenyFeature from
|
|
7
|
+
import SyntenyFeature from "../SyntenyFeature/index.js";
|
|
8
8
|
function createBlastLineParser(columns) {
|
|
9
9
|
const columnNames = columns.trim().split(' ');
|
|
10
10
|
const qseqidIndex = columnNames.indexOf('qseqid');
|
|
@@ -68,7 +68,9 @@ function createBlastLineParser(columns) {
|
|
|
68
68
|
return record;
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
class BlastTabularAdapter extends BaseFeatureDataAdapter {
|
|
71
|
+
export default class BlastTabularAdapter extends BaseFeatureDataAdapter {
|
|
72
|
+
data;
|
|
73
|
+
static capabilities = ['getFeatures', 'getRefNames'];
|
|
72
74
|
getData(opts) {
|
|
73
75
|
if (!this.data) {
|
|
74
76
|
this.data = this.setup(opts).catch((e) => {
|
|
@@ -88,7 +90,7 @@ class BlastTabularAdapter extends BaseFeatureDataAdapter {
|
|
|
88
90
|
lines.push(res);
|
|
89
91
|
}
|
|
90
92
|
return true;
|
|
91
|
-
}, opts
|
|
93
|
+
}, opts?.statusCallback);
|
|
92
94
|
return lines;
|
|
93
95
|
}
|
|
94
96
|
async hasDataForRefName() {
|
|
@@ -104,8 +106,7 @@ class BlastTabularAdapter extends BaseFeatureDataAdapter {
|
|
|
104
106
|
return assemblyNames;
|
|
105
107
|
}
|
|
106
108
|
async getRefNames(opts = {}) {
|
|
107
|
-
|
|
108
|
-
const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
|
|
109
|
+
const r1 = opts.regions?.[0].assemblyName;
|
|
109
110
|
const feats = await this.getData(opts);
|
|
110
111
|
const idx = this.getAssemblyNames().indexOf(r1);
|
|
111
112
|
if (idx !== -1) {
|
|
@@ -172,6 +173,8 @@ class BlastTabularAdapter extends BaseFeatureDataAdapter {
|
|
|
172
173
|
[mateStart, mateEnd] = [mateEnd, mateStart];
|
|
173
174
|
mateStrand = -1;
|
|
174
175
|
}
|
|
176
|
+
start -= 1;
|
|
177
|
+
mateStart -= 1;
|
|
175
178
|
if (refName === queryRefName &&
|
|
176
179
|
doesIntersect2(queryStart, queryEnd, start, end)) {
|
|
177
180
|
observer.next(new SyntenyFeature({
|
|
@@ -197,5 +200,3 @@ class BlastTabularAdapter extends BaseFeatureDataAdapter {
|
|
|
197
200
|
});
|
|
198
201
|
}
|
|
199
202
|
}
|
|
200
|
-
BlastTabularAdapter.capabilities = ['getFeatures', 'getRefNames'];
|
|
201
|
-
export default BlastTabularAdapter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const BlastTabularAdapter: import("
|
|
1
|
+
declare const BlastTabularAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
assemblyNames: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: never[];
|
|
@@ -26,5 +26,5 @@ declare const BlastTabularAdapter: import("@jbrowse/core/configuration/configura
|
|
|
26
26
|
description: string;
|
|
27
27
|
defaultValue: string;
|
|
28
28
|
};
|
|
29
|
-
}, import("
|
|
29
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
30
30
|
export default BlastTabularAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function BlastTabularAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'BlastTabularAdapter',
|
|
@@ -8,6 +8,6 @@ export default function BlastTabularAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./BlastTabularAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
import PAFAdapter from '../PAFAdapter/PAFAdapter';
|
|
1
|
+
import PAFAdapter from '../PAFAdapter/PAFAdapter.ts';
|
|
2
2
|
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
export default class ChainAdapter extends PAFAdapter {
|
|
4
|
-
setupPre(opts?: BaseOptions): Promise<
|
|
5
|
-
qname: string;
|
|
6
|
-
qstart: number;
|
|
7
|
-
qend: number;
|
|
8
|
-
tname: string;
|
|
9
|
-
tstart: number;
|
|
10
|
-
tend: number;
|
|
11
|
-
strand: number;
|
|
12
|
-
extra: {
|
|
13
|
-
numMatches: number;
|
|
14
|
-
blockLen: number;
|
|
15
|
-
mappingQual: number;
|
|
16
|
-
cg: string;
|
|
17
|
-
};
|
|
18
|
-
}[]>;
|
|
4
|
+
setupPre(opts?: BaseOptions): Promise<import("../PAFAdapter/util.ts").PAFRecord[]>;
|
|
19
5
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
|
|
2
2
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
|
-
import { paf_chain2paf } from
|
|
4
|
-
import PAFAdapter from
|
|
3
|
+
import { paf_chain2paf } from "./util.js";
|
|
4
|
+
import PAFAdapter from "../PAFAdapter/PAFAdapter.js";
|
|
5
|
+
import { getWeightedMeans } from "../PAFAdapter/util.js";
|
|
5
6
|
export default class ChainAdapter extends PAFAdapter {
|
|
6
7
|
async setupPre(opts) {
|
|
7
|
-
return paf_chain2paf(await fetchAndMaybeUnzip(openLocation(this.getConf('chainLocation'), this.pluginManager), opts), opts);
|
|
8
|
+
return getWeightedMeans(paf_chain2paf(await fetchAndMaybeUnzip(openLocation(this.getConf('chainLocation'), this.pluginManager), opts), opts));
|
|
8
9
|
}
|
|
9
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ChainAdapter: import("
|
|
1
|
+
declare const ChainAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
assemblyNames: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: never[];
|
|
@@ -21,5 +21,5 @@ declare const ChainAdapter: import("@jbrowse/core/configuration/configurationSch
|
|
|
21
21
|
locationType: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
}, import("
|
|
24
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
25
25
|
export default ChainAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function ChainAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'ChainAdapter',
|
|
@@ -8,6 +8,6 @@ export default function ChainAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./ChainAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|
package/esm/ChainAdapter/util.js
CHANGED
|
@@ -59,7 +59,7 @@ export function paf_chain2paf(buffer, opts) {
|
|
|
59
59
|
const diff_in_target = l_vec.length > 1 ? +l_vec[1] : 0;
|
|
60
60
|
const diff_in_query = l_vec.length > 2 ? +l_vec[2] : 0;
|
|
61
61
|
if (size_ungapped_alignment !== 0) {
|
|
62
|
-
num_matches +=
|
|
62
|
+
num_matches += size_ungapped_alignment;
|
|
63
63
|
cigar += `${size_ungapped_alignment}M`;
|
|
64
64
|
}
|
|
65
65
|
if (diff_in_query !== 0) {
|
|
@@ -70,9 +70,9 @@ export function paf_chain2paf(buffer, opts) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return true;
|
|
73
|
-
}, opts
|
|
73
|
+
}, opts?.statusCallback);
|
|
74
74
|
if (cigar) {
|
|
75
|
-
generate_record(q_name, q_start, q_end, q_strand, t_name, t_start, t_end, cigar, num_matches);
|
|
75
|
+
records.push(generate_record(q_name, q_start, q_end, q_strand, t_name, t_start, t_end, cigar, num_matches));
|
|
76
76
|
}
|
|
77
77
|
statusCallback('');
|
|
78
78
|
return records;
|
|
@@ -3,11 +3,10 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { AssemblySelector } from '@jbrowse/core/ui';
|
|
4
4
|
import { getSession } from '@jbrowse/core/util';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
-
const ComparativeAddTrackComponent = observer(function ({ model }) {
|
|
7
|
-
var _a, _b;
|
|
6
|
+
const ComparativeAddTrackComponent = observer(function ComparativeAddTrackComponent({ model }) {
|
|
8
7
|
const session = getSession(model);
|
|
9
|
-
const [r0, setR0] = useState(
|
|
10
|
-
const [r1, setR1] = useState(
|
|
8
|
+
const [r0, setR0] = useState(session.assemblies[0]?.name);
|
|
9
|
+
const [r1, setR1] = useState(session.assemblies[0]?.name);
|
|
11
10
|
useEffect(() => {
|
|
12
11
|
model.setMixinData({
|
|
13
12
|
adapter: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
-
import { pairwiseTypes } from
|
|
3
|
-
const ComparativeAddTrackComponent = lazy(() => import(
|
|
2
|
+
import { pairwiseTypes } from "../syntenyTypes.js";
|
|
3
|
+
const ComparativeAddTrackComponent = lazy(() => import("./ComparativeAddTrackComponent.js"));
|
|
4
4
|
export default function ComparativeAddTrackComponentF(pluginManager) {
|
|
5
5
|
pluginManager.addToExtensionPoint('Core-addTrackComponent', (comp, { model }) => {
|
|
6
6
|
return pairwiseTypes.includes(model.trackAdapterType)
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import PAFAdapter from '../PAFAdapter/PAFAdapter';
|
|
1
|
+
import PAFAdapter from '../PAFAdapter/PAFAdapter.ts';
|
|
2
2
|
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
export default class DeltaAdapter extends PAFAdapter {
|
|
4
|
-
setupPre(opts?: BaseOptions): Promise<
|
|
5
|
-
qname: string;
|
|
6
|
-
qstart: number;
|
|
7
|
-
qend: number;
|
|
8
|
-
tname: string;
|
|
9
|
-
tstart: number;
|
|
10
|
-
tend: number;
|
|
11
|
-
strand: number;
|
|
12
|
-
extra: Record<string, unknown>;
|
|
13
|
-
}[]>;
|
|
4
|
+
setupPre(opts?: BaseOptions): Promise<import("../PAFAdapter/util.ts").PAFRecord[]>;
|
|
14
5
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
|
|
2
2
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
|
-
import { paf_delta2paf } from
|
|
4
|
-
import PAFAdapter from
|
|
3
|
+
import { paf_delta2paf } from "./util.js";
|
|
4
|
+
import PAFAdapter from "../PAFAdapter/PAFAdapter.js";
|
|
5
|
+
import { getWeightedMeans } from "../PAFAdapter/util.js";
|
|
5
6
|
export default class DeltaAdapter extends PAFAdapter {
|
|
6
7
|
async setupPre(opts) {
|
|
7
|
-
return paf_delta2paf(await fetchAndMaybeUnzip(openLocation(this.getConf('deltaLocation'), this.pluginManager), opts), opts);
|
|
8
|
+
return getWeightedMeans(paf_delta2paf(await fetchAndMaybeUnzip(openLocation(this.getConf('deltaLocation'), this.pluginManager), opts), opts));
|
|
8
9
|
}
|
|
9
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const DeltaAdapter: import("
|
|
1
|
+
declare const DeltaAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
assemblyNames: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: never[];
|
|
@@ -21,5 +21,5 @@ declare const DeltaAdapter: import("@jbrowse/core/configuration/configurationSch
|
|
|
21
21
|
locationType: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
}, import("
|
|
24
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
25
25
|
export default DeltaAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function DeltaAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'DeltaAdapter',
|
|
@@ -8,6 +8,6 @@ export default function DeltaAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./DeltaAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|
package/esm/DeltaAdapter/util.js
CHANGED
|
@@ -14,7 +14,7 @@ export function paf_delta2paf(buffer, opts) {
|
|
|
14
14
|
let y = 0;
|
|
15
15
|
let seen_gt = false;
|
|
16
16
|
const records = [];
|
|
17
|
-
const regex =
|
|
17
|
+
const regex = /^>(\S+)\s+(\S+)\s+(\d+)\s+(\d+)/;
|
|
18
18
|
parseLineByLine(buffer, line => {
|
|
19
19
|
const m = regex.exec(line);
|
|
20
20
|
if (m !== null) {
|
|
@@ -34,10 +34,10 @@ export function paf_delta2paf(buffer, opts) {
|
|
|
34
34
|
const t3 = +t[3];
|
|
35
35
|
const t4 = +t[4];
|
|
36
36
|
strand = (t0 < t1 && t2 < t3) || (t0 > t1 && t2 > t3) ? 1 : -1;
|
|
37
|
-
rs =
|
|
38
|
-
re =
|
|
39
|
-
qs =
|
|
40
|
-
qe =
|
|
37
|
+
rs = Math.min(t0, t1) - 1;
|
|
38
|
+
re = Math.max(t1, t0);
|
|
39
|
+
qs = Math.min(t2, t3) - 1;
|
|
40
|
+
qe = Math.max(t3, t2);
|
|
41
41
|
x = y = 0;
|
|
42
42
|
NM = t4;
|
|
43
43
|
cigar = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { testAdapter } from '@jbrowse/core/util';
|
|
2
2
|
import { getFileName, makeIndex, makeIndexType, } from '@jbrowse/core/util/tracks';
|
|
3
|
-
import { syntenyTypes } from
|
|
3
|
+
import { syntenyTypes } from "../syntenyTypes.js";
|
|
4
4
|
export default function GuessAdapterF(pluginManager) {
|
|
5
5
|
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
|
|
6
6
|
return (file, index, adapterHint) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const MCScanAddTrackComponent: ({ model }: any) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
declare const MCScanAddTrackComponent: ({ model, }: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default MCScanAddTrackComponent;
|
|
@@ -4,11 +4,10 @@ import { AssemblySelector, FileSelector } from '@jbrowse/core/ui';
|
|
|
4
4
|
import { getSession } from '@jbrowse/core/util';
|
|
5
5
|
import { Typography } from '@mui/material';
|
|
6
6
|
import { observer } from 'mobx-react';
|
|
7
|
-
const MCScanAddTrackComponent = observer(function ({ model }) {
|
|
8
|
-
var _a, _b;
|
|
7
|
+
const MCScanAddTrackComponent = observer(function MCScanAddTrackComponent({ model, }) {
|
|
9
8
|
const session = getSession(model);
|
|
10
|
-
const [r0, setR0] = useState(
|
|
11
|
-
const [r1, setR1] = useState(
|
|
9
|
+
const [r0, setR0] = useState(session.assemblies[0]?.name);
|
|
10
|
+
const [r1, setR1] = useState(session.assemblies[0]?.name);
|
|
12
11
|
const [bed1Location, setBed1Location] = useState();
|
|
13
12
|
const [bed2Location, setBed2Location] = useState();
|
|
14
13
|
useEffect(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
-
import { mcscanTypes } from
|
|
3
|
-
const MCScanAddTrackComponent = lazy(() => import(
|
|
2
|
+
import { mcscanTypes } from "../syntenyTypes.js";
|
|
3
|
+
const MCScanAddTrackComponent = lazy(() => import("./MCScanAddTrackComponent.js"));
|
|
4
4
|
export default function MCScanAddTrackComponentF(pluginManager) {
|
|
5
5
|
pluginManager.addToExtensionPoint('Core-addTrackComponent', (comp, { model }) => {
|
|
6
6
|
return mcscanTypes.includes(model.trackAdapterType)
|
|
@@ -2,8 +2,10 @@ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
|
2
2
|
import { SimpleFeature, doesIntersect2, updateStatus } from '@jbrowse/core/util';
|
|
3
3
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
4
4
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
5
|
-
import { parseBed, readFile } from
|
|
6
|
-
class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
5
|
+
import { parseBed, readFile } from "../util.js";
|
|
6
|
+
export default class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
7
|
+
setupP;
|
|
8
|
+
static capabilities = ['getFeatures', 'getRefNames'];
|
|
7
9
|
async setup(opts) {
|
|
8
10
|
if (!this.setupP) {
|
|
9
11
|
this.setupP = this.setupPre(opts).catch((e) => {
|
|
@@ -48,8 +50,7 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
48
50
|
return assemblyNames;
|
|
49
51
|
}
|
|
50
52
|
async getRefNames(opts = {}) {
|
|
51
|
-
|
|
52
|
-
const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
|
|
53
|
+
const r1 = opts.regions?.[0].assemblyName;
|
|
53
54
|
const { feats } = await this.setup(opts);
|
|
54
55
|
const idx = this.getAssemblyNames().indexOf(r1);
|
|
55
56
|
if (idx !== -1) {
|
|
@@ -92,5 +93,3 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
|
-
MCScanAnchorsAdapter.capabilities = ['getFeatures', 'getRefNames'];
|
|
96
|
-
export default MCScanAnchorsAdapter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const MCScanAnchorsAdapter: import("
|
|
1
|
+
declare const MCScanAnchorsAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
mcscanAnchorsLocation: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: {
|
|
@@ -24,5 +24,5 @@ declare const MCScanAnchorsAdapter: import("@jbrowse/core/configuration/configur
|
|
|
24
24
|
type: string;
|
|
25
25
|
defaultValue: never[];
|
|
26
26
|
};
|
|
27
|
-
}, import("
|
|
27
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
28
28
|
export default MCScanAnchorsAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function MCScanAnchorsAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'MCScanAnchorsAdapter',
|
|
@@ -8,6 +8,6 @@ export default function MCScanAnchorsAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./MCScanAnchorsAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|
|
@@ -3,8 +3,10 @@ import { doesIntersect2, updateStatus } from '@jbrowse/core/util';
|
|
|
3
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 { parseBed, readFile } from
|
|
7
|
-
class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
6
|
+
import { parseBed, readFile } from "../util.js";
|
|
7
|
+
export default class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
8
|
+
setupP;
|
|
9
|
+
static capabilities = ['getFeatures', 'getRefNames'];
|
|
8
10
|
async setup(opts) {
|
|
9
11
|
if (!this.setupP) {
|
|
10
12
|
this.setupP = this.setupPre(opts).catch((e) => {
|
|
@@ -59,8 +61,7 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
59
61
|
return assemblyNames;
|
|
60
62
|
}
|
|
61
63
|
async getRefNames(opts = {}) {
|
|
62
|
-
|
|
63
|
-
const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
|
|
64
|
+
const r1 = opts.regions?.[0].assemblyName;
|
|
64
65
|
const { feats } = await this.setup(opts);
|
|
65
66
|
const idx = this.getAssemblyNames().indexOf(r1);
|
|
66
67
|
if (idx !== -1) {
|
|
@@ -123,5 +124,3 @@ class MCScanAnchorsAdapter extends BaseFeatureDataAdapter {
|
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
|
-
MCScanAnchorsAdapter.capabilities = ['getFeatures', 'getRefNames'];
|
|
127
|
-
export default MCScanAnchorsAdapter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const MCScanSimpleAnchorsAdapter: import("
|
|
1
|
+
declare const MCScanSimpleAnchorsAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
mcscanSimpleAnchorsLocation: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: {
|
|
@@ -24,5 +24,5 @@ declare const MCScanSimpleAnchorsAdapter: import("@jbrowse/core/configuration/co
|
|
|
24
24
|
type: string;
|
|
25
25
|
defaultValue: never[];
|
|
26
26
|
};
|
|
27
|
-
}, import("
|
|
27
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
28
28
|
export default MCScanSimpleAnchorsAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function MCScanSimpleAnchorsAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'MCScanSimpleAnchorsAdapter',
|
|
@@ -8,6 +8,6 @@ export default function MCScanSimpleAnchorsAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./MCScanSimpleAnchorsAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import PAFAdapter from '../PAFAdapter/PAFAdapter';
|
|
1
|
+
import PAFAdapter from '../PAFAdapter/PAFAdapter.ts';
|
|
2
2
|
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
export default class MashMapAdapter extends PAFAdapter {
|
|
4
|
-
setupPre(opts?: BaseOptions): Promise<
|
|
5
|
-
tname: string;
|
|
6
|
-
tstart: number;
|
|
7
|
-
tend: number;
|
|
8
|
-
qname: string;
|
|
9
|
-
qstart: number;
|
|
10
|
-
qend: number;
|
|
11
|
-
strand: number;
|
|
12
|
-
extra: {
|
|
13
|
-
mappingQual: number;
|
|
14
|
-
};
|
|
15
|
-
}[]>;
|
|
4
|
+
setupPre(opts?: BaseOptions): Promise<import("../PAFAdapter/util.ts").PAFRecord[]>;
|
|
16
5
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
|
|
2
2
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
3
|
import { parseLineByLine } from '@jbrowse/core/util/parseLineByLine';
|
|
4
|
-
import PAFAdapter from
|
|
4
|
+
import PAFAdapter from "../PAFAdapter/PAFAdapter.js";
|
|
5
|
+
import { getWeightedMeans } from "../PAFAdapter/util.js";
|
|
5
6
|
export default class MashMapAdapter extends PAFAdapter {
|
|
6
7
|
async setupPre(opts) {
|
|
7
8
|
const lines = [];
|
|
8
9
|
parseLineByLine(await fetchAndMaybeUnzip(openLocation(this.getConf('outLocation'), this.pluginManager), opts), line => {
|
|
9
10
|
lines.push(parseMashMapLine(line));
|
|
10
11
|
return true;
|
|
11
|
-
}, opts
|
|
12
|
-
return lines;
|
|
12
|
+
}, opts?.statusCallback);
|
|
13
|
+
return getWeightedMeans(lines);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
function parseMashMapLine(line) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const MashMapAdapter: import("
|
|
1
|
+
declare const MashMapAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
assemblyNames: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: never[];
|
|
@@ -21,5 +21,5 @@ declare const MashMapAdapter: import("@jbrowse/core/configuration/configurationS
|
|
|
21
21
|
locationType: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
}, import("
|
|
24
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
25
25
|
export default MashMapAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function MashMapAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'MashMapAdapter',
|
|
@@ -8,6 +8,6 @@ export default function MashMapAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./MashMapAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import type { PAFRecord } from './util';
|
|
2
|
+
import type { PAFRecord } from './util.ts';
|
|
3
3
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
4
|
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
5
5
|
import type { Feature } from '@jbrowse/core/util';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
1
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
2
|
import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
|
|
4
3
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
@@ -6,11 +5,13 @@ import { parseLineByLine } from '@jbrowse/core/util/parseLineByLine';
|
|
|
6
5
|
import { doesIntersect2 } from '@jbrowse/core/util/range';
|
|
7
6
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
8
7
|
import { MismatchParser } from '@jbrowse/plugin-alignments';
|
|
9
|
-
import SyntenyFeature from
|
|
10
|
-
import { flipCigar, parsePAFLine, swapIndelCigar } from
|
|
11
|
-
import { getWeightedMeans } from
|
|
8
|
+
import SyntenyFeature from "../SyntenyFeature/index.js";
|
|
9
|
+
import { flipCigar, parsePAFLine, swapIndelCigar } from "../util.js";
|
|
10
|
+
import { getWeightedMeans } from "./util.js";
|
|
12
11
|
const { parseCigar } = MismatchParser;
|
|
13
|
-
class PAFAdapter extends BaseFeatureDataAdapter {
|
|
12
|
+
export default class PAFAdapter extends BaseFeatureDataAdapter {
|
|
13
|
+
setupP;
|
|
14
|
+
static capabilities = ['getFeatures', 'getRefNames'];
|
|
14
15
|
async setup(opts) {
|
|
15
16
|
if (!this.setupP) {
|
|
16
17
|
this.setupP = this.setupPre(opts).catch((e) => {
|
|
@@ -25,8 +26,8 @@ class PAFAdapter extends BaseFeatureDataAdapter {
|
|
|
25
26
|
parseLineByLine(await fetchAndMaybeUnzip(openLocation(this.getConf('pafLocation'), this.pluginManager), opts), line => {
|
|
26
27
|
lines.push(parsePAFLine(line));
|
|
27
28
|
return true;
|
|
28
|
-
}, opts
|
|
29
|
-
return lines;
|
|
29
|
+
}, opts?.statusCallback);
|
|
30
|
+
return getWeightedMeans(lines);
|
|
30
31
|
}
|
|
31
32
|
async hasDataForRefName() {
|
|
32
33
|
return true;
|
|
@@ -41,8 +42,7 @@ class PAFAdapter extends BaseFeatureDataAdapter {
|
|
|
41
42
|
return assemblyNames;
|
|
42
43
|
}
|
|
43
44
|
async getRefNames(opts = {}) {
|
|
44
|
-
|
|
45
|
-
const r1 = (_a = opts.regions) === null || _a === void 0 ? void 0 : _a[0].assemblyName;
|
|
45
|
+
const r1 = opts.regions?.[0].assemblyName;
|
|
46
46
|
const feats = await this.setup(opts);
|
|
47
47
|
const idx = this.getAssemblyNames().indexOf(r1);
|
|
48
48
|
if (idx !== -1) {
|
|
@@ -57,11 +57,7 @@ class PAFAdapter extends BaseFeatureDataAdapter {
|
|
|
57
57
|
}
|
|
58
58
|
getFeatures(query, opts = {}) {
|
|
59
59
|
return ObservableCreate(async (observer) => {
|
|
60
|
-
|
|
61
|
-
const { config } = opts;
|
|
62
|
-
if (config && readConfObject(config, 'colorBy') === 'meanQueryIdentity') {
|
|
63
|
-
pafRecords = getWeightedMeans(pafRecords);
|
|
64
|
-
}
|
|
60
|
+
const pafRecords = await this.setup(opts);
|
|
65
61
|
const assemblyNames = this.getAssemblyNames();
|
|
66
62
|
const { start: qstart, end: qend, refName: qref, assemblyName } = query;
|
|
67
63
|
const index = assemblyNames.indexOf(assemblyName);
|
|
@@ -133,5 +129,3 @@ class PAFAdapter extends BaseFeatureDataAdapter {
|
|
|
133
129
|
});
|
|
134
130
|
}
|
|
135
131
|
}
|
|
136
|
-
PAFAdapter.capabilities = ['getFeatures', 'getRefNames'];
|
|
137
|
-
export default PAFAdapter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const PAFAdapter: import("
|
|
1
|
+
declare const PAFAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
assemblyNames: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: never[];
|
|
@@ -21,5 +21,5 @@ declare const PAFAdapter: import("@jbrowse/core/configuration/configurationSchem
|
|
|
21
21
|
locationType: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
}, import("
|
|
24
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
25
25
|
export default PAFAdapter;
|
package/esm/PAFAdapter/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function PAFAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'PAFAdapter',
|
|
@@ -8,6 +8,6 @@ export default function PAFAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
category: 'Synteny adapters',
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./PAFAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|