@nfdi4plants/arctrl 1.0.0-beta.8 → 1.0.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/ARC.js +9 -8
- package/Contracts/Contracts.ArcTypes.js +12 -9
- package/ISA/ISA/ArcTypes/ArcTable.js +17 -17
- package/ISA/ISA/ArcTypes/ArcTableAux.js +13 -11
- package/ISA/ISA/ArcTypes/ArcTables.js +6 -6
- package/ISA/ISA/ArcTypes/ArcTypes.js +209 -185
- package/ISA/ISA/ArcTypes/CompositeHeader.js +2 -2
- package/ISA/ISA/ArcTypes/CompositeRow.js +4 -4
- package/ISA/ISA/Fable.js +83 -10
- package/ISA/ISA/Helper.js +11 -4
- package/ISA/ISA/Identifier.js +10 -8
- package/ISA/ISA/JsonTypes/ColumnIndex.js +2 -2
- package/ISA/ISA/JsonTypes/Component.js +24 -16
- package/ISA/ISA/JsonTypes/OntologyAnnotation.js +3 -2
- package/ISA/ISA/JsonTypes/Process.js +7 -6
- package/ISA/ISA/JsonTypes/ProcessParameterValue.js +70 -92
- package/ISA/ISA/JsonTypes/ProtocolParameter.js +51 -79
- package/ISA/ISA/JsonTypes/Value.js +100 -165
- package/ISA/ISA/Regex.js +12 -6
- package/ISA/ISA.Json/ArcTypes/ArcAssay.js +197 -0
- package/ISA/ISA.Json/ArcTypes/ArcInvestigation.js +79 -0
- package/ISA/ISA.Json/ArcTypes/ArcStudy.js +77 -0
- package/ISA/ISA.Json/ArcTypes/ArcTable.js +57 -0
- package/ISA/ISA.Json/ArcTypes/CompositeCell.js +51 -0
- package/ISA/ISA.Json/ArcTypes/CompositeHeader.js +82 -0
- package/ISA/ISA.Json/ArcTypes/IOType.js +35 -0
- package/ISA/ISA.Json/Assay.js +0 -18
- package/ISA/ISA.Json/Investigation.js +17 -35
- package/ISA/ISA.Json/Process.js +3 -3
- package/ISA/ISA.Json/Study.js +0 -18
- package/ISA/ISA.Spreadsheet/ArcAssay.js +3 -3
- package/ISA/ISA.Spreadsheet/ArcInvestigation.js +21 -5
- package/ISA/ISA.Spreadsheet/ArcStudy.js +3 -5
- package/ISA/ISA.Spreadsheet/Metadata/Conversions.js +3 -3
- package/SemVer.js +5 -7
- package/Templates/Template.Json.js +12 -17
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +5 -5
package/ISA/ISA/Fable.js
CHANGED
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
import { toString } from "../../fable_modules/fable-library.4.5.0/Types.js";
|
|
2
|
-
import { append } from "../../fable_modules/fable-library.4.5.0/
|
|
3
|
-
import { append as append_1 } from "../../fable_modules/fable-library.4.5.0/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { map, reduce, append } from "../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
3
|
+
import { append as append_1 } from "../../fable_modules/fable-library.4.5.0/List.js";
|
|
4
|
+
import { append as append_2 } from "../../fable_modules/fable-library.4.5.0/Array.js";
|
|
5
|
+
import { Array_distinct, List_distinct, distinct } from "../../fable_modules/fable-library.4.5.0/Seq2.js";
|
|
6
|
+
import { identityHash, structuralHash, equals } from "../../fable_modules/fable-library.4.5.0/Util.js";
|
|
6
7
|
|
|
7
|
-
export function
|
|
8
|
+
export function isList_python(l1) {
|
|
9
|
+
return (to_string(type(l1))).indexOf("FSharpList") >= 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function isSeq_python(l1) {
|
|
13
|
+
const t = to_string(type(l1));
|
|
14
|
+
if (t.indexOf("Enumerator_Seq") >= 0) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return t.indexOf("Enumerable") >= 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function isArray_python(l1) {
|
|
23
|
+
return (to_string(type(l1))).indexOf("list") >= 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function isMap_python(l1) {
|
|
27
|
+
return (to_string(type(l1))).indexOf("FSharpMap") >= 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function isNone_python(l1) {
|
|
31
|
+
let copyOfStruct;
|
|
32
|
+
return ((copyOfStruct = l1, toString(copyOfStruct))) === "None";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function isMap_json(l1) {
|
|
8
36
|
let copyOfStruct;
|
|
9
37
|
return ((copyOfStruct = l1, toString(copyOfStruct))).indexOf("map [") === 0;
|
|
10
38
|
}
|
|
11
39
|
|
|
12
|
-
export function
|
|
40
|
+
export function isSeq_json(l1) {
|
|
41
|
+
let copyOfStruct;
|
|
42
|
+
return ((copyOfStruct = l1, toString(copyOfStruct))).indexOf("seq [") === 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function isList_json(l1) {
|
|
13
46
|
let s;
|
|
14
47
|
let copyOfStruct = l1;
|
|
15
48
|
s = toString(copyOfStruct);
|
|
@@ -21,20 +54,53 @@ export function isList_generic(l1) {
|
|
|
21
54
|
}
|
|
22
55
|
}
|
|
23
56
|
|
|
57
|
+
export function isNone_json(l1) {
|
|
58
|
+
return l1 == null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function isList_generic(l1) {
|
|
62
|
+
return isList_json(l1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function isSeq_generic(l1) {
|
|
66
|
+
return isSeq_json(l1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function isArray_generic(l1) {
|
|
70
|
+
return isList_json(l1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function isMap_generic(l1) {
|
|
74
|
+
return isMap_json(l1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function isNone_generic(l1) {
|
|
78
|
+
return isNone_json(l1);
|
|
79
|
+
}
|
|
80
|
+
|
|
24
81
|
export function append_generic(l1, l2) {
|
|
25
|
-
if (l2
|
|
82
|
+
if (isNone_generic(l2)) {
|
|
26
83
|
return l1;
|
|
27
84
|
}
|
|
28
|
-
else if (
|
|
85
|
+
else if (isSeq_generic(l1)) {
|
|
29
86
|
return append(l1, l2);
|
|
30
87
|
}
|
|
31
|
-
else {
|
|
88
|
+
else if (isList_generic(l1)) {
|
|
32
89
|
return append_1(l1, l2);
|
|
33
90
|
}
|
|
91
|
+
else {
|
|
92
|
+
return append_2(l1, l2);
|
|
93
|
+
}
|
|
34
94
|
}
|
|
35
95
|
|
|
36
96
|
export function distinct_generic(l1) {
|
|
37
|
-
if (
|
|
97
|
+
if (isSeq_generic(l1)) {
|
|
98
|
+
return distinct(l1, {
|
|
99
|
+
Equals: equals,
|
|
100
|
+
GetHashCode: structuralHash,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
else if (isList_generic(l1)) {
|
|
38
104
|
return List_distinct(l1, {
|
|
39
105
|
Equals: equals,
|
|
40
106
|
GetHashCode: structuralHash,
|
|
@@ -48,3 +114,10 @@ export function distinct_generic(l1) {
|
|
|
48
114
|
}
|
|
49
115
|
}
|
|
50
116
|
|
|
117
|
+
export function hashSeq(s) {
|
|
118
|
+
return reduce((a, b) => (a + b), map((x) => {
|
|
119
|
+
let copyOfStruct = x;
|
|
120
|
+
return identityHash(copyOfStruct) | 0;
|
|
121
|
+
}, s));
|
|
122
|
+
}
|
|
123
|
+
|
package/ISA/ISA/Helper.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isIterable, defaultOf, numberHash, identityHash, structuralHash, equals, disposeSafe, getEnumerator } from "../../fable_modules/fable-library.4.5.0/Util.js";
|
|
2
2
|
import { some, value as value_1 } from "../../fable_modules/fable-library.4.5.0/Option.js";
|
|
3
3
|
import { exactlyOne, partition, fold, contains } from "../../fable_modules/fable-library.4.5.0/Array.js";
|
|
4
|
+
import { isEmpty as isEmpty_1, iterate, fold as fold_1 } from "../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
4
5
|
import { empty, singleton, append, head, tail, isEmpty } from "../../fable_modules/fable-library.4.5.0/List.js";
|
|
5
6
|
import { Dictionary } from "../../fable_modules/fable-library.4.5.0/MutableMap.js";
|
|
6
|
-
import { isEmpty as isEmpty_1, iterate } from "../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
7
7
|
import { tryGetValue, addToDict } from "../../fable_modules/fable-library.4.5.0/MapUtil.js";
|
|
8
8
|
import { Union, toString, FSharpRef } from "../../fable_modules/fable-library.4.5.0/Types.js";
|
|
9
|
-
import { append_generic, distinct_generic, isList_generic, isMap_generic } from "./Fable.js";
|
|
9
|
+
import { isNone_generic, append_generic, distinct_generic, isList_generic, isMap_generic } from "./Fable.js";
|
|
10
10
|
import { union_type, makeUnion, option_type, makeGenericType, getUnionCases, name, obj_type } from "../../fable_modules/fable-library.4.5.0/Reflection.js";
|
|
11
11
|
|
|
12
12
|
export function ResizeArray_map(f, a) {
|
|
@@ -175,6 +175,13 @@ export function HashCodes_boxHashArray(a) {
|
|
|
175
175
|
}, 0, a);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
export function HashCodes_boxHashSeq(a) {
|
|
179
|
+
return fold_1((acc, o) => {
|
|
180
|
+
let copyOfStruct;
|
|
181
|
+
return ((-1640531527 + ((copyOfStruct = o, identityHash(copyOfStruct)))) + (acc << 6)) + (acc >> 2);
|
|
182
|
+
}, 0, a);
|
|
183
|
+
}
|
|
184
|
+
|
|
178
185
|
/**
|
|
179
186
|
* If the value matches the default, a None is returned, else a Some is returned
|
|
180
187
|
*/
|
|
@@ -377,7 +384,7 @@ export function Update_updateAppend(oldVal, newVal) {
|
|
|
377
384
|
* updates oldRT with newRT by replacing all values, but only if the new value is not empty.
|
|
378
385
|
*/
|
|
379
386
|
export function Update_updateOnlyByExisting(oldVal, newVal) {
|
|
380
|
-
if (
|
|
387
|
+
if (isNone_generic(newVal)) {
|
|
381
388
|
return oldVal;
|
|
382
389
|
}
|
|
383
390
|
else {
|
|
@@ -428,7 +435,7 @@ export function Update_updateOnlyByExisting(oldVal, newVal) {
|
|
|
428
435
|
* updates oldRT with newRT by replacing all values, but only if the new value is not empty.
|
|
429
436
|
*/
|
|
430
437
|
export function Update_updateOnlyByExistingAppend(oldVal, newVal) {
|
|
431
|
-
if (
|
|
438
|
+
if (isNone_generic(newVal)) {
|
|
432
439
|
return oldVal;
|
|
433
440
|
}
|
|
434
441
|
else {
|
package/ISA/ISA/Identifier.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActivePatterns_$007CRegex$007C_$007C } from "./Regex.js";
|
|
2
2
|
import { newGuid } from "../../fable_modules/fable-library.4.5.0/Guid.js";
|
|
3
3
|
import { combineMany } from "../../FileSystem/Path.js";
|
|
4
4
|
|
|
5
5
|
export function checkValidCharacters(identifier) {
|
|
6
|
-
if (
|
|
6
|
+
if (ActivePatterns_$007CRegex$007C_$007C("^[a-zA-Z0-9_\\- ]+$", identifier) != null) {
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
7
9
|
throw new Error(`New identifier "${identifier}"contains forbidden characters! Allowed characters are: letters, digits, underscore (_), dash (-) and whitespace ( ).`);
|
|
8
10
|
}
|
|
9
11
|
}
|
|
@@ -32,9 +34,9 @@ export function removeMissingIdentifier(str) {
|
|
|
32
34
|
* This functions extracts assayIdentifier from any of these combinations and returns it.
|
|
33
35
|
*/
|
|
34
36
|
export function Assay_identifierFromFileName(fileName) {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("^(assays(\\/|\\\\))?(?<identifier>[a-zA-Z0-9_\\- ]+)((\\/|\\\\)isa.assay.xlsx)?$", fileName);
|
|
38
|
+
if (activePatternResult != null) {
|
|
39
|
+
const m = activePatternResult;
|
|
38
40
|
return (m.groups && m.groups.identifier) || "";
|
|
39
41
|
}
|
|
40
42
|
else {
|
|
@@ -56,9 +58,9 @@ export function Assay_fileNameFromIdentifier(identifier) {
|
|
|
56
58
|
* This functions extracts studyIdentifier from any of these combinations and returns it.
|
|
57
59
|
*/
|
|
58
60
|
export function Study_identifierFromFileName(fileName) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("^(studies(\\/|\\\\))?(?<identifier>[a-zA-Z0-9_\\- ]+)((\\/|\\\\)isa.study.xlsx)?$", fileName);
|
|
62
|
+
if (activePatternResult != null) {
|
|
63
|
+
const m = activePatternResult;
|
|
62
64
|
return (m.groups && m.groups.identifier) || "";
|
|
63
65
|
}
|
|
64
66
|
else {
|
|
@@ -8,7 +8,7 @@ import { append } from "../../../fable_modules/fable-library.4.5.0/Array.js";
|
|
|
8
8
|
import { OntologyAnnotation } from "./OntologyAnnotation.js";
|
|
9
9
|
import { Factor } from "./Factor.js";
|
|
10
10
|
import { MaterialAttribute_fromString_Z2304A83C } from "./MaterialAttribute.js";
|
|
11
|
-
import {
|
|
11
|
+
import { ProtocolParameter } from "./ProtocolParameter.js";
|
|
12
12
|
import { Component_fromString_Z61E08C1 } from "./Component.js";
|
|
13
13
|
|
|
14
14
|
function tryInt(str) {
|
|
@@ -186,7 +186,7 @@ export function ARCtrl_ISA_MaterialAttributeValue__MaterialAttributeValue_TryGet
|
|
|
186
186
|
* Create a ISAJson parameter from ISATab string entries
|
|
187
187
|
*/
|
|
188
188
|
export function ARCtrl_ISA_ProtocolParameter__ProtocolParameter_fromStringWithColumnIndex_Static(term, source, accession, valueIndex) {
|
|
189
|
-
return
|
|
189
|
+
return ProtocolParameter.fromString(term, source, accession, [createOrderComment(valueIndex)]);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
export function ARCtrl_ISA_ProtocolParameter__ProtocolParameter_getColumnIndex_Static_Z3A4310A5(p) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Record } from "../../../fable_modules/fable-library.4.5.0/Types.js";
|
|
2
2
|
import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
|
|
3
|
-
import { Value as Value_1,
|
|
3
|
+
import { Value as Value_1, Value_$reflection } from "./Value.js";
|
|
4
4
|
import { OntologyAnnotation, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ActivePatterns_$007CRegex$007C_$007C } from "../Regex.js";
|
|
6
6
|
import { AnnotationValue } from "./AnnotationValue.js";
|
|
7
7
|
import { map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
8
8
|
import { Option_fromValueWithDefault } from "../Helper.js";
|
|
@@ -52,11 +52,11 @@ export function Component_composeName(value, unit) {
|
|
|
52
52
|
else if (unit != null) {
|
|
53
53
|
const u = unit;
|
|
54
54
|
const v_1 = value;
|
|
55
|
-
return `${
|
|
55
|
+
return `${v_1.Text} ${u.NameText} (${u.TermAccessionShort})`;
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
const v = value;
|
|
59
|
-
return `${
|
|
59
|
+
return `${v.Text}`;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -68,22 +68,30 @@ export function Component_composeName(value, unit) {
|
|
|
68
68
|
* Without this string composition we loose the ontology information for the header value.
|
|
69
69
|
*/
|
|
70
70
|
export function Component_decomposeName_Z721C83C5(name) {
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
71
|
+
let value;
|
|
72
|
+
const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(?<value>[\\d\\.]+) (?<unit>.+) \\((?<ontology>[^(]*:[^)]*)\\)", name);
|
|
73
|
+
if (activePatternResult != null) {
|
|
74
|
+
const unitr = activePatternResult;
|
|
74
75
|
let oa;
|
|
75
76
|
const termAnnotation = (unitr.groups && unitr.groups.ontology) || "";
|
|
76
77
|
oa = OntologyAnnotation.fromTermAnnotation(termAnnotation);
|
|
77
|
-
return [
|
|
78
|
-
}
|
|
79
|
-
else if (r != null) {
|
|
80
|
-
let oa_1;
|
|
81
|
-
const termAnnotation_1 = (r.groups && r.groups.ontology) || "";
|
|
82
|
-
oa_1 = OntologyAnnotation.fromTermAnnotation(termAnnotation_1);
|
|
83
|
-
return [new Value_1(0, [new OntologyAnnotation(oa_1.ID, new AnnotationValue(0, [Value__get_Text(Value_fromString_Z721C83C5((r.groups && r.groups.value) || ""))]), oa_1.TermSourceREF, oa_1.TermAccessionNumber, oa_1.Comments)]), void 0];
|
|
78
|
+
return [(value = ((unitr.groups && unitr.groups.value) || ""), Value_1.fromString(value)), new OntologyAnnotation(oa.ID, new AnnotationValue(0, [(unitr.groups && unitr.groups.unit) || ""]), oa.TermSourceREF, oa.TermAccessionNumber, oa.Comments)];
|
|
84
79
|
}
|
|
85
80
|
else {
|
|
86
|
-
|
|
81
|
+
const activePatternResult_1 = ActivePatterns_$007CRegex$007C_$007C("(?<value>[^\\(]+) \\((?<ontology>[^(]*:[^)]*)\\)", name);
|
|
82
|
+
if (activePatternResult_1 != null) {
|
|
83
|
+
const r = activePatternResult_1;
|
|
84
|
+
let oa_1;
|
|
85
|
+
const termAnnotation_1 = (r.groups && r.groups.ontology) || "";
|
|
86
|
+
oa_1 = OntologyAnnotation.fromTermAnnotation(termAnnotation_1);
|
|
87
|
+
let v_1;
|
|
88
|
+
const value_1 = (r.groups && r.groups.value) || "";
|
|
89
|
+
v_1 = Value_1.fromString(value_1);
|
|
90
|
+
return [new Value_1(0, [new OntologyAnnotation(oa_1.ID, new AnnotationValue(0, [v_1.Text]), oa_1.TermSourceREF, oa_1.TermAccessionNumber, oa_1.Comments)]), void 0];
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return [new Value_1(3, [name]), void 0];
|
|
94
|
+
}
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
|
|
@@ -133,7 +141,7 @@ export function Component__get_UnitText(this$) {
|
|
|
133
141
|
}
|
|
134
142
|
|
|
135
143
|
export function Component__get_ValueText(this$) {
|
|
136
|
-
return defaultArg(map(
|
|
144
|
+
return defaultArg(map((c) => c.Text, this$.ComponentValue), "");
|
|
137
145
|
}
|
|
138
146
|
|
|
139
147
|
export function Component__get_ValueWithUnitText(this$) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { value as value_4, map, defaultArg,
|
|
1
|
+
import { value as value_4, map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
2
2
|
import { Pattern_TermAnnotationShortPattern, ActivePatterns_$007CRegex$007C_$007C, tryParseTermAnnotation } from "../Regex.js";
|
|
3
3
|
import { equals, stringHash, int32ToString } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
4
4
|
import { AnnotationValue_$reflection, AnnotationValue_toString_Z6FAD7738, AnnotationValue_fromString_Z721C83C5 } from "./AnnotationValue.js";
|
|
@@ -29,8 +29,9 @@ export class OntologyAnnotation extends Record {
|
|
|
29
29
|
return OntologyAnnotation.create();
|
|
30
30
|
}
|
|
31
31
|
get TANInfo() {
|
|
32
|
+
let matchValue;
|
|
32
33
|
const this$ = this;
|
|
33
|
-
return unwrap(
|
|
34
|
+
return unwrap((matchValue = this$.TermAccessionNumber, (matchValue == null) ? void 0 : tryParseTermAnnotation(matchValue)));
|
|
34
35
|
}
|
|
35
36
|
get NameText() {
|
|
36
37
|
const this$ = this;
|
|
@@ -8,11 +8,11 @@ import { ProcessParameterValue_$reflection } from "./ProcessParameterValue.js";
|
|
|
8
8
|
import { ProcessInput_tryMaterial_102B6859, ProcessInput_trySample_102B6859, ProcessInput_tryData_102B6859, ProcessInput_trySource_102B6859, ProcessInput_tryGetCharacteristicValues_102B6859, ProcessInput_$reflection } from "./ProcessInput.js";
|
|
9
9
|
import { ProcessOutput_tryGetFactorValues_11830B70, ProcessOutput_tryGetCharacteristicValues_11830B70, ProcessOutput_$reflection } from "./ProcessOutput.js";
|
|
10
10
|
import { Comment$_$reflection } from "./Comment.js";
|
|
11
|
-
import {
|
|
11
|
+
import { ActivePatterns_$007CRegex$007C_$007C } from "../Regex.js";
|
|
12
12
|
import { parse } from "../../../fable_modules/fable-library.4.5.0/Int32.js";
|
|
13
13
|
import { List_distinct } from "../../../fable_modules/fable-library.4.5.0/Seq2.js";
|
|
14
14
|
import { safeHash, equals } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
15
|
-
import {
|
|
15
|
+
import { ProtocolParameter } from "./ProtocolParameter.js";
|
|
16
16
|
import { Update_UpdateOptions, Option_fromValueWithDefault } from "../Helper.js";
|
|
17
17
|
import { map2 } from "../../../fable_modules/fable-library.4.5.0/Array.js";
|
|
18
18
|
import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Helper.js";
|
|
@@ -67,8 +67,9 @@ export function Process_composeName(processNameRoot, i) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export function Process_decomposeName_Z721C83C5(name) {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
70
|
+
const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(?<name>.+)_(?<num>\\d+)", name);
|
|
71
|
+
if (activePatternResult != null) {
|
|
72
|
+
const r = activePatternResult;
|
|
72
73
|
return [(r.groups && r.groups.name) || "", parse((r.groups && r.groups.num) || "", 511, false, 32)];
|
|
73
74
|
}
|
|
74
75
|
else {
|
|
@@ -192,7 +193,7 @@ export function Process_tryGetInputsWithParameterBy(predicate, p) {
|
|
|
192
193
|
return void 0;
|
|
193
194
|
}
|
|
194
195
|
else {
|
|
195
|
-
const matchValue_1 = tryFind((pv) => predicate(defaultArg(pv.Category,
|
|
196
|
+
const matchValue_1 = tryFind((pv) => predicate(defaultArg(pv.Category, ProtocolParameter.empty)), matchValue);
|
|
196
197
|
if (matchValue_1 == null) {
|
|
197
198
|
return void 0;
|
|
198
199
|
}
|
|
@@ -212,7 +213,7 @@ export function Process_tryGetOutputsWithParameterBy(predicate, p) {
|
|
|
212
213
|
return void 0;
|
|
213
214
|
}
|
|
214
215
|
else {
|
|
215
|
-
const matchValue_1 = tryFind((pv) => predicate(defaultArg(pv.Category,
|
|
216
|
+
const matchValue_1 = tryFind((pv) => predicate(defaultArg(pv.Category, ProtocolParameter.empty)), matchValue);
|
|
216
217
|
if (matchValue_1 == null) {
|
|
217
218
|
return void 0;
|
|
218
219
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { bind, unwrap, map, defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
2
|
+
import { int32ToString } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
3
|
+
import { printf, toText } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
4
|
+
import { ProtocolParameter_$reflection, ProtocolParameter } from "./ProtocolParameter.js";
|
|
1
5
|
import { Record, toString } from "../../../fable_modules/fable-library.4.5.0/Types.js";
|
|
2
|
-
import { bind, defaultArg, map } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
3
|
-
import { ProtocolParameter__SetCategory_Z4C0FE73C, ProtocolParameter_create_Z6C54B221, ProtocolParameter__MapCategory_Z69DD836A, ProtocolParameter__get_TryNameText, ProtocolParameter_$reflection, ProtocolParameter__get_NameText } from "./ProtocolParameter.js";
|
|
4
6
|
import { record_type, option_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
|
|
5
7
|
import { Value_$reflection } from "./Value.js";
|
|
6
8
|
import { OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
|
|
7
|
-
import { int32ToString } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
8
|
-
import { printf, toText } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
9
9
|
|
|
10
10
|
export class ProcessParameterValue extends Record {
|
|
11
11
|
constructor(Category, Value, Unit) {
|
|
@@ -14,6 +14,71 @@ export class ProcessParameterValue extends Record {
|
|
|
14
14
|
this.Value = Value;
|
|
15
15
|
this.Unit = Unit;
|
|
16
16
|
}
|
|
17
|
+
static make(category, value, unit) {
|
|
18
|
+
return new ProcessParameterValue(category, value, unit);
|
|
19
|
+
}
|
|
20
|
+
static create(Category, Value, Unit) {
|
|
21
|
+
return ProcessParameterValue.make(Category, Value, Unit);
|
|
22
|
+
}
|
|
23
|
+
static get empty() {
|
|
24
|
+
return ProcessParameterValue.create();
|
|
25
|
+
}
|
|
26
|
+
get NameText() {
|
|
27
|
+
const this$ = this;
|
|
28
|
+
return defaultArg(map((oa) => oa.NameText, this$.Category), "");
|
|
29
|
+
}
|
|
30
|
+
get TryNameText() {
|
|
31
|
+
const this$ = this;
|
|
32
|
+
return unwrap(bind((oa) => oa.TryNameText, this$.Category));
|
|
33
|
+
}
|
|
34
|
+
get ValueText() {
|
|
35
|
+
const this$ = this;
|
|
36
|
+
return defaultArg(map((oa) => {
|
|
37
|
+
switch (oa.tag) {
|
|
38
|
+
case 2:
|
|
39
|
+
return oa.fields[0].toString();
|
|
40
|
+
case 1:
|
|
41
|
+
return int32ToString(oa.fields[0]);
|
|
42
|
+
case 3:
|
|
43
|
+
return oa.fields[0];
|
|
44
|
+
default:
|
|
45
|
+
return oa.fields[0].NameText;
|
|
46
|
+
}
|
|
47
|
+
}, this$.Value), "");
|
|
48
|
+
}
|
|
49
|
+
get ValueWithUnitText() {
|
|
50
|
+
const this$ = this;
|
|
51
|
+
const unit = map((oa) => oa.NameText, this$.Unit);
|
|
52
|
+
const v = this$.ValueText;
|
|
53
|
+
if (unit == null) {
|
|
54
|
+
return v;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const u = unit;
|
|
58
|
+
return toText(printf("%s %s"))(v)(u);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
MapCategory(f) {
|
|
62
|
+
const this$ = this;
|
|
63
|
+
return new ProcessParameterValue(map((p) => p.MapCategory(f), this$.Category), this$.Value, this$.Unit);
|
|
64
|
+
}
|
|
65
|
+
SetCategory(c) {
|
|
66
|
+
let matchValue, p;
|
|
67
|
+
const this$ = this;
|
|
68
|
+
return new ProcessParameterValue((matchValue = this$.Category, (matchValue == null) ? ProtocolParameter.create(void 0, c) : ((p = matchValue, p.SetCategory(c)))), this$.Value, this$.Unit);
|
|
69
|
+
}
|
|
70
|
+
static tryGetNameText(pv) {
|
|
71
|
+
return pv.TryNameText;
|
|
72
|
+
}
|
|
73
|
+
static getNameText(pv) {
|
|
74
|
+
return pv.NameText;
|
|
75
|
+
}
|
|
76
|
+
static nameEqualsString(name, pv) {
|
|
77
|
+
return pv.NameText === name;
|
|
78
|
+
}
|
|
79
|
+
static getCategory(pv) {
|
|
80
|
+
return pv.Category;
|
|
81
|
+
}
|
|
17
82
|
Print() {
|
|
18
83
|
const this$ = this;
|
|
19
84
|
return toString(this$);
|
|
@@ -21,7 +86,7 @@ export class ProcessParameterValue extends Record {
|
|
|
21
86
|
PrintCompact() {
|
|
22
87
|
let value_2, category_2, category_1, value_1;
|
|
23
88
|
const this$ = this;
|
|
24
|
-
const category = map(
|
|
89
|
+
const category = map((f) => f.NameText, this$.Category);
|
|
25
90
|
const unit = map((oa) => oa.NameText, this$.Unit);
|
|
26
91
|
const value = map((v) => {
|
|
27
92
|
const s = v.PrintCompact();
|
|
@@ -40,90 +105,3 @@ export function ProcessParameterValue_$reflection() {
|
|
|
40
105
|
return record_type("ARCtrl.ISA.ProcessParameterValue", [], ProcessParameterValue, () => [["Category", option_type(ProtocolParameter_$reflection())], ["Value", option_type(Value_$reflection())], ["Unit", option_type(OntologyAnnotation_$reflection())]]);
|
|
41
106
|
}
|
|
42
107
|
|
|
43
|
-
export function ProcessParameterValue_make(category, value, unit) {
|
|
44
|
-
return new ProcessParameterValue(category, value, unit);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function ProcessParameterValue_create_569825F3(Category, Value, Unit) {
|
|
48
|
-
return ProcessParameterValue_make(Category, Value, Unit);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function ProcessParameterValue_get_empty() {
|
|
52
|
-
return ProcessParameterValue_create_569825F3();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Returns the name of the category as string
|
|
57
|
-
*/
|
|
58
|
-
export function ProcessParameterValue__get_NameText(this$) {
|
|
59
|
-
return defaultArg(map(ProtocolParameter__get_NameText, this$.Category), "");
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Returns the name of the category as string
|
|
64
|
-
*/
|
|
65
|
-
export function ProcessParameterValue__get_TryNameText(this$) {
|
|
66
|
-
return bind(ProtocolParameter__get_TryNameText, this$.Category);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function ProcessParameterValue__get_ValueText(this$) {
|
|
70
|
-
return defaultArg(map((oa) => {
|
|
71
|
-
switch (oa.tag) {
|
|
72
|
-
case 2:
|
|
73
|
-
return oa.fields[0].toString();
|
|
74
|
-
case 1:
|
|
75
|
-
return int32ToString(oa.fields[0]);
|
|
76
|
-
case 3:
|
|
77
|
-
return oa.fields[0];
|
|
78
|
-
default:
|
|
79
|
-
return oa.fields[0].NameText;
|
|
80
|
-
}
|
|
81
|
-
}, this$.Value), "");
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function ProcessParameterValue__get_ValueWithUnitText(this$) {
|
|
85
|
-
const unit = map((oa) => oa.NameText, this$.Unit);
|
|
86
|
-
const v = ProcessParameterValue__get_ValueText(this$);
|
|
87
|
-
if (unit == null) {
|
|
88
|
-
return v;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
const u = unit;
|
|
92
|
-
return toText(printf("%s %s"))(v)(u);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function ProcessParameterValue__MapCategory_Z69DD836A(this$, f) {
|
|
97
|
-
return new ProcessParameterValue(map((p) => ProtocolParameter__MapCategory_Z69DD836A(p, f), this$.Category), this$.Value, this$.Unit);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function ProcessParameterValue__SetCategory_Z4C0FE73C(this$, c) {
|
|
101
|
-
let matchValue;
|
|
102
|
-
return new ProcessParameterValue((matchValue = this$.Category, (matchValue == null) ? ProtocolParameter_create_Z6C54B221(void 0, c) : ProtocolParameter__SetCategory_Z4C0FE73C(matchValue, c)), this$.Value, this$.Unit);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Returns the name of the paramater value as string if it exists
|
|
107
|
-
*/
|
|
108
|
-
export function ProcessParameterValue_tryGetNameText_5FD7232D(pv) {
|
|
109
|
-
return ProcessParameterValue__get_TryNameText(pv);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Returns the name of the paramater value as string
|
|
114
|
-
*/
|
|
115
|
-
export function ProcessParameterValue_getNameText_5FD7232D(pv) {
|
|
116
|
-
return ProcessParameterValue__get_NameText(pv);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Returns true if the given name matches the name of the parameter value
|
|
121
|
-
*/
|
|
122
|
-
export function ProcessParameterValue_nameEqualsString(name, pv) {
|
|
123
|
-
return ProcessParameterValue__get_NameText(pv) === name;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export function ProcessParameterValue_getCategory_5FD7232D(pv) {
|
|
127
|
-
return pv.Category;
|
|
128
|
-
}
|
|
129
|
-
|