@jbrowse/plugin-data-management 2.7.2 → 2.9.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/AddTrackWidget/model.d.ts +81 -0
- package/dist/AddTrackWidget/model.js +81 -0
- package/dist/HierarchicalTrackSelectorWidget/components/ShoppingCart.d.ts +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/ShoppingCart.js +11 -53
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.d.ts +5 -7
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.js +12 -11
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.d.ts +5 -7
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.js +11 -8
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.d.ts +1 -11
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.js +9 -7
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +40 -135
- package/dist/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.d.ts +12 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.js +57 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.d.ts +6 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.js +42 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js +71 -46
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js +5 -34
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalTree.js +8 -3
- package/dist/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.d.ts +6 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.js +42 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackCategory.js +7 -6
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.js +9 -28
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.d.ts +12 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.js +50 -0
- package/dist/HierarchicalTrackSelectorWidget/components/util.d.ts +3 -0
- package/dist/HierarchicalTrackSelectorWidget/components/util.js +5 -1
- package/dist/HierarchicalTrackSelectorWidget/facetedModel.d.ts +128 -0
- package/dist/HierarchicalTrackSelectorWidget/facetedModel.js +206 -0
- package/dist/HierarchicalTrackSelectorWidget/facetedUtil.d.ts +2 -0
- package/dist/HierarchicalTrackSelectorWidget/{components/faceted/util.js → facetedUtil.js} +5 -1
- package/dist/HierarchicalTrackSelectorWidget/generateHierarchy.d.ts +17 -5
- package/dist/HierarchicalTrackSelectorWidget/generateHierarchy.js +27 -21
- package/dist/HierarchicalTrackSelectorWidget/model.d.ts +196 -17
- package/dist/HierarchicalTrackSelectorWidget/model.js +178 -23
- package/dist/ucsc-trackhub/doConnect.d.ts +1 -0
- package/dist/ucsc-trackhub/doConnect.js +131 -0
- package/dist/ucsc-trackhub/model.d.ts +19 -2
- package/dist/ucsc-trackhub/model.js +16 -71
- package/dist/ucsc-trackhub/ucscTrackHub.d.ts +161 -4
- package/dist/ucsc-trackhub/ucscTrackHub.js +49 -166
- package/esm/AddTrackWidget/model.d.ts +81 -0
- package/esm/AddTrackWidget/model.js +81 -0
- package/esm/HierarchicalTrackSelectorWidget/components/ShoppingCart.d.ts +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/ShoppingCart.js +12 -31
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.d.ts +5 -7
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.js +13 -11
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.d.ts +5 -7
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.js +12 -8
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.d.ts +1 -11
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.js +9 -7
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +41 -113
- package/esm/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.d.ts +12 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.js +29 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.d.ts +6 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.js +37 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js +71 -46
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js +6 -12
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalTree.js +8 -3
- package/esm/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.d.ts +6 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.js +37 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackCategory.js +7 -6
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.js +8 -27
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.d.ts +12 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.js +45 -0
- package/esm/HierarchicalTrackSelectorWidget/components/util.d.ts +3 -0
- package/esm/HierarchicalTrackSelectorWidget/components/util.js +5 -1
- package/esm/HierarchicalTrackSelectorWidget/facetedModel.d.ts +128 -0
- package/esm/HierarchicalTrackSelectorWidget/facetedModel.js +202 -0
- package/esm/HierarchicalTrackSelectorWidget/facetedUtil.d.ts +2 -0
- package/esm/HierarchicalTrackSelectorWidget/{components/faceted/util.js → facetedUtil.js} +3 -0
- package/esm/HierarchicalTrackSelectorWidget/generateHierarchy.d.ts +17 -5
- package/esm/HierarchicalTrackSelectorWidget/generateHierarchy.js +27 -21
- package/esm/HierarchicalTrackSelectorWidget/model.d.ts +196 -17
- package/esm/HierarchicalTrackSelectorWidget/model.js +180 -25
- package/esm/ucsc-trackhub/doConnect.d.ts +1 -0
- package/esm/ucsc-trackhub/doConnect.js +127 -0
- package/esm/ucsc-trackhub/model.d.ts +19 -2
- package/esm/ucsc-trackhub/model.js +17 -72
- package/esm/ucsc-trackhub/ucscTrackHub.d.ts +161 -4
- package/esm/ucsc-trackhub/ucscTrackHub.js +48 -141
- package/package.json +3 -3
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/util.d.ts +0 -1
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/util.d.ts +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doConnect = void 0;
|
|
4
|
+
const ucsc_hub_1 = require("@gmod/ucsc-hub");
|
|
5
|
+
const ucscTrackHub_1 = require("./ucscTrackHub");
|
|
6
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
7
|
+
const util_1 = require("@jbrowse/core/util");
|
|
8
|
+
const io_1 = require("@jbrowse/core/util/io");
|
|
9
|
+
const nanoid_1 = require("@jbrowse/core/util/nanoid");
|
|
10
|
+
function resolve(uri, baseUri) {
|
|
11
|
+
return new URL(uri, baseUri).href;
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
async function doConnect(self) {
|
|
15
|
+
var _a;
|
|
16
|
+
const session = (0, util_1.getSession)(self);
|
|
17
|
+
const notLoadedAssemblies = [];
|
|
18
|
+
try {
|
|
19
|
+
const hubFileLocation = (0, configuration_1.getConf)(self, 'hubTxtLocation');
|
|
20
|
+
const hubFileText = await (0, io_1.openLocation)(hubFileLocation).readFile('utf8');
|
|
21
|
+
// @ts-expect-error
|
|
22
|
+
const hubUri = resolve(hubFileLocation.uri, hubFileLocation.baseUri);
|
|
23
|
+
const { assemblyManager } = session;
|
|
24
|
+
if (hubFileText.includes('useOneFile on')) {
|
|
25
|
+
const hub = new ucsc_hub_1.SingleFileHub(hubFileText);
|
|
26
|
+
const { genome, tracks } = hub;
|
|
27
|
+
const genomeName = genome.name;
|
|
28
|
+
const asm = assemblyManager.get(genomeName);
|
|
29
|
+
if (!asm) {
|
|
30
|
+
// @ts-expect-error
|
|
31
|
+
session.addSessionAssembly({
|
|
32
|
+
name: genomeName,
|
|
33
|
+
sequence: {
|
|
34
|
+
type: 'ReferenceSequenceTrack',
|
|
35
|
+
trackId: `${genomeName}-${(0, nanoid_1.nanoid)()}`,
|
|
36
|
+
adapter: {
|
|
37
|
+
type: 'TwoBitAdapter',
|
|
38
|
+
twoBitLocation: {
|
|
39
|
+
uri: resolve(genome.data.twoBitPath, hubUri),
|
|
40
|
+
},
|
|
41
|
+
chromSizesLocation: {
|
|
42
|
+
uri: resolve(genome.data.chromSizes, hubUri),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const asm2 = assemblyManager.get(genomeName);
|
|
49
|
+
const sequenceAdapter = (0, configuration_1.getConf)(asm2, ['sequence', 'adapter']);
|
|
50
|
+
const tracksNew = (0, ucscTrackHub_1.generateTracks)({
|
|
51
|
+
trackDb: tracks,
|
|
52
|
+
trackDbLoc: hubFileLocation,
|
|
53
|
+
assemblyName: genomeName,
|
|
54
|
+
sequenceAdapter,
|
|
55
|
+
});
|
|
56
|
+
self.addTrackConfs(tracksNew);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const hubFile = new ucsc_hub_1.HubFile(hubFileText);
|
|
60
|
+
const genomeFile = hubFile.data.genomesFile;
|
|
61
|
+
if (!genomeFile) {
|
|
62
|
+
throw new Error('genomesFile not found on hub');
|
|
63
|
+
}
|
|
64
|
+
// @ts-expect-error
|
|
65
|
+
const hubUri = resolve(hubFileLocation.uri, hubFileLocation.baseUri);
|
|
66
|
+
const genomesFileLocation = hubUri
|
|
67
|
+
? {
|
|
68
|
+
uri: resolve(genomeFile, hubUri),
|
|
69
|
+
locationType: 'UriLocation',
|
|
70
|
+
}
|
|
71
|
+
: {
|
|
72
|
+
localPath: genomeFile,
|
|
73
|
+
locationType: 'LocalPathLocation',
|
|
74
|
+
};
|
|
75
|
+
const genomesFile = await (0, ucscTrackHub_1.fetchGenomesFile)(genomesFileLocation);
|
|
76
|
+
const map = {};
|
|
77
|
+
for (const [genomeName, genome] of Object.entries(genomesFile.data)) {
|
|
78
|
+
const assemblyNames = (0, configuration_1.getConf)(self, 'assemblyNames');
|
|
79
|
+
if (assemblyNames.length > 0 && !assemblyNames.includes(genomeName)) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const asm = assemblyManager.get(genomeName);
|
|
83
|
+
if (!asm) {
|
|
84
|
+
notLoadedAssemblies.push(genomeName);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
// @ts-expect-error
|
|
88
|
+
const db = genome.data.trackDb;
|
|
89
|
+
if (!db) {
|
|
90
|
+
throw new Error('genomesFile not found on hub');
|
|
91
|
+
}
|
|
92
|
+
const base = new URL(genomeFile, hubUri);
|
|
93
|
+
const loc = hubUri
|
|
94
|
+
? {
|
|
95
|
+
uri: new URL(db, base).href,
|
|
96
|
+
locationType: 'UriLocation',
|
|
97
|
+
}
|
|
98
|
+
: {
|
|
99
|
+
localPath: db,
|
|
100
|
+
locationType: 'LocalPathLocation',
|
|
101
|
+
};
|
|
102
|
+
const trackDb = await (0, ucscTrackHub_1.fetchTrackDbFile)(loc);
|
|
103
|
+
const sequenceAdapter = (0, configuration_1.getConf)(asm, ['sequence', 'adapter']);
|
|
104
|
+
const tracks = (0, ucscTrackHub_1.generateTracks)({
|
|
105
|
+
trackDb,
|
|
106
|
+
trackDbLoc: loc,
|
|
107
|
+
assemblyName: genomeName,
|
|
108
|
+
sequenceAdapter,
|
|
109
|
+
});
|
|
110
|
+
self.addTrackConfs(tracks);
|
|
111
|
+
map[genomeName] = tracks.length;
|
|
112
|
+
}
|
|
113
|
+
const loadedAssemblies = Object.entries(map);
|
|
114
|
+
const str1 = loadedAssemblies.length
|
|
115
|
+
? `Loaded data from these assemblies: ${loadedAssemblies
|
|
116
|
+
.map(([key, val]) => `${key} (${val} tracks)`)
|
|
117
|
+
.join(', ')}`
|
|
118
|
+
: '';
|
|
119
|
+
const str2 = notLoadedAssemblies.length
|
|
120
|
+
? `Skipped data from these assemblies: ${notLoadedAssemblies.join(', ')}`
|
|
121
|
+
: '';
|
|
122
|
+
session.notify([str1, str2].filter(f => !!f).join('. '), 'success');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (e) {
|
|
126
|
+
console.error(e);
|
|
127
|
+
session.notify(`${(0, configuration_1.getConf)(self, 'name')}: "${e}"`, 'error');
|
|
128
|
+
(_a = session.breakConnection) === null || _a === void 0 ? void 0 : _a.call(session, self.configuration);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.doConnect = doConnect;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
/**
|
|
3
|
+
* #stateModel UCSCTrackHubConnection
|
|
4
|
+
* extends BaseConnectionModel
|
|
5
|
+
*/
|
|
2
6
|
export default function UCSCTrackHubConnection(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
3
7
|
name: import("mobx-state-tree").ISimpleType<string>;
|
|
4
8
|
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
@@ -10,11 +14,16 @@ export default function UCSCTrackHubConnection(pluginManager: PluginManager): im
|
|
|
10
14
|
};
|
|
11
15
|
assemblyNames: {
|
|
12
16
|
type: string;
|
|
13
|
-
defaultValue: never[];
|
|
17
|
+
defaultValue: never[]; /**
|
|
18
|
+
* #action
|
|
19
|
+
*/
|
|
14
20
|
description: string;
|
|
15
21
|
};
|
|
16
22
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
|
|
17
23
|
} & {
|
|
24
|
+
/**
|
|
25
|
+
* #property
|
|
26
|
+
*/
|
|
18
27
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
19
28
|
hubTxtLocation: {
|
|
20
29
|
type: string;
|
|
@@ -25,7 +34,9 @@ export default function UCSCTrackHubConnection(pluginManager: PluginManager): im
|
|
|
25
34
|
description: string;
|
|
26
35
|
};
|
|
27
36
|
assemblyNames: {
|
|
28
|
-
type: string;
|
|
37
|
+
type: string; /**
|
|
38
|
+
* #property
|
|
39
|
+
*/
|
|
29
40
|
defaultValue: never[];
|
|
30
41
|
description: string;
|
|
31
42
|
};
|
|
@@ -41,6 +52,9 @@ export default function UCSCTrackHubConnection(pluginManager: PluginManager): im
|
|
|
41
52
|
description: string;
|
|
42
53
|
};
|
|
43
54
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>, undefined>>;
|
|
55
|
+
/**
|
|
56
|
+
* #property
|
|
57
|
+
*/
|
|
44
58
|
type: import("mobx-state-tree").ISimpleType<"UCSCTrackHubConnection">;
|
|
45
59
|
}, {
|
|
46
60
|
connect(_arg: {
|
|
@@ -67,5 +81,8 @@ export default function UCSCTrackHubConnection(pluginManager: PluginManager): im
|
|
|
67
81
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[]): import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
68
82
|
clear(): void;
|
|
69
83
|
} & {
|
|
84
|
+
/**
|
|
85
|
+
* #action
|
|
86
|
+
*/
|
|
70
87
|
connect(): Promise<void>;
|
|
71
88
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -28,88 +28,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
|
|
30
30
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
31
|
-
const util_1 = require("@jbrowse/core/util");
|
|
32
31
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
33
32
|
// locals
|
|
34
33
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
34
|
+
/**
|
|
35
|
+
* #stateModel UCSCTrackHubConnection
|
|
36
|
+
* extends BaseConnectionModel
|
|
37
|
+
*/
|
|
35
38
|
function UCSCTrackHubConnection(pluginManager) {
|
|
36
39
|
return mobx_state_tree_1.types
|
|
37
40
|
.compose('UCSCTrackHubConnection', (0, models_1.BaseConnectionModelFactory)(pluginManager), mobx_state_tree_1.types.model({
|
|
41
|
+
/**
|
|
42
|
+
* #property
|
|
43
|
+
*/
|
|
38
44
|
configuration: (0, configuration_1.ConfigurationReference)(configSchema_1.default),
|
|
45
|
+
/**
|
|
46
|
+
* #property
|
|
47
|
+
*/
|
|
39
48
|
type: mobx_state_tree_1.types.literal('UCSCTrackHubConnection'),
|
|
40
49
|
}))
|
|
41
50
|
.actions(self => ({
|
|
51
|
+
/**
|
|
52
|
+
* #action
|
|
53
|
+
*/
|
|
42
54
|
async connect() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
const hubFileLocation = (0, configuration_1.getConf)(self, 'hubTxtLocation');
|
|
48
|
-
const { generateTracks, fetchGenomesFile, fetchTrackDbFile, fetchHubFile, } = await Promise.resolve().then(() => __importStar(require('./ucscTrackHub')));
|
|
49
|
-
const hubFile = await fetchHubFile(hubFileLocation);
|
|
50
|
-
const genomeFile = hubFile.get('genomesFile');
|
|
51
|
-
if (!genomeFile) {
|
|
52
|
-
throw new Error('genomesFile not found on hub');
|
|
53
|
-
}
|
|
54
|
-
const hubUri = new URL(hubFileLocation.uri, hubFileLocation.baseUri);
|
|
55
|
-
const genomesFileLocation = hubUri
|
|
56
|
-
? {
|
|
57
|
-
uri: new URL(genomeFile, hubUri).href,
|
|
58
|
-
locationType: 'UriLocation',
|
|
59
|
-
}
|
|
60
|
-
: {
|
|
61
|
-
localPath: genomeFile,
|
|
62
|
-
locationType: 'LocalPathLocation',
|
|
63
|
-
};
|
|
64
|
-
const genomesFile = await fetchGenomesFile(genomesFileLocation);
|
|
65
|
-
const map = {};
|
|
66
|
-
for (const [genomeName, genome] of genomesFile) {
|
|
67
|
-
const assemblyNames = (0, configuration_1.getConf)(self, 'assemblyNames');
|
|
68
|
-
if (assemblyNames.length > 0 &&
|
|
69
|
-
!assemblyNames.includes(genomeName)) {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
const conf = (_a = session.assemblyManager.get(genomeName)) === null || _a === void 0 ? void 0 : _a.configuration;
|
|
73
|
-
if (!conf) {
|
|
74
|
-
notLoadedAssemblies.push(genomeName);
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
const db = genome.get('trackDb');
|
|
78
|
-
if (!db) {
|
|
79
|
-
throw new Error('genomesFile not found on hub');
|
|
80
|
-
}
|
|
81
|
-
const base = new URL(genomeFile, hubUri);
|
|
82
|
-
const loc = hubUri
|
|
83
|
-
? {
|
|
84
|
-
uri: new URL(db, base).href,
|
|
85
|
-
locationType: 'UriLocation',
|
|
86
|
-
}
|
|
87
|
-
: {
|
|
88
|
-
localPath: db,
|
|
89
|
-
locationType: 'LocalPathLocation',
|
|
90
|
-
};
|
|
91
|
-
const trackDb = await fetchTrackDbFile(loc);
|
|
92
|
-
const seqAdapter = (0, configuration_1.readConfObject)(conf, ['sequence', 'adapter']);
|
|
93
|
-
const tracks = generateTracks(trackDb, loc, genomeName, seqAdapter);
|
|
94
|
-
self.addTrackConfs(tracks);
|
|
95
|
-
map[genomeName] = tracks.length;
|
|
96
|
-
}
|
|
97
|
-
const loadedAssemblies = Object.entries(map);
|
|
98
|
-
const str1 = loadedAssemblies.length
|
|
99
|
-
? `Loaded data from these assemblies: ${loadedAssemblies
|
|
100
|
-
.map(([key, val]) => `${key} (${val} tracks)`)
|
|
101
|
-
.join(', ')}`
|
|
102
|
-
: '';
|
|
103
|
-
const str2 = notLoadedAssemblies.length
|
|
104
|
-
? `Skipped data from these assemblies: ${notLoadedAssemblies.join(', ')}`
|
|
105
|
-
: '';
|
|
106
|
-
session.notify([str1, str2].filter(f => !!f).join('. '), 'success');
|
|
107
|
-
}
|
|
108
|
-
catch (e) {
|
|
109
|
-
console.error(e);
|
|
110
|
-
session.notify(`There was a problem connecting to the UCSC Track Hub "${self.configuration.name}". Please make sure you have entered a valid hub.txt file. The error that was thrown is: "${e}"`, 'error');
|
|
111
|
-
(_b = session.breakConnection) === null || _b === void 0 ? void 0 : _b.call(session, self.configuration);
|
|
112
|
-
}
|
|
55
|
+
const { doConnect } = await Promise.resolve().then(() => __importStar(require('./doConnect')));
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
57
|
+
doConnect(self);
|
|
113
58
|
},
|
|
114
59
|
}));
|
|
115
60
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TrackDbFile } from '@gmod/ucsc-hub';
|
|
2
1
|
import { FileLocation } from '@jbrowse/core/util';
|
|
3
|
-
|
|
4
|
-
export declare function fetchGenomesFile(genomesLoc: FileLocation): Promise<
|
|
2
|
+
import { GenomesFile, TrackDbFile } from '@gmod/ucsc-hub';
|
|
3
|
+
export declare function fetchGenomesFile(genomesLoc: FileLocation): Promise<GenomesFile>;
|
|
5
4
|
export declare function fetchTrackDbFile(trackDbLoc: FileLocation): Promise<TrackDbFile>;
|
|
6
5
|
export declare function makeLoc(first: string, base: {
|
|
7
6
|
uri: string;
|
|
7
|
+
baseUri?: string;
|
|
8
8
|
}): {
|
|
9
9
|
uri: string;
|
|
10
10
|
locationType: string;
|
|
@@ -19,5 +19,162 @@ export declare function makeLoc2(first: string, alt?: string): {
|
|
|
19
19
|
uri: string | undefined;
|
|
20
20
|
locationType: string;
|
|
21
21
|
};
|
|
22
|
-
export declare function generateTracks(trackDb
|
|
22
|
+
export declare function generateTracks({ trackDb, trackDbLoc, assemblyName, sequenceAdapter, }: {
|
|
23
|
+
trackDb: TrackDbFile;
|
|
24
|
+
trackDbLoc: FileLocation;
|
|
25
|
+
assemblyName: string;
|
|
26
|
+
sequenceAdapter: any;
|
|
27
|
+
}): ({
|
|
28
|
+
trackId: string;
|
|
29
|
+
assemblyNames: string[];
|
|
30
|
+
type: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
category: string[] | undefined;
|
|
34
|
+
} | {
|
|
35
|
+
trackId: string;
|
|
36
|
+
assemblyNames: string[];
|
|
37
|
+
type: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
category: string[];
|
|
41
|
+
adapter: {
|
|
42
|
+
type: string;
|
|
43
|
+
bamLocation: {
|
|
44
|
+
uri: string | undefined;
|
|
45
|
+
locationType: string;
|
|
46
|
+
};
|
|
47
|
+
index: {
|
|
48
|
+
location: {
|
|
49
|
+
uri: string | undefined;
|
|
50
|
+
locationType: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
cramLocation?: undefined;
|
|
54
|
+
craiLocation?: undefined;
|
|
55
|
+
sequenceAdapter?: undefined;
|
|
56
|
+
bigBedLocation?: undefined;
|
|
57
|
+
bigWigLocation?: undefined;
|
|
58
|
+
vcfGzLocation?: undefined;
|
|
59
|
+
hicLocation?: undefined;
|
|
60
|
+
};
|
|
61
|
+
} | {
|
|
62
|
+
trackId: string;
|
|
63
|
+
assemblyNames: string[];
|
|
64
|
+
type: string;
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
category: string[];
|
|
68
|
+
adapter: {
|
|
69
|
+
type: string;
|
|
70
|
+
cramLocation: {
|
|
71
|
+
uri: string | undefined;
|
|
72
|
+
locationType: string;
|
|
73
|
+
};
|
|
74
|
+
craiLocation: {
|
|
75
|
+
uri: string | undefined;
|
|
76
|
+
locationType: string;
|
|
77
|
+
};
|
|
78
|
+
sequenceAdapter: any;
|
|
79
|
+
bamLocation?: undefined;
|
|
80
|
+
index?: undefined;
|
|
81
|
+
bigBedLocation?: undefined;
|
|
82
|
+
bigWigLocation?: undefined;
|
|
83
|
+
vcfGzLocation?: undefined;
|
|
84
|
+
hicLocation?: undefined;
|
|
85
|
+
};
|
|
86
|
+
} | {
|
|
87
|
+
trackId: string;
|
|
88
|
+
assemblyNames: string[];
|
|
89
|
+
type: string;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
category: string[];
|
|
93
|
+
adapter: {
|
|
94
|
+
type: string;
|
|
95
|
+
bigBedLocation: {
|
|
96
|
+
uri: string | undefined;
|
|
97
|
+
locationType: string;
|
|
98
|
+
};
|
|
99
|
+
bamLocation?: undefined;
|
|
100
|
+
index?: undefined;
|
|
101
|
+
cramLocation?: undefined;
|
|
102
|
+
craiLocation?: undefined;
|
|
103
|
+
sequenceAdapter?: undefined;
|
|
104
|
+
bigWigLocation?: undefined;
|
|
105
|
+
vcfGzLocation?: undefined;
|
|
106
|
+
hicLocation?: undefined;
|
|
107
|
+
};
|
|
108
|
+
} | {
|
|
109
|
+
trackId: string;
|
|
110
|
+
assemblyNames: string[];
|
|
111
|
+
type: string;
|
|
112
|
+
name: string;
|
|
113
|
+
description: string;
|
|
114
|
+
category: string[];
|
|
115
|
+
adapter: {
|
|
116
|
+
type: string;
|
|
117
|
+
bigWigLocation: {
|
|
118
|
+
uri: string | undefined;
|
|
119
|
+
locationType: string;
|
|
120
|
+
};
|
|
121
|
+
bamLocation?: undefined;
|
|
122
|
+
index?: undefined;
|
|
123
|
+
cramLocation?: undefined;
|
|
124
|
+
craiLocation?: undefined;
|
|
125
|
+
sequenceAdapter?: undefined;
|
|
126
|
+
bigBedLocation?: undefined;
|
|
127
|
+
vcfGzLocation?: undefined;
|
|
128
|
+
hicLocation?: undefined;
|
|
129
|
+
};
|
|
130
|
+
} | {
|
|
131
|
+
trackId: string;
|
|
132
|
+
assemblyNames: string[];
|
|
133
|
+
type: string;
|
|
134
|
+
name: string;
|
|
135
|
+
description: string;
|
|
136
|
+
category: string[];
|
|
137
|
+
adapter: {
|
|
138
|
+
type: string;
|
|
139
|
+
vcfGzLocation: {
|
|
140
|
+
uri: string | undefined;
|
|
141
|
+
locationType: string;
|
|
142
|
+
};
|
|
143
|
+
index: {
|
|
144
|
+
location: {
|
|
145
|
+
uri: string | undefined;
|
|
146
|
+
locationType: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
bamLocation?: undefined;
|
|
150
|
+
cramLocation?: undefined;
|
|
151
|
+
craiLocation?: undefined;
|
|
152
|
+
sequenceAdapter?: undefined;
|
|
153
|
+
bigBedLocation?: undefined;
|
|
154
|
+
bigWigLocation?: undefined;
|
|
155
|
+
hicLocation?: undefined;
|
|
156
|
+
};
|
|
157
|
+
} | {
|
|
158
|
+
trackId: string;
|
|
159
|
+
assemblyNames: string[];
|
|
160
|
+
type: string;
|
|
161
|
+
name: string;
|
|
162
|
+
description: string;
|
|
163
|
+
category: string[];
|
|
164
|
+
adapter: {
|
|
165
|
+
type: string;
|
|
166
|
+
hicLocation: {
|
|
167
|
+
uri: string | undefined;
|
|
168
|
+
locationType: string;
|
|
169
|
+
};
|
|
170
|
+
bamLocation?: undefined;
|
|
171
|
+
index?: undefined;
|
|
172
|
+
cramLocation?: undefined;
|
|
173
|
+
craiLocation?: undefined;
|
|
174
|
+
sequenceAdapter?: undefined;
|
|
175
|
+
bigBedLocation?: undefined;
|
|
176
|
+
bigWigLocation?: undefined;
|
|
177
|
+
vcfGzLocation?: undefined;
|
|
178
|
+
};
|
|
179
|
+
})[];
|
|
23
180
|
export { default as ucscAssemblies } from './ucscAssemblies';
|