@nfdi4plants/arctrl 1.0.0-beta.7 → 1.0.0-beta.9
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 +21 -18
- package/ISA/ISA/ArcTypes/ArcTableAux.js +16 -12
- package/ISA/ISA/ArcTypes/ArcTables.js +6 -6
- package/ISA/ISA/ArcTypes/ArcTypes.js +267 -190
- package/ISA/ISA/ArcTypes/CompositeCell.js +9 -0
- package/ISA/ISA/ArcTypes/CompositeHeader.js +65 -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/Process.js +3 -3
- package/ISA/ISA.Spreadsheet/ArcInvestigation.js +21 -5
- package/ISA/ISA.Spreadsheet/Metadata/Conversions.js +3 -3
- package/README.md +3 -2
- package/SemVer.js +5 -7
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +5 -5
|
@@ -176,6 +176,15 @@ export class CompositeCell extends Union {
|
|
|
176
176
|
const this$ = this;
|
|
177
177
|
return (this$.tag === 1) ? this$.fields[0] : ((this$.tag === 2) ? (`${this$.fields[0]} ${this$.fields[1].NameText}`) : (`${this$.fields[0].NameText}`));
|
|
178
178
|
}
|
|
179
|
+
static term(oa) {
|
|
180
|
+
return new CompositeCell(0, [oa]);
|
|
181
|
+
}
|
|
182
|
+
static freeText(s) {
|
|
183
|
+
return new CompositeCell(1, [s]);
|
|
184
|
+
}
|
|
185
|
+
static unitized(v, oa) {
|
|
186
|
+
return new CompositeCell(2, [v, oa]);
|
|
187
|
+
}
|
|
179
188
|
}
|
|
180
189
|
|
|
181
190
|
export function CompositeCell_$reflection() {
|
|
@@ -5,7 +5,7 @@ import { ActivePatterns_$007CTermColumn$007C_$007C, Pattern_OutputPattern, Patte
|
|
|
5
5
|
import { equals } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
6
6
|
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
7
7
|
import { OntologyAnnotation_$reflection, OntologyAnnotation } from "../JsonTypes/OntologyAnnotation.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ProtocolParameter } from "../JsonTypes/ProtocolParameter.js";
|
|
9
9
|
import { Factor } from "../JsonTypes/Factor.js";
|
|
10
10
|
import { MaterialAttribute_create_Z6C54B221 } from "../JsonTypes/MaterialAttribute.js";
|
|
11
11
|
import { Component_create_61502994 } from "../JsonTypes/Component.js";
|
|
@@ -215,6 +215,27 @@ export class IOType extends Union {
|
|
|
215
215
|
throw new Error(`Unable to parse combination to existing IOType: \`${iotype}\``);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
+
static source() {
|
|
219
|
+
return new IOType(0, []);
|
|
220
|
+
}
|
|
221
|
+
static sample() {
|
|
222
|
+
return new IOType(1, []);
|
|
223
|
+
}
|
|
224
|
+
static rawDataFile() {
|
|
225
|
+
return new IOType(2, []);
|
|
226
|
+
}
|
|
227
|
+
static derivedDataFile() {
|
|
228
|
+
return new IOType(3, []);
|
|
229
|
+
}
|
|
230
|
+
static imageFile() {
|
|
231
|
+
return new IOType(4, []);
|
|
232
|
+
}
|
|
233
|
+
static material() {
|
|
234
|
+
return new IOType(5, []);
|
|
235
|
+
}
|
|
236
|
+
static freeText(s) {
|
|
237
|
+
return new IOType(6, [s]);
|
|
238
|
+
}
|
|
218
239
|
}
|
|
219
240
|
|
|
220
241
|
export function IOType_$reflection() {
|
|
@@ -526,7 +547,7 @@ export class CompositeHeader extends Union {
|
|
|
526
547
|
}
|
|
527
548
|
TryParameter() {
|
|
528
549
|
const this$ = this;
|
|
529
|
-
return (this$.tag === 3) ?
|
|
550
|
+
return (this$.tag === 3) ? ProtocolParameter.create(void 0, this$.fields[0]) : void 0;
|
|
530
551
|
}
|
|
531
552
|
TryFactor() {
|
|
532
553
|
const this$ = this;
|
|
@@ -684,6 +705,48 @@ export class CompositeHeader extends Union {
|
|
|
684
705
|
throw new Error(`Unable to parse combination to existing CompositeHeader: \`${header}\``);
|
|
685
706
|
}
|
|
686
707
|
}
|
|
708
|
+
static component(oa) {
|
|
709
|
+
return new CompositeHeader(0, [oa]);
|
|
710
|
+
}
|
|
711
|
+
static characteristic(oa) {
|
|
712
|
+
return new CompositeHeader(1, [oa]);
|
|
713
|
+
}
|
|
714
|
+
static factor(oa) {
|
|
715
|
+
return new CompositeHeader(2, [oa]);
|
|
716
|
+
}
|
|
717
|
+
static parameter(oa) {
|
|
718
|
+
return new CompositeHeader(3, [oa]);
|
|
719
|
+
}
|
|
720
|
+
static protocolType() {
|
|
721
|
+
return new CompositeHeader(4, []);
|
|
722
|
+
}
|
|
723
|
+
static protocolDescription() {
|
|
724
|
+
return new CompositeHeader(5, []);
|
|
725
|
+
}
|
|
726
|
+
static protocolUri() {
|
|
727
|
+
return new CompositeHeader(6, []);
|
|
728
|
+
}
|
|
729
|
+
static protocolVersion() {
|
|
730
|
+
return new CompositeHeader(7, []);
|
|
731
|
+
}
|
|
732
|
+
static protocolREF() {
|
|
733
|
+
return new CompositeHeader(8, []);
|
|
734
|
+
}
|
|
735
|
+
static performer() {
|
|
736
|
+
return new CompositeHeader(9, []);
|
|
737
|
+
}
|
|
738
|
+
static date() {
|
|
739
|
+
return new CompositeHeader(10, []);
|
|
740
|
+
}
|
|
741
|
+
static input(io) {
|
|
742
|
+
return new CompositeHeader(11, [io]);
|
|
743
|
+
}
|
|
744
|
+
static output(io) {
|
|
745
|
+
return new CompositeHeader(12, [io]);
|
|
746
|
+
}
|
|
747
|
+
static freeText(s) {
|
|
748
|
+
return new CompositeHeader(13, [s]);
|
|
749
|
+
}
|
|
687
750
|
}
|
|
688
751
|
|
|
689
752
|
export function CompositeHeader_$reflection() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fold } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
2
2
|
import { Protocol_create_Z7DFD6E67, Protocol_addComponent, Protocol_addParameter, Protocol_setName, Protocol_setDescription, Protocol_setUri, Protocol_setVersion, Protocol_setProtocolType } from "../JsonTypes/Protocol.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ProtocolParameter } from "../JsonTypes/ProtocolParameter.js";
|
|
4
4
|
import { Component_create_61502994 } from "../JsonTypes/Component.js";
|
|
5
|
-
import { Value
|
|
5
|
+
import { Value } from "../JsonTypes/Value.js";
|
|
6
6
|
|
|
7
7
|
export function toProtocol(tableName, row) {
|
|
8
8
|
return fold((p, hc) => {
|
|
@@ -98,9 +98,9 @@ export function toProtocol(tableName, row) {
|
|
|
98
98
|
case 4:
|
|
99
99
|
return Protocol_setName(p, v_3);
|
|
100
100
|
case 5:
|
|
101
|
-
return Protocol_addParameter(
|
|
101
|
+
return Protocol_addParameter(ProtocolParameter.create(void 0, oa_1), p);
|
|
102
102
|
case 6:
|
|
103
|
-
return Protocol_addComponent(Component_create_61502994(void 0,
|
|
103
|
+
return Protocol_addComponent(Component_create_61502994(void 0, Value.fromString(v_4), unit, oa_2), p);
|
|
104
104
|
case 7:
|
|
105
105
|
return Protocol_addComponent(Component_create_61502994(void 0, new Value(0, [t]), void 0, oa_3), p);
|
|
106
106
|
default:
|
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
|
}
|