@jbrowse/img 4.2.0 → 4.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.
package/README.md CHANGED
@@ -99,11 +99,38 @@ jb2export --fasta data/volvox/volvox.fa \
99
99
  --loc ctgA:609..968
100
100
  ```
101
101
 
102
- You can see that instead of adding extra dash dash --flags, it is a colon based
103
- syntax that follows a track definition.
104
-
105
- The color and sort are specific to pileup, and height can apply to any track.
106
- More options may be described here soon
102
+ Instead of extra `--flags`, track modifiers use a colon-based syntax that
103
+ follows the track file argument. Full list of available modifiers:
104
+
105
+ **All tracks**
106
+
107
+ | Modifier | Example | Description |
108
+ | ------------ | ------------ | ---------------------------------- |
109
+ | `height:N` | `height:400` | Track height in pixels |
110
+ | `force:true` | `force:true` | Render even if region is too large |
111
+
112
+ **Alignment tracks (BAM/CRAM)**
113
+
114
+ | Modifier | Example | Description |
115
+ | -------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------- |
116
+ | `color:type` or `color:type:tag` | `color:strand`, `color:tag:XS` | Color scheme |
117
+ | `sort:type` or `sort:type:tag` | `sort:strand`, `sort:tag:RG` | Sort reads |
118
+ | `featureHeight:preset\|N` | `featureHeight:super-compact`, `featureHeight:4` | Per-read height. Presets: `normal` (7px), `compact` (2px), `super-compact` (1px) |
119
+ | `noSpacing:true\|false` | `noSpacing:true` | Remove gap between reads |
120
+ | `softClipping:true\|false` | `softClipping:true` | Show soft-clipped bases |
121
+ | `snpcov` | `snpcov` | Render only the SNP/coverage subtrack |
122
+
123
+ **BigWig tracks**
124
+
125
+ | Modifier | Example | Description |
126
+ | ------------------------ | ---------------------- | -------------------------------------------------------- |
127
+ | `autoscale:mode` | `autoscale:localsd` | Autoscale mode (`local`, `global`, `localsd`) |
128
+ | `minmax:min:max` | `minmax:0:100` | Manual score range |
129
+ | `scaletype:type` | `scaletype:log` | Scale type (`linear` or `log`) |
130
+ | `fill:true\|false` | `fill:false` | Fill under curve |
131
+ | `crosshatch:true\|false` | `crosshatch:true` | Draw crosshatches |
132
+ | `resolution:value` | `resolution:superfine` | BigWig resolution (`fine`, `superfine`, or a multiplier) |
133
+ | `color:colorname` | `color:purple` | Fill color |
107
134
 
108
135
  ### Force render a large region
109
136
 
@@ -303,6 +303,43 @@ function process(trackEntry, view, extra = c => c) {
303
303
  display.setColor(type);
304
304
  }
305
305
  }
306
+ else if (opt.startsWith('featureHeight:')) {
307
+ const [, val] = opt.split(':');
308
+ if (val) {
309
+ const pileup = display.PileupDisplay ?? display;
310
+ if (val === 'normal') {
311
+ pileup.setFeatureHeight(7);
312
+ pileup.setNoSpacing(false);
313
+ }
314
+ else if (val === 'compact') {
315
+ pileup.setFeatureHeight(2);
316
+ pileup.setNoSpacing(true);
317
+ }
318
+ else if (val === 'super-compact') {
319
+ pileup.setFeatureHeight(1);
320
+ pileup.setNoSpacing(true);
321
+ }
322
+ else {
323
+ const n = +val;
324
+ if (isNaN(n)) {
325
+ throw new Error(`Invalid featureHeight "${val}". Use normal, compact, super-compact, or a number.`);
326
+ }
327
+ pileup.setFeatureHeight(n);
328
+ }
329
+ }
330
+ }
331
+ else if (opt.startsWith('noSpacing:')) {
332
+ const [, val = 'true'] = opt.split(':');
333
+ const pileup = display.PileupDisplay ?? display;
334
+ pileup.setNoSpacing(booleanize(val));
335
+ }
336
+ else if (opt.startsWith('softClipping:')) {
337
+ const [, val = 'true'] = opt.split(':');
338
+ const pileup = display.PileupDisplay ?? display;
339
+ if (booleanize(val) !== pileup.showSoftClipping) {
340
+ pileup.toggleSoftClipping();
341
+ }
342
+ }
306
343
  else if (opt.startsWith('force:')) {
307
344
  const [, force] = opt.split(':');
308
345
  if (force) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/img",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "main": "esm/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "repository": {
@@ -34,12 +34,12 @@
34
34
  "@types/yargs": "^17.0.35",
35
35
  "canvas": "^3.2.3",
36
36
  "jsdom": "29.0.2",
37
- "react": "^19.2.5",
38
- "react-dom": "^19.2.5",
37
+ "react": "^19.2.6",
38
+ "react-dom": "^19.2.6",
39
39
  "tmp": "^0.2.5",
40
40
  "yargs": "^18.0.0",
41
- "@jbrowse/plugin-linear-genome-view": "^4.2.0",
42
- "@jbrowse/react-linear-genome-view2": "^4.2.0"
41
+ "@jbrowse/plugin-linear-genome-view": "^4.3.0",
42
+ "@jbrowse/react-linear-genome-view2": "^4.3.0"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"