@jbrowse/cli 5.0.0-beta.1 → 5.0.0-beta.11

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.
Files changed (39) hide show
  1. package/README.md +149 -44
  2. package/dist/commands/add-track-utils/adapter-utils.js +47 -39
  3. package/dist/commands/add-track-utils/track-config.js +5 -7
  4. package/dist/commands/add-track.js +31 -9
  5. package/dist/commands/admin-server/index.js +13 -5
  6. package/dist/commands/admin-server/utils.js +8 -6
  7. package/dist/commands/make-density/density-generator.js +180 -0
  8. package/dist/commands/make-density/index.js +139 -0
  9. package/dist/commands/make-pif/index.js +62 -27
  10. package/dist/commands/make-pif/pif-generator.js +98 -132
  11. package/dist/commands/shared/density.js +12 -0
  12. package/dist/commands/text-index/adapter-utils.js +17 -7
  13. package/dist/commands/text-index/aggregate.js +5 -5
  14. package/dist/commands/text-index/command.js +3 -1
  15. package/dist/commands/text-index/config-utils.js +7 -7
  16. package/dist/commands/text-index/indexing-utils.js +21 -49
  17. package/dist/commands/validate/configManifest.generated.js +4071 -1845
  18. package/dist/commands/validate/configSchema.generated.js +20482 -0
  19. package/dist/commands/validate/index.js +21 -5
  20. package/dist/commands/validate/liftConfig.js +34 -0
  21. package/dist/commands/validate/markRules/aggregateFieldName.js +9 -0
  22. package/dist/commands/validate/markRules/autoBin.js +27 -0
  23. package/dist/commands/validate/markRules/colorScale.js +244 -0
  24. package/dist/commands/validate/markRules/cssColorsLevel4.js +162 -0
  25. package/dist/commands/validate/markRules/jexlStrings.js +23 -0
  26. package/dist/commands/validate/markRules/markProblems.js +573 -0
  27. package/dist/commands/validate/markRules/markRuleFacts.js +6 -0
  28. package/dist/commands/validate/markRules/markSpecs.js +84 -0
  29. package/dist/commands/validate/markRules/markVocabulary.js +59 -0
  30. package/dist/commands/validate/markRules/shapeNameList.js +7 -0
  31. package/dist/commands/validate/markRules/stepChannels.js +55 -0
  32. package/dist/commands/validate/schemaValidate.js +425 -0
  33. package/dist/commands/validate/validateConfig.js +317 -258
  34. package/dist/index.js +5 -0
  35. package/dist/version.js +1 -1
  36. package/package.json +6 -10
  37. package/bin/run +0 -4
  38. package/bundle/index.js +0 -1569
  39. package/dist/commands/make-pif/cigar-utils.js +0 -67
@@ -1,67 +0,0 @@
1
- // Walk a CIGAR and split the alignment wherever an insertion or deletion is at
2
- // least `splitGap` bp, so each coarse-tier row's bounding box stays tight.
3
- // Returns one segment per contiguous run; `splitGap` must be positive (the
4
- // caller keeps the whole row when there is nothing to split on).
5
- // PAF semantics: qstart < qend always; '-' strand CIGAR walks query backward.
6
- export function splitCigarOnLargeGaps({ cigar, strand, tstart, tend, qstart, qend, splitGap, }) {
7
- const qStep = strand === '-' ? -1 : 1;
8
- let tCursor = tstart;
9
- let qCursor = strand === '-' ? qend : qstart;
10
- let segTStart = tCursor;
11
- let segQAnchor = qCursor;
12
- let segBlockLen = 0;
13
- const out = [];
14
- const emit = () => {
15
- if (tCursor > segTStart || qCursor !== segQAnchor) {
16
- out.push({
17
- tstart: segTStart,
18
- tend: tCursor,
19
- qstart: Math.min(segQAnchor, qCursor),
20
- qend: Math.max(segQAnchor, qCursor),
21
- blockLen: segBlockLen,
22
- });
23
- }
24
- };
25
- // Parse CIGAR directly to avoid intermediate array + string-to-number conversions
26
- let i = 0;
27
- while (i < cigar.length) {
28
- let len = 0;
29
- while (i < cigar.length &&
30
- cigar.charCodeAt(i) >= 48 &&
31
- cigar.charCodeAt(i) <= 57) {
32
- len = len * 10 + cigar.charCodeAt(i++) - 48;
33
- }
34
- const op = cigar[i++];
35
- if ('M=X'.includes(op)) {
36
- tCursor += len;
37
- qCursor += len * qStep;
38
- segBlockLen += len;
39
- }
40
- else if ('DIN'.includes(op)) {
41
- const isLarge = len >= splitGap;
42
- if (isLarge) {
43
- emit();
44
- }
45
- if (op === 'I') {
46
- qCursor += len * qStep;
47
- }
48
- else {
49
- tCursor += len;
50
- }
51
- if (isLarge) {
52
- segTStart = tCursor;
53
- segQAnchor = qCursor;
54
- segBlockLen = 0;
55
- }
56
- else {
57
- segBlockLen += len;
58
- }
59
- }
60
- // S/H/P (clipping/padding) don't consume target or forward-strand query in PAF
61
- }
62
- emit();
63
- return {
64
- segments: out,
65
- closed: tCursor === tend && qCursor === (strand === '-' ? qstart : qend),
66
- };
67
- }