@jbrowse/img 2.12.3 → 2.13.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.
@@ -30,6 +30,5 @@ interface Config {
30
30
  [key: string]: unknown;
31
31
  }
32
32
  export declare function readData({ assembly: asm, config, session, fasta, aliases, cytobands, defaultSession, tracks, trackList, }: Opts): Config;
33
- export declare const muiCache: import("@emotion/utils").EmotionCache;
34
33
  export declare function renderRegion(opts: Opts): Promise<string>;
35
34
  export {};
@@ -3,18 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.muiCache = void 0;
7
6
  exports.readData = readData;
8
7
  exports.renderRegion = renderRegion;
9
- const react_1 = __importDefault(require("react"));
8
+ const client_1 = require("react-dom/client");
10
9
  const react_linear_genome_view_1 = require("@jbrowse/react-linear-genome-view");
11
10
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
12
- const cache_1 = __importDefault(require("@emotion/cache"));
13
- const react_2 = require("@emotion/react");
14
11
  const path_1 = __importDefault(require("path"));
15
12
  const fs_1 = __importDefault(require("fs"));
16
13
  const util_1 = require("./util");
17
- const client_1 = require("react-dom/client");
18
14
  function read(file) {
19
15
  let res;
20
16
  try {
@@ -121,8 +117,10 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
121
117
  configData.tracks = [];
122
118
  }
123
119
  trackList.forEach(track => {
120
+ var _a;
124
121
  const [type, opts] = track;
125
- const [file] = opts;
122
+ const [file, ...rest] = opts;
123
+ const index = (_a = rest.find(r => r.startsWith('index:'))) === null || _a === void 0 ? void 0 : _a.replace('index:', '');
126
124
  if (type === 'bam') {
127
125
  configData.tracks = [
128
126
  ...configData.tracks,
@@ -134,7 +132,10 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
134
132
  adapter: {
135
133
  type: 'BamAdapter',
136
134
  bamLocation: makeLocation(file),
137
- index: { location: makeLocation(file + '.bai') },
135
+ index: {
136
+ location: makeLocation(index || file + '.bai'),
137
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'BAI',
138
+ },
138
139
  sequenceAdapter: configData.assembly.sequence.adapter,
139
140
  },
140
141
  ...(opts.includes('snpcov')
@@ -161,7 +162,7 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
161
162
  adapter: {
162
163
  type: 'CramAdapter',
163
164
  cramLocation: makeLocation(file),
164
- craiLocation: makeLocation(file + '.crai'),
165
+ craiLocation: makeLocation(index || file + '.crai'),
165
166
  sequenceAdapter: configData.assembly.sequence.adapter,
166
167
  },
167
168
  ...(opts.includes('snpcov')
@@ -204,7 +205,8 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
204
205
  type: 'VcfTabixAdapter',
205
206
  vcfGzLocation: makeLocation(file),
206
207
  index: {
207
- location: makeLocation(file + '.tbi'),
208
+ location: makeLocation(index || file + '.tbi'),
209
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'TBI',
208
210
  },
209
211
  },
210
212
  },
@@ -222,7 +224,8 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
222
224
  type: 'Gff3TabixAdapter',
223
225
  gffGzLocation: makeLocation(file),
224
226
  index: {
225
- location: makeLocation(file + '.tbi'),
227
+ location: makeLocation(index || file + '.tbi'),
228
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'TBI',
226
229
  },
227
230
  },
228
231
  },
@@ -270,7 +273,8 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
270
273
  type: 'BedTabixAdapter',
271
274
  bedGzLocation: makeLocation(file),
272
275
  index: {
273
- location: makeLocation(file + '.tbi'),
276
+ location: makeLocation(index || file + '.tbi'),
277
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'TBI',
274
278
  },
275
279
  },
276
280
  },
@@ -288,12 +292,6 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
288
292
  }
289
293
  return configData;
290
294
  }
