@nfdi4plants/arctrl 1.0.0-beta.8 → 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.
@@ -1,8 +1,8 @@
1
- import { Record, toString } from "../../../fable_modules/fable-library.4.5.0/Types.js";
2
- import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
3
- import { OntologyAnnotation, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
1
+ import { OntologyAnnotation_$reflection, OntologyAnnotation } from "./OntologyAnnotation.js";
4
2
  import { bind, map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.5.0/Option.js";
5
3
  import { Option_fromValueWithDefault } from "../Helper.js";
4
+ import { Record, toString } from "../../../fable_modules/fable-library.4.5.0/Types.js";
5
+ import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
6
6
 
7
7
  export class ProtocolParameter extends Record {
8
8
  constructor(ID, ParameterName) {
@@ -10,13 +10,60 @@ export class ProtocolParameter extends Record {
10
10
  this.ID = ID;
11
11
  this.ParameterName = ParameterName;
12
12
  }
13
+ static make(id, parameterName) {
14
+ return new ProtocolParameter(id, parameterName);
15
+ }
16
+ static create(Id, ParameterName) {
17
+ return ProtocolParameter.make(Id, ParameterName);
18
+ }
19
+ static get empty() {
20
+ return ProtocolParameter.create();
21
+ }
22
+ static fromString(term, source, accession, comments) {
23
+ const oa = OntologyAnnotation.fromString(term, source, accession, unwrap(comments));
24
+ const parameterName = Option_fromValueWithDefault(OntologyAnnotation.empty, oa);
25
+ return ProtocolParameter.make(void 0, parameterName);
26
+ }
27
+ static toString(pp) {
28
+ const value = {
29
+ TermAccessionNumber: "",
30
+ TermName: "",
31
+ TermSourceREF: "",
32
+ };
33
+ return defaultArg(map((oa) => OntologyAnnotation.toString(oa), pp.ParameterName), value);
34
+ }
35
+ get NameText() {
36
+ const this$ = this;
37
+ return defaultArg(map((oa) => oa.NameText, this$.ParameterName), "");
38
+ }
39
+ get TryNameText() {
40
+ const this$ = this;
41
+ return unwrap(bind((oa) => oa.TryNameText, this$.ParameterName));
42
+ }
43
+ MapCategory(f) {
44
+ const this$ = this;
45
+ return new ProtocolParameter(this$.ID, map(f, this$.ParameterName));
46
+ }
47
+ SetCategory(c) {
48
+ const this$ = this;
49
+ return new ProtocolParameter(this$.ID, c);
50
+ }
51
+ static tryGetNameText(pp) {
52
+ return pp.TryNameText;
53
+ }
54
+ static getNameText(pp) {
55
+ return defaultArg(ProtocolParameter.tryGetNameText(pp), "");
56
+ }
57
+ static nameEqualsString(name, pp) {
58
+ return pp.NameText === name;
59
+ }
13
60
  Print() {
14
61
  const this$ = this;
15
62
  return toString(this$);
16
63
  }
17
64
  PrintCompact() {
18
65
  const this$ = this;
19
- return "OA " + ProtocolParameter__get_NameText(this$);
66
+ return "OA " + this$.NameText;
20
67
  }
21
68
  }
22
69
 
@@ -24,78 +71,3 @@ export function ProtocolParameter_$reflection() {
24
71
  return record_type("ARCtrl.ISA.ProtocolParameter", [], ProtocolParameter, () => [["ID", option_type(string_type)], ["ParameterName", option_type(OntologyAnnotation_$reflection())]]);
25
72
  }
26
73
 
27
- export function ProtocolParameter_make(id, parameterName) {
28
- return new ProtocolParameter(id, parameterName);
29
- }
30
-
31
- export function ProtocolParameter_create_Z6C54B221(Id, ParameterName) {
32
- return ProtocolParameter_make(Id, ParameterName);
33
- }
34
-
35
- export function ProtocolParameter_get_empty() {
36
- return ProtocolParameter_create_Z6C54B221();
37
- }
38
-
39
- /**
40
- * Create a ISAJson Protocol Parameter from ISATab string entries
41
- */
42
- export function ProtocolParameter_fromString_Z2304A83C(term, source, accession, comments) {
43
- const oa = OntologyAnnotation.fromString(term, source, accession, unwrap(comments));
44
- return ProtocolParameter_make(void 0, Option_fromValueWithDefault(OntologyAnnotation.empty, oa));
45
- }
46
-
47
- /**
48
- * Get ISATab string entries from an ISAJson ProtocolParameter object (name,source,accession)
49
- */
50
- export function ProtocolParameter_toString_Z3A4310A5(pp) {
51
- const value = {
52
- TermAccessionNumber: "",
53
- TermName: "",
54
- TermSourceREF: "",
55
- };
56
- return defaultArg(map((oa) => OntologyAnnotation.toString(oa), pp.ParameterName), value);
57
- }
58
-
59
- /**
60
- * Returns the name of the parameter as string
61
- */
62
- export function ProtocolParameter__get_NameText(this$) {
63
- return defaultArg(map((oa) => oa.NameText, this$.ParameterName), "");
64
- }
65
-
66
- /**
67
- * Returns the name of the parameter as string
68
- */
69
- export function ProtocolParameter__get_TryNameText(this$) {
70
- return bind((oa) => oa.TryNameText, this$.ParameterName);
71
- }
72
-
73
- export function ProtocolParameter__MapCategory_Z69DD836A(this$, f) {
74
- return new ProtocolParameter(this$.ID, map(f, this$.ParameterName));
75
- }
76
-
77
- export function ProtocolParameter__SetCategory_Z4C0FE73C(this$, c) {
78
- return new ProtocolParameter(this$.ID, c);
79
- }
80
-
81
- /**
82
- * Returns the name of the paramater as string if it exists
83
- */
84
- export function ProtocolParameter_tryGetNameText_Z3A4310A5(pp) {
85
- return ProtocolParameter__get_TryNameText(pp);
86
- }
87
-
88
- /**
89
- * Returns the name of the paramater as string
90
- */
91
- export function ProtocolParameter_getNameText_Z3A4310A5(pp) {
92
- return defaultArg(ProtocolParameter_tryGetNameText_Z3A4310A5(pp), "");
93
- }
94
-
95
- /**
96
- * Returns true if the given name matches the name of the parameter
97
- */
98
- export function ProtocolParameter_nameEqualsString(name, pp) {
99
- return ProtocolParameter__get_NameText(pp) === name;
100
- }
101
-
@@ -1,12 +1,12 @@
1
- import { Union, toString } from "../../../fable_modules/fable-library.4.5.0/Types.js";
2
- import { printf, toText } from "../../../fable_modules/fable-library.4.5.0/String.js";
3
- import { OntologyAnnotation, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
4
- import { union_type, string_type, float64_type, int32_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
5
1
  import { parse } from "../../../fable_modules/fable-library.4.5.0/Double.js";
6
2
  import { parse as parse_1 } from "../../../fable_modules/fable-library.4.5.0/Int32.js";
3
+ import { OntologyAnnotation_$reflection, OntologyAnnotation } from "./OntologyAnnotation.js";
7
4
  import { map, defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
8
5
  import { int32ToString } from "../../../fable_modules/fable-library.4.5.0/Util.js";
9
6
  import { AnnotationValue_toString_Z6FAD7738 } from "./AnnotationValue.js";
7
+ import { Union, toString } from "../../../fable_modules/fable-library.4.5.0/Types.js";
8
+ import { printf, toText } from "../../../fable_modules/fable-library.4.5.0/String.js";
9
+ import { union_type, string_type, float64_type, int32_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
10
10
 
11
11
  export class Value extends Union {
12
12
  constructor(tag, fields) {
@@ -17,194 +17,129 @@ export class Value extends Union {
17
17
  cases() {
18
18
  return ["Ontology", "Int", "Float", "Name"];
19
19
  }
20
- Print() {
21
- const this$ = this;
22
- return toString(this$);
23
- }
24
- PrintCompact() {
25
- const this$ = this;
26
- return (this$.tag === 1) ? toText(printf("%i"))(this$.fields[0]) : ((this$.tag === 2) ? toText(printf("%f"))(this$.fields[0]) : ((this$.tag === 3) ? this$.fields[0] : this$.fields[0].NameText));
27
- }
28
- }
29
-
30
- export function Value_$reflection() {
31
- return union_type("ARCtrl.ISA.Value", [], Value, () => [[["Item", OntologyAnnotation_$reflection()]], [["Item", int32_type]], [["Item", float64_type]], [["Item", string_type]]]);
32
- }
33
-
34
- export function Value_fromString_Z721C83C5(value) {
35
- try {
36
- return new Value(1, [parse_1(value, 511, false, 32)]);
37
- }
38
- catch (matchValue) {
20
+ static fromString(value) {
39
21
  try {
40
- return new Value(2, [parse(value)]);
22
+ return new Value(1, [parse_1(value, 511, false, 32)]);
41
23
  }
42
- catch (matchValue_1) {
43
- return new Value(3, [value]);
24
+ catch (matchValue) {
25
+ try {
26
+ return new Value(2, [parse(value)]);
27
+ }
28
+ catch (matchValue_1) {
29
+ return new Value(3, [value]);
30
+ }
44
31
  }
45
32
  }
46
- }
47
-
48
- export function Value_fromOptions(value, termSource, termAccesssion) {
49
- let matchResult, value_1;
50
- if (value == null) {
51
- if (termSource == null) {
52
- if (termAccesssion == null) {
53
- matchResult = 1;
33
+ static fromOptions(value, termSource, termAccesssion) {
34
+ let value_1;
35
+ return (value == null) ? ((termSource == null) ? ((termAccesssion == null) ? void 0 : (new Value(0, [OntologyAnnotation.fromString(defaultArg(value, ""), termSource, termAccesssion)]))) : (new Value(0, [OntologyAnnotation.fromString(defaultArg(value, ""), termSource, termAccesssion)]))) : ((termSource == null) ? ((termAccesssion == null) ? ((value_1 = value, (() => {
36
+ try {
37
+ return new Value(1, [parse_1(value_1, 511, false, 32)]);
38
+ }
39
+ catch (matchValue_1) {
40
+ try {
41
+ return new Value(2, [parse(value_1)]);
42
+ }
43
+ catch (matchValue_2) {
44
+ return new Value(3, [value_1]);
45
+ }
54
46
  }
55
- else {
56
- matchResult = 2;
47
+ })())) : (new Value(0, [OntologyAnnotation.fromString(defaultArg(value, ""), termSource, termAccesssion)]))) : (new Value(0, [OntologyAnnotation.fromString(defaultArg(value, ""), termSource, termAccesssion)])));
48
+ }
49
+ static toOptions(value) {
50
+ switch (value.tag) {
51
+ case 1:
52
+ return [int32ToString(value.fields[0]), void 0, void 0];
53
+ case 2:
54
+ return [value.fields[0].toString(), void 0, void 0];
55
+ case 3:
56
+ return [value.fields[0], void 0, void 0];
57
+ default: {
58
+ const oa = value.fields[0];
59
+ return [map(AnnotationValue_toString_Z6FAD7738, oa.Name), oa.TermAccessionNumber, oa.TermSourceREF];
57
60
  }
58
61
  }
62
+ }
63
+ get Text() {
64
+ const this$ = this;
65
+ return (this$.tag === 2) ? this$.fields[0].toString() : ((this$.tag === 1) ? int32ToString(this$.fields[0]) : ((this$.tag === 3) ? this$.fields[0] : this$.fields[0].NameText));
66
+ }
67
+ AsName() {
68
+ const this$ = this;
69
+ if (this$.tag === 3) {
70
+ return this$.fields[0];
71
+ }
59
72
  else {
60
- matchResult = 2;
73
+ throw new Error(`Value ${this$} is not of case name`);
61
74
  }
62
75
  }
63
- else if (termSource == null) {
64
- if (termAccesssion == null) {
65
- matchResult = 0;
66
- value_1 = value;
76
+ AsInt() {
77
+ const this$ = this;
78
+ if (this$.tag === 1) {
79
+ return this$.fields[0] | 0;
67
80
  }
68
81
  else {
69
- matchResult = 2;
82
+ throw new Error(`Value ${this$} is not of case int`);
70
83
  }
71
84
  }
72
- else {
73
- matchResult = 2;
74
- }
75
- switch (matchResult) {
76
- case 0:
77
- return (() => {
78
- try {
79
- return new Value(1, [parse_1(value_1, 511, false, 32)]);
80
- }
81
- catch (matchValue_1) {
82
- try {
83
- return new Value(2, [parse(value_1)]);
84
- }
85
- catch (matchValue_2) {
86
- return new Value(3, [value_1]);
87
- }
88
- }
89
- })();
90
- case 1:
91
- return void 0;
92
- default:
93
- return new Value(0, [OntologyAnnotation.fromString(defaultArg(value, ""), termSource, termAccesssion)]);
94
- }
95
- }
96
-
97
- export function Value_toOptions_72E9EF0F(value) {
98
- switch (value.tag) {
99
- case 1:
100
- return [int32ToString(value.fields[0]), void 0, void 0];
101
- case 2:
102
- return [value.fields[0].toString(), void 0, void 0];
103
- case 3:
104
- return [value.fields[0], void 0, void 0];
105
- default: {
106
- const oa = value.fields[0];
107
- return [map(AnnotationValue_toString_Z6FAD7738, oa.Name), oa.TermAccessionNumber, oa.TermSourceREF];
85
+ AsFloat() {
86
+ const this$ = this;
87
+ if (this$.tag === 2) {
88
+ return this$.fields[0];
89
+ }
90
+ else {
91
+ throw new Error(`Value ${this$} is not of case float`);
108
92
  }
109
93
  }
110
- }
111
-
112
- export function Value__get_Text(this$) {
113
- switch (this$.tag) {
114
- case 2:
115
- return this$.fields[0].toString();
116
- case 1:
117
- return int32ToString(this$.fields[0]);
118
- case 3:
94
+ AsOntology() {
95
+ const this$ = this;
96
+ if (this$.tag === 0) {
119
97
  return this$.fields[0];
120
- default:
121
- return this$.fields[0].NameText;
122
- }
123
- }
124
-
125
- export function Value__AsName(this$) {
126
- if (this$.tag === 3) {
127
- return this$.fields[0];
128
- }
129
- else {
130
- throw new Error(`Value ${this$} is not of case name`);
131
- }
132
- }
133
-
134
- export function Value__AsInt(this$) {
135
- if (this$.tag === 1) {
136
- return this$.fields[0] | 0;
137
- }
138
- else {
139
- throw new Error(`Value ${this$} is not of case int`);
140
- }
141
- }
142
-
143
- export function Value__AsFloat(this$) {
144
- if (this$.tag === 2) {
145
- return this$.fields[0];
146
- }
147
- else {
148
- throw new Error(`Value ${this$} is not of case float`);
149
- }
150
- }
151
-
152
- export function Value__AsOntology(this$) {
153
- if (this$.tag === 0) {
154
- return this$.fields[0];
155
- }
156
- else {
157
- throw new Error(`Value ${this$} is not of case ontology`);
158
- }
159
- }
160
-
161
- export function Value__get_IsAnOntology(this$) {
162
- if (this$.tag === 0) {
163
- return true;
98
+ }
99
+ else {
100
+ throw new Error(`Value ${this$} is not of case ontology`);
101
+ }
164
102
  }
165
- else {
166
- return false;
103
+ get IsAnOntology() {
104
+ const this$ = this;
105
+ return this$.tag === 0;
167
106
  }
168
- }
169
-
170
- export function Value__get_IsNumerical(this$) {
171
- switch (this$.tag) {
172
- case 1:
173
- case 2:
174
- return true;
175
- default:
176
- return false;
107
+ get IsNumerical() {
108
+ const this$ = this;
109
+ switch (this$.tag) {
110
+ case 1:
111
+ case 2:
112
+ return true;
113
+ default:
114
+ return false;
115
+ }
177
116
  }
178
- }
179
-
180
- export function Value__get_IsAnInt(this$) {
181
- if (this$.tag === 1) {
182
- return true;
117
+ get IsAnInt() {
118
+ const this$ = this;
119
+ return this$.tag === 1;
183
120
  }
184
- else {
185
- return false;
121
+ get IsAFloat() {
122
+ const this$ = this;
123
+ return this$.tag === 2;
186
124
  }
187
- }
188
-
189
- export function Value__get_IsAFloat(this$) {
190
- if (this$.tag === 2) {
191
- return true;
125
+ get IsAText() {
126
+ const this$ = this;
127
+ return this$.tag === 3;
192
128
  }
193
- else {
194
- return false;
129
+ static getText(v) {
130
+ return v.Text;
195
131
  }
196
- }
197
-
198
- export function Value__get_IsAText(this$) {
199
- if (this$.tag === 3) {
200
- return true;
132
+ Print() {
133
+ const this$ = this;
134
+ return toString(this$);
201
135
  }
202
- else {
203
- return false;
136
+ PrintCompact() {
137
+ const this$ = this;
138
+ return (this$.tag === 1) ? toText(printf("%i"))(this$.fields[0]) : ((this$.tag === 2) ? toText(printf("%f"))(this$.fields[0]) : ((this$.tag === 3) ? this$.fields[0] : this$.fields[0].NameText));
204
139
  }
205
140
  }
206
141
 
207
- export function Value_getText_72E9EF0F(v) {
208
- return Value__get_Text(v);
142
+ export function Value_$reflection() {
143
+ return union_type("ARCtrl.ISA.Value", [], Value, () => [[["Item", OntologyAnnotation_$reflection()]], [["Item", int32_type]], [["Item", float64_type]], [["Item", string_type]]]);
209
144
  }
210
145
 
package/ISA/ISA/Regex.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { create, match } from "../../fable_modules/fable-library.4.5.0/RegExp.js";
2
- import { value as value_1, map, some } from "../../fable_modules/fable-library.4.5.0/Option.js";
3
2
  import { parse } from "../../fable_modules/fable-library.4.5.0/Int32.js";
3
+ import { map } from "../../fable_modules/fable-library.4.5.0/Option.js";
4
+
5
+ export function Pattern_handleGroupPatterns(pattern) {
6
+ return pattern;
7
+ }
4
8
 
5
9
  export const Pattern_ExcelNumberFormat = `"(?<${"numberFormat"}>(.*?))"`;
6
10
 
@@ -20,7 +24,7 @@ export const Pattern_OutputPattern = `Output\\s\\[(?<${"iotype"}>.+)\\]`;
20
24
  * Matches, if the input string matches the given regex pattern.
21
25
  */
22
26
  export function ActivePatterns_$007CRegex$007C_$007C(pattern, input) {
23
- const m = match(create(pattern), input.trim());
27
+ const m = match(create(Pattern_handleGroupPatterns(pattern)), input.trim());
24
28
  if (m != null) {
25
29
  return m;
26
30
  }
@@ -66,8 +70,10 @@ export function ActivePatterns_$007CTermColumn$007C_$007C(input) {
66
70
  * Matches a "Unit" column header.
67
71
  */
68
72
  export function ActivePatterns_$007CUnitColumnHeader$007C_$007C(input) {
69
- if (ActivePatterns_$007CRegex$007C_$007C("Unit", input) != null) {
70
- return some(void 0);
73
+ const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("Unit", input);
74
+ if (activePatternResult != null) {
75
+ const o = activePatternResult;
76
+ return o[0];
71
77
  }
72
78
  else {
73
79
  return void 0;
@@ -462,8 +468,8 @@ export function tryParseTermColumn(input) {
462
468
  export function tryParseUnitColumnHeader(input) {
463
469
  const activePatternResult = ActivePatterns_$007CUnitColumnHeader$007C_$007C(input);
464
470
  if (activePatternResult != null) {
465
- const r = value_1(activePatternResult);
466
- return some(void 0);
471
+ const r = activePatternResult;
472
+ return r;
467
473
  }
468
474
  else {
469
475
  return void 0;
@@ -1,6 +1,6 @@
1
1
  import { replace } from "../../fable_modules/fable-library.4.5.0/String.js";
2
- import { ProtocolParameter_getNameText_Z3A4310A5 } from "../ISA/JsonTypes/ProtocolParameter.js";
3
- import { Value_getText_72E9EF0F } from "../ISA/JsonTypes/Value.js";
2
+ import { ProtocolParameter } from "../ISA/JsonTypes/ProtocolParameter.js";
3
+ import { Value } from "../ISA/JsonTypes/Value.js";
4
4
  import { list as list_2, toString, nil, object as object_22 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
5
5
  import { map, choose } from "../../fable_modules/fable-library.4.5.0/List.js";
6
6
  import { uncurry2, equals } from "../../fable_modules/fable-library.4.5.0/Util.js";
@@ -41,7 +41,7 @@ export function ProcessParameterValue_genID(p) {
41
41
  }
42
42
  switch (matchResult) {
43
43
  case 0:
44
- return (("#Param_" + replace(ProtocolParameter_getNameText_Z3A4310A5(c), " ", "_")) + "_") + replace(Value_getText_72E9EF0F(v), " ", "_");
44
+ return (("#Param_" + replace(ProtocolParameter.getNameText(c), " ", "_")) + "_") + replace(Value.getText(v), " ", "_");
45
45
  default:
46
46
  return "#EmptyParameterValue";
47
47
  }
@@ -14,7 +14,7 @@ import { toRows as toRows_1, fromRows as fromRows_1 } from "./Metadata/OntologyS
14
14
  import { toRows as toRows_2, fromRows as fromRows_2 } from "./Metadata/Publication.js";
15
15
  import { toRows as toRows_3, fromRows as fromRows_3 } from "./Metadata/Contacts.js";
16
16
  import { toRows as toRows_4, fromRows as fromRows_4 } from "./Metadata/Study.js";
17
- import { iterateIndexed, map as map_1, toList, collect, singleton, append as append_1, delay } from "../../fable_modules/fable-library.4.5.0/Seq.js";
17
+ import { iterateIndexed, map as map_1, toList, empty as empty_1, collect, singleton, append as append_1, delay } from "../../fable_modules/fable-library.4.5.0/Seq.js";
18
18
  import { tryFind, ofList } from "../../fable_modules/fable-library.4.5.0/Map.js";
19
19
  import { printf, toFail } from "../../fable_modules/fable-library.4.5.0/String.js";
20
20
  import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.5.0.1/FsWorksheet.fs.js";
@@ -242,12 +242,12 @@ export function fromRows(rows) {
242
242
  }
243
243
  }
244
244
 
245
- export function toRows(investigation) {
245
+ export function toRows(isLight, investigation) {
246
246
  let remarks, rows;
247
- return (remarks = ofArray(investigation.Remarks), (rows = delay(() => append_1(singleton(SparseRowModule_fromValues(["ONTOLOGY SOURCE REFERENCE"])), delay(() => append_1(toRows_1(ofArray(investigation.OntologySourceReferences)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION"])), delay(() => append_1(InvestigationInfo_toRows_Z4D87C88C(investigation), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION PUBLICATIONS"])), delay(() => append_1(toRows_2("Investigation Publication", ofArray(investigation.Publications)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION CONTACTS"])), delay(() => append_1(toRows_3("Investigation Person", ofArray(investigation.Contacts)), delay(() => collect((studyIdentifier) => {
247
+ return (remarks = ofArray(investigation.Remarks), (rows = delay(() => append_1(singleton(SparseRowModule_fromValues(["ONTOLOGY SOURCE REFERENCE"])), delay(() => append_1(toRows_1(ofArray(investigation.OntologySourceReferences)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION"])), delay(() => append_1(InvestigationInfo_toRows_Z4D87C88C(investigation), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION PUBLICATIONS"])), delay(() => append_1(toRows_2("Investigation Publication", ofArray(investigation.Publications)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION CONTACTS"])), delay(() => append_1(toRows_3("Investigation Person", ofArray(investigation.Contacts)), delay(() => (!isLight ? collect((studyIdentifier) => {
248
248
  const study = defaultArg(investigation.TryGetStudy(studyIdentifier), new ArcStudy(studyIdentifier));
249
249
  return append_1(singleton(SparseRowModule_fromValues(["STUDY"])), delay(() => toRows_4(study, void 0)));
250
- }, investigation.RegisteredStudyIdentifiers)))))))))))))))))), (() => {
250
+ }, investigation.RegisteredStudyIdentifiers) : empty_1())))))))))))))))))), (() => {
251
251
  try {
252
252
  const rm = ofList(map((remark) => Remark.toTuple(remark), remarks), {
253
253
  Compare: comparePrimitives,
@@ -305,7 +305,23 @@ export function toFsWorkbook(investigation) {
305
305
  const sheet = new FsWorksheet("isa_investigation");
306
306
  iterateIndexed((rowI, r) => {
307
307
  SparseRowModule_writeToSheet(rowI + 1, r, sheet);
308
- }, toRows(investigation));
308
+ }, toRows(false, investigation));
309
+ wb.AddWorksheet(sheet);
310
+ return wb;
311
+ }
312
+ catch (err) {
313
+ const arg = err.message;
314
+ return toFail(printf("Could not write investigation to spreadsheet: %s"))(arg);
315
+ }
316
+ }
317
+
318
+ export function toLightFsWorkbook(investigation) {
319
+ try {
320
+ const wb = new FsWorkbook();
321
+ const sheet = new FsWorksheet("isa_investigation");
322
+ iterateIndexed((rowI, r) => {
323
+ SparseRowModule_writeToSheet(rowI + 1, r, sheet);
324
+ }, toRows(true, investigation));
309
325
  wb.AddWorksheet(sheet);
310
326
  return wb;
311
327
  }
@@ -6,7 +6,7 @@ import { OntologyAnnotation } from "../../ISA/JsonTypes/OntologyAnnotation.js";
6
6
  import { map as map_1, fold as fold_1, ofArray, empty } from "../../../fable_modules/fable-library.4.5.0/List.js";
7
7
  import { Array_map4 } from "../CollectionAux.js";
8
8
  import { Component_toString_Z609B8895, Component_fromString_Z61E08C1 } from "../../ISA/JsonTypes/Component.js";
9
- import { ProtocolParameter_toString_Z3A4310A5, ProtocolParameter_make } from "../../ISA/JsonTypes/ProtocolParameter.js";
9
+ import { ProtocolParameter } from "../../ISA/JsonTypes/ProtocolParameter.js";
10
10
 
11
11
  /**
12
12
  * If the value matches the default, a None is returned, else a Some is returned
@@ -145,7 +145,7 @@ export function Component_toAggregatedStrings(separator, cs) {
145
145
  * Returns a list of ISAJson ProtocolParameter objects from ISATab aggregated strings
146
146
  */
147
147
  export function ProtocolParameter_fromAggregatedStrings(separator, terms, source, accessions) {
148
- return map((arg) => ((parameterName) => ProtocolParameter_make(void 0, parameterName))(arg), OntologyAnnotation_fromAggregatedStrings(separator, terms, source, accessions));
148
+ return map((arg) => ((parameterName) => ProtocolParameter.make(void 0, parameterName))(arg), OntologyAnnotation_fromAggregatedStrings(separator, terms, source, accessions));
149
149
  }
150
150
 
151
151
  /**
@@ -169,7 +169,7 @@ export function ProtocolParameter_toAggregatedStrings(separator, oas) {
169
169
  else {
170
170
  return [toText(printf("%s%c%s"))(tupledArg[0])(separator)(term.TermName), toText(printf("%s%c%s"))(tupledArg[1])(separator)(term.TermSourceREF), toText(printf("%s%c%s"))(tupledArg[2])(separator)(term.TermAccessionNumber)];
171
171
  }
172
- }, ["", "", ""], map_1(ProtocolParameter_toString_Z3A4310A5, oas));
172
+ }, ["", "", ""], map_1((pp) => ProtocolParameter.toString(pp), oas));
173
173
  return {
174
174
  TermAccessionNumberAgg: tupledArg_1[2],
175
175
  TermNameAgg: tupledArg_1[0],
package/SemVer.js CHANGED
@@ -1,14 +1,12 @@
1
- import { match, create } from "./fable_modules/fable-library.4.5.0/RegExp.js";
2
1
  import { toString, Record } from "./fable_modules/fable-library.4.5.0/Types.js";
3
2
  import { record_type, option_type, string_type, int32_type } from "./fable_modules/fable-library.4.5.0/Reflection.js";
3
+ import { ActivePatterns_$007CRegex$007C_$007C } from "./ISA/ISA/Regex.js";
4
4
  import { parse } from "./fable_modules/fable-library.4.5.0/Int32.js";
5
5
  import { value as value_3, unwrap } from "./fable_modules/fable-library.4.5.0/Option.js";
6
6
  import { StringBuilder__Append_Z721C83C5, StringBuilder_$ctor } from "./fable_modules/fable-library.4.5.0/System.Text.js";
7
7
  import { printf, toText } from "./fable_modules/fable-library.4.5.0/String.js";
8
8
 
9
- const SemVerAux_Pattern = "^(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(-(?<pre>[0-9A-Za-z-\\.]+))?(\\+(?<build>[0-9A-Za-z-\\.]+))?$";
10
-
11
- export const SemVerAux_SemVerRegex = create(SemVerAux_Pattern);
9
+ export const SemVerAux_Pattern = "^(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(-(?<pre>[0-9A-Za-z-\\.]+))?(\\+(?<build>[0-9A-Za-z-\\.]+))?$";
12
10
 
13
11
  export class SemVer extends Record {
14
12
  constructor(Major, Minor, Patch, PreRelease, Metadata) {
@@ -34,9 +32,9 @@ export function SemVer_create_Z55658624(major, minor, patch, pre, meta) {
34
32
  }
35
33
 
36
34
  export function SemVer_tryOfString_Z721C83C5(str) {
37
- const m = match(SemVerAux_SemVerRegex, str);
38
- const matchValue = m != null;
39
- if (matchValue) {
35
+ const activePatternResult = ActivePatterns_$007CRegex$007C_$007C(SemVerAux_Pattern, str);
36
+ if (activePatternResult != null) {
37
+ const m = activePatternResult;
40
38
  const g = m;
41
39
  return SemVer_create_Z55658624(parse((g.groups && g.groups.major) || "", 511, false, 32), parse((g.groups && g.groups.minor) || "", 511, false, 32), parse((g.groups && g.groups.patch) || "", 511, false, 32), unwrap(((g.groups && g.groups.pre) != null) ? ((g.groups && g.groups.pre) || "") : void 0), unwrap(((g.groups && g.groups.build) != null) ? ((g.groups && g.groups.build) || "") : void 0));
42
40
  }