@jbrowse/core 3.6.4 → 3.7.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/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +31 -33
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +15 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/consts.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/consts.js +9 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +17 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +6 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +4 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +4 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +11 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/useSequenceData.d.ts +13 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/useSequenceData.js +67 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +2 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +36 -39
- package/BaseFeatureWidget/stateModelFactory.d.ts +4 -4
- package/BaseFeatureWidget/util.d.ts +5 -2
- package/BaseFeatureWidget/util.js +41 -12
- package/PluginLoader.js +1 -1
- package/assemblyManager/assembly.d.ts +1 -0
- package/assemblyManager/assembly.js +3 -0
- package/assemblyManager/assemblyManager.d.ts +8 -0
- package/assemblyManager/assemblyManager.js +4 -0
- package/configuration/configurationSchema.js +1 -1
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +2 -2
- package/package.json +3 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/BaseTooltip.d.ts +1 -1
- package/ui/CascadingMenu.js +33 -4
- package/ui/ConfirmDialog.d.ts +10 -0
- package/ui/ConfirmDialog.js +18 -0
- package/ui/EditableTypography.js +1 -8
- package/ui/LoadingEllipses.d.ts +2 -1
- package/ui/LoadingEllipses.js +1 -1
- package/ui/Menu.d.ts +1 -0
- package/ui/Menu.js +2 -2
- package/ui/SanitizedHTML.js +13 -10
- package/util/aborting.js +1 -1
- package/util/cluster.js +17 -11
- package/util/color/index.d.ts +1 -0
- package/util/color/index.js +8 -0
- package/util/compositeMap.d.ts +2 -2
- package/util/convertCodingSequenceToPeptides.d.ts +6 -0
- package/util/convertCodingSequenceToPeptides.js +12 -0
- package/util/fetchSeq.d.ts +8 -0
- package/util/fetchSeq.js +27 -0
- package/util/flatbush/index.d.ts +25 -0
- package/util/flatbush/index.js +362 -0
- package/util/flatqueue/index.d.ts +11 -0
- package/util/flatqueue/index.js +66 -0
- package/util/index.js +18 -12
- package/util/jexl.js +1 -0
- package/util/layouts/PrecomputedLayout.d.ts +3 -1
- package/util/layouts/PrecomputedLayout.js +23 -14
- package/util/tracks.js +1 -1
- package/util/types/index.d.ts +2 -2
- package/util/useFeatureSequence.d.ts +19 -0
- package/util/useFeatureSequence.js +90 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +0 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +0 -65
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stitch = stitch;
|
|
4
|
-
exports.
|
|
4
|
+
exports.filterSuccessiveElementsWithSameStartAndEndCoord = filterSuccessiveElementsWithSameStartAndEndCoord;
|
|
5
5
|
exports.revlist = revlist;
|
|
6
6
|
exports.calculateUTRs = calculateUTRs;
|
|
7
7
|
exports.calculateUTRs2 = calculateUTRs2;
|
|
@@ -14,7 +14,7 @@ function stitch(subfeats, sequence) {
|
|
|
14
14
|
function getItemId(feat) {
|
|
15
15
|
return `${feat.start}-${feat.end}`;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function filterSuccessiveElementsWithSameStartAndEndCoord(list) {
|
|
18
18
|
return list.filter((item, pos, ary) => !pos || getItemId(item) !== getItemId(ary[pos - 1]));
|
|
19
19
|
}
|
|
20
20
|
function revlist(list, seqlen) {
|
|
@@ -30,21 +30,37 @@ function calculateUTRs(cds, exons) {
|
|
|
30
30
|
if (!cds.length) {
|
|
31
31
|
return [];
|
|
32
32
|
}
|
|
33
|
+
if (exons.length < cds.length) {
|
|
34
|
+
console.warn('exons.length less than cds.length, cant calculate UTR properly', { exons, cds });
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
33
37
|
const firstCds = cds.at(0);
|
|
34
38
|
const lastCds = cds.at(-1);
|
|
35
39
|
const firstCdsIdx = exons.findIndex(exon => exon.end >= firstCds.start && exon.start <= firstCds.start);
|
|
36
40
|
const lastCdsIdx = exons.findIndex(exon => exon.end >= lastCds.end && exon.start <= lastCds.end);
|
|
37
41
|
const lastCdsExon = exons[lastCdsIdx];
|
|
38
42
|
const firstCdsExon = exons[firstCdsIdx];
|
|
39
|
-
const
|
|
43
|
+
const fivePrimeUTRs = [
|
|
40
44
|
...exons.slice(0, firstCdsIdx),
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
{
|
|
46
|
+
start: firstCdsExon.start,
|
|
47
|
+
end: firstCds.start,
|
|
48
|
+
},
|
|
49
|
+
].map(elt => ({
|
|
50
|
+
...elt,
|
|
51
|
+
type: 'five_prime_UTR',
|
|
52
|
+
}));
|
|
53
|
+
const threePrimeUTRs = [
|
|
54
|
+
{
|
|
55
|
+
start: lastCds.end,
|
|
56
|
+
end: lastCdsExon.end,
|
|
57
|
+
},
|
|
45
58
|
...exons.slice(lastCdsIdx + 1),
|
|
46
|
-
].map(elt => ({
|
|
47
|
-
|
|
59
|
+
].map(elt => ({
|
|
60
|
+
...elt,
|
|
61
|
+
type: 'three_prime_UTR',
|
|
62
|
+
}));
|
|
63
|
+
return [...fivePrimeUTRs, ...threePrimeUTRs];
|
|
48
64
|
}
|
|
49
65
|
function calculateUTRs2(cds, parentFeat) {
|
|
50
66
|
if (!cds.length) {
|
|
@@ -52,12 +68,25 @@ function calculateUTRs2(cds, parentFeat) {
|
|
|
52
68
|
}
|
|
53
69
|
const firstCds = cds.at(0);
|
|
54
70
|
const lastCds = cds.at(-1);
|
|
55
|
-
const
|
|
56
|
-
|
|
71
|
+
const fivePrimeUTRs = [
|
|
72
|
+
{
|
|
73
|
+
start: parentFeat.start,
|
|
74
|
+
end: firstCds.start,
|
|
75
|
+
},
|
|
76
|
+
].map(elt => ({
|
|
77
|
+
...elt,
|
|
78
|
+
type: 'five_prime_UTR',
|
|
79
|
+
}));
|
|
80
|
+
const threePrimeUTRs = [
|
|
81
|
+
{
|
|
82
|
+
start: lastCds.end,
|
|
83
|
+
end: parentFeat.end,
|
|
84
|
+
},
|
|
85
|
+
].map(elt => ({
|
|
57
86
|
...elt,
|
|
58
87
|
type: 'three_prime_UTR',
|
|
59
88
|
}));
|
|
60
|
-
return [...
|
|
89
|
+
return [...fivePrimeUTRs, ...threePrimeUTRs];
|
|
61
90
|
}
|
|
62
91
|
function ellipses(slug) {
|
|
63
92
|
return slug.length > 20 ? `${slug.slice(0, 20)}...` : slug;
|
package/PluginLoader.js
CHANGED
|
@@ -45,6 +45,7 @@ export default function assemblyFactory(assemblyConfigType: IAnyType, pluginMana
|
|
|
45
45
|
readonly refNames: string[] | undefined;
|
|
46
46
|
} & {
|
|
47
47
|
getCanonicalRefName(refName: string): string | undefined;
|
|
48
|
+
getCanonicalRefName2(asmName: string): string;
|
|
48
49
|
getRefNameColor(refName: string): string | undefined;
|
|
49
50
|
isValidRefName(refName: string): boolean;
|
|
50
51
|
} & {
|
|
@@ -162,6 +162,9 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
162
162
|
}
|
|
163
163
|
return (self.refNameAliases[refName] || self.lowerCaseRefNameAliases[refName]);
|
|
164
164
|
},
|
|
165
|
+
getCanonicalRefName2(asmName) {
|
|
166
|
+
return this.getCanonicalRefName(asmName) || asmName;
|
|
167
|
+
},
|
|
165
168
|
getRefNameColor(refName) {
|
|
166
169
|
if (!self.refNames) {
|
|
167
170
|
return undefined;
|
|
@@ -37,6 +37,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
37
37
|
readonly refNames: string[] | undefined;
|
|
38
38
|
} & {
|
|
39
39
|
getCanonicalRefName(refName: string): string | undefined;
|
|
40
|
+
getCanonicalRefName2(asmName: string): string;
|
|
40
41
|
getRefNameColor(refName: string): string | undefined;
|
|
41
42
|
isValidRefName(refName: string): boolean;
|
|
42
43
|
} & {
|
|
@@ -105,6 +106,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
105
106
|
readonly refNames: string[] | undefined;
|
|
106
107
|
} & {
|
|
107
108
|
getCanonicalRefName(refName: string): string | undefined;
|
|
109
|
+
getCanonicalRefName2(asmName: string): string;
|
|
108
110
|
getRefNameColor(refName: string): string | undefined;
|
|
109
111
|
isValidRefName(refName: string): boolean;
|
|
110
112
|
} & {
|
|
@@ -171,6 +173,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
171
173
|
readonly refNames: string[] | undefined;
|
|
172
174
|
} & {
|
|
173
175
|
getCanonicalRefName(refName: string): string | undefined;
|
|
176
|
+
getCanonicalRefName2(asmName: string): string;
|
|
174
177
|
getRefNameColor(refName: string): string | undefined;
|
|
175
178
|
isValidRefName(refName: string): boolean;
|
|
176
179
|
} & {
|
|
@@ -208,6 +211,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
208
211
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
209
212
|
} & {
|
|
210
213
|
getCanonicalAssemblyName(asmName: string): string | undefined;
|
|
214
|
+
getCanonicalAssemblyName2(asmName: string): string;
|
|
211
215
|
get(asmName: string): ({
|
|
212
216
|
configuration: any;
|
|
213
217
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -240,6 +244,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
240
244
|
readonly refNames: string[] | undefined;
|
|
241
245
|
} & {
|
|
242
246
|
getCanonicalRefName(refName: string): string | undefined;
|
|
247
|
+
getCanonicalRefName2(asmName: string): string;
|
|
243
248
|
getRefNameColor(refName: string): string | undefined;
|
|
244
249
|
isValidRefName(refName: string): boolean;
|
|
245
250
|
} & {
|
|
@@ -306,6 +311,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
306
311
|
readonly refNames: string[] | undefined;
|
|
307
312
|
} & {
|
|
308
313
|
getCanonicalRefName(refName: string): string | undefined;
|
|
314
|
+
getCanonicalRefName2(asmName: string): string;
|
|
309
315
|
getRefNameColor(refName: string): string | undefined;
|
|
310
316
|
isValidRefName(refName: string): boolean;
|
|
311
317
|
} & {
|
|
@@ -377,6 +383,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
377
383
|
readonly refNames: string[] | undefined;
|
|
378
384
|
} & {
|
|
379
385
|
getCanonicalRefName(refName: string): string | undefined;
|
|
386
|
+
getCanonicalRefName2(asmName: string): string;
|
|
380
387
|
getRefNameColor(refName: string): string | undefined;
|
|
381
388
|
isValidRefName(refName: string): boolean;
|
|
382
389
|
} & {
|
|
@@ -443,6 +450,7 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
443
450
|
readonly refNames: string[] | undefined;
|
|
444
451
|
} & {
|
|
445
452
|
getCanonicalRefName(refName: string): string | undefined;
|
|
453
|
+
getCanonicalRefName2(asmName: string): string;
|
|
446
454
|
getRefNameColor(refName: string): string | undefined;
|
|
447
455
|
isValidRefName(refName: string): boolean;
|
|
448
456
|
} & {
|
|
@@ -29,6 +29,10 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
29
29
|
var _a;
|
|
30
30
|
return (_a = self.assemblyNameMap[asmName]) === null || _a === void 0 ? void 0 : _a.name;
|
|
31
31
|
},
|
|
32
|
+
getCanonicalAssemblyName2(asmName) {
|
|
33
|
+
var _a;
|
|
34
|
+
return ((_a = self.assemblyNameMap[asmName]) === null || _a === void 0 ? void 0 : _a.name) || asmName;
|
|
35
|
+
},
|
|
32
36
|
get(asmName) {
|
|
33
37
|
if (asmName) {
|
|
34
38
|
const assembly = self.assemblyNameMap[asmName];
|
|
@@ -33,8 +33,8 @@ function preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition
|
|
|
33
33
|
options = {
|
|
34
34
|
...inputOptions.baseConfiguration.jbrowseSchemaOptions,
|
|
35
35
|
...inputOptions,
|
|
36
|
+
baseConfiguration: undefined,
|
|
36
37
|
};
|
|
37
|
-
options.baseConfiguration = undefined;
|
|
38
38
|
}
|
|
39
39
|
return { schemaDefinition, options };
|
|
40
40
|
}
|
|
@@ -59,7 +59,7 @@ class BaseFeatureDataAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
getRegionFeatureDensityStats(region, opts) {
|
|
62
|
-
let lastTime =
|
|
62
|
+
let lastTime = Date.now();
|
|
63
63
|
const statsFromInterval = async (length, expansionTime) => {
|
|
64
64
|
const { start, end } = region;
|
|
65
65
|
const sampleCenter = start * 0.75 + end * 0.25;
|
|
@@ -83,7 +83,7 @@ class BaseFeatureDataAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
83
83
|
return stats;
|
|
84
84
|
}
|
|
85
85
|
else if (expansionTime <= 5000) {
|
|
86
|
-
const currTime =
|
|
86
|
+
const currTime = Date.now();
|
|
87
87
|
expansionTime += currTime - lastTime;
|
|
88
88
|
lastTime = currTime;
|
|
89
89
|
return statsFromInterval(interval * 2, expansionTime);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"copy-to-clipboard": "^3.3.1",
|
|
45
45
|
"deepmerge": "^4.2.2",
|
|
46
46
|
"detect-node": "^2.1.0",
|
|
47
|
-
"dompurify": "^3.
|
|
47
|
+
"dompurify": "^3.3.0",
|
|
48
48
|
"escape-html": "^1.0.3",
|
|
49
49
|
"fast-deep-equal": "^3.1.3",
|
|
50
50
|
"generic-filehandle2": "^2.0.1",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"mobx": "^6.0.0",
|
|
55
55
|
"mobx-react": "^9.0.0",
|
|
56
56
|
"mobx-state-tree": "^5.0.0",
|
|
57
|
-
"rbush": "^3.0.1",
|
|
58
57
|
"react-draggable": "^4.4.5",
|
|
59
58
|
"rxjs": "^7.0.0",
|
|
60
59
|
"serialize-error": "^8.0.0",
|
|
@@ -69,5 +68,5 @@
|
|
|
69
68
|
"access": "public",
|
|
70
69
|
"directory": "dist"
|
|
71
70
|
},
|
|
72
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
|
|
73
72
|
}
|