@galaxy-tool-util/workflow-graph 1.0.0 → 1.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/README.md +2 -12
- package/dist/collection-type-variants.d.ts +12 -6
- package/dist/collection-type-variants.d.ts.map +1 -1
- package/dist/collection-type-variants.js +14 -8
- package/dist/collection-type-variants.js.map +1 -1
- package/dist/collection-type.d.ts +16 -2
- package/dist/collection-type.d.ts.map +1 -1
- package/dist/collection-type.js +57 -4
- package/dist/collection-type.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/rules-dsl.d.ts +67 -0
- package/dist/rules-dsl.d.ts.map +1 -0
- package/dist/rules-dsl.js +477 -0
- package/dist/rules-dsl.js.map +1 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
# @galaxy-tool-util/workflow-graph
|
|
2
2
|
|
|
3
|
-
Pure collection-type algebra
|
|
3
|
+
Pure collection-type algebra, datatype subtyping primitives and the rule builder DSL, extracted from Galaxy. Its one runtime dependency, `pyre-to-regexp`, is the regex translator Galaxy's client uses.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Galaxy (re-exported from `client/src/components/Workflow/Editor/modules/` and
|
|
8
|
-
`client/src/components/Datatypes/`).
|
|
9
|
-
- The TypeScript workflow connection validator in this monorepo.
|
|
10
|
-
- Future tooling (CLI, VS Code plugin, gxwf-ui).
|
|
11
|
-
|
|
12
|
-
No runtime dependencies. Pure TypeScript / ESM.
|
|
13
|
-
|
|
14
|
-
See `TS_CONNECTION_REFACTOR_IN_GX_PLAN.md` and the `old/CONNECTION_VALIDATION.md`
|
|
15
|
-
historical note for context on why these primitives were extracted.
|
|
5
|
+
See the [workflow-graph package docs](https://jmchilton.github.io/galaxy-tool-util-ts/#/packages/workflow-graph) for the public API and TS-specific notes. The collection-type algebra itself is documented Galaxy-side in [`collection_semantics.yml`](https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/model/dataset_collections/types/collection_semantics.yml).
|
|
@@ -4,19 +4,25 @@
|
|
|
4
4
|
* Galaxy tools can declare `collection_types: string[]` on collection inputs,
|
|
5
5
|
* meaning the input accepts any of several collection types. These helpers
|
|
6
6
|
* mirror the inner loop of `InputCollectionTerminal._effectiveMapOver` in the
|
|
7
|
-
* Galaxy editor and the Python port's `_split_collection_type` helper
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Galaxy editor and the Python port's `_split_collection_type` helper.
|
|
8
|
+
*
|
|
9
|
+
* sample_sheet asymmetry is enforced inside `CollectionTypeDescription.accepts`
|
|
10
|
+
* itself, so callers don't need to re-check it here for the simple
|
|
11
|
+
* `accepts(output)` cases. The Galaxy `InputCollectionTerminal.canAccept`
|
|
12
|
+
* still keeps a defense-in-depth re-check for compound effective types where
|
|
13
|
+
* the receiver's raw type can hide the guard from `accepts` — that remains a
|
|
14
|
+
* caller-side concern.
|
|
10
15
|
*/
|
|
11
16
|
import type { CollectionTypeDescriptor } from "./collection-type.js";
|
|
12
17
|
/**
|
|
13
|
-
* True if
|
|
18
|
+
* True if any of the accepted `inputs` accepts `output` directly.
|
|
19
|
+
* Direction follows `input_type.accepts(output_type)`.
|
|
14
20
|
*/
|
|
15
|
-
export declare function
|
|
21
|
+
export declare function acceptsAny(output: CollectionTypeDescriptor, inputs: CollectionTypeDescriptor[]): boolean;
|
|
16
22
|
/**
|
|
17
23
|
* Compute the effective map-over for an output connecting to a multi-accept
|
|
18
24
|
* input. Mirrors `InputCollectionTerminal._effectiveMapOver`:
|
|
19
|
-
* - If any accepted input directly
|
|
25
|
+
* - If any accepted input directly accepts the output, no map-over is needed
|
|
20
26
|
* (returns NULL).
|
|
21
27
|
* - Otherwise, return the first non-null `output.effectiveMapOver(input)` for
|
|
22
28
|
* an input the output can map over.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-type-variants.d.ts","sourceRoot":"","sources":["../src/collection-type-variants.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collection-type-variants.d.ts","sourceRoot":"","sources":["../src/collection-type-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE;;;GAGG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,wBAAwB,EAAE,GACjC,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,wBAAwB,EAAE,GACjC,wBAAwB,CAa1B"}
|
|
@@ -4,28 +4,34 @@
|
|
|
4
4
|
* Galaxy tools can declare `collection_types: string[]` on collection inputs,
|
|
5
5
|
* meaning the input accepts any of several collection types. These helpers
|
|
6
6
|
* mirror the inner loop of `InputCollectionTerminal._effectiveMapOver` in the
|
|
7
|
-
* Galaxy editor and the Python port's `_split_collection_type` helper
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Galaxy editor and the Python port's `_split_collection_type` helper.
|
|
8
|
+
*
|
|
9
|
+
* sample_sheet asymmetry is enforced inside `CollectionTypeDescription.accepts`
|
|
10
|
+
* itself, so callers don't need to re-check it here for the simple
|
|
11
|
+
* `accepts(output)` cases. The Galaxy `InputCollectionTerminal.canAccept`
|
|
12
|
+
* still keeps a defense-in-depth re-check for compound effective types where
|
|
13
|
+
* the receiver's raw type can hide the guard from `accepts` — that remains a
|
|
14
|
+
* caller-side concern.
|
|
10
15
|
*/
|
|
11
16
|
import { NULL_COLLECTION_TYPE_DESCRIPTION } from "./collection-type.js";
|
|
12
17
|
/**
|
|
13
|
-
* True if
|
|
18
|
+
* True if any of the accepted `inputs` accepts `output` directly.
|
|
19
|
+
* Direction follows `input_type.accepts(output_type)`.
|
|
14
20
|
*/
|
|
15
|
-
export function
|
|
16
|
-
return inputs.some((input) => input.
|
|
21
|
+
export function acceptsAny(output, inputs) {
|
|
22
|
+
return inputs.some((input) => input.accepts(output));
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
19
25
|
* Compute the effective map-over for an output connecting to a multi-accept
|
|
20
26
|
* input. Mirrors `InputCollectionTerminal._effectiveMapOver`:
|
|
21
|
-
* - If any accepted input directly
|
|
27
|
+
* - If any accepted input directly accepts the output, no map-over is needed
|
|
22
28
|
* (returns NULL).
|
|
23
29
|
* - Otherwise, return the first non-null `output.effectiveMapOver(input)` for
|
|
24
30
|
* an input the output can map over.
|
|
25
31
|
* - Falls back to NULL when no variant accepts the output.
|
|
26
32
|
*/
|
|
27
33
|
export function effectiveMapOverAny(output, inputs) {
|
|
28
|
-
if (inputs.some((input) => input.
|
|
34
|
+
if (inputs.some((input) => input.accepts(output))) {
|
|
29
35
|
return NULL_COLLECTION_TYPE_DESCRIPTION;
|
|
30
36
|
}
|
|
31
37
|
for (const input of inputs) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-type-variants.js","sourceRoot":"","sources":["../src/collection-type-variants.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collection-type-variants.js","sourceRoot":"","sources":["../src/collection-type-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,MAAgC,EAChC,MAAkC;IAElC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAgC,EAChC,MAAkC;IAElC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAClD,OAAO,gCAAgC,CAAC;IAC1C,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACjD,IAAI,SAAS,KAAK,gCAAgC,EAAE,CAAC;gBACnD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,gCAAgC,CAAC;AAC1C,CAAC"}
|
|
@@ -2,7 +2,8 @@ export interface CollectionTypeDescriptor {
|
|
|
2
2
|
isCollection: boolean;
|
|
3
3
|
collectionType: string | null;
|
|
4
4
|
rank: number;
|
|
5
|
-
|
|
5
|
+
accepts(other: CollectionTypeDescriptor): boolean;
|
|
6
|
+
compatible(other: CollectionTypeDescriptor): boolean;
|
|
6
7
|
canMapOver(other: CollectionTypeDescriptor): boolean;
|
|
7
8
|
append(other: CollectionTypeDescriptor): CollectionTypeDescriptor;
|
|
8
9
|
equal(other: CollectionTypeDescriptor | null): boolean;
|
|
@@ -17,7 +18,20 @@ export declare class CollectionTypeDescription implements CollectionTypeDescript
|
|
|
17
18
|
rank: number;
|
|
18
19
|
constructor(collectionType: string);
|
|
19
20
|
append(other: CollectionTypeDescriptor): CollectionTypeDescriptor;
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Asymmetric direct-edge check: does an input slot of type `this`
|
|
23
|
+
* accept an output of type `other`? Convention:
|
|
24
|
+
* `input_type.accepts(output_type)`. Used at workflow-editor edge
|
|
25
|
+
* validation.
|
|
26
|
+
*/
|
|
27
|
+
accepts(other: CollectionTypeDescriptor): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Symmetric sibling-matching check: do `this` and `other` match such
|
|
30
|
+
* that they could drive a common map-over over sibling inputs of a
|
|
31
|
+
* single tool? Used for sibling map-over state checks where neither
|
|
32
|
+
* side is the declared input slot.
|
|
33
|
+
*/
|
|
34
|
+
compatible(other: CollectionTypeDescriptor): boolean;
|
|
21
35
|
canMapOver(other: CollectionTypeDescriptor): boolean;
|
|
22
36
|
effectiveMapOver(other: CollectionTypeDescriptor): CollectionTypeDescriptor;
|
|
23
37
|
equal(other: CollectionTypeDescriptor | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-type.d.ts","sourceRoot":"","sources":["../src/collection-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collection-type.d.ts","sourceRoot":"","sources":["../src/collection-type.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC;IAClD,UAAU,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACrD,UAAU,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACrD,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB,CAAC;IAClE,KAAK,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI,GAAG,OAAO,CAAC;IACvD,QAAQ,IAAI,MAAM,CAAC;IACnB,gBAAgB,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB,CAAC;CAC7E;AAED,eAAO,MAAM,gCAAgC,EAAE,wBAyB9C,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,wBAyB7C,CAAC;AAaF,qBAAa,yBAA0B,YAAW,wBAAwB;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;gBAED,cAAc,EAAE,MAAM;IAKlC,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB;IASjE;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,wBAAwB;IAqCvC;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,wBAAwB;IAG1C,UAAU,CAAC,KAAK,EAAE,wBAAwB;IAgD1C,gBAAgB,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB;IAkD3E,KAAK,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI;IAM5C,QAAQ;IAGR,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAGtC;AAKD,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,WAM1E"}
|
package/dist/collection-type.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* Classes for reasoning about collection map-over state and the
|
|
2
|
+
compatibility algebra.
|
|
3
|
+
|
|
4
|
+
Two operations on collection types:
|
|
5
|
+
- accepts(other): asymmetric. input_type.accepts(output_type) is true
|
|
6
|
+
iff an output of type other can be connected to an input slot of
|
|
7
|
+
type this. Used at workflow-editor edge validation.
|
|
8
|
+
- compatible(other): symmetric. True iff this and other match such
|
|
9
|
+
that they could drive a common map-over over sibling inputs of one
|
|
10
|
+
tool. Used for sibling map-over state checks (neither side is the
|
|
11
|
+
input slot).
|
|
12
|
+
|
|
13
|
+
Mirrors the Python implementation in
|
|
14
|
+
lib/galaxy/model/dataset_collections/type_description.py — keep in sync.
|
|
15
|
+
See lib/galaxy/model/dataset_collections/types/collection_semantics.yml
|
|
16
|
+
"Type Compatibility Algebra" for the lattice diagram and worked examples.
|
|
17
|
+
|
|
18
|
+
Type variants:
|
|
2
19
|
null: not a collection?
|
|
3
20
|
NULL_COLLECTION_TYPE_DESCRIPTION: also not a collection. Is there any difference with null ?
|
|
4
21
|
ANY_COLLECTION_TYPE_DESCRIPTION: collection, but will never be mapped over (input has no collection_type)
|
|
@@ -8,7 +25,10 @@ export const NULL_COLLECTION_TYPE_DESCRIPTION = {
|
|
|
8
25
|
isCollection: false,
|
|
9
26
|
collectionType: null,
|
|
10
27
|
rank: 0,
|
|
11
|
-
|
|
28
|
+
accepts: function (_other) {
|
|
29
|
+
return false;
|
|
30
|
+
},
|
|
31
|
+
compatible: function (_other) {
|
|
12
32
|
return false;
|
|
13
33
|
},
|
|
14
34
|
canMapOver: function () {
|
|
@@ -31,7 +51,10 @@ export const ANY_COLLECTION_TYPE_DESCRIPTION = {
|
|
|
31
51
|
isCollection: true,
|
|
32
52
|
collectionType: "any",
|
|
33
53
|
rank: -1,
|
|
34
|
-
|
|
54
|
+
accepts: function (other) {
|
|
55
|
+
return NULL_COLLECTION_TYPE_DESCRIPTION !== other;
|
|
56
|
+
},
|
|
57
|
+
compatible: function (other) {
|
|
35
58
|
return NULL_COLLECTION_TYPE_DESCRIPTION !== other;
|
|
36
59
|
},
|
|
37
60
|
canMapOver: function () {
|
|
@@ -78,7 +101,13 @@ export class CollectionTypeDescription {
|
|
|
78
101
|
}
|
|
79
102
|
return new CollectionTypeDescription(`${this.collectionType}:${other.collectionType}`);
|
|
80
103
|
}
|
|
81
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Asymmetric direct-edge check: does an input slot of type `this`
|
|
106
|
+
* accept an output of type `other`? Convention:
|
|
107
|
+
* `input_type.accepts(output_type)`. Used at workflow-editor edge
|
|
108
|
+
* validation.
|
|
109
|
+
*/
|
|
110
|
+
accepts(other) {
|
|
82
111
|
const otherCollectionType = other.collectionType;
|
|
83
112
|
if (other === NULL_COLLECTION_TYPE_DESCRIPTION) {
|
|
84
113
|
return false;
|
|
@@ -86,6 +115,14 @@ export class CollectionTypeDescription {
|
|
|
86
115
|
if (other === ANY_COLLECTION_TYPE_DESCRIPTION) {
|
|
87
116
|
return true;
|
|
88
117
|
}
|
|
118
|
+
// sample_sheet asymmetry: a sample_sheet input needs column metadata
|
|
119
|
+
// that a plain-list output cannot provide. Check raw types before
|
|
120
|
+
// normalization (which otherwise equates the two).
|
|
121
|
+
if (this.collectionType.startsWith("sample_sheet") &&
|
|
122
|
+
otherCollectionType &&
|
|
123
|
+
!otherCollectionType.startsWith("sample_sheet")) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
89
126
|
const normalizedThis = normalizeCollectionType(this.collectionType);
|
|
90
127
|
const normalizedOther = otherCollectionType
|
|
91
128
|
? normalizeCollectionType(otherCollectionType)
|
|
@@ -105,10 +142,26 @@ export class CollectionTypeDescription {
|
|
|
105
142
|
}
|
|
106
143
|
return normalizedOther == normalizedThis;
|
|
107
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Symmetric sibling-matching check: do `this` and `other` match such
|
|
147
|
+
* that they could drive a common map-over over sibling inputs of a
|
|
148
|
+
* single tool? Used for sibling map-over state checks where neither
|
|
149
|
+
* side is the declared input slot.
|
|
150
|
+
*/
|
|
151
|
+
compatible(other) {
|
|
152
|
+
return this.accepts(other) || other.accepts(this);
|
|
153
|
+
}
|
|
108
154
|
canMapOver(other) {
|
|
109
155
|
if (!other.collectionType || other.collectionType === "any") {
|
|
110
156
|
return false;
|
|
111
157
|
}
|
|
158
|
+
// sample_sheet asymmetry: a sample_sheet input requires sample_sheet
|
|
159
|
+
// column metadata; a plain-list output cannot be mapped over it.
|
|
160
|
+
// `this` is the output, `other` is the input.
|
|
161
|
+
if (other.collectionType.startsWith("sample_sheet") &&
|
|
162
|
+
!this.collectionType.startsWith("sample_sheet")) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
112
165
|
const normalizedThis = normalizeCollectionType(this.collectionType);
|
|
113
166
|
const normalizedOther = normalizeCollectionType(other.collectionType);
|
|
114
167
|
if (this.rank <= other.rank) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-type.js","sourceRoot":"","sources":["../src/collection-type.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collection-type.js","sourceRoot":"","s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F;AAED,MAAM,mBAAmB,GACvB,6KAA6K,CAAC;AAEhL,MAAM,UAAU,wBAAwB,CAAC,cAAkC;IACzE,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ANY_COLLECTION_TYPE_DESCRIPTION, CollectionTypeDescription, NULL_COLLECTION_TYPE_DESCRIPTION, isValidCollectionTypeStr, type CollectionTypeDescriptor, } from "./collection-type.js";
|
|
2
|
-
export {
|
|
2
|
+
export { acceptsAny, effectiveMapOverAny } from "./collection-type-variants.js";
|
|
3
3
|
export type { DatatypesCombinedMap } from "./datatypes-combined-map.js";
|
|
4
4
|
export { DatatypesMapperModel } from "./datatypes-mapper.js";
|
|
5
5
|
export { ConnectionAcceptable, producesAcceptableDatatype } from "./connection-acceptable.js";
|
|
6
|
+
export { RuleSet, RulesDSLError, SKIPPED_RULE_WARNING, applyRules, colHeadersFor, type ApplyRulesResult, type ClientRule, type Rule, type RuleMapping, type RuleRow, type RuleSetDict, type RuleSource, } from "./rules-dsl.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAChF,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EACL,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ANY_COLLECTION_TYPE_DESCRIPTION, CollectionTypeDescription, NULL_COLLECTION_TYPE_DESCRIPTION, isValidCollectionTypeStr, } from "./collection-type.js";
|
|
2
|
-
export {
|
|
2
|
+
export { acceptsAny, effectiveMapOverAny } from "./collection-type-variants.js";
|
|
3
3
|
export { DatatypesMapperModel } from "./datatypes-mapper.js";
|
|
4
4
|
export { ConnectionAcceptable, producesAcceptableDatatype } from "./connection-acceptable.js";
|
|
5
|
+
export { RuleSet, RulesDSLError, SKIPPED_RULE_WARNING, applyRules, colHeadersFor, } from "./rules-dsl.js";
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EACL,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,aAAa,GAQd,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of Galaxy's rule builder DSL: `galaxy.util.rules_dsl.RuleSet` and the
|
|
3
|
+
* client's `RuleBuilder/rule-definitions.js` `applyRules`.
|
|
4
|
+
*
|
|
5
|
+
* Conformance is checked against Galaxy's `rules_dsl_spec.yml`, synced via
|
|
6
|
+
* `make sync-rules-dsl-spec`. Python `re` expressions go through
|
|
7
|
+
* `pyre-to-regexp`, as in Galaxy's client.
|
|
8
|
+
*/
|
|
9
|
+
export declare class RulesDSLError extends Error {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
export interface Rule {
|
|
13
|
+
type: string;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface RuleMapping {
|
|
17
|
+
type: string;
|
|
18
|
+
columns: number[];
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface RuleSetDict {
|
|
22
|
+
rules: Rule[];
|
|
23
|
+
mapping?: RuleMapping[];
|
|
24
|
+
}
|
|
25
|
+
/** Collection element metadata a rule set reads from; tests also pass bare scalars. */
|
|
26
|
+
export interface RuleSource {
|
|
27
|
+
identifiers?: string[];
|
|
28
|
+
indices?: number[];
|
|
29
|
+
tags?: string[];
|
|
30
|
+
columns?: unknown[];
|
|
31
|
+
hid?: unknown;
|
|
32
|
+
name?: unknown;
|
|
33
|
+
path?: unknown;
|
|
34
|
+
uri?: unknown;
|
|
35
|
+
}
|
|
36
|
+
export type RuleRow = unknown[];
|
|
37
|
+
export declare class RuleSet {
|
|
38
|
+
readonly rules: Rule[];
|
|
39
|
+
readonly mapping: RuleMapping[];
|
|
40
|
+
constructor(ruleSet: RuleSetDict);
|
|
41
|
+
apply(data: RuleRow[], sources: unknown[]): [RuleRow[], unknown[]];
|
|
42
|
+
get hasErrors(): boolean;
|
|
43
|
+
get mappingAsDict(): Record<string, RuleMapping>;
|
|
44
|
+
get identifierColumns(): number[];
|
|
45
|
+
/** Collection type the mapping builds, e.g. `list:paired`; `""` when nothing is mapped. */
|
|
46
|
+
get collectionType(): string;
|
|
47
|
+
}
|
|
48
|
+
/** A rule as Galaxy's rule builder holds it; `applyRules` sets `error` and `warn`. */
|
|
49
|
+
export interface ClientRule extends Rule {
|
|
50
|
+
error?: string | null;
|
|
51
|
+
warn?: string | null;
|
|
52
|
+
}
|
|
53
|
+
export interface ApplyRulesResult {
|
|
54
|
+
data: RuleRow[];
|
|
55
|
+
sources: unknown[];
|
|
56
|
+
columns: string[];
|
|
57
|
+
colHeadersPerRule: string[][];
|
|
58
|
+
}
|
|
59
|
+
export declare const SKIPPED_RULE_WARNING = "Skipped due to previous errors.";
|
|
60
|
+
/** Spreadsheet-style headers (`A`, `B`, …) for the current table width. */
|
|
61
|
+
export declare function colHeadersFor(data: RuleRow[], columns?: string[]): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Galaxy client's `applyRules`: runs rules without validating them, records a
|
|
64
|
+
* failing rule's message on `rule.error` and skips the rest with `rule.warn`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function applyRules(data: RuleRow[], sources: unknown[], columns: string[], rules: ClientRule[], headersPerRule?: string[][]): ApplyRulesResult;
|
|
67
|
+
//# sourceMappingURL=rules-dsl.d.ts.map
|
|
@@ -0,0 +1 @@
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IAED,IAAI,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAE/C;IAED,IAAI,iBAAiB,IAAI,MAAM,EAAE,CAShC;IAED,2FAA2F;IAC3F,IAAI,cAAc,IAAI,MAAM,CAU3B;CACF;AAED,sFAAsF;AACtF,MAAM,WAAW,UAAW,SAAQ,IAAI;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iBAAiB,EAAE,MAAM,EAAE,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,oCAAoC,CAAC;AAEtE,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAG3E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,OAAO,EAAE,EAClB,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,UAAU,EAAE,EACnB,cAAc,GAAE,MAAM,EAAE,EAAO,GAC9B,gBAAgB,CAqBlB"}
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of Galaxy's rule builder DSL: `galaxy.util.rules_dsl.RuleSet` and the
|
|
3
|
+
* client's `RuleBuilder/rule-definitions.js` `applyRules`.
|
|
4
|
+
*
|
|
5
|
+
* Conformance is checked against Galaxy's `rules_dsl_spec.yml`, synced via
|
|
6
|
+
* `make sync-rules-dsl-spec`. Python `re` expressions go through
|
|
7
|
+
* `pyre-to-regexp`, as in Galaxy's client.
|
|
8
|
+
*/
|
|
9
|
+
import pyre from "pyre-to-regexp";
|
|
10
|
+
export class RulesDSLError extends Error {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "RulesDSLError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const NEW_COLUMN = "new";
|
|
17
|
+
const addsOneColumn = (_rule, columns) => [...columns, NEW_COLUMN];
|
|
18
|
+
const removeColumns = (columns, targets) => columns.filter((_, index) => !targets.includes(index));
|
|
19
|
+
const KEY_TYPE_CHECKS = {
|
|
20
|
+
int: (value) => Number.isInteger(value),
|
|
21
|
+
str: (value) => typeof value === "string",
|
|
22
|
+
bool: (value) => typeof value === "boolean",
|
|
23
|
+
list: (value) => Array.isArray(value),
|
|
24
|
+
};
|
|
25
|
+
function ensureRuleContainsKeys(rule, keys) {
|
|
26
|
+
for (const [key, keyType] of Object.entries(keys)) {
|
|
27
|
+
if (!(key in rule)) {
|
|
28
|
+
throw new RulesDSLError(`Rule of type [${rule.type}] does not contain key [${key}].`);
|
|
29
|
+
}
|
|
30
|
+
if (!KEY_TYPE_CHECKS[keyType](rule[key])) {
|
|
31
|
+
throw new RulesDSLError(`Rule of type [${rule.type}] does not contain correct value type for key [${key}].`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function ensureKeyValueIn(rule, key, values) {
|
|
36
|
+
const value = rule[key];
|
|
37
|
+
if (!values.includes(value)) {
|
|
38
|
+
throw new RulesDSLError(`Invalid value [${String(value)}] for [${key}] encountered.`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Compile a Python `re` pattern the way Galaxy's client does. */
|
|
42
|
+
function compilePattern(expression) {
|
|
43
|
+
try {
|
|
44
|
+
return pyre(String(expression));
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
throw new RulesDSLError("Invalid regular expression specified.");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function applyRegex(regex, target, data, replacement, groupCount, allowUnmatched = false) {
|
|
51
|
+
const pattern = compilePattern(regex);
|
|
52
|
+
const groups = groupCount ? Number(groupCount) : 0;
|
|
53
|
+
let failedCount = 0;
|
|
54
|
+
const newData = data.map((row) => {
|
|
55
|
+
const match = pattern.exec(String(row[target]));
|
|
56
|
+
if (!match) {
|
|
57
|
+
if (!allowUnmatched) {
|
|
58
|
+
failedCount++;
|
|
59
|
+
return row;
|
|
60
|
+
}
|
|
61
|
+
return [...row, ...Array(replacement == null && groups ? groups : 1).fill("")];
|
|
62
|
+
}
|
|
63
|
+
if (replacement != null) {
|
|
64
|
+
return [...row, pattern.pyreReplace(match[0], replacement)];
|
|
65
|
+
}
|
|
66
|
+
if (groups) {
|
|
67
|
+
if (match.length - 1 !== groups) {
|
|
68
|
+
failedCount++;
|
|
69
|
+
return row;
|
|
70
|
+
}
|
|
71
|
+
return [...row, ...match.slice(1)];
|
|
72
|
+
}
|
|
73
|
+
return [...row, match[0]];
|
|
74
|
+
});
|
|
75
|
+
if (failedCount > 0) {
|
|
76
|
+
throw new RulesDSLError(`${failedCount} row(s) failed to match specified regular expression.`);
|
|
77
|
+
}
|
|
78
|
+
return newData;
|
|
79
|
+
}
|
|
80
|
+
function filterIndex(keep, items) {
|
|
81
|
+
return items.filter((_, index) => keep(index));
|
|
82
|
+
}
|
|
83
|
+
/** Python `float()` on a cell; throws instead of producing NaN. */
|
|
84
|
+
function toFloat(value) {
|
|
85
|
+
const text = String(value).trim();
|
|
86
|
+
const result = Number(text);
|
|
87
|
+
if (text === "" || (Number.isNaN(result) && text.toLowerCase() !== "nan")) {
|
|
88
|
+
throw new RulesDSLError(`Could not convert [${text}] to a number.`);
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
function source(sources, index) {
|
|
93
|
+
return sources[index];
|
|
94
|
+
}
|
|
95
|
+
function metadataIndex(value, prefix) {
|
|
96
|
+
const index = Number(value.slice(prefix.length));
|
|
97
|
+
if (!Number.isInteger(index)) {
|
|
98
|
+
throw new RulesDSLError(`Invalid column metadata value [${value}].`);
|
|
99
|
+
}
|
|
100
|
+
return index;
|
|
101
|
+
}
|
|
102
|
+
/** Upload/history metadata only Galaxy's client reads; Python rejects these. */
|
|
103
|
+
const CLIENT_METADATA = ["hid", "name", "path", "uri"];
|
|
104
|
+
const RULES_DEFINITIONS = {
|
|
105
|
+
add_column_metadata: {
|
|
106
|
+
columns: addsOneColumn,
|
|
107
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { value: "str" }),
|
|
108
|
+
apply: (rule, data, sources) => {
|
|
109
|
+
const value = rule.value;
|
|
110
|
+
let cell;
|
|
111
|
+
if (value.startsWith("identifier")) {
|
|
112
|
+
const identifierIndex = metadataIndex(value, "identifier");
|
|
113
|
+
cell = (index) => source(sources, index).identifiers[identifierIndex];
|
|
114
|
+
}
|
|
115
|
+
else if (value.startsWith("index")) {
|
|
116
|
+
const elementIndex = metadataIndex(value, "index");
|
|
117
|
+
cell = (index) => String(source(sources, index).indices[elementIndex]);
|
|
118
|
+
}
|
|
119
|
+
else if (value === "tags") {
|
|
120
|
+
cell = (index) => [...source(sources, index).tags].sort().join(",");
|
|
121
|
+
}
|
|
122
|
+
else if (CLIENT_METADATA.includes(value)) {
|
|
123
|
+
cell = (index) => source(sources, index)[value];
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
throw new RulesDSLError(`Unknown metadata type [${value}]`);
|
|
127
|
+
}
|
|
128
|
+
return [data.map((row, index) => [...row, cell(index)]), sources];
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
add_column_group_tag_value: {
|
|
132
|
+
columns: addsOneColumn,
|
|
133
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { value: "str" }),
|
|
134
|
+
apply: (rule, data, sources) => {
|
|
135
|
+
const tagPrefix = `group:${rule.value}:`;
|
|
136
|
+
const newRows = data.map((row, index) => {
|
|
137
|
+
const tag = [...source(sources, index).tags].sort().find((t) => t.startsWith(tagPrefix));
|
|
138
|
+
const value = tag === undefined ? (rule.default_value ?? "") : tag.slice(tagPrefix.length);
|
|
139
|
+
return [...row, value];
|
|
140
|
+
});
|
|
141
|
+
return [newRows, sources];
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
add_column_concatenate: {
|
|
145
|
+
columns: addsOneColumn,
|
|
146
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_column_0: "int", target_column_1: "int" }),
|
|
147
|
+
apply: (rule, data, sources) => {
|
|
148
|
+
const column0 = rule.target_column_0;
|
|
149
|
+
const column1 = rule.target_column_1;
|
|
150
|
+
return [
|
|
151
|
+
data.map((row) => [...row, row[column0] + row[column1]]),
|
|
152
|
+
sources,
|
|
153
|
+
];
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
add_column_basename: {
|
|
157
|
+
columns: addsOneColumn,
|
|
158
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_column: "int" }),
|
|
159
|
+
apply: (rule, data, sources) => [
|
|
160
|
+
applyRegex("[^/]*$", rule.target_column, data),
|
|
161
|
+
sources,
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
add_column_regex: {
|
|
165
|
+
columns: (rule, columns) => {
|
|
166
|
+
const added = rule.replacement == null && rule.group_count ? Number(rule.group_count) : 1;
|
|
167
|
+
return [...columns, ...Array(added).fill(NEW_COLUMN)];
|
|
168
|
+
},
|
|
169
|
+
validate: (rule) => {
|
|
170
|
+
ensureRuleContainsKeys(rule, { target_column: "int", expression: "str" });
|
|
171
|
+
compilePattern(rule.expression);
|
|
172
|
+
},
|
|
173
|
+
apply: (rule, data, sources) => {
|
|
174
|
+
let allowUnmatched = false;
|
|
175
|
+
if ("allow_unmatched" in rule) {
|
|
176
|
+
ensureRuleContainsKeys(rule, { allow_unmatched: "bool" });
|
|
177
|
+
allowUnmatched = rule.allow_unmatched;
|
|
178
|
+
}
|
|
179
|
+
const newData = applyRegex(rule.expression, rule.target_column, data, rule.replacement, rule.group_count, allowUnmatched);
|
|
180
|
+
return [newData, sources];
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
add_column_rownum: {
|
|
184
|
+
columns: addsOneColumn,
|
|
185
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { start: "int" }),
|
|
186
|
+
apply: (rule, data, sources) => {
|
|
187
|
+
const start = rule.start;
|
|
188
|
+
return [data.map((row, index) => [...row, `${index + start}`]), sources];
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
add_column_value: {
|
|
192
|
+
columns: addsOneColumn,
|
|
193
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { value: "str" }),
|
|
194
|
+
apply: (rule, data, sources) => [data.map((row) => [...row, String(rule.value)]), sources],
|
|
195
|
+
},
|
|
196
|
+
add_column_substr: {
|
|
197
|
+
columns: addsOneColumn,
|
|
198
|
+
validate: (rule) => {
|
|
199
|
+
ensureRuleContainsKeys(rule, { target_column: "int", length: "int", substr_type: "str" });
|
|
200
|
+
ensureKeyValueIn(rule, "substr_type", [
|
|
201
|
+
"keep_prefix",
|
|
202
|
+
"drop_prefix",
|
|
203
|
+
"keep_suffix",
|
|
204
|
+
"drop_suffix",
|
|
205
|
+
]);
|
|
206
|
+
},
|
|
207
|
+
apply: (rule, data, sources) => {
|
|
208
|
+
const target = rule.target_column;
|
|
209
|
+
const length = rule.length;
|
|
210
|
+
const substrType = rule.substr_type;
|
|
211
|
+
const newRows = data.map((row) => {
|
|
212
|
+
const original = row[target];
|
|
213
|
+
let start = 0;
|
|
214
|
+
let end = original.length;
|
|
215
|
+
if (substrType === "keep_prefix") {
|
|
216
|
+
end = length;
|
|
217
|
+
}
|
|
218
|
+
else if (substrType === "drop_prefix") {
|
|
219
|
+
start = length;
|
|
220
|
+
}
|
|
221
|
+
else if (substrType === "keep_suffix") {
|
|
222
|
+
start = Math.max(end - length, 0);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
end = Math.max(end - length, 0);
|
|
226
|
+
}
|
|
227
|
+
return [...row, original.slice(start, end)];
|
|
228
|
+
});
|
|
229
|
+
return [newRows, sources];
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
add_column_from_sample_sheet_index: {
|
|
233
|
+
columns: addsOneColumn,
|
|
234
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { value: "int" }),
|
|
235
|
+
apply: (rule, data, sources) => {
|
|
236
|
+
const columnIndex = rule.value;
|
|
237
|
+
return [
|
|
238
|
+
data.map((row, index) => [...row, source(sources, index).columns[columnIndex]]),
|
|
239
|
+
sources,
|
|
240
|
+
];
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
remove_columns: {
|
|
244
|
+
columns: (rule, columns) => removeColumns(columns, rule.target_columns),
|
|
245
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_columns: "list" }),
|
|
246
|
+
apply: (rule, data, sources) => {
|
|
247
|
+
const targetColumns = rule.target_columns;
|
|
248
|
+
return [data.map((row) => row.filter((_, index) => !targetColumns.includes(index))), sources];
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
add_filter_regex: {
|
|
252
|
+
validate: (rule) => {
|
|
253
|
+
ensureRuleContainsKeys(rule, { target_column: "int", invert: "bool", expression: "str" });
|
|
254
|
+
compilePattern(rule.expression);
|
|
255
|
+
},
|
|
256
|
+
apply: (rule, data, sources) => {
|
|
257
|
+
const pattern = compilePattern(rule.expression);
|
|
258
|
+
const invert = rule.invert;
|
|
259
|
+
const keep = (index) => pattern.test(String(data[index][rule.target_column])) ? !invert : invert;
|
|
260
|
+
return [filterIndex(keep, data), filterIndex(keep, sources)];
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
add_filter_count: {
|
|
264
|
+
validate: (rule) => {
|
|
265
|
+
ensureRuleContainsKeys(rule, { count: "int", invert: "bool", which: "str" });
|
|
266
|
+
ensureKeyValueIn(rule, "which", ["first", "last"]);
|
|
267
|
+
},
|
|
268
|
+
apply: (rule, data, sources) => {
|
|
269
|
+
const numRows = data.length;
|
|
270
|
+
const n = rule.count;
|
|
271
|
+
const invert = rule.invert;
|
|
272
|
+
const keep = (index) => {
|
|
273
|
+
const matches = rule.which === "first" ? index >= n : index < numRows - n;
|
|
274
|
+
return matches ? !invert : invert;
|
|
275
|
+
};
|
|
276
|
+
return [filterIndex(keep, data), filterIndex(keep, sources)];
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
add_filter_empty: {
|
|
280
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_column: "int", invert: "bool" }),
|
|
281
|
+
apply: (rule, data, sources) => {
|
|
282
|
+
const invert = rule.invert;
|
|
283
|
+
const keep = (index) => data[index][rule.target_column].length !== 0 ? !invert : invert;
|
|
284
|
+
return [filterIndex(keep, data), filterIndex(keep, sources)];
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
add_filter_matches: {
|
|
288
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_column: "int", invert: "bool", value: "str" }),
|
|
289
|
+
apply: (rule, data, sources) => {
|
|
290
|
+
const invert = rule.invert;
|
|
291
|
+
const keep = (index) => data[index][rule.target_column] === rule.value ? !invert : invert;
|
|
292
|
+
return [filterIndex(keep, data), filterIndex(keep, sources)];
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
add_filter_compare: {
|
|
296
|
+
validate: (rule) => {
|
|
297
|
+
ensureRuleContainsKeys(rule, { target_column: "int", value: "int", compare_type: "str" });
|
|
298
|
+
ensureKeyValueIn(rule, "compare_type", [
|
|
299
|
+
"less_than",
|
|
300
|
+
"less_than_equal",
|
|
301
|
+
"greater_than",
|
|
302
|
+
"greater_than_equal",
|
|
303
|
+
]);
|
|
304
|
+
},
|
|
305
|
+
apply: (rule, data, sources) => {
|
|
306
|
+
const value = rule.value;
|
|
307
|
+
const keep = (index) => {
|
|
308
|
+
const target = toFloat(data[index][rule.target_column]);
|
|
309
|
+
switch (rule.compare_type) {
|
|
310
|
+
case "less_than":
|
|
311
|
+
return target < value;
|
|
312
|
+
case "less_than_equal":
|
|
313
|
+
return target <= value;
|
|
314
|
+
case "greater_than":
|
|
315
|
+
return target > value;
|
|
316
|
+
default:
|
|
317
|
+
return target >= value;
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
return [filterIndex(keep, data), filterIndex(keep, sources)];
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
sort: {
|
|
324
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_column: "int", numeric: "bool" }),
|
|
325
|
+
apply: (rule, data, sources) => {
|
|
326
|
+
const target = rule.target_column;
|
|
327
|
+
const key = (row) => (rule.numeric ? toFloat(row[target]) : String(row[target]));
|
|
328
|
+
// Array.prototype.sort is stable, matching Python's sorted().
|
|
329
|
+
const sorted = data
|
|
330
|
+
.map((row, index) => ({ row, source: sources[index], key: key(row) }))
|
|
331
|
+
.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
|
|
332
|
+
return [sorted.map((item) => item.row), sorted.map((item) => item.source)];
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
swap_columns: {
|
|
336
|
+
columns: (rule, columns) => {
|
|
337
|
+
const swapped = [...columns];
|
|
338
|
+
swapped[rule.target_column_0] = columns[rule.target_column_1];
|
|
339
|
+
swapped[rule.target_column_1] = columns[rule.target_column_0];
|
|
340
|
+
return swapped;
|
|
341
|
+
},
|
|
342
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_column_0: "int", target_column_1: "int" }),
|
|
343
|
+
apply: (rule, data, sources) => {
|
|
344
|
+
const column0 = rule.target_column_0;
|
|
345
|
+
const column1 = rule.target_column_1;
|
|
346
|
+
const newRows = data.map((row) => {
|
|
347
|
+
const copy = [...row];
|
|
348
|
+
copy[column0] = row[column1];
|
|
349
|
+
copy[column1] = row[column0];
|
|
350
|
+
return copy;
|
|
351
|
+
});
|
|
352
|
+
return [newRows, sources];
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
split_columns: {
|
|
356
|
+
columns: (rule, columns) => removeColumns(columns, rule.target_columns_0),
|
|
357
|
+
validate: (rule) => ensureRuleContainsKeys(rule, { target_columns_0: "list", target_columns_1: "list" }),
|
|
358
|
+
apply: (rule, data, sources) => {
|
|
359
|
+
const columns0 = rule.target_columns_0;
|
|
360
|
+
const columns1 = rule.target_columns_1;
|
|
361
|
+
const newRows = data.flatMap((row) => {
|
|
362
|
+
const row0 = [];
|
|
363
|
+
const row1 = [];
|
|
364
|
+
row.forEach((cell, index) => {
|
|
365
|
+
if (columns0.includes(index)) {
|
|
366
|
+
row0.push(cell);
|
|
367
|
+
}
|
|
368
|
+
else if (columns1.includes(index)) {
|
|
369
|
+
row1.push(cell);
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
row0.push(cell);
|
|
373
|
+
row1.push(cell);
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
return [row0, row1];
|
|
377
|
+
});
|
|
378
|
+
return [newRows, sources.flatMap((s) => [s, s])];
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
};
|
|
382
|
+
function ruleDefinition(rule) {
|
|
383
|
+
const definition = RULES_DEFINITIONS[rule.type];
|
|
384
|
+
if (!definition) {
|
|
385
|
+
throw new RulesDSLError(`Unknown rule type [${rule.type}].`);
|
|
386
|
+
}
|
|
387
|
+
return definition;
|
|
388
|
+
}
|
|
389
|
+
export class RuleSet {
|
|
390
|
+
rules;
|
|
391
|
+
mapping;
|
|
392
|
+
constructor(ruleSet) {
|
|
393
|
+
if (!Array.isArray(ruleSet.rules)) {
|
|
394
|
+
throw new RulesDSLError("Rule set does not contain [rules].");
|
|
395
|
+
}
|
|
396
|
+
this.rules = ruleSet.rules;
|
|
397
|
+
this.mapping = ruleSet.mapping ?? [];
|
|
398
|
+
}
|
|
399
|
+
apply(data, sources) {
|
|
400
|
+
for (const rule of this.rules) {
|
|
401
|
+
const definition = ruleDefinition(rule);
|
|
402
|
+
definition.validate(rule);
|
|
403
|
+
[data, sources] = definition.apply(rule, data, sources);
|
|
404
|
+
}
|
|
405
|
+
return [data, sources];
|
|
406
|
+
}
|
|
407
|
+
get hasErrors() {
|
|
408
|
+
try {
|
|
409
|
+
for (const rule of this.rules) {
|
|
410
|
+
ruleDefinition(rule).validate(rule);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
catch {
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
get mappingAsDict() {
|
|
419
|
+
return Object.fromEntries(this.mapping.map((m) => [m.type, m]));
|
|
420
|
+
}
|
|
421
|
+
get identifierColumns() {
|
|
422
|
+
const mapping = this.mappingAsDict;
|
|
423
|
+
const columns = [...(mapping.list_identifiers?.columns ?? [])];
|
|
424
|
+
for (const type of ["paired_identifier", "paired_or_unpaired_identifier"]) {
|
|
425
|
+
if (mapping[type]) {
|
|
426
|
+
columns.push(mapping[type].columns[0]);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return columns;
|
|
430
|
+
}
|
|
431
|
+
/** Collection type the mapping builds, e.g. `list:paired`; `""` when nothing is mapped. */
|
|
432
|
+
get collectionType() {
|
|
433
|
+
const mapping = this.mappingAsDict;
|
|
434
|
+
const ranks = (mapping.list_identifiers?.columns ?? []).map(() => "list");
|
|
435
|
+
if (mapping.paired_identifier) {
|
|
436
|
+
ranks.push("paired");
|
|
437
|
+
}
|
|
438
|
+
if (mapping.paired_or_unpaired_identifier) {
|
|
439
|
+
ranks.push("paired_or_unpaired");
|
|
440
|
+
}
|
|
441
|
+
return ranks.join(":");
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
export const SKIPPED_RULE_WARNING = "Skipped due to previous errors.";
|
|
445
|
+
/** Spreadsheet-style headers (`A`, `B`, …) for the current table width. */
|
|
446
|
+
export function colHeadersFor(data, columns) {
|
|
447
|
+
const width = data.length === 0 ? (columns?.length ?? 0) : data[0].length;
|
|
448
|
+
return Array.from({ length: width }, (_, i) => String.fromCharCode(65 + i));
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Galaxy client's `applyRules`: runs rules without validating them, records a
|
|
452
|
+
* failing rule's message on `rule.error` and skips the rest with `rule.warn`.
|
|
453
|
+
*/
|
|
454
|
+
export function applyRules(data, sources, columns, rules, headersPerRule = []) {
|
|
455
|
+
const colHeadersPerRule = Array.from(headersPerRule);
|
|
456
|
+
let hasRuleError = false;
|
|
457
|
+
rules.forEach((rule, ruleIndex) => {
|
|
458
|
+
colHeadersPerRule[ruleIndex] = colHeadersFor(data, columns);
|
|
459
|
+
rule.error = null;
|
|
460
|
+
rule.warn = null;
|
|
461
|
+
if (hasRuleError) {
|
|
462
|
+
rule.warn = SKIPPED_RULE_WARNING;
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
try {
|
|
466
|
+
const definition = ruleDefinition(rule);
|
|
467
|
+
[data, sources] = definition.apply(rule, data, sources);
|
|
468
|
+
columns = definition.columns ? definition.columns(rule, columns) : columns;
|
|
469
|
+
}
|
|
470
|
+
catch (e) {
|
|
471
|
+
hasRuleError = true;
|
|
472
|
+
rule.error = e instanceof Error ? e.message : String(e);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
return { data, sources, columns, colHeadersPerRule };
|
|
476
|
+
}
|
|
477
|
+
//# sourceMappingURL=rules-dsl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-dsl.js","sourceRoot":"","sources":["../src/rules-dsl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,IAAyB,MAAM,gBAAgB,CAAC;AAEvD,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAyCD,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB,MAAM,aAAa,GAAG,CAAC,KAAW,EAAE,OAAiB,EAAE,EAAE,CAAC,CAAC,GAAG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 -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galaxy-tool-util/workflow-graph",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Pure collection-type algebra
|
|
3
|
+
"version": "1.15.0",
|
|
4
|
+
"description": "Pure collection-type algebra, datatype subtyping primitives and rule builder DSL extracted from Galaxy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
"datatypes"
|
|
33
33
|
],
|
|
34
34
|
"license": "MIT",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"yaml": "^2.8.3"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"pyre-to-regexp": "0.0.6"
|
|
40
|
+
},
|
|
35
41
|
"scripts": {
|
|
36
42
|
"build": "tsc",
|
|
37
43
|
"typecheck": "tsc --noEmit",
|