291
- // without this, the styles can become messed up especially in lgv header
292
- // xref https://github.com/garronej/tss-react/issues/25
293
- exports.muiCache = (0, cache_1.default)({
294
- key: 'mui',
295
- prepend: true,
296
- });
297
295
  function process(trackEntry, view, extra = c => c) {
298
296
  const [, [track, ...opts]] = trackEntry;
299
297
  const currentTrack = view.showTrack(extra(track));
@@ -393,6 +391,5 @@ async function renderRegion(opts) {
393
391
  return (0, plugin_linear_genome_view_1.renderToSvg)(view, {
394
392
  rasterizeLayers: !opts.noRasterize,
395
393
  ...opts,
396
- Wrapper: ({ children }) => (react_1.default.createElement(react_2.CacheProvider, { value: exports.muiCache }, children)),
397
394
  });
398
395
  }
@@ -30,6 +30,5 @@ interface Config {
30
30
  [key: string]: unknown;
31
31
  }
32
32
  export declare function readData({ assembly: asm, config, session, fasta, aliases, cytobands, defaultSession, tracks, trackList, }: Opts): Config;
33
- export declare const muiCache: import("@emotion/utils").EmotionCache;
34
33
  export declare function renderRegion(opts: Opts): Promise<string>;
35
34
  export {};
@@ -1,12 +1,9 @@
1
- import React from 'react';
1
+ import { createRoot } from 'react-dom/client';
2
2
  import { createViewState } from '@jbrowse/react-linear-genome-view';
3
3
  import { renderToSvg, } from '@jbrowse/plugin-linear-genome-view';
4
- import createCache from '@emotion/cache';
5
- import { CacheProvider } from '@emotion/react';
6
4
  import path from 'path';
7
5
  import fs from 'fs';
8
6
  import { booleanize } from './util';
9
- import { createRoot } from 'react-dom/client';
10
7
  function read(file) {
11
8
  let res;
12
9
  try {
@@ -113,8 +110,10 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
113
110
  configData.tracks = [];
114
111
  }
115
112
  trackList.forEach(track => {
113
+ var _a;
116
114
  const [type, opts] = track;
117
- const [file] = opts;
115
+ const [file, ...rest] = opts;
116
+ const index = (_a = rest.find(r => r.startsWith('index:'))) === null || _a === void 0 ? void 0 : _a.replace('index:', '');
118
117
  if (type === 'bam') {
119
118
  configData.tracks = [
120
119
  ...configData.tracks,
@@ -126,7 +125,10 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
126
125
  adapter: {
127
126
  type: 'BamAdapter',
128
127
  bamLocation: makeLocation(file),
129
- index: { location: makeLocation(file + '.bai') },
128
+ index: {
129
+ location: makeLocation(index || file + '.bai'),
130
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'BAI',
131
+ },
130
132
  sequenceAdapter: configData.assembly.sequence.adapter,
131
133
  },
132
134
  ...(opts.includes('snpcov')
@@ -153,7 +155,7 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
153
155
  adapter: {
154
156
  type: 'CramAdapter',
155
157
  cramLocation: makeLocation(file),
156
- craiLocation: makeLocation(file + '.crai'),
158
+ craiLocation: makeLocation(index || file + '.crai'),
157
159
  sequenceAdapter: configData.assembly.sequence.adapter,
158
160
  },
159
161
  ...(opts.includes('snpcov')
@@ -196,7 +198,8 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
196
198
  type: 'VcfTabixAdapter',
197
199
  vcfGzLocation: makeLocation(file),
198
200
  index: {
199
- location: makeLocation(file + '.tbi'),
201
+ location: makeLocation(index || file + '.tbi'),
202
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'TBI',
200
203
  },
201
204
  },
202
205
  },
@@ -214,7 +217,8 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
214
217
  type: 'Gff3TabixAdapter',
215
218
  gffGzLocation: makeLocation(file),
216
219
  index: {
217
- location: makeLocation(file + '.tbi'),
220
+ location: makeLocation(index || file + '.tbi'),
221
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'TBI',
218
222
  },
219
223
  },
220
224
  },
@@ -262,7 +266,8 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
262
266
  type: 'BedTabixAdapter',
263
267
  bedGzLocation: makeLocation(file),
264
268
  index: {
265
- location: makeLocation(file + '.tbi'),
269
+ location: makeLocation(index || file + '.tbi'),
270
+ indexType: (index === null || index === void 0 ? void 0 : index.endsWith('.csi')) ? 'CSI' : 'TBI',
266
271
  },
267
272
  },
268
273
  },
@@ -280,12 +285,6 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
280
285
  }
281
286
  return configData;
282
287
  }
283
- // without this, the styles can become messed up especially in lgv header
284
- // xref https://github.com/garronej/tss-react/issues/25
285
- export const muiCache = createCache({
286
- key: 'mui',
287
- prepend: true,
288
- });
289
288
  function process(trackEntry, view, extra = c => c) {
290
289
  const [, [track, ...opts]] = trackEntry;
291
290
  const currentTrack = view.showTrack(extra(track));
@@ -385,6 +384,5 @@ export async function renderRegion(opts) {
385
384
  return renderToSvg(view, {
386
385
  rasterizeLayers: !opts.noRasterize,
387
386
  ...opts,
388
- Wrapper: ({ children }) => (React.createElement(CacheProvider, { value: muiCache }, children)),
389
387
  });
390
388
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/img",
3
- "version": "2.12.3",
3
+ "version": "2.13.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "esm/index.js",
6
6
  "author": "JBrowse Team",
@@ -27,8 +27,8 @@
27
27
  "@babel/runtime": "^7.17.9",
28
28
  "@emotion/cache": "^11.7.1",
29
29
  "@emotion/react": "^11.9.0",
30
- "@jbrowse/plugin-linear-genome-view": "^2.12.3",
31
- "@jbrowse/react-linear-genome-view": "^2.12.3",
30
+ "@jbrowse/plugin-linear-genome-view": "^2.13.0",
31
+ "@jbrowse/react-linear-genome-view": "^2.13.0",
32
32
  "canvas": "^2.9.1",
33
33
  "jsdom": "^24.0.0",
34
34
  "mobx": "^6.6.0",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "2775490221cde56af344acebb0afa7e14531cd81"
44
+ "gitHead": "efe02fb9616e20e929cceeed46eb96420c1b6923"
45
45
  }