@nfdi4plants/arctrl 2.0.0-alpha.6 → 2.0.0-alpha.7
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/Core/Data.js +53 -4
- package/Core/DataContext.js +92 -0
- package/Core/Helper/Regex.js +26 -10
- package/Core/Helper/Url.js +38 -0
- package/Core/OntologyAnnotation.js +2 -1
- package/Core/Table/ArcTableAux.js +2 -2
- package/Core/Table/CompositeCell.js +4 -0
- package/Core/Table/DataMap.js +95 -82
- package/Json/Assay.js +16 -0
- package/Json/Comment.js +17 -5
- package/Json/Investigation.js +17 -1
- package/Json/OntologyAnnotation.js +17 -5
- package/Json/OntologySourceReference.js +17 -5
- package/Json/Person.js +17 -5
- package/Json/Process/Component.js +9 -0
- package/Json/Process/Data.js +8 -0
- package/Json/Process/DataFile.js +9 -0
- package/Json/Process/Factor.js +5 -1
- package/Json/Process/FactorValue.js +5 -0
- package/Json/Process/Material.js +9 -0
- package/Json/Process/MaterialAttribute.js +5 -0
- package/Json/Process/MaterialAttributeValue.js +9 -0
- package/Json/Process/MaterialType.js +5 -0
- package/Json/Process/Process.js +9 -0
- package/Json/Process/ProcessInput.js +5 -0
- package/Json/Process/ProcessOutput.js +9 -0
- package/Json/Process/ProcessParameterValue.js +9 -0
- package/Json/Process/Protocol.js +10 -2
- package/Json/Process/ProtocolParameter.js +5 -0
- package/Json/Process/Sample.js +9 -1
- package/Json/Process/Source.js +9 -0
- package/Json/Publication.js +17 -5
- package/Json/Study.js +26 -10
- package/Json/Table/CellTable.js +4 -1
- package/Json/Table/Templates.js +10 -2
- package/Spreadsheet/DataMapTable/DataMapColumn.js +36 -30
- package/Spreadsheet/DataMapTable/DataMapHeader.js +146 -122
- package/Spreadsheet/DataMapTable/DataMapTable.js +17 -12
- package/Template.Web.js +1 -1
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +1 -1
package/Json/Study.js
CHANGED
|
@@ -247,6 +247,10 @@ export function ARCtrl_ArcStudy__ArcStudy_toJsonString_Static_71136F3F(spaces) {
|
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToJsonString_71136F3F(this$, spaces) {
|
|
251
|
+
return ARCtrl_ArcStudy__ArcStudy_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
252
|
+
}
|
|
253
|
+
|
|
250
254
|
export function ARCtrl_ArcStudy__ArcStudy_fromCompressedJsonString_Static_Z721C83C5(s) {
|
|
251
255
|
try {
|
|
252
256
|
const matchValue = fromString(decode(Study_decoderCompressed), s);
|
|
@@ -267,14 +271,8 @@ export function ARCtrl_ArcStudy__ArcStudy_toCompressedJsonString_Static_71136F3F
|
|
|
267
271
|
return (obj) => toString(defaultArg(spaces, 0), encode(Study_encoderCompressed, obj));
|
|
268
272
|
}
|
|
269
273
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
*/
|
|
273
|
-
export function ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086(assays, spaces) {
|
|
274
|
-
return (obj) => {
|
|
275
|
-
const value = Study_ROCrate_encoder(assays, obj);
|
|
276
|
-
return toString(defaultSpaces(spaces), value);
|
|
277
|
-
};
|
|
274
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToCompressedJsonString_71136F3F(this$, spaces) {
|
|
275
|
+
return ARCtrl_ArcStudy__ArcStudy_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
278
276
|
}
|
|
279
277
|
|
|
280
278
|
export function ARCtrl_ArcStudy__ArcStudy_fromROCrateJsonString_Static_Z721C83C5(s) {
|
|
@@ -287,13 +285,20 @@ export function ARCtrl_ArcStudy__ArcStudy_fromROCrateJsonString_Static_Z721C83C5
|
|
|
287
285
|
}
|
|
288
286
|
}
|
|
289
287
|
|
|
290
|
-
|
|
288
|
+
/**
|
|
289
|
+
* exports in json-ld format
|
|
290
|
+
*/
|
|
291
|
+
export function ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086(assays, spaces) {
|
|
291
292
|
return (obj) => {
|
|
292
|
-
const value =
|
|
293
|
+
const value = Study_ROCrate_encoder(assays, obj);
|
|
293
294
|
return toString(defaultSpaces(spaces), value);
|
|
294
295
|
};
|
|
295
296
|
}
|
|
296
297
|
|
|
298
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToROCrateJsonString_3BA23086(this$, assays, spaces) {
|
|
299
|
+
return ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086(unwrap(assays), unwrap(spaces))(this$);
|
|
300
|
+
}
|
|
301
|
+
|
|
297
302
|
export function ARCtrl_ArcStudy__ArcStudy_fromISAJsonString_Static_Z721C83C5(s) {
|
|
298
303
|
const matchValue = fromString(Study_ISAJson_decoder, s);
|
|
299
304
|
if (matchValue.tag === 1) {
|
|
@@ -304,3 +309,14 @@ export function ARCtrl_ArcStudy__ArcStudy_fromISAJsonString_Static_Z721C83C5(s)
|
|
|
304
309
|
}
|
|
305
310
|
}
|
|
306
311
|
|
|
312
|
+
export function ARCtrl_ArcStudy__ArcStudy_toISAJsonString_Static_3BA23086(assays, spaces) {
|
|
313
|
+
return (obj) => {
|
|
314
|
+
const value = Study_ISAJson_encoder(assays, obj);
|
|
315
|
+
return toString(defaultSpaces(spaces), value);
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToISAJsonString_3BA23086(this$, assays, spaces) {
|
|
320
|
+
return ARCtrl_ArcStudy__ArcStudy_toISAJsonString_Static_3BA23086(unwrap(assays), unwrap(spaces))(this$);
|
|
321
|
+
}
|
|
322
|
+
|
package/Json/Table/CellTable.js
CHANGED
|
@@ -35,6 +35,9 @@ export function encodeCell(otm, cc) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export function decodeCell(ot) {
|
|
38
|
-
return object((get$) =>
|
|
38
|
+
return object((get$) => {
|
|
39
|
+
const i = get$.Required.Raw(int) | 0;
|
|
40
|
+
return item(i, ot).Copy();
|
|
41
|
+
});
|
|
39
42
|
}
|
|
40
43
|
|
package/Json/Table/Templates.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toString } from "../../fable_modules/fable-library-js.4.16.0/Types.js";
|
|
2
2
|
import { Json } from "../../fable_modules/Thoth.Json.Core.0.2.1/Types.fs.js";
|
|
3
|
-
import {
|
|
3
|
+
import { array as array_1, datetimeUtc, guid, object, string, succeed, andThen } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
4
4
|
import { Template, Organisation } from "../../Core/Template.js";
|
|
5
5
|
import { ArcTable_decoderCompressed, ArcTable_encoderCompressed, ArcTable_decoder, ArcTable_encoder } from "./ArcTable.js";
|
|
6
6
|
import { defaultSpaces, dateTime, tryIncludeSeq } from "../Encode.js";
|
|
@@ -45,7 +45,7 @@ export function Templates_encoder(templates) {
|
|
|
45
45
|
return new Json(6, [map(Template_encoder, templates)]);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export const Templates_decoder =
|
|
48
|
+
export const Templates_decoder = array_1(Template_decoder);
|
|
49
49
|
|
|
50
50
|
export function Templates_fromJsonString(jsonString) {
|
|
51
51
|
try {
|
|
@@ -85,6 +85,10 @@ export function ARCtrl_Template__Template_toJsonString_Static_71136F3F(spaces) {
|
|
|
85
85
|
return (template) => toString_2(defaultSpaces(spaces), Template_encoder(template));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
export function ARCtrl_Template__Template_toJsonString_71136F3F(this$, spaces) {
|
|
89
|
+
return ARCtrl_Template__Template_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
90
|
+
}
|
|
91
|
+
|
|
88
92
|
export function ARCtrl_Template__Template_fromCompressedJsonString_Static_Z721C83C5(s) {
|
|
89
93
|
try {
|
|
90
94
|
const matchValue = fromString(decode(Template_decoderCompressed), s);
|
|
@@ -105,3 +109,7 @@ export function ARCtrl_Template__Template_toCompressedJsonString_Static_71136F3F
|
|
|
105
109
|
return (obj) => toString_2(defaultArg(spaces, 0), encode(Template_encoderCompressed, obj));
|
|
106
110
|
}
|
|
107
111
|
|
|
112
|
+
export function ARCtrl_Template__Template_toCompressedJsonString_71136F3F(this$, spaces) {
|
|
113
|
+
return ARCtrl_Template__Template_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
114
|
+
}
|
|
115
|
+
|
|
@@ -1,36 +1,42 @@
|
|
|
1
1
|
import { toFsCells, fromFsCells } from "./DataMapHeader.js";
|
|
2
|
-
import { singleton
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { item as item_1, map as map_2 } from "../../fable_modules/fable-library-js.4.16.0/Array.js";
|
|
10
|
-
import { toFsCells as toFsCells_1 } from "../AnnotationTable/CompositeCell.js";
|
|
2
|
+
import { transpose, singleton, ofArray, map } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
3
|
+
import { tryFind, singleton as singleton_1, append, delay, map as map_1, collect, toList } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
|
|
4
|
+
import { distinct } from "../../fable_modules/fable-library-js.4.16.0/Seq2.js";
|
|
5
|
+
import { bind, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
6
|
+
import { stringHash } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
7
|
+
import { FsCell } from "../../fable_modules/FsSpreadsheet.6.1.2/Cells/FsCell.fs.js";
|
|
8
|
+
import { DataContext__get_GeneratedBy, DataContext__get_Description, DataContext__get_ObjectType, DataContext__get_Unit, DataContext__get_Explication } from "../../Core/DataContext.js";
|
|
11
9
|
|
|
12
|
-
export function
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export function setFromFsColumns(dc, columns) {
|
|
11
|
+
const cellParser = fromFsCells(map((c) => c.Item(1), columns));
|
|
12
|
+
for (let i = 0; i <= (dc.length - 1); i++) {
|
|
13
|
+
cellParser(dc[i])(map((c_1) => c_1.Item(i + 2), columns));
|
|
14
|
+
}
|
|
15
|
+
return dc;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
export function toFsColumns(
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
export function toFsColumns(dc) {
|
|
19
|
+
const commentKeys = toList(distinct(collect((dc_1) => map_1((c) => defaultArg(c.Name, ""), dc_1.Comments), dc), {
|
|
20
|
+
Equals: (x, y) => (x === y),
|
|
21
|
+
GetHashCode: stringHash,
|
|
22
|
+
}));
|
|
23
|
+
const headers = toFsCells(commentKeys);
|
|
24
|
+
const createTerm = (oa) => {
|
|
25
|
+
if (oa == null) {
|
|
26
|
+
return ofArray([new FsCell(""), new FsCell(""), new FsCell("")]);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const oa_1 = oa;
|
|
30
|
+
return ofArray([new FsCell(defaultArg(oa_1.Name, "")), new FsCell(defaultArg(oa_1.TermSourceREF, "")), new FsCell(defaultArg(oa_1.TermAccessionNumber, ""))]);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const createText = (s) => singleton(new FsCell(defaultArg(s, "")));
|
|
34
|
+
return transpose(toList(delay(() => append(singleton_1(headers), delay(() => map_1((dc_4) => {
|
|
35
|
+
const dc_3 = dc_4;
|
|
36
|
+
return toList(delay(() => {
|
|
37
|
+
let dc_2;
|
|
38
|
+
return append((dc_2 = dc_3, ofArray([new FsCell(defaultArg(dc_2.Name, "")), new FsCell(defaultArg(dc_2.Format, "")), new FsCell(defaultArg(dc_2.SelectorFormat, ""))])), delay(() => append(createTerm(DataContext__get_Explication(dc_3)), delay(() => append(createTerm(DataContext__get_Unit(dc_3)), delay(() => append(createTerm(DataContext__get_ObjectType(dc_3)), delay(() => append(createText(DataContext__get_Description(dc_3)), delay(() => append(createText(DataContext__get_GeneratedBy(dc_3)), delay(() => map((key) => (new FsCell(defaultArg(bind((c_2) => c_2.Value, tryFind((c_1) => (defaultArg(c_1.Name, "") === key), dc_3.Comments)), ""))), commentKeys)))))))))))));
|
|
39
|
+
}));
|
|
40
|
+
}, dc))))));
|
|
35
41
|
}
|
|
36
42
|
|
|
@@ -1,16 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { dataFromFsCells, freeTextFromFsCells, termFromFsCells } from "../AnnotationTable/CompositeCell.js";
|
|
3
|
-
import { DataMapAux_generatedByHeader, DataMapAux_descriptionHeader, DataMapAux_objectTypeHeader, DataMapAux_unitHeader, DataMapAux_explicationHeader } from "../../Core/Table/DataMap.js";
|
|
1
|
+
import { tryFindIndex, tail, head, isEmpty, item, map } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
4
2
|
import { map as map_1 } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { OntologyAnnotation } from "../../Core/OntologyAnnotation.js";
|
|
4
|
+
import { Data } from "../../Core/Data.js";
|
|
5
|
+
import { DataContext__set_GeneratedBy_6DFDD678, DataContext__set_Description_6DFDD678, DataContext__set_ObjectType_279AAFF2, DataContext__set_Unit_279AAFF2, DataContext__set_Explication_279AAFF2 } from "../../Core/DataContext.js";
|
|
6
|
+
import { Comment$ } from "../../Core/Comment.js";
|
|
7
|
+
import { ActivePatterns_$007CComment$007C_$007C } from "../../Core/Helper/Regex.js";
|
|
8
|
+
import { printf, toFail, join } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
9
|
+
import { map as map_2, append, delay, toList } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
|
|
7
10
|
import { FsCell } from "../../fable_modules/FsSpreadsheet.6.1.2/Cells/FsCell.fs.js";
|
|
8
|
-
import { equals } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
9
11
|
|
|
10
|
-
export function
|
|
12
|
+
export function ActivePattern_ontologyAnnotationFromFsCells(tsrCol, tanCol, cells) {
|
|
13
|
+
const cellValues = map((c) => c.ValueAsString(), cells);
|
|
14
|
+
const tsr = map_1((i) => item(i, cellValues), tsrCol);
|
|
15
|
+
const tan = map_1((i_1) => item(i_1, cellValues), tanCol);
|
|
16
|
+
return new OntologyAnnotation(item(0, cellValues), tsr, tan);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function ActivePattern_freeTextFromFsCells(cells) {
|
|
20
|
+
return item(0, map((c) => c.ValueAsString(), cells));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function ActivePattern_dataFromFsCells(format, selectorFormat, cells) {
|
|
24
|
+
const cellValues = map((c) => c.ValueAsString(), cells);
|
|
25
|
+
const format_1 = map_1((i) => item(i, cellValues), format);
|
|
26
|
+
const selectorFormat_1 = map_1((i_1) => item(i_1, cellValues), selectorFormat);
|
|
27
|
+
return new Data(void 0, item(0, cellValues), void 0, format_1, selectorFormat_1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function ActivePattern_$007CTerm$007C_$007C(categoryString, cells) {
|
|
11
31
|
const $007CAC$007C_$007C = (s) => {
|
|
12
32
|
if (s === categoryString) {
|
|
13
|
-
return
|
|
33
|
+
return 1;
|
|
14
34
|
}
|
|
15
35
|
else {
|
|
16
36
|
return void 0;
|
|
@@ -54,7 +74,7 @@ export function ActivePattern_$007CTerm$007C_$007C(categoryString, categoryHeade
|
|
|
54
74
|
}
|
|
55
75
|
switch (matchResult) {
|
|
56
76
|
case 0:
|
|
57
|
-
return
|
|
77
|
+
return (cells_1) => ActivePattern_ontologyAnnotationFromFsCells(void 0, void 0, cells_1);
|
|
58
78
|
default: {
|
|
59
79
|
let matchResult_1, header_1;
|
|
60
80
|
if (!isEmpty(cellValues)) {
|
|
@@ -97,7 +117,7 @@ export function ActivePattern_$007CTerm$007C_$007C(categoryString, categoryHeade
|
|
|
97
117
|
}
|
|
98
118
|
switch (matchResult_1) {
|
|
99
119
|
case 0:
|
|
100
|
-
return
|
|
120
|
+
return (cells_2) => ActivePattern_ontologyAnnotationFromFsCells(1, 2, cells_2);
|
|
101
121
|
default: {
|
|
102
122
|
let matchResult_2, header_2;
|
|
103
123
|
if (!isEmpty(cellValues)) {
|
|
@@ -140,7 +160,7 @@ export function ActivePattern_$007CTerm$007C_$007C(categoryString, categoryHeade
|
|
|
140
160
|
}
|
|
141
161
|
switch (matchResult_2) {
|
|
142
162
|
case 0:
|
|
143
|
-
return
|
|
163
|
+
return (cells_3) => ActivePattern_ontologyAnnotationFromFsCells(2, 1, cells_3);
|
|
144
164
|
default:
|
|
145
165
|
return void 0;
|
|
146
166
|
}
|
|
@@ -151,10 +171,13 @@ export function ActivePattern_$007CTerm$007C_$007C(categoryString, categoryHeade
|
|
|
151
171
|
}
|
|
152
172
|
|
|
153
173
|
export function ActivePattern_$007CExplication$007C_$007C(cells) {
|
|
154
|
-
const activePatternResult = ActivePattern_$007CTerm$007C_$007C("Explication",
|
|
174
|
+
const activePatternResult = ActivePattern_$007CTerm$007C_$007C("Explication", cells);
|
|
155
175
|
if (activePatternResult != null) {
|
|
156
176
|
const r = activePatternResult;
|
|
157
|
-
return
|
|
177
|
+
return (dc) => ((cells_1) => {
|
|
178
|
+
DataContext__set_Explication_279AAFF2(dc, r(cells_1));
|
|
179
|
+
return dc;
|
|
180
|
+
});
|
|
158
181
|
}
|
|
159
182
|
else {
|
|
160
183
|
return void 0;
|
|
@@ -162,10 +185,13 @@ export function ActivePattern_$007CExplication$007C_$007C(cells) {
|
|
|
162
185
|
}
|
|
163
186
|
|
|
164
187
|
export function ActivePattern_$007CUnit$007C_$007C(cells) {
|
|
165
|
-
const activePatternResult = ActivePattern_$007CTerm$007C_$007C("Unit",
|
|
188
|
+
const activePatternResult = ActivePattern_$007CTerm$007C_$007C("Unit", cells);
|
|
166
189
|
if (activePatternResult != null) {
|
|
167
190
|
const r = activePatternResult;
|
|
168
|
-
return
|
|
191
|
+
return (dc) => ((cells_1) => {
|
|
192
|
+
DataContext__set_Unit_279AAFF2(dc, r(cells_1));
|
|
193
|
+
return dc;
|
|
194
|
+
});
|
|
169
195
|
}
|
|
170
196
|
else {
|
|
171
197
|
return void 0;
|
|
@@ -173,10 +199,13 @@ export function ActivePattern_$007CUnit$007C_$007C(cells) {
|
|
|
173
199
|
}
|
|
174
200
|
|
|
175
201
|
export function ActivePattern_$007CObjectType$007C_$007C(cells) {
|
|
176
|
-
const activePatternResult = ActivePattern_$007CTerm$007C_$007C("Object Type",
|
|
202
|
+
const activePatternResult = ActivePattern_$007CTerm$007C_$007C("Object Type", cells);
|
|
177
203
|
if (activePatternResult != null) {
|
|
178
204
|
const r = activePatternResult;
|
|
179
|
-
return
|
|
205
|
+
return (dc) => ((cells_1) => {
|
|
206
|
+
DataContext__set_ObjectType_279AAFF2(dc, r(cells_1));
|
|
207
|
+
return dc;
|
|
208
|
+
});
|
|
180
209
|
}
|
|
181
210
|
else {
|
|
182
211
|
return void 0;
|
|
@@ -204,7 +233,10 @@ export function ActivePattern_$007CDescription$007C_$007C(cells) {
|
|
|
204
233
|
}
|
|
205
234
|
switch (matchResult) {
|
|
206
235
|
case 0:
|
|
207
|
-
return
|
|
236
|
+
return (dc) => ((cells_1) => {
|
|
237
|
+
DataContext__set_Description_6DFDD678(dc, ActivePattern_freeTextFromFsCells(cells_1));
|
|
238
|
+
return dc;
|
|
239
|
+
});
|
|
208
240
|
default:
|
|
209
241
|
return void 0;
|
|
210
242
|
}
|
|
@@ -231,7 +263,10 @@ export function ActivePattern_$007CGeneratedBy$007C_$007C(cells) {
|
|
|
231
263
|
}
|
|
232
264
|
switch (matchResult) {
|
|
233
265
|
case 0:
|
|
234
|
-
return
|
|
266
|
+
return (dc) => ((cells_1) => {
|
|
267
|
+
DataContext__set_GeneratedBy_6DFDD678(dc, ActivePattern_freeTextFromFsCells(cells_1));
|
|
268
|
+
return dc;
|
|
269
|
+
});
|
|
235
270
|
default:
|
|
236
271
|
return void 0;
|
|
237
272
|
}
|
|
@@ -253,23 +288,60 @@ export function ActivePattern_$007CData$007C_$007C(cells) {
|
|
|
253
288
|
matchResult = 1;
|
|
254
289
|
}
|
|
255
290
|
switch (matchResult) {
|
|
256
|
-
case 0:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
291
|
+
case 0:
|
|
292
|
+
return (dc) => ((cells_1) => {
|
|
293
|
+
const d = ActivePattern_dataFromFsCells(map_1((y) => (1 + y), tryFindIndex((s) => (s.indexOf("Data Format") === 0), cols)), map_1((y_1) => (1 + y_1), tryFindIndex((s_1) => (s_1.indexOf("Data Selector Format") === 0), cols)), cells_1);
|
|
294
|
+
dc.FilePath = d.FilePath;
|
|
295
|
+
dc.Selector = d.Selector;
|
|
296
|
+
dc.Format = d.Format;
|
|
297
|
+
dc.SelectorFormat = d.SelectorFormat;
|
|
298
|
+
return dc;
|
|
299
|
+
});
|
|
300
|
+
default:
|
|
301
|
+
return void 0;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export function ActivePattern_$007CComment$007C_$007C(cells) {
|
|
306
|
+
const cellValues = map((c) => c.ValueAsString(), cells);
|
|
307
|
+
let matchResult, key;
|
|
308
|
+
if (!isEmpty(cellValues)) {
|
|
309
|
+
const activePatternResult = ActivePatterns_$007CComment$007C_$007C(head(cellValues));
|
|
310
|
+
if (activePatternResult != null) {
|
|
311
|
+
if (isEmpty(tail(cellValues))) {
|
|
312
|
+
matchResult = 0;
|
|
313
|
+
key = activePatternResult;
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
matchResult = 1;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
matchResult = 1;
|
|
260
321
|
}
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
matchResult = 1;
|
|
325
|
+
}
|
|
326
|
+
switch (matchResult) {
|
|
327
|
+
case 0:
|
|
328
|
+
return (dc) => ((cells_1) => {
|
|
329
|
+
const comment = item(0, map((c_1) => c_1.ValueAsString(), cells_1));
|
|
330
|
+
void (dc.Comments.push(Comment$.create(key, comment)));
|
|
331
|
+
return dc;
|
|
332
|
+
});
|
|
261
333
|
default:
|
|
262
334
|
return void 0;
|
|
263
335
|
}
|
|
264
336
|
}
|
|
265
337
|
|
|
266
|
-
export function ActivePattern_$
|
|
338
|
+
export function ActivePattern_$007CFreetext$007C_$007C(cells) {
|
|
267
339
|
const cellValues = map((c) => c.ValueAsString(), cells);
|
|
268
|
-
let matchResult,
|
|
340
|
+
let matchResult, key;
|
|
269
341
|
if (!isEmpty(cellValues)) {
|
|
270
342
|
if (isEmpty(tail(cellValues))) {
|
|
271
343
|
matchResult = 0;
|
|
272
|
-
|
|
344
|
+
key = head(cellValues);
|
|
273
345
|
}
|
|
274
346
|
else {
|
|
275
347
|
matchResult = 1;
|
|
@@ -280,56 +352,68 @@ export function ActivePattern_$007CFreeText$007C_$007C(cells) {
|
|
|
280
352
|
}
|
|
281
353
|
switch (matchResult) {
|
|
282
354
|
case 0:
|
|
283
|
-
return
|
|
355
|
+
return (dc) => ((cells_1) => {
|
|
356
|
+
const comment = item(0, map((c_1) => c_1.ValueAsString(), cells_1));
|
|
357
|
+
void (dc.Comments.push(Comment$.create(key, comment)));
|
|
358
|
+
return dc;
|
|
359
|
+
});
|
|
284
360
|
default:
|
|
285
361
|
return void 0;
|
|
286
362
|
}
|
|
287
363
|
}
|
|
288
364
|
|
|
289
365
|
export function fromFsCells(cells) {
|
|
290
|
-
|
|
366
|
+
let matchResult, r;
|
|
367
|
+
const activePatternResult = ActivePattern_$007CExplication$007C_$007C(cells);
|
|
291
368
|
if (activePatternResult != null) {
|
|
292
|
-
|
|
293
|
-
|
|
369
|
+
matchResult = 0;
|
|
370
|
+
r = activePatternResult;
|
|
294
371
|
}
|
|
295
372
|
else {
|
|
296
|
-
const activePatternResult_1 = ActivePattern_$
|
|
373
|
+
const activePatternResult_1 = ActivePattern_$007CUnit$007C_$007C(cells);
|
|
297
374
|
if (activePatternResult_1 != null) {
|
|
298
|
-
|
|
299
|
-
|
|
375
|
+
matchResult = 0;
|
|
376
|
+
r = activePatternResult_1;
|
|
300
377
|
}
|
|
301
378
|
else {
|
|
302
|
-
const activePatternResult_2 = ActivePattern_$
|
|
379
|
+
const activePatternResult_2 = ActivePattern_$007CObjectType$007C_$007C(cells);
|
|
303
380
|
if (activePatternResult_2 != null) {
|
|
304
|
-
|
|
305
|
-
|
|
381
|
+
matchResult = 0;
|
|
382
|
+
r = activePatternResult_2;
|
|
306
383
|
}
|
|
307
384
|
else {
|
|
308
|
-
const activePatternResult_3 = ActivePattern_$
|
|
385
|
+
const activePatternResult_3 = ActivePattern_$007CDescription$007C_$007C(cells);
|
|
309
386
|
if (activePatternResult_3 != null) {
|
|
310
|
-
|
|
311
|
-
|
|
387
|
+
matchResult = 0;
|
|
388
|
+
r = activePatternResult_3;
|
|
312
389
|
}
|
|
313
390
|
else {
|
|
314
|
-
const activePatternResult_4 = ActivePattern_$
|
|
391
|
+
const activePatternResult_4 = ActivePattern_$007CGeneratedBy$007C_$007C(cells);
|
|
315
392
|
if (activePatternResult_4 != null) {
|
|
316
|
-
|
|
317
|
-
|
|
393
|
+
matchResult = 0;
|
|
394
|
+
r = activePatternResult_4;
|
|
318
395
|
}
|
|
319
396
|
else {
|
|
320
|
-
const activePatternResult_5 = ActivePattern_$
|
|
397
|
+
const activePatternResult_5 = ActivePattern_$007CData$007C_$007C(cells);
|
|
321
398
|
if (activePatternResult_5 != null) {
|
|
322
|
-
|
|
323
|
-
|
|
399
|
+
matchResult = 0;
|
|
400
|
+
r = activePatternResult_5;
|
|
324
401
|
}
|
|
325
402
|
else {
|
|
326
|
-
const activePatternResult_6 = ActivePattern_$
|
|
403
|
+
const activePatternResult_6 = ActivePattern_$007CComment$007C_$007C(cells);
|
|
327
404
|
if (activePatternResult_6 != null) {
|
|
328
|
-
|
|
329
|
-
|
|
405
|
+
matchResult = 0;
|
|
406
|
+
r = activePatternResult_6;
|
|
330
407
|
}
|
|
331
408
|
else {
|
|
332
|
-
|
|
409
|
+
const activePatternResult_7 = ActivePattern_$007CFreetext$007C_$007C(cells);
|
|
410
|
+
if (activePatternResult_7 != null) {
|
|
411
|
+
matchResult = 0;
|
|
412
|
+
r = activePatternResult_7;
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
matchResult = 1;
|
|
416
|
+
}
|
|
333
417
|
}
|
|
334
418
|
}
|
|
335
419
|
}
|
|
@@ -337,81 +421,21 @@ export function fromFsCells(cells) {
|
|
|
337
421
|
}
|
|
338
422
|
}
|
|
339
423
|
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
export function toFsCells(header) {
|
|
343
|
-
let matchResult, h_9, h_10, h_11, text;
|
|
344
|
-
switch (header.tag) {
|
|
345
|
-
case 11: {
|
|
346
|
-
if (header.fields[0].tag === 2) {
|
|
347
|
-
matchResult = 0;
|
|
348
|
-
}
|
|
349
|
-
else if (equals(header, DataMapAux_explicationHeader)) {
|
|
350
|
-
matchResult = 1;
|
|
351
|
-
h_9 = header;
|
|
352
|
-
}
|
|
353
|
-
else if (equals(header, DataMapAux_unitHeader)) {
|
|
354
|
-
matchResult = 2;
|
|
355
|
-
h_10 = header;
|
|
356
|
-
}
|
|
357
|
-
else if (equals(header, DataMapAux_objectTypeHeader)) {
|
|
358
|
-
matchResult = 3;
|
|
359
|
-
h_11 = header;
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
matchResult = 5;
|
|
363
|
-
}
|
|
364
|
-
break;
|
|
365
|
-
}
|
|
366
|
-
case 13: {
|
|
367
|
-
if (equals(header, DataMapAux_explicationHeader)) {
|
|
368
|
-
matchResult = 1;
|
|
369
|
-
h_9 = header;
|
|
370
|
-
}
|
|
371
|
-
else if (equals(header, DataMapAux_unitHeader)) {
|
|
372
|
-
matchResult = 2;
|
|
373
|
-
h_10 = header;
|
|
374
|
-
}
|
|
375
|
-
else if (equals(header, DataMapAux_objectTypeHeader)) {
|
|
376
|
-
matchResult = 3;
|
|
377
|
-
h_11 = header;
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
matchResult = 4;
|
|
381
|
-
text = header.fields[0];
|
|
382
|
-
}
|
|
383
|
-
break;
|
|
384
|
-
}
|
|
385
|
-
default:
|
|
386
|
-
if (equals(header, DataMapAux_explicationHeader)) {
|
|
387
|
-
matchResult = 1;
|
|
388
|
-
h_9 = header;
|
|
389
|
-
}
|
|
390
|
-
else if (equals(header, DataMapAux_unitHeader)) {
|
|
391
|
-
matchResult = 2;
|
|
392
|
-
h_10 = header;
|
|
393
|
-
}
|
|
394
|
-
else if (equals(header, DataMapAux_objectTypeHeader)) {
|
|
395
|
-
matchResult = 3;
|
|
396
|
-
h_11 = header;
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
matchResult = 5;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
424
|
switch (matchResult) {
|
|
403
425
|
case 0:
|
|
404
|
-
return
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
return
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
default:
|
|
414
|
-
return toFail(printf("Could not parse DataMap header %O."))(header);
|
|
426
|
+
return (dc) => ((cells_1) => r(dc)(cells_1));
|
|
427
|
+
default: {
|
|
428
|
+
const arg = join(", ", map((c) => c.ValueAsString(), cells));
|
|
429
|
+
const clo_1 = toFail(printf("Could not parse data map column: %s"))(arg);
|
|
430
|
+
return (arg_1) => {
|
|
431
|
+
const clo_2 = clo_1(arg_1);
|
|
432
|
+
return clo_2;
|
|
433
|
+
};
|
|
434
|
+
}
|
|
415
435
|
}
|
|
416
436
|
}
|
|
417
437
|
|
|
438
|
+
export function toFsCells(commentKeys) {
|
|
439
|
+
return toList(delay(() => append([new FsCell("Data"), new FsCell("Data Format"), new FsCell("Data Selector Format")], delay(() => append([new FsCell("Explication"), new FsCell("Term Source REF"), new FsCell("Term Accession Number")], delay(() => append([new FsCell("Unit"), new FsCell("Term Source REF"), new FsCell("Term Accession Number")], delay(() => append([new FsCell("Object Type"), new FsCell("Term Source REF"), new FsCell("Term Accession Number")], delay(() => append([new FsCell("Description")], delay(() => append([new FsCell("Generated By")], delay(() => map_2((ck) => (new FsCell(ck)), commentKeys)))))))))))))));
|
|
440
|
+
}
|
|
441
|
+
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { iterateIndexed, head, length,
|
|
2
|
-
import {
|
|
3
|
-
import { toList, tryFind } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
|
|
4
|
-
import {
|
|
1
|
+
import { iterateIndexed, head, length, iterate, exists, ofArray } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
2
|
+
import { Aux_List_groupWhen } from "../AnnotationTable/ArcTable.js";
|
|
3
|
+
import { toList, map, delay, toArray, item, tryFind } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
|
|
4
|
+
import { DataContext_$ctor_Z2FD70A12 } from "../../Core/DataContext.js";
|
|
5
|
+
import { rangeDouble } from "../../fable_modules/fable-library-js.4.16.0/Range.js";
|
|
6
|
+
import { toFsColumns, setFromFsColumns } from "./DataMapColumn.js";
|
|
5
7
|
import { printf, toFail } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
6
|
-
import {
|
|
8
|
+
import { DataMap__get_DataContexts, DataMap_$ctor_4E3220A7 } from "../../Core/Table/DataMap.js";
|
|
7
9
|
import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.6.1.2/FsWorksheet.fs.js";
|
|
8
|
-
import { comparePrimitives } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
9
10
|
import { FsRangeAddress_$ctor_7E77A4A0 } from "../../fable_modules/FsSpreadsheet.6.1.2/Ranges/FsRangeAddress.fs.js";
|
|
10
11
|
import { FsAddress_$ctor_Z37302880 } from "../../fable_modules/FsSpreadsheet.6.1.2/FsAddress.fs.js";
|
|
11
12
|
import { Dictionary_tryGet } from "../../fable_modules/FsSpreadsheet.6.1.2/Cells/FsCellsCollection.fs.js";
|
|
@@ -32,7 +33,12 @@ export function tryDataMapTable(sheet) {
|
|
|
32
33
|
* Groups and parses a collection of single columns into the according ISA composite columns
|
|
33
34
|
*/
|
|
34
35
|
export function composeColumns(columns) {
|
|
35
|
-
|
|
36
|
+
const l = (item(0, columns).MaxRowIndex - 1) | 0;
|
|
37
|
+
const dc = Array.from(toArray(delay(() => map((i) => DataContext_$ctor_Z2FD70A12(), rangeDouble(0, 1, l - 1)))));
|
|
38
|
+
iterate((arg) => {
|
|
39
|
+
setFromFsColumns(dc, arg);
|
|
40
|
+
}, groupColumnsByHeader(toList(columns)));
|
|
41
|
+
return dc;
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
/**
|
|
@@ -46,7 +52,7 @@ export function tryFromFsWorksheet(sheet) {
|
|
|
46
52
|
}
|
|
47
53
|
else {
|
|
48
54
|
const t = matchValue;
|
|
49
|
-
return
|
|
55
|
+
return DataMap_$ctor_4E3220A7(composeColumns(t.GetColumns(sheet.CellCollection)));
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
catch (err) {
|
|
@@ -59,13 +65,11 @@ export function tryFromFsWorksheet(sheet) {
|
|
|
59
65
|
export function toFsWorksheet(table) {
|
|
60
66
|
const stringCount = new Map([]);
|
|
61
67
|
const ws = new FsWorksheet("isa_datamap");
|
|
62
|
-
if (
|
|
68
|
+
if (DataMap__get_DataContexts(table).length === 0) {
|
|
63
69
|
return ws;
|
|
64
70
|
}
|
|
65
71
|
else {
|
|
66
|
-
const columns =
|
|
67
|
-
Compare: comparePrimitives,
|
|
68
|
-
}));
|
|
72
|
+
const columns = toFsColumns(DataMap__get_DataContexts(table));
|
|
69
73
|
const maxRow = length(head(columns)) | 0;
|
|
70
74
|
const maxCol = length(columns) | 0;
|
|
71
75
|
const fsTable = ws.Table("datamapTable", FsRangeAddress_$ctor_7E77A4A0(FsAddress_$ctor_Z37302880(1, 1), FsAddress_$ctor_Z37302880(maxRow, maxCol)));
|
|
@@ -92,6 +96,7 @@ export function toFsWorksheet(table) {
|
|
|
92
96
|
FsRangeBase__Cell_Z3407A44B(fsTable, address, ws.CellCollection).SetValueAs(value);
|
|
93
97
|
}, col);
|
|
94
98
|
}, columns);
|
|
99
|
+
ws.RescanRows();
|
|
95
100
|
return ws;
|
|
96
101
|
}
|
|
97
102
|
}
|