@jbrowse/plugin-sequence 3.1.0 → 3.3.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.
@@ -29,5 +29,26 @@ const BgzipFastaAdapter = (0, configuration_1.ConfigurationSchema)('BgzipFastaAd
29
29
  locationType: 'UriLocation',
30
30
  },
31
31
  },
32
- }, { explicitlyTyped: true });
32
+ }, {
33
+ explicitlyTyped: true,
34
+ preProcessSnapshot: snap => {
35
+ return snap.uri
36
+ ? {
37
+ ...snap,
38
+ fastaLocation: {
39
+ uri: snap.uri,
40
+ baseUri: snap.baseUri,
41
+ },
42
+ faiLocation: {
43
+ uri: `${snap.uri}.fai`,
44
+ baseUri: snap.baseUri,
45
+ },
46
+ gziLocation: {
47
+ uri: `${snap.uri}.gzi`,
48
+ baseUri: snap.baseUri,
49
+ },
50
+ }
51
+ : snap;
52
+ },
53
+ });
33
54
  exports.default = BgzipFastaAdapter;
@@ -10,5 +10,18 @@ const ChromSizesAdapter = (0, configuration_1.ConfigurationSchema)('ChromSizesAd
10
10
  locationType: 'UriLocation',
11
11
  },
12
12
  },
13
- }, { explicitlyTyped: true });
13
+ }, {
14
+ explicitlyTyped: true,
15
+ preProcessSnapshot: snap => {
16
+ return snap.uri
17
+ ? {
18
+ ...snap,
19
+ chromSizesLocation: {
20
+ uri: snap.uri,
21
+ baseUri: snap.baseUri,
22
+ },
23
+ }
24
+ : snap;
25
+ },
26
+ });
14
27
  exports.default = ChromSizesAdapter;
@@ -19,5 +19,22 @@ const IndexedFastaAdapter = (0, configuration_1.ConfigurationSchema)('IndexedFas
19
19
  locationType: 'UriLocation',
20
20
  },
21
21
  },
22
- }, { explicitlyTyped: true });
22
+ }, {
23
+ explicitlyTyped: true,
24
+ preProcessSnapshot: snap => {
25
+ return snap.uri
26
+ ? {
27
+ ...snap,
28
+ fastaLocation: {
29
+ uri: snap.uri,
30
+ baseUri: snap.baseUri,
31
+ },
32
+ faiLocation: {
33
+ uri: `${snap.uri}.fai`,
34
+ baseUri: snap.baseUri,
35
+ },
36
+ }
37
+ : snap;
38
+ },
39
+ });
23
40
  exports.default = IndexedFastaAdapter;
@@ -46,16 +46,20 @@ function createReferenceSeqTrackConfig(pluginManager) {
46
46
  const displayTypes = new Set();
47
47
  const { displays = [] } = snap;
48
48
  if (snap.trackId !== 'placeholderId') {
49
- displays.forEach((d) => d && displayTypes.add(d.type));
49
+ for (const d of displays) {
50
+ if (d) {
51
+ displayTypes.add(d.type);
52
+ }
53
+ }
50
54
  const trackType = pluginManager.getTrackType(snap.type);
51
- trackType === null || trackType === void 0 ? void 0 : trackType.displayTypes.forEach(displayType => {
55
+ for (const displayType of (trackType === null || trackType === void 0 ? void 0 : trackType.displayTypes) || []) {
52
56
  if (!displayTypes.has(displayType.name)) {
53
57
  displays.push({
54
58
  displayId: `${snap.trackId}-${displayType.name}`,
55
59
  type: displayType.name,
56
60
  });
57
61
  }
58
- });
62
+ }
59
63
  }
60
64
  return { ...snap, displays };
61
65
  },
