chromosomix 0.0.0-stage → 0.15.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jacques Serizay
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,572 @@
1
- # Temporary Holding Version
1
+ # chromosomix
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Web app](https://img.shields.io/badge/web%20app-chromosomix.app-1f6feb)](https://chromosomix.app/)
4
+ [![Tests](https://github.com/js2264/chromosomix/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/js2264/chromosomix/actions/workflows/test.yml)
5
+ [![Deploy](https://github.com/js2264/chromosomix/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/js2264/chromosomix/actions/workflows/deploy.yml)
6
+ [![npm](https://img.shields.io/npm/v/chromosomix?logo=npm)](https://www.npmjs.com/package/chromosomix)
7
+ [![Release](https://img.shields.io/github/v/release/js2264/chromosomix?logo=github)](https://github.com/js2264/chromosomix/releases)
8
+ [![Validation](https://img.shields.io/badge/validation-vs%20reference%20tools-2ea44f)](https://chromosomix.app/validation/)
9
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
10
+
11
+ **A unified genome browser for multi-dimensional genomic data.** Chromatin contact maps, genome tracks and 3D models, side by side, straight from your files.
12
+
13
+ chromosomix launches in about a second and reads your data where it lives, on your own disk or in the cloud. No server, no preprocessing, no installation, no account, and it works offline. Most formats open as they are: `.*cool`, `.hic`, HiC-Pro, `.pairs`, bigWig, BED, BAM, FASTA/`.2bit`, 3D structures and more.
14
+
15
+ <p align="center">
16
+ <img src="docs/screenshot.png" alt="chromosomix: a yeast micro-C contact map with its loop calls, beside sequence, gene, ATAC and Pol II tracks" width="100%">
17
+ </p>
18
+
19
+ ## Main features
20
+
21
+ - Support for all genomic data types:
22
+ - Supports 1D genomic formats: bigWig, bigBed, BED, bedGraph, wig, GTF/GFF3, FASTA (+`.fai`), `.2bit`, BAM, VCF, barChart/bigBarChart, genePred/refFlat/bigGenePred, bedMethyl/bigMethyl, chrom.sizes, ...
23
+ - Supports 2D genomic formats: `.*cool`, `.hic`, HiC-Pro, `pairs(.gz)`, ..., at every resolution the file stores. Also supports interaction formats: BEDPE, and UCSC's `interact`/`bigInteract` and `longrange`/longTabix — drawn as arcs over the contact map and as their own lane in the 1D browser.
24
+ - Supports 3D genomic formats: WashU's g3d (text or binary), `.3dg`, and `bed3d`, drawn in 3D and synchronized with the maps and tracks view.
25
+
26
+ - Perform analyses directly in the browser:
27
+ - 1D analysis tasks: peak calling from a coverage track (yapc, with IDR between replicates), motif search, base composition and GC skew, the origin and terminus of replication, metaplots, track correlation, FRiP over a feature set, signal by group, interval overlap with a shuffle null, ...
28
+ - 2D analysis tasks: P(s) (and its four pair orientations), scalogram, diamond insulation, directionality index, HiC score, coverage, cis/trans per chromosome, virtual 4C, compartments annotation and saddle plot, the alignment of a bacterial chromosome's two arms, loops and borders detection, APA, loop ranking, ...
29
+ - 3D analysis tasks: build a 3D model from the contact map (pastis-NB or ShRec3D), compare a 3D model with the contact map, and turn a 3D model into tracks.
30
+
31
+ - Serverless browser & CLI-based: there is no upload, no required preprocessing step and no backend of any kind — the viewer is static files that read standard genome-wide formats directly. Every analysis can be run **interactively**, in the browser, or **programmatically**, with the `chromosomix` command line in a script or a pipeline: the same tasks, with the same parameters, producing the same results. A bottom Console panel in the browser records every run and reports the `chromosomix` command that repeats it.
32
+
33
+ - Side by side: contact maps, 1D browsers and 3D models open as the cells of a deck, panned and zoomed together, and several sessions stay open at once, one tab each.
34
+
35
+ - Dedicated browser panels, four around the picture:
36
+ - General panel: the file itself — its attributes, its chromosomes (or a metagenome's genomes and contigs), a minimap of the genome and the metadata it stores.
37
+ - Aesthetics panel: to customize scales, color map, normalization, track layout, grouping, ...
38
+ - Annotations panel, supporting linear tracks, 1D and 2D manual annotations, bookmarks and synthetic annotations.
39
+ - Analysis panel: runs the analyses above on what is on screen, with exportable results.
40
+
41
+ - Virtual file system: The browser runs entirely in the client, with no server-side processing or data upload. It uses a virtual file system to access local files, remote files, and cloud storage:
42
+ - Cloud-based file access: Open files directly from any object store that serves byte ranges with CORS (e.g. S3, Cloudflare R2, Google Cloud Storage, or any HTTP server that supports range requests), from Dropbox and Google Drive share links, and private Google Drive folder or Dropbox.
43
+ - Stores: several pre-configured remote data stores are available — the lab's own figures, IGV's genomes, 4DN open data, ENCODE, DNA Zoo and Roadmap — and so is any UCSC track hub with a `hub.txt` file. The user can also setup their own store by providing a structured JSON file describing the store and its data.
44
+
45
+ ## Philosophy
46
+
47
+ 1. **No backend or install of any kind.** No tile server, no specific process on a host, no accounts. The viewer is static files; the data are objects on a bucket, or a file on your disk. This is what makes the app free to run and free to archive.
48
+
49
+ 1. **Nothing is uploaded.** A local file is handed to an air-gapped worker by reference and read in place through the Emscripten filesystem. Nothing crosses the network, which is why there is no account system, no storage, no hosting cost and nothing to review for GDPR. You can open unpublished patient-derived genomic data on a laptop with the network cable out.
50
+
51
+ 1. **No pre-parsing of genomic files is required.** Contact maps and 1D genomic files are read in bounded reads, and the rest is pure canvas transforms with **zero** further I/O. That is the central difference from HiGlass, which needs a tile server, a tile cache and a tile compositor to stream contact maps.
52
+
53
+ ## Using chromosomix
54
+
55
+ ### Use it from a web browser
56
+
57
+ Go to [`chromosomix.app`](https://chromosomix.app/) to open the viewer in a web browser. The app runs entirely in the browser, with no server-side processing or data upload.
58
+
59
+ ### Install as a PWA (Progressive Web App)
60
+
61
+ Go to [`chromosomix.app`](https://chromosomix.app/) and:
62
+
63
+ - On **Chrome** or **Edge**: click on the **Install** in the URL bar (far right button).
64
+ - On **Safari**: click on **Share → Add to Dock**.
65
+ - On **Firefox**: support to be added soon.
66
+
67
+ The app is then available offline as a desktop app as a PWA (Progressive Web App).
68
+
69
+ ### Install as a desktop app
70
+
71
+ To install the app as a desktop app, you can fetch the latest release from [https://github.com/js2264/chromosomix/releases](https://github.com/js2264/chromosomix/releases). Builds are available for macOS (`.dmg`, Intel and Apple silicon) and Linux (`AppImage`, `.deb`); the Windows installer is temporarily not built, and on Windows the static HTML page below needs no installer at all. The app is then available offline as a desktop app.
72
+
73
+ ### From a static HTML file
74
+
75
+ Every release produces a single `index.html` (about 14 MB). It has
76
+ no server and no install: put it on a USB stick, email it, open it by
77
+ double-clicking and you end up with a fully functional genome browser.
78
+
79
+ It is attached to every [release](https://github.com/js2264/chromosomix/releases)
80
+ as `chromosomix-<tag>.html`, and `npm run build:standalone` builds it from a clone.
81
+
82
+ ## Embedding chromosomix in a page
83
+
84
+ A minimal version of the viewer can be added to any HTML page as an `<iframe>`. Nothing needs to be installed. There is no extra package dependency and no modifications to make to the page's header, just drop the `<iframe>` in. The `src` attribute is the URL of the viewer, with a query string that tells it what to show.
85
+
86
+ ```html
87
+ <iframe
88
+ src="https://chromosomix.app/?embed=1#uri=https://rsglab-data.s3.eu-west-3.amazonaws.com/demo/yeast/Yeast_microC_G2M_1kb.cool&view=region&region=IV:1000000-1400000&transform=log10&balance=true"
89
+ width="100%"
90
+ height="640"
91
+ loading="lazy"
92
+ style="border: 0"
93
+ title="Mitotic micro-C of synthetic yeast, IV:1.0–1.4 Mb"
94
+ ></iframe>
95
+ ```
96
+
97
+ Paste it into a page and it works (not rendered here though because GitHub does not allow `<iframe>`). The `src` URL is the same as the one you would use to open the viewer in a browser, with the addition of `?embed=1` to tell it to hide the header and tab strip.
98
+
99
+ The text below is a live version of the above `<iframe>` (it will not work on GitHub, but it would work on any HTML page):
100
+
101
+ <iframe
102
+ src="https://chromosomix.app/?embed=1#uri=https://rsglab-data.s3.eu-west-3.amazonaws.com/demo/yeast/Yeast_microC_G2M_1kb.cool&view=region&region=IV:1000000-1400000&transform=log10&balance=true"
103
+ width="100%"
104
+ height="640"
105
+ ></iframe>
106
+
107
+ ## Using the chromosomix analysis CLI
108
+
109
+ Thirty-one analysis tasks can be executed programatically through the CLI, with the same parameters and producing the same results as the Analysis panel interactively. This can be used in a pipeline or a script.
110
+
111
+ ### Installing the CLI
112
+
113
+ The CLI is published to npm with every release. It needs Node 22.12 or later on the machine:
114
+
115
+ ```bash
116
+ node --version
117
+ ```
118
+
119
+ Then install the `chromosomix` command globally, at the latest release:
120
+
121
+ ```bash
122
+ npm install -g chromosomix
123
+ ```
124
+
125
+ To pin a release instead, which is what a pipeline or a methods section should do, name its version; `npx` runs a given version without installing anything:
126
+
127
+ ```bash
128
+ npm install -g chromosomix@<version>
129
+ npx chromosomix@<version> insulation sample.cool --window 10 --out results/
130
+ ```
131
+
132
+ `chromosomix --version` prints the version on its first line, then the Node it runs on and the versions of the two libraries that read every map and track, `h5wasm` and `@gmod/bbi`, as they are installed.
133
+
134
+ To run the CLI from a clone instead, for example to try a change before it is released:
135
+
136
+ ```bash
137
+ git clone https://github.com/js2264/chromosomix
138
+ cd chromosomix
139
+ npm install
140
+ npm run build:cli && npm link
141
+ ```
142
+
143
+ ### Running tasks
144
+
145
+ Once it is installed, run the following command to see the available tasks and their parameters:
146
+
147
+ ```bash
148
+ chromosomix tasks
149
+
150
+ ## coverage
151
+ ## Coverage and marginals
152
+ ## --total (default true) total coverage
153
+ ## --fraction (default false) cis fraction
154
+ ## --cis (default false) cis coverage
155
+ ## --trans (default false) trans coverage
156
+ ## --balance (default false) use balancing weights
157
+ ##
158
+ ## cistrans
159
+ ## Cis and trans per sequence
160
+ ## --sequences sequences
161
+ ## --bars (default "cis") bars per sequence
162
+ ## --normalise (default "enrichment") off-diagonal value
163
+ ## --minContacts (default 10) least contact worth listing
164
+ ## --maxEdges (default 500) pairs to list
165
+ ## --matrix (default true) draw the square
166
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
167
+ ##
168
+ ## expected
169
+ ## Contact probability P(s)
170
+ ## --scope (default "contig") scope
171
+ ## --sequences sequences
172
+ ## --quantity (default "density") quantity
173
+ ## --factor (default 1.1) log bins per step
174
+ ## --minSeparation (default 2) minimum separation
175
+ ## --derivative (default true) log-log slope
176
+ ## --stranded (default false) four orientations
177
+ ## --pairsUri .pairs file
178
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
179
+ ##
180
+ ## scalogram
181
+ ## Scalogram
182
+ ## --quantiles (default "standard") quantiles
183
+ ## --reach (default 0) look out to
184
+ ## --sequences sequences
185
+ ## --ignoreDiags (default 1) diagonals to ignore
186
+ ## --minValid (default 0.5) minimum coverage of the distribution
187
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
188
+ ##
189
+ ## fourc
190
+ ## 4C profile from an anchor
191
+ ## --anchor anchor
192
+ ## --normalise (default "none") normalisation
193
+ ## --cis (default true) cis only
194
+ ## --excludeAnchor (default false) exclude anchor region
195
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
196
+ ##
197
+ ## insulation
198
+ ## Diamond insulation
199
+ ## --window (default 10) window
200
+ ## --scales (default 1) scales
201
+ ## --sequences sequences
202
+ ## --ignoreDiags (default 2) diagonals to ignore
203
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
204
+ ## --call (default true) call boundaries
205
+ ## --prominence (default 0.2) minimum prominence
206
+ ## --minValid (default 0.5) diamond coverage to call
207
+ ## --spacing (default 0) minimum spacing
208
+ ## --domains (default true) domains between them
209
+ ##
210
+ ## di
211
+ ## Directionality index
212
+ ## --window (default 50) window
213
+ ## --sequences sequences
214
+ ## --ignoreDiags (default 0) diagonals to ignore
215
+ ## --minValid (default 0.5) minimum coverage of each side
216
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
217
+ ## --call (default true) call borders
218
+ ## --prominence (default 10) minimum prominence
219
+ ## --spacing (default 0) minimum spacing
220
+ ## --domains (default true) domains between them
221
+ ##
222
+ ## hicscore
223
+ ## HiC score
224
+ ## --diagonals (default 3) diagonals
225
+ ## --sequences sequences
226
+ ## --ignoreDiags (default 0) diagonals to ignore
227
+ ## --minValid (default 0.5) minimum coverage of the line
228
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
229
+ ##
230
+ ## compartments
231
+ ## Compartments
232
+ ## --sequences sequences
233
+ ## --contacts (default "cis") contacts
234
+ ## --ignoreDiags (default 2) diagonals to ignore
235
+ ## --expected (default "distance") expected
236
+ ## --armWindow (default 50) window along the arms
237
+ ## --method (default "cooltools") method
238
+ ## --components (default 1) components
239
+ ## --phaseFeatures phase by gene density
240
+ ## --phaseTrack phase by a track
241
+ ## --phaseSequence phase by GC content
242
+ ## --minR (default 0.1) least convincing correlation
243
+ ## --saddle (default true) draw the saddle
244
+ ## --quantiles (default 50) quantile groups
245
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
246
+ ##
247
+ ## interarm
248
+ ## Inter-arm alignment
249
+ ## --sequences sequences
250
+ ## --band (default 2) band
251
+ ## --armWindow (default 50) window along the arms
252
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
253
+ ##
254
+ ## chromosight
255
+ ## Pattern detection
256
+ ## --pattern (default "loops") pattern
257
+ ## --sequences sequences
258
+ ## --thresholds (default "preset") thresholds
259
+ ## --pearson (default 0.3) score threshold
260
+ ## --minDist (default 10) nearest to the diagonal
261
+ ## --maxDist (default 1000) furthest from the diagonal
262
+ ## --minSeparation (default 3) nearest two calls may be
263
+ ## --iterations (default 1) refinement passes
264
+ ## --maxPercUndetected (default 50) most undetectable pixels a window may hold
265
+ ## --maxPercZero (default 10) most empty pixels a window may hold
266
+ ## --nMads (default 5) detectability cut
267
+ ## --maxQvalue (default 1) report down to a q-value of
268
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
269
+ ##
270
+ ## apa
271
+ ## Aggregate peak analysis
272
+ ## --anchors (default "pairs") anchors
273
+ ## --pairs pairs
274
+ ## --features features
275
+ ## --at (default "centre") anchor on
276
+ ## --mode (default "fixed") mode
277
+ ## --window (default 21) half-width
278
+ ## --grid (default 51) grid
279
+ ## --flankFraction (default 0.5) flank
280
+ ## --minDiag (default 2) diagonals left out
281
+ ## --norm (default "oe") normalisation
282
+ ## --csPattern (default "loops") template
283
+ ## --controls (default 5) controls per pair
284
+ ## --minShift (default 50) smallest shift
285
+ ## --maxShift (default 500) largest shift
286
+ ## --minShiftScale (default 1) smallest shift
287
+ ## --maxShiftScale (default 3) largest shift
288
+ ## --seed (default 1) seed
289
+ ## --minDist (default 5) nearest loop
290
+ ## --minSep (default 2) nearest two features may be
291
+ ## --maxSep (default 200) furthest two features may be
292
+ ## --byDistance (default 0) split by separation into
293
+ ## --rankBy rank by
294
+ ## --subset (default "all") then
295
+ ## --count (default 500) N
296
+ ## --groups (default 4) groups
297
+ ## --tracks track aggregates
298
+ ## --symmetric (default true) same profile both sides
299
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
300
+ ##
301
+ ## reconstruct3d
302
+ ## Model from the map
303
+ ## --method (default "nb") method
304
+ ## --region sequences
305
+ ## --alpha (default 3) exponent α
306
+ ## --weights (default "contacts") weight pairs by
307
+ ## --iterations (default 150) refinement steps
308
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
309
+ ##
310
+ ## structuremap
311
+ ## Model versus map
312
+ ## --structure structure
313
+ ## --region sequences
314
+ ## --alpha (default 3) exponent α
315
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
316
+ ##
317
+ ## spatialtracks
318
+ ## Spatial tracks
319
+ ## --structure structure
320
+ ## --locus distance to
321
+ ## --window (default 5) compaction window
322
+ ##
323
+ ## motif
324
+ ## Find a motif
325
+ ## --sequence reference
326
+ ## --sequences sequences
327
+ ## --pattern motif
328
+ ## --bothStrands (default true) both strands
329
+ ## --mismatches (default 0) mismatches
330
+ ## --limit (default 500000) most sites
331
+ ##
332
+ ## peaks
333
+ ## Peak calling
334
+ ## --signal track
335
+ ## --replicate replicate
336
+ ## --idr (default "0.05") IDR threshold
337
+ ## --sequences sequences
338
+ ## --perPeak (default false) list every peak
339
+ ## --width (default 150) smoothing window
340
+ ## --times (default 3) smoothing passes
341
+ ## --minWidth (default 75) narrowest peak
342
+ ## --halfWidth (default 0) fixed half-width
343
+ ## --truncate (default 100000) keep the strongest
344
+ ##
345
+ ## composition
346
+ ## Base composition
347
+ ## --sequence reference
348
+ ## --resolution (default 10000) bin size
349
+ ## --window (default 0) window
350
+ ## --gc (default true) GC content
351
+ ## --gcSkew (default true) GC skew
352
+ ## --atSkew (default true) AT skew
353
+ ## --cumulative (default true) cumulative GC skew
354
+ ##
355
+ ## oriter
356
+ ## Origin and terminus
357
+ ## --sequence reference
358
+ ## --sequences sequences
359
+ ## --coverage coverage
360
+ ## --window (default 5000) skew window
361
+ ## --step (default 1000) skew step
362
+ ## --parS (default "TGTTNCACGTGNAACA") parS motif
363
+ ## --parSMismatches (default 1) parS mismatches
364
+ ## --matS (default "GTGACRNYGTCAC") matS motif
365
+ ## --matSMismatches (default 0) matS mismatches
366
+ ## --knots (default 10) spline knots
367
+ ##
368
+ ## metaplot
369
+ ## Metaplot over a feature set
370
+ ## --tracks tracks
371
+ ## --features features
372
+ ## --mode (default "reference") mode
373
+ ## --at (default "start") anchor on
374
+ ## --flank (default 2000) flank
375
+ ## --step (default 50) resolution
376
+ ## --body (default 100) body columns
377
+ ## --stranded (default true) respect strand
378
+ ## --rankBy rank by
379
+ ## --subset (default "all") then
380
+ ## --count (default 500) N
381
+ ## --groups (default 4) groups
382
+ ## --zscore (default false) z-score tracks first
383
+ ## --average (default "mean") average
384
+ ## --band (default "bootstrap") band
385
+ ## --iterations (default 200) bootstrap draws
386
+ ## --seed (default 1) seed
387
+ ## --heatmap (default true) per-feature heatmap
388
+ ##
389
+ ## trackcorr
390
+ ## Track correlation
391
+ ## --tracks tracks
392
+ ## --over (default "bins") compare over
393
+ ## --binsize (default 100) window
394
+ ## --features features
395
+ ## --method (default "spearman") method
396
+ ##
397
+ ## frip
398
+ ## Fraction of signal in features
399
+ ## --tracks tracks
400
+ ## --features features
401
+ ## --resolution (default 0) read features at
402
+ ## --perFeature (default false) score every feature
403
+ ##
404
+ ## groupsignal
405
+ ## Signal by group
406
+ ## --tracks tracks
407
+ ## --groupBy (default "features") groups from
408
+ ## --features features
409
+ ## --split (default "name") split the set by
410
+ ## --outside (default true) the rest as a group
411
+ ## --groupTrack grouping track
412
+ ## --cut (default "sign") cut it by
413
+ ## --quantiles (default 4) quantiles
414
+ ## --resolution (default 10000) bin size
415
+ ## --perFeature (default false) score every feature
416
+ ##
417
+ ## overlap
418
+ ## Interval set overlap
419
+ ## --a first set
420
+ ## --b second set
421
+ ## --minFraction (default 0.000001) least of a feature covered
422
+ ## --shuffle (default false) shuffled null
423
+ ## --shuffleWhich (default "a") set that moves
424
+ ## --iterations (default 1000) shuffles
425
+ ## --seed (default 1) seed
426
+ ##
427
+ ## dotplot
428
+ ## Two sequences against each other
429
+ ## --x along x
430
+ ## --y along y
431
+ ## --streaks (default "one to one") streaks
432
+ ## --cells (default 400) cells
433
+ ##
434
+ ## magqc
435
+ ## MAG contact QC
436
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
437
+ ## --network (default true) inter-MAG matrix
438
+ ##
439
+ ## magnetwork
440
+ ## Inter-MAG network
441
+ ## --normalise (default "coverage") edge weight
442
+ ## --minWeight (default 0) least edge worth listing
443
+ ## --maxEdges (default 500) edges to list
444
+ ##
445
+ ## magpurity
446
+ ## MAG purity and contamination
447
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
448
+ ## --minContacts (default 10) least contact before judging a contig
449
+ ## --flagAbove (default 0.5) flag above this outside fraction
450
+ ##
451
+ ## magsplit
452
+ ## Split-MAG detection
453
+ ## --no-balance read the raw counts (balanced by default where the file carries weights)
454
+ ## --minContigs (default 4) least contigs before judging a MAG
455
+ ## --flagBelow (default 0.1) flag below this cross-block ratio
456
+ ```
457
+
458
+ Each analysis is held to the package it reproduces — cooltools, coolpuppy, chromosight, deepTools,
459
+ bedtools and a dozen others — on public data, command for command, in a notebook rendered with every
460
+ release: <https://chromosomix.app/validation/>, and how long each command takes beside its
461
+ reference, <https://chromosomix.app/timings/>.
462
+
463
+ Every task writes its results where `--out` points, each named after the file it came from up to
464
+ its first dot — `sample.coverage.coverage-total.tsv`. Two files of one command that would share a
465
+ name keep more of theirs (`HCT116.rep1`, `HCT116.rep2`), then their directories (`dirA_sample`,
466
+ `dirB_sample`), and nothing one command writes is written over by it. A map is read balanced
467
+ wherever the file carries balancing weights, as the app reads it; `--no-balance` reads the raw
468
+ counts. A locus — `--window`, or a task's own, such as 4C's `--anchor` — is written as the app
469
+ writes one: 1-based and inclusive, digits grouped or not. A parameter that is on or off takes no
470
+ value after it: `--stranded` turns it on, `--stranded=false` or `--no-stranded` off. A choice that
471
+ is none of its values is refused before any file is opened, with exit 2 and the values there are,
472
+ and so is a number that is not one.
473
+
474
+ Files are read from disk. A file named by an http or https address — the map, or what `--against`,
475
+ `--sequence`, `--tracks`, `--features` or `--pairs` names — is downloaded first, whole, because the
476
+ reader's range requests are synchronous, which a browser worker has and Node does not: it goes into
477
+ `$TMPDIR`, with its progress on stderr, and is removed when the command ends. For several commands
478
+ over one large remote file, download it once yourself and name the copy.
479
+
480
+ ```bash
481
+ chromosomix insulation *.mcool --sequences II --out results/
482
+ chromosomix chromosight sample.cool --pattern borders --out results/
483
+ chromosomix apa sample.cool --pairs loops.bedpe --norm chromosight
484
+
485
+ # A 4C profile from an anchor, written as the breadcrumb or IGV writes a locus:
486
+ # 1-based and inclusive, so the window you copied is the window that is read.
487
+ chromosomix fourc sample.cool --anchor IV:1,200,001-1,210,000 --out results/
488
+
489
+ # The domain pileup: a set of TADs — the span from one insulation boundary to
490
+ # the next — every one of them stretched to the same width, with half a domain
491
+ # of padding each side, over its distance-matched control rather than over the
492
+ # expected. The control is shifted by a multiple of the window, so it never
493
+ # overlaps the domain it is the denominator of.
494
+ chromosomix apa sample.cool --features domains.bed --anchors features \
495
+ --mode scaled --grid 48 --flankFraction 0.5 --norm matched --out results/
496
+
497
+ # Two of the tasks that run beside the tracks rather than on the map. A motif
498
+ # search reads the reference `--sequence` names and writes both halves: the
499
+ # sites as a BED-shaped table, and their density on the open map's bin grid.
500
+ chromosomix motif sample.cool --sequence ref.fa.gz --pattern GGTCANNNTGACC --mismatches 1 --out results/
501
+ chromosomix overlap sample.cool --features peaks.bed --features boundaries.bed --a peaks.bed --b boundaries.bed
502
+
503
+ # The tasks that read tracks take them as --tracks: a bigWig, a bedGraph, a
504
+ # wig, or a FASTA read as GC content. Repeat the flag or separate with commas.
505
+ chromosomix metaplot sample.cool --tracks ATAC.bw --features peaks.narrowPeak --flank 2000 --out results/
506
+ chromosomix frip sample.cool --tracks ATAC.bw,MNase.bw --features peaks.narrowPeak
507
+ chromosomix trackcorr sample.cool --tracks ATAC.bw --tracks MNase.bw --over features --features peaks.bed
508
+
509
+ # ...and with no contact map at all, over the assembly the tracks declare —
510
+ # what a 1D browser session runs. Peak calling names its track --signal (and a
511
+ # second one --replicate, for IDR); base composition reads a reference.
512
+ chromosomix metaplot --tracks ATAC.bw --features peaks.narrowPeak --out results/
513
+ chromosomix peaks --signal ChIP.bw --out results/
514
+ chromosomix composition --sequence ref.fa.gz --out results/
515
+
516
+ # Compartments phased by GC content read the reference under --sequence.
517
+ chromosomix compartments sample.cool --sequence ref.fa.gz --phaseSequence ref.fa.gz
518
+
519
+ # Maps drawn to one number of contacts before the task reads them: an exact
520
+ # subsample below the file's own total, Boost-HiC above it, with the app's seed.
521
+ chromosomix insulation rep1.cool --contacts 10M --out results/
522
+ # The map that oversample draws each chromosome's new contacts from, written as
523
+ # Boost-HiC's own main.py writes it: one square TSV per sequence.
524
+ chromosomix boost rep1.mcool::/resolutions/100000 --sequences chr19 --out results/
525
+
526
+ # A resolution the file does not store, as the app reads one you added (3 kb*):
527
+ # the 1 kb bins summed three at a time, counts exactly, weights by their
528
+ # harmonic mean.
529
+ chromosomix insulation sample.mcool::resolutions/1000 --coarsen 3000 --out results/
530
+
531
+ # A bacterial chromosome: which sequences join their own ends (the test the app
532
+ # runs on a first open), then the alignment of its two arms about its origin.
533
+ chromosomix circular ecoli.mcool::/resolutions/5000
534
+ chromosomix interarm ecoli.mcool::/resolutions/5000 --circular NC_000913.3 \
535
+ --origin NC_000913.3:3925744 --out results/
536
+
537
+ # A 3D model built from the map, written as a bed3d the viewer opens beside it.
538
+ chromosomix reconstruct3d ecoli.mcool::/resolutions/20000 --out results/
539
+
540
+ # What the session set from the picture, as flags: the score column a
541
+ # .metacool is drawn from and the sequences declared circular. The console
542
+ # writes them whenever they differ from the defaults (count, none).
543
+ chromosomix insulation sample.metacool --value balanced_by_depth --circular pCEN,p2u
544
+
545
+ # A .pairs is binned first, at a resolution you name — the shell's answer to
546
+ # the browser's dialog. `--pairs` above is a BEDPE of features; the contact
547
+ # list is the positional argument.
548
+ chromosomix coverage Hum53.pairs.gz --bin-size 5000 --rungs 4
549
+
550
+ chromosomix replay workspace.chromosomix.json --over data/*.hic
551
+ ```
552
+
553
+ ### Recovering the commands you ran
554
+
555
+ You do not have to write those lines from memory. The browser app has a **console** and every analysis run lands in it as the `chromosomix` command that repeats it, written the moment the run happens rather than when you look at the result.
556
+
557
+ The log is kept in your own browser for seven days or five hundred lines, whichever comes first. Nothing is uploaded; it is listed under *What this browser is remembering* (in the command palette, `Ctrl+P` → Help) with everything else this app keeps, and *forget everything* drops it.
558
+
559
+ ## Licence
560
+
561
+ chromosomix is released under the MIT licence (`LICENSE`).
562
+
563
+ Every build also carries the work of other projects, each under its own licence. The libraries compiled into the bundles are echarts (Apache-2.0), zrender (BSD-3-Clause), three.js (MIT), h5wasm (NIST's notice, with the BSD-style licence of the HDF5 library inside it), and `@gmod/bbi` with its dependencies (MIT). The source also holds material copied from Lucide (ISC), Simple Icons (CC0), chromosight (MIT), matplotlib (the Matplotlib licence) and ColorBrewer (Apache-2.0). Each build lists what it carries and reproduces every one of those licences in full in `THIRD-PARTY-NOTICES.txt`, beside its `index.html`:
564
+
565
+ - the web app: <https://chromosomix.app/THIRD-PARTY-NOTICES.txt>;
566
+ - the npm package: `dist/` for the viewer, `dist-cli/` for the command;
567
+ - the desktop app: inside the application;
568
+ - the standalone HTML page: in a comment at the end of the file.
569
+
570
+ The upstream texts that are not in an npm package are kept under [`licenses/`](licenses/).
571
+
572
+ **Trademarks.** The logos on the data store tiles (IGV, 4DN, ENCODE, DNA Zoo, UCSC and Roadmap Epigenomics) are those projects' own published marks, and the GitHub, Google Drive and Dropbox marks in the interface are their owners' trademarks. Each is shown only to name the store or service it stands for. None of them is covered by chromosomix's licence or by the notices above, and their use implies no endorsement of chromosomix by their owners.