@@ -5,7 +5,10 @@ function x() { }
5
5
  const TwoBitAdapter = (0, configuration_1.ConfigurationSchema)('TwoBitAdapter', {
6
6
  twoBitLocation: {
7
7
  type: 'fileLocation',
8
- defaultValue: { uri: '/path/to/my.2bit', locationType: 'UriLocation' },
8
+ defaultValue: {
9
+ uri: '/path/to/my.2bit',
10
+ locationType: 'UriLocation',
11
+ },
9
12
  },
10
13
  chromSizesLocation: {
11
14
  type: 'fileLocation',
@@ -15,5 +18,26 @@ const TwoBitAdapter = (0, configuration_1.ConfigurationSchema)('TwoBitAdapter',
15
18
  },
16
19
  description: 'An optional chrom.sizes file can be supplied to speed up loading since parsing the twobit file can take time',
17
20
  },
18
- }, { explicitlyTyped: true });
21
+ }, {
22
+ explicitlyTyped: true,
23
+ preProcessSnapshot: snap => {
24
+ return snap.uri
25
+ ? {
26
+ ...snap,
27
+ twoBitLocation: {
28
+ uri: snap.uri,
29
+ baseUri: snap.baseUri,
30
+ },
31
+ ...(snap.chromSizes
32
+ ? {
33
+ chromSizesLocation: {
34
+ uri: snap.chromSizes,
35
+ baseUri: snap.baseUri,
36
+ },
37
+ }
38
+ : {}),
39
+ }
40
+ : snap;
41
+ },
42
+ });
19
43
  exports.default = TwoBitAdapter;
@@ -23,5 +23,18 @@ const UnindexedFastaAdapter = (0, configuration_1.ConfigurationSchema)('Unindexe
23
23
  locationType: 'UriLocation',
24
24
  },
25
25
  },
26
- }, { explicitlyTyped: true });
26
+ }, {
27
+ explicitlyTyped: true,
28
+ preProcessSnapshot: snap => {
29
+ return snap.uri
30
+ ? {
31
+ ...snap,
32
+ fastaLocation: {
33
+ uri: snap.uri,
34
+ baseUri: snap.baseUri,
35
+ },
36
+ }
37
+ : snap;
38
+ },
39
+ });
27
40
  exports.default = UnindexedFastaAdapter;
@@ -27,5 +27,26 @@ const BgzipFastaAdapter = ConfigurationSchema('BgzipFastaAdapter', {
27
27
  locationType: 'UriLocation',
28
28
  },
29
29
  },
30
- }, { explicitlyTyped: true });
30
+ }, {
31
+ explicitlyTyped: true,
32
+ preProcessSnapshot: snap => {
33
+ return snap.uri
34
+ ? {
35
+ ...snap,
36
+ fastaLocation: {
37
+ uri: snap.uri,
38
+ baseUri: snap.baseUri,
39
+ },
40
+ faiLocation: {
41
+ uri: `${snap.uri}.fai`,
42
+ baseUri: snap.baseUri,
43
+ },
44
+ gziLocation: {
45
+ uri: `${snap.uri}.gzi`,
46
+ baseUri: snap.baseUri,
47
+ },
48
+ }
49
+ : snap;
50
+ },
51
+ });
31
52
  export default BgzipFastaAdapter;
@@ -8,5 +8,18 @@ const ChromSizesAdapter = ConfigurationSchema('ChromSizesAdapter', {
8
8
  locationType: 'UriLocation',
9
9
  },
10
10
  },
11
- }, { explicitlyTyped: true });
11
+ }, {
12
+ explicitlyTyped: true,
13
+ preProcessSnapshot: snap => {
14
+ return snap.uri
15
+ ? {
16
+ ...snap,
17
+ chromSizesLocation: {
18
+ uri: snap.uri,
19
+ baseUri: snap.baseUri,
20
+ },
21
+ }
22
+ : snap;
23
+ },
24
+ });
12
25
  export default ChromSizesAdapter;
@@ -17,5 +17,22 @@ const IndexedFastaAdapter = ConfigurationSchema('IndexedFastaAdapter', {
17
17
  locationType: 'UriLocation',
18
18
  },
19
19
  },
20
- }, { explicitlyTyped: true });
20
+ }, {
21
+ explicitlyTyped: true,
22
+ preProcessSnapshot: snap => {
23
+ return snap.uri
24
+ ? {
25
+ ...snap,
26
+ fastaLocation: {
27
+ uri: snap.uri,
28
+ baseUri: snap.baseUri,
29
+ },
30
+ faiLocation: {
31
+ uri: `${snap.uri}.fai`,
32
+ baseUri: snap.baseUri,
33
+ },
34
+ }
35
+ : snap;
36
+ },
37
+ });
21
38
  export default IndexedFastaAdapter;
@@ -43,16 +43,20 @@ export function createReferenceSeqTrackConfig(pluginManager) {
43
43
  const displayTypes = new Set();
44
44
  const { displays = [] } = snap;
45
45
  if (snap.trackId !== 'placeholderId') {
46
- displays.forEach((d) => d && displayTypes.add(d.type));
46
+ for (const d of displays) {
47
+ if (d) {
48
+ displayTypes.add(d.type);
49
+ }
50
+ }
47
51
  const trackType = pluginManager.getTrackType(snap.type);
48
- trackType === null || trackType === void 0 ? void 0 : trackType.displayTypes.forEach(displayType => {
52
+ for (const displayType of (trackType === null || trackType === void 0 ? void 0 : trackType.displayTypes) || []) {
49
53
  if (!displayTypes.has(displayType.name)) {
50
54
  displays.push({
51
55
  displayId: `${snap.trackId}-${displayType.name}`,
52
56
  type: displayType.name,
53
57
  });
54
58
  }
55
- });
59
+ }
56
60
  }
57
61
  return { ...snap, displays };
58
62
  },
@@ -3,7 +3,10 @@ function x() { }
3
3
  const TwoBitAdapter = ConfigurationSchema('TwoBitAdapter', {
4
4
  twoBitLocation: {
5
5
  type: 'fileLocation',
6
- defaultValue: { uri: '/path/to/my.2bit', locationType: 'UriLocation' },
6
+ defaultValue: {
7
+ uri: '/path/to/my.2bit',
8
+ locationType: 'UriLocation',
9
+ },
7
10
  },
8
11
  chromSizesLocation: {
9
12
  type: 'fileLocation',
@@ -13,5 +16,26 @@ const TwoBitAdapter = ConfigurationSchema('TwoBitAdapter', {
13
16
  },
14
17
  description: 'An optional chrom.sizes file can be supplied to speed up loading since parsing the twobit file can take time',
15
18
  },
16
- }, { explicitlyTyped: true });
19
+ }, {
20
+ explicitlyTyped: true,
21
+ preProcessSnapshot: snap => {
22
+ return snap.uri
23
+ ? {
24
+ ...snap,
25
+ twoBitLocation: {
26
+ uri: snap.uri,
27
+ baseUri: snap.baseUri,
28
+ },
29
+ ...(snap.chromSizes
30
+ ? {
31
+ chromSizesLocation: {
32
+ uri: snap.chromSizes,
33
+ baseUri: snap.baseUri,
34
+ },
35
+ }
36
+ : {}),
37
+ }
38
+ : snap;
39
+ },
40
+ });
17
41
  export default TwoBitAdapter;
@@ -21,5 +21,18 @@ const UnindexedFastaAdapter = ConfigurationSchema('UnindexedFastaAdapter', {
21
21
  locationType: 'UriLocation',
22
22
  },
23
23
  },
24
- }, { explicitlyTyped: true });
24
+ }, {
25
+ explicitlyTyped: true,
26
+ preProcessSnapshot: snap => {
27
+ return snap.uri
28
+ ? {
29
+ ...snap,
30
+ fastaLocation: {
31
+ uri: snap.uri,
32
+ baseUri: snap.baseUri,
33
+ },
34
+ }
35
+ : snap;
36
+ },
37
+ });
25
38
  export default UnindexedFastaAdapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-sequence",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "JBrowse 2 sequence adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -39,10 +39,10 @@
39
39
  "@gmod/abortable-promise-cache": "^2.0.0",
40
40
  "@gmod/indexedfasta": "^3.0.0",
41
41
  "@gmod/twobit": "^4.0.1",
42
- "@jbrowse/core": "^3.1.0",
43
- "@jbrowse/plugin-linear-genome-view": "^3.1.0",
44
- "@jbrowse/plugin-wiggle": "^3.1.0",
45
- "@mui/material": "^6.0.0",
42
+ "@jbrowse/core": "^3.3.0",
43
+ "@jbrowse/plugin-linear-genome-view": "^3.3.0",
44
+ "@jbrowse/plugin-wiggle": "^3.3.0",
45
+ "@mui/material": "^7.0.0",
46
46
  "mobx": "^6.0.0",
47
47
  "mobx-react": "^9.0.0",
48
48
  "mobx-state-tree": "^5.0.0",
@@ -57,5 +57,5 @@
57
57
  "distModule": "esm/index.js",
58
58
  "srcModule": "src/index.ts",
59
59
  "module": "esm/index.js",
60
- "gitHead": "91492049ddea0aed90eb24d3c066c2d9f5a6b189"
60
+ "gitHead": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
61
61
  }