@nfdi4plants/arctrl 3.0.0-alpha.4 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -8
- package/dist/ts/cjs/ts/ARC.js +31 -20
- package/dist/ts/cjs/ts/Conversion.js +122 -76
- package/dist/ts/cjs/ts/Core/ArcTypes.js +1 -1
- package/dist/ts/cjs/ts/Core/Conversion.js +110 -43
- package/dist/ts/cjs/ts/Core/Data.js +4 -2
- package/dist/ts/cjs/ts/Core/Helper/Collections.js +69 -1
- package/dist/ts/cjs/ts/Core/OntologyAnnotation.js +27 -23
- package/dist/ts/cjs/ts/Core/Table/ArcTable.js +234 -217
- package/dist/ts/cjs/ts/Core/Table/ArcTableAux.js +904 -255
- package/dist/ts/cjs/ts/Core/Table/ArcTables.js +12 -19
- package/dist/ts/cjs/ts/Core/Table/CompositeColumn.js +4 -2
- package/dist/ts/cjs/ts/FileSystem/DefaultGitattributes.js +1 -1
- package/dist/ts/cjs/ts/Json/Decode.js +105 -0
- package/dist/ts/cjs/ts/Json/Encode.js +42 -0
- package/dist/ts/cjs/ts/Json/Table/ArcTable.js +100 -113
- package/dist/ts/cjs/ts/Json.js +46 -1
- package/dist/ts/cjs/ts/ROCrateIO.js +12 -1
- package/dist/ts/cjs/ts/Spreadsheet/AnnotationTable/ArcTable.js +15 -4
- package/dist/ts/cjs/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +77 -6
- package/dist/ts/cjs/ts/Spreadsheet/ArcInvestigation.js +31 -15
- package/dist/ts/cjs/ts/Spreadsheet/DataMapTable/DataMapHeader.js +1 -1
- package/dist/ts/cjs/ts/Spreadsheet/Metadata/SparseTable.js +2 -5
- package/dist/ts/esm/ts/ARC.js +34 -23
- package/dist/ts/esm/ts/Conversion.js +128 -82
- package/dist/ts/esm/ts/Core/ArcTypes.js +1 -1
- package/dist/ts/esm/ts/Core/Conversion.js +112 -45
- package/dist/ts/esm/ts/Core/Data.js +7 -5
- package/dist/ts/esm/ts/Core/Helper/Collections.js +61 -1
- package/dist/ts/esm/ts/Core/OntologyAnnotation.js +29 -25
- package/dist/ts/esm/ts/Core/Table/ArcTable.js +243 -226
- package/dist/ts/esm/ts/Core/Table/ArcTableAux.js +897 -264
- package/dist/ts/esm/ts/Core/Table/ArcTables.js +15 -22
- package/dist/ts/esm/ts/Core/Table/CompositeColumn.js +5 -3
- package/dist/ts/esm/ts/FileSystem/DefaultGitattributes.js +1 -1
- package/dist/ts/esm/ts/Json/Decode.js +105 -3
- package/dist/ts/esm/ts/Json/Encode.js +42 -2
- package/dist/ts/esm/ts/Json/Table/ArcTable.js +108 -121
- package/dist/ts/esm/ts/Json.js +39 -0
- package/dist/ts/esm/ts/ROCrateIO.js +14 -3
- package/dist/ts/esm/ts/Spreadsheet/AnnotationTable/ArcTable.js +17 -7
- package/dist/ts/esm/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +78 -9
- package/dist/ts/esm/ts/Spreadsheet/ArcInvestigation.js +33 -17
- package/dist/ts/esm/ts/Spreadsheet/DataMapTable/DataMapHeader.js +1 -1
- package/dist/ts/esm/ts/Spreadsheet/Metadata/SparseTable.js +3 -6
- package/dist/ts/types/ts/ARC.d.ts +2 -2
- package/dist/ts/types/ts/ARC.d.ts.map +1 -1
- package/dist/ts/types/ts/Conversion.d.ts +15 -16
- package/dist/ts/types/ts/Conversion.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/ArcTypes.d.ts +2 -0
- package/dist/ts/types/ts/Core/ArcTypes.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Conversion.d.ts +14 -15
- package/dist/ts/types/ts/Core/Conversion.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Data.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts +8 -0
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/OntologyAnnotation.d.ts +9 -0
- package/dist/ts/types/ts/Core/OntologyAnnotation.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTable.d.ts +35 -28
- package/dist/ts/types/ts/Core/Table/ArcTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts +83 -35
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTables.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/CompositeColumn.d.ts.map +1 -1
- package/dist/ts/types/ts/FileSystem/DefaultGitattributes.d.ts +1 -1
- package/dist/ts/types/ts/FileSystem/DefaultGitattributes.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Decode.d.ts +6 -0
- package/dist/ts/types/ts/Json/Decode.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Encode.d.ts +2 -0
- package/dist/ts/types/ts/Json/Encode.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Table/ArcTable.d.ts +4 -3
- package/dist/ts/types/ts/Json/Table/ArcTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Json.d.ts +17 -0
- package/dist/ts/types/ts/Json.d.ts.map +1 -1
- package/dist/ts/types/ts/ROCrateIO.d.ts +1 -1
- package/dist/ts/types/ts/ROCrateIO.d.ts.map +1 -1
- package/dist/ts/types/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts +5 -0
- package/dist/ts/types/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts +7 -0
- package/dist/ts/types/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts.map +1 -1
- package/dist/ts/types/ts/Spreadsheet/ArcInvestigation.d.ts.map +1 -1
- package/dist/ts/types/ts/Spreadsheet/Metadata/SparseTable.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/ts/cjs/ts/Json.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsonController = exports.JsonHelper_ARCJson = exports.JsonHelper_InvestigationJson = exports.JsonHelper_StudyJson = exports.JsonHelper_AssayJson = exports.JsonHelper_OntologyAnnotationJson = void 0;
|
|
3
|
+
exports.JsonController = exports.JsonHelper_LDNodeJson = exports.JsonHelper_LDGraphJson = exports.JsonHelper_ARCJson = exports.JsonHelper_InvestigationJson = exports.JsonHelper_StudyJson = exports.JsonHelper_AssayJson = exports.JsonHelper_OntologyAnnotationJson = void 0;
|
|
4
4
|
exports.JsonHelper_OntologyAnnotationJson_$reflection = JsonHelper_OntologyAnnotationJson_$reflection;
|
|
5
5
|
exports.JsonHelper_OntologyAnnotationJson_$ctor = JsonHelper_OntologyAnnotationJson_$ctor;
|
|
6
6
|
exports.JsonHelper_AssayJson_$reflection = JsonHelper_AssayJson_$reflection;
|
|
@@ -11,6 +11,10 @@ exports.JsonHelper_InvestigationJson_$reflection = JsonHelper_InvestigationJson_
|
|
|
11
11
|
exports.JsonHelper_InvestigationJson_$ctor = JsonHelper_InvestigationJson_$ctor;
|
|
12
12
|
exports.JsonHelper_ARCJson_$reflection = JsonHelper_ARCJson_$reflection;
|
|
13
13
|
exports.JsonHelper_ARCJson_$ctor = JsonHelper_ARCJson_$ctor;
|
|
14
|
+
exports.JsonHelper_LDGraphJson_$reflection = JsonHelper_LDGraphJson_$reflection;
|
|
15
|
+
exports.JsonHelper_LDGraphJson_$ctor = JsonHelper_LDGraphJson_$ctor;
|
|
16
|
+
exports.JsonHelper_LDNodeJson_$reflection = JsonHelper_LDNodeJson_$reflection;
|
|
17
|
+
exports.JsonHelper_LDNodeJson_$ctor = JsonHelper_LDNodeJson_$ctor;
|
|
14
18
|
exports.JsonController_$reflection = JsonController_$reflection;
|
|
15
19
|
const OntologyAnnotation_js_1 = require("./JsonIO/OntologyAnnotation.js");
|
|
16
20
|
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
@@ -19,6 +23,7 @@ const Assay_js_1 = require("./JsonIO/Assay.js");
|
|
|
19
23
|
const Study_js_1 = require("./JsonIO/Study.js");
|
|
20
24
|
const Investigation_js_1 = require("./JsonIO/Investigation.js");
|
|
21
25
|
const ARC_js_1 = require("./ARC.js");
|
|
26
|
+
const LDObject_js_1 = require("./JsonIO/LDObject.js");
|
|
22
27
|
class JsonHelper_OntologyAnnotationJson {
|
|
23
28
|
constructor() {
|
|
24
29
|
}
|
|
@@ -170,6 +175,40 @@ function JsonHelper_ARCJson_$reflection() {
|
|
|
170
175
|
function JsonHelper_ARCJson_$ctor() {
|
|
171
176
|
return new JsonHelper_ARCJson();
|
|
172
177
|
}
|
|
178
|
+
class JsonHelper_LDGraphJson {
|
|
179
|
+
constructor() {
|
|
180
|
+
}
|
|
181
|
+
fromROCrateJsonString(s) {
|
|
182
|
+
return (0, LDObject_js_1.ARCtrl_ROCrate_LDGraph__LDGraph_fromROCrateJsonString_Static_Z721C83C5)(s);
|
|
183
|
+
}
|
|
184
|
+
toROCrateJsonString(spaces) {
|
|
185
|
+
return (0, LDObject_js_1.ARCtrl_ROCrate_LDGraph__LDGraph_toROCrateJsonString_Static_71136F3F)((0, Option_js_1.unwrap)(spaces));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.JsonHelper_LDGraphJson = JsonHelper_LDGraphJson;
|
|
189
|
+
function JsonHelper_LDGraphJson_$reflection() {
|
|
190
|
+
return (0, Reflection_js_1.class_type)("ARCtrl.JsonHelper.LDGraphJson", undefined, JsonHelper_LDGraphJson);
|
|
191
|
+
}
|
|
192
|
+
function JsonHelper_LDGraphJson_$ctor() {
|
|
193
|
+
return new JsonHelper_LDGraphJson();
|
|
194
|
+
}
|
|
195
|
+
class JsonHelper_LDNodeJson {
|
|
196
|
+
constructor() {
|
|
197
|
+
}
|
|
198
|
+
fromROCrateJsonString(s) {
|
|
199
|
+
return (0, LDObject_js_1.ARCtrl_ROCrate_LDNode__LDNode_fromROCrateJsonString_Static_Z721C83C5)(s);
|
|
200
|
+
}
|
|
201
|
+
toROCrateJsonString(spaces) {
|
|
202
|
+
return (0, LDObject_js_1.ARCtrl_ROCrate_LDNode__LDNode_toROCrateJsonString_Static_71136F3F)((0, Option_js_1.unwrap)(spaces));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.JsonHelper_LDNodeJson = JsonHelper_LDNodeJson;
|
|
206
|
+
function JsonHelper_LDNodeJson_$reflection() {
|
|
207
|
+
return (0, Reflection_js_1.class_type)("ARCtrl.JsonHelper.LDNodeJson", undefined, JsonHelper_LDNodeJson);
|
|
208
|
+
}
|
|
209
|
+
function JsonHelper_LDNodeJson_$ctor() {
|
|
210
|
+
return new JsonHelper_LDNodeJson();
|
|
211
|
+
}
|
|
173
212
|
class JsonController {
|
|
174
213
|
constructor() {
|
|
175
214
|
}
|
|
@@ -188,6 +227,12 @@ class JsonController {
|
|
|
188
227
|
static get ARC() {
|
|
189
228
|
return new JsonHelper_ARCJson();
|
|
190
229
|
}
|
|
230
|
+
static get LDGraph() {
|
|
231
|
+
return new JsonHelper_LDGraphJson();
|
|
232
|
+
}
|
|
233
|
+
static get LDNode() {
|
|
234
|
+
return new JsonHelper_LDNodeJson();
|
|
235
|
+
}
|
|
191
236
|
}
|
|
192
237
|
exports.JsonController = JsonController;
|
|
193
238
|
function JsonController_$reflection() {
|
|
@@ -17,6 +17,8 @@ const LDContext_js_1 = require("./ROCrate/LDContext.js");
|
|
|
17
17
|
const ROCrateContext_js_1 = require("./ROCrate/ROCrateContext.js");
|
|
18
18
|
const LDGraph_js_1 = require("./Json/ROCrate/LDGraph.js");
|
|
19
19
|
const Decode_fs_js_1 = require("./fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js");
|
|
20
|
+
const Collections_js_1 = require("./Core/Helper/Collections.js");
|
|
21
|
+
const File_js_1 = require("./ROCrate/Generic/File.js");
|
|
20
22
|
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
21
23
|
const LDNode_js_1 = require("./Json/ROCrate/LDNode.js");
|
|
22
24
|
class ROCrate {
|
|
@@ -55,7 +57,16 @@ function ROCrate_get_decoder() {
|
|
|
55
57
|
throw new Error("RO-Crate graph did not contain root data Entity");
|
|
56
58
|
}
|
|
57
59
|
else {
|
|
58
|
-
|
|
60
|
+
const node = (0, Option_js_1.value)(matchValue);
|
|
61
|
+
const files = (0, Collections_js_1.ResizeArray_choose)((n) => {
|
|
62
|
+
if (File_js_1.LDFile.validate(n, (0, Option_js_1.unwrap)(graph.TryGetContext())) && !(n.Id.indexOf("#") >= 0)) {
|
|
63
|
+
return n.Id;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}, graph.Nodes);
|
|
69
|
+
return [(0, Conversion_js_1.ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateInvestigation_Static_Z6839B9E8)(node, graph, (0, Option_js_1.unwrap)(graph.TryGetContext())), files];
|
|
59
70
|
}
|
|
60
71
|
}, LDGraph_js_1.decoder);
|
|
61
72
|
}
|
|
@@ -7,6 +7,7 @@ exports.classifyColumnOrder = classifyColumnOrder;
|
|
|
7
7
|
exports.groupColumnsByHeader = groupColumnsByHeader;
|
|
8
8
|
exports.tryAnnotationTable = tryAnnotationTable;
|
|
9
9
|
exports.composeColumns = composeColumns;
|
|
10
|
+
exports.composeArcTableValues = composeArcTableValues;
|
|
10
11
|
exports.tryFromFsWorksheet = tryFromFsWorksheet;
|
|
11
12
|
exports.toFsWorksheet = toFsWorksheet;
|
|
12
13
|
const List_js_1 = require("@fable-org/fable-library-js/List.js");
|
|
@@ -15,6 +16,8 @@ const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
|
15
16
|
const FsWorksheet_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/FsWorksheet.fs.js");
|
|
16
17
|
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
17
18
|
const CompositeColumn_js_1 = require("./CompositeColumn.js");
|
|
19
|
+
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
20
|
+
const ArcTableAux_js_1 = require("../../Core/Table/ArcTableAux.js");
|
|
18
21
|
const String_js_1 = require("@fable-org/fable-library-js/String.js");
|
|
19
22
|
const FsCellsCollection_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Cells/FsCellsCollection.fs.js");
|
|
20
23
|
const Range_js_1 = require("@fable-org/fable-library-js/Range.js");
|
|
@@ -22,7 +25,6 @@ const FsAddress_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/FsAdd
|
|
|
22
25
|
const FsRangeAddress_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Ranges/FsRangeAddress.fs.js");
|
|
23
26
|
const FsRangeBase_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Ranges/FsRangeBase.fs.js");
|
|
24
27
|
const ArcTable_js_1 = require("../../Core/Table/ArcTable.js");
|
|
25
|
-
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
26
28
|
const Double_js_1 = require("@fable-org/fable-library-js/Double.js");
|
|
27
29
|
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
28
30
|
/**
|
|
@@ -92,6 +94,15 @@ function tryAnnotationTable(sheet) {
|
|
|
92
94
|
function composeColumns(stringCellColumns) {
|
|
93
95
|
return (0, Array_js_1.map)(CompositeColumn_js_1.fromStringCellColumns, groupColumnsByHeader(stringCellColumns));
|
|
94
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Groups and parses a collection of single columns into the according ISA composite columns
|
|
99
|
+
*/
|
|
100
|
+
function composeArcTableValues(stringCellColumns) {
|
|
101
|
+
const valueMap = new Map([]);
|
|
102
|
+
const rowCount = ((0, Array_js_1.item)(0, stringCellColumns).length - 1) | 0;
|
|
103
|
+
const patternInput = (0, Array_js_1.unzip)((0, Array_js_1.map)((columns) => (0, CompositeColumn_js_1.ColumnValueRefs_fromStringCellColumns)(valueMap, columns), groupColumnsByHeader(stringCellColumns)));
|
|
104
|
+
return [patternInput[0], ArcTableAux_js_1.ArcTableValues.fromRefColumns(patternInput[1], valueMap, rowCount)];
|
|
105
|
+
}
|
|
95
106
|
/**
|
|
96
107
|
* Returns the protocol described by the headers and a function for parsing the values of the matrix to the processes of this protocol
|
|
97
108
|
*/
|
|
@@ -103,7 +114,7 @@ function tryFromFsWorksheet(sheet) {
|
|
|
103
114
|
}
|
|
104
115
|
else {
|
|
105
116
|
const t = (0, Option_js_1.value)(matchValue);
|
|
106
|
-
const
|
|
117
|
+
const patternInput = composeArcTableValues((0, Array_js_1.map)(CompositeColumn_js_1.fixDeprecatedIOHeader, (0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((c) => (0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.collect)((r) => {
|
|
107
118
|
const matchValue_1 = (0, FsCellsCollection_fs_js_1.FsCellsCollection__TryGetCell_Z37302880)(sheet.CellCollection, r, c);
|
|
108
119
|
if (matchValue_1 == null) {
|
|
109
120
|
return (0, Seq_js_1.singleton)("");
|
|
@@ -113,7 +124,7 @@ function tryFromFsWorksheet(sheet) {
|
|
|
113
124
|
return (0, Seq_js_1.singleton)(cell.ValueAsString());
|
|
114
125
|
}
|
|
115
126
|
}, (0, Range_js_1.rangeDouble)(1, 1, (0, FsAddress_fs_js_1.FsAddress__get_RowNumber)((0, FsRangeAddress_fs_js_1.FsRangeAddress__get_LastAddress)((0, FsRangeBase_fs_js_1.FsRangeBase__get_RangeAddress)(t))))))), (0, Range_js_1.rangeDouble)(1, 1, (0, FsAddress_fs_js_1.FsAddress__get_ColumnNumber)((0, FsRangeAddress_fs_js_1.FsRangeAddress__get_LastAddress)((0, FsRangeBase_fs_js_1.FsRangeBase__get_RangeAddress)(t)))))))));
|
|
116
|
-
return ArcTable_js_1.ArcTable.
|
|
127
|
+
return ArcTable_js_1.ArcTable.fromArcTableValues(sheet.Name, Array.from(patternInput[0]), patternInput[1]);
|
|
117
128
|
}
|
|
118
129
|
}
|
|
119
130
|
catch (err) {
|
|
@@ -129,7 +140,7 @@ function toFsWorksheet(index, table) {
|
|
|
129
140
|
return ws;
|
|
130
141
|
}
|
|
131
142
|
else {
|
|
132
|
-
const columns = (0, List_js_1.collect)(CompositeColumn_js_1.toStringCellColumns, (0, List_js_1.sortBy)(classifyColumnOrder, (0, List_js_1.
|
|
143
|
+
const columns = (0, List_js_1.collect)(CompositeColumn_js_1.toStringCellColumns, (0, List_js_1.sortBy)(classifyColumnOrder, (0, List_js_1.ofSeq)(table.Columns), {
|
|
133
144
|
Compare: Util_js_1.comparePrimitives,
|
|
134
145
|
}));
|
|
135
146
|
let tableRowCount;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fixDeprecatedIOHeader = fixDeprecatedIOHeader;
|
|
4
4
|
exports.fromStringCellColumns = fromStringCellColumns;
|
|
5
|
+
exports.stringCellColumnsOfFsColumns = stringCellColumnsOfFsColumns;
|
|
5
6
|
exports.fromFsColumns = fromFsColumns;
|
|
6
7
|
exports.toStringCellColumns = toStringCellColumns;
|
|
7
8
|
exports.toFsColumns = toFsColumns;
|
|
9
|
+
exports.ColumnValueRefs_fromStringCellColumns = ColumnValueRefs_fromStringCellColumns;
|
|
8
10
|
const Array_js_1 = require("@fable-org/fable-library-js/Array.js");
|
|
9
11
|
const CompositeHeader_js_1 = require("../../Core/Table/CompositeHeader.js");
|
|
10
12
|
const Types_js_1 = require("@fable-org/fable-library-js/Types.js");
|
|
@@ -16,6 +18,10 @@ const FsCell_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Cells/Fs
|
|
|
16
18
|
const CompositeCell_js_1 = require("./CompositeCell.js");
|
|
17
19
|
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
18
20
|
const List_js_1 = require("@fable-org/fable-library-js/List.js");
|
|
21
|
+
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
22
|
+
const ArcTableAux_js_1 = require("../../Core/Table/ArcTableAux.js");
|
|
23
|
+
const HashCodes_js_1 = require("../../Core/Helper/HashCodes.js");
|
|
24
|
+
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
19
25
|
/**
|
|
20
26
|
* Checks if the column header is a deprecated IO Header. If so, fixes it.
|
|
21
27
|
*
|
|
@@ -45,9 +51,15 @@ function fixDeprecatedIOHeader(stringCellCol) {
|
|
|
45
51
|
function fromStringCellColumns(columns) {
|
|
46
52
|
const patternInput = (0, CompositeHeader_js_2.fromStringCells)((0, Array_js_1.map)((c) => (0, Array_js_1.item)(0, c), columns));
|
|
47
53
|
const l = (0, Array_js_1.item)(0, columns).length | 0;
|
|
48
|
-
const cells = (0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => patternInput[1]((0, Array_js_1.map)((c_1) => (0, Array_js_1.item)(i, c_1), columns)), (0, Range_js_1.rangeDouble)(1, 1, l - 1))));
|
|
54
|
+
const cells = Array.from((0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => patternInput[1]((0, Array_js_1.map)((c_1) => (0, Array_js_1.item)(i, c_1), columns)), (0, Range_js_1.rangeDouble)(1, 1, l - 1)))));
|
|
49
55
|
return CompositeColumn_js_1.CompositeColumn.create(patternInput[0], cells);
|
|
50
56
|
}
|
|
57
|
+
function stringCellColumnsOfFsColumns(columns) {
|
|
58
|
+
return (0, Array_js_1.map)((c) => {
|
|
59
|
+
c.ToDenseColumn();
|
|
60
|
+
return (0, Array_js_1.map)((cell) => cell.ValueAsString(), (0, Seq_js_1.toArray)(c.Cells));
|
|
61
|
+
}, columns);
|
|
62
|
+
}
|
|
51
63
|
function fromFsColumns(columns) {
|
|
52
64
|
return fromStringCellColumns((0, Array_js_1.map)((c) => {
|
|
53
65
|
c.ToDenseColumn();
|
|
@@ -59,21 +71,80 @@ function toStringCellColumns(column) {
|
|
|
59
71
|
const isTerm = column.Header.IsTermColumn;
|
|
60
72
|
const isData = column.Header.IsDataColumn && (0, Seq_js_1.exists)((c_1) => c_1.isData, column.Cells);
|
|
61
73
|
const header = (0, CompositeHeader_js_2.toStringCells)(hasUnit, column.Header);
|
|
62
|
-
const
|
|
74
|
+
const compositeCells = (0, Seq_js_1.toArray)(column.Cells);
|
|
75
|
+
const cells = (0, Array_js_1.map)((cell) => (0, CompositeCell_js_1.toStringCells)(isTerm, hasUnit, cell), (0, Seq_js_1.toArray)(column.Cells));
|
|
63
76
|
const getCellOrDefault = (ri, ci, cells_1) => (0, Option_js_1.defaultArg)((0, Array_js_1.tryItem)(ci, (0, Array_js_1.item)(ri, cells_1)), "");
|
|
64
77
|
if (hasUnit) {
|
|
65
|
-
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => getCellOrDefault(i, 0, cells), (0, Range_js_1.rangeDouble)(0, 1,
|
|
78
|
+
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => getCellOrDefault(i, 0, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(1, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_1) => getCellOrDefault(i_1, 1, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(2, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_2) => getCellOrDefault(i_2, 2, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(3, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_3) => getCellOrDefault(i_3, 3, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1))))))]);
|
|
66
79
|
}
|
|
67
80
|
else if (isTerm) {
|
|
68
|
-
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_4) => getCellOrDefault(i_4, 0, cells), (0, Range_js_1.rangeDouble)(0, 1,
|
|
81
|
+
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_4) => getCellOrDefault(i_4, 0, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(1, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_5) => getCellOrDefault(i_5, 1, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(2, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_6) => getCellOrDefault(i_6, 2, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1))))))]);
|
|
69
82
|
}
|
|
70
83
|
else if (isData) {
|
|
71
|
-
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_7) => getCellOrDefault(i_7, 0, cells), (0, Range_js_1.rangeDouble)(0, 1,
|
|
84
|
+
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_7) => getCellOrDefault(i_7, 0, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(1, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_8) => getCellOrDefault(i_8, 1, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(2, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_9) => getCellOrDefault(i_9, 2, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1))))))]);
|
|
72
85
|
}
|
|
73
86
|
else {
|
|
74
|
-
return (0, List_js_1.singleton)((0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_10) => (0, Array_js_1.item)(0, (0, Array_js_1.item)(i_10, cells)), (0, Range_js_1.rangeDouble)(0, 1,
|
|
87
|
+
return (0, List_js_1.singleton)((0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_10) => (0, Array_js_1.item)(0, (0, Array_js_1.item)(i_10, cells)), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))));
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
function toFsColumns(column) {
|
|
78
91
|
return (0, List_js_1.map)((c) => (0, List_js_1.map)((s) => (new FsCell_fs_js_1.FsCell(s)), c), toStringCellColumns(column));
|
|
79
92
|
}
|
|
93
|
+
function ColumnValueRefs_fromStringCellColumns(valueMap, columns) {
|
|
94
|
+
let cellHash;
|
|
95
|
+
const hashMap = new Map([]);
|
|
96
|
+
const cells = new Map([]);
|
|
97
|
+
let constant = true;
|
|
98
|
+
const patternInput = (0, CompositeHeader_js_2.fromStringCells)((0, Array_js_1.map)((c) => (0, Array_js_1.item)(0, c), columns));
|
|
99
|
+
const header = patternInput[0];
|
|
100
|
+
const cellParser = patternInput[1];
|
|
101
|
+
const l = (0, Array_js_1.item)(0, columns).length | 0;
|
|
102
|
+
if (l === 1) {
|
|
103
|
+
return [header, (0, ArcTableAux_js_1.ColumnValueRefs_Sparse)(cells)];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
for (let i = 1; i <= (l - 1); i++) {
|
|
107
|
+
const strings = (0, Array_js_1.map)((c_1) => (0, Array_js_1.item)(i, c_1), columns);
|
|
108
|
+
const hash_2 = (0, Seq_js_1.reduce)(HashCodes_js_1.mergeHashes, (0, Seq_js_1.map)(Util_js_1.stringHash, strings)) | 0;
|
|
109
|
+
let matchValue;
|
|
110
|
+
let patternInput_1;
|
|
111
|
+
let outArg = (0, Util_js_1.defaultOf)();
|
|
112
|
+
patternInput_1 = [(0, MapUtil_js_1.tryGetValue)(hashMap, hash_2, new Types_js_1.FSharpRef(() => outArg, (v) => {
|
|
113
|
+
outArg = (v | 0);
|
|
114
|
+
})), outArg];
|
|
115
|
+
matchValue = (patternInput_1[0] ? patternInput_1[1] : undefined);
|
|
116
|
+
if (matchValue == null) {
|
|
117
|
+
if (i === 1) {
|
|
118
|
+
const cellHash_3 = (0, ArcTableAux_js_1.ensureCellHashInValueMap)(cellParser(strings), valueMap) | 0;
|
|
119
|
+
hashMap.set(hash_2, cellHash_3);
|
|
120
|
+
cells.set(i - 1, cellHash_3);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
if (constant) {
|
|
124
|
+
constant = false;
|
|
125
|
+
for (let j = 0; j <= (i - 1); j++) {
|
|
126
|
+
const cellHash_4 = (0, MapUtil_js_1.getItemFromDict)(cells, 0) | 0;
|
|
127
|
+
cells.set(j, cellHash_4);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const cellHash_5 = (0, ArcTableAux_js_1.ensureCellHashInValueMap)(cellParser(strings), valueMap) | 0;
|
|
131
|
+
hashMap.set(hash_2, cellHash_5);
|
|
132
|
+
cells.set(i - 1, cellHash_5);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if ((cellHash = ((0, Option_js_1.value)(matchValue) | 0), constant)) {
|
|
136
|
+
const cellHash_1 = (0, Option_js_1.value)(matchValue) | 0;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
const cellHash_2 = (0, Option_js_1.value)(matchValue) | 0;
|
|
140
|
+
cells.set(i - 1, cellHash_2);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (constant) {
|
|
144
|
+
return [header, (0, ArcTableAux_js_1.ColumnValueRefs_Constant)((0, MapUtil_js_1.getItemFromDict)(cells, 0))];
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return [header, (0, ArcTableAux_js_1.ColumnValueRefs_Sparse)(cells)];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -31,11 +31,11 @@ const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
|
31
31
|
const Collections_js_1 = require("../Core/Helper/Collections.js");
|
|
32
32
|
const Seq2_js_1 = require("@fable-org/fable-library-js/Seq2.js");
|
|
33
33
|
const ArcTypes_js_1 = require("../Core/ArcTypes.js");
|
|
34
|
+
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
34
35
|
const OntologySourceReference_js_1 = require("./Metadata/OntologySourceReference.js");
|
|
35
36
|
const Publication_js_1 = require("./Metadata/Publication.js");
|
|
36
37
|
const Contacts_js_1 = require("./Metadata/Contacts.js");
|
|
37
38
|
const Study_js_1 = require("./Metadata/Study.js");
|
|
38
|
-
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
39
39
|
const Map_js_1 = require("@fable-org/fable-library-js/Map.js");
|
|
40
40
|
const FsWorksheet_fs_js_1 = require("../fable_modules/FsSpreadsheet.6.3.1/FsWorksheet.fs.js");
|
|
41
41
|
const FsWorkbook_fs_js_1 = require("../fable_modules/FsSpreadsheet.6.3.1/FsWorkbook.fs.js");
|
|
@@ -108,6 +108,9 @@ function ArcInvestigation_fromParts(investigationInfo, ontologySourceReference,
|
|
|
108
108
|
return ArcTypes_js_1.ArcInvestigation.make(investigationInfo.Identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications_1, contacts_1, assays_1, studies_1, [], [], registeredStudyIdentifiers, comments, remarks_1);
|
|
109
109
|
}
|
|
110
110
|
function ArcInvestigation_fromRows(rows) {
|
|
111
|
+
if ((0, Seq_js_1.isEmpty)(rows)) {
|
|
112
|
+
throw new Error("isa_investigation sheet in Investigation file is empty");
|
|
113
|
+
}
|
|
111
114
|
const en = (0, Util_js_1.getEnumerator)(rows);
|
|
112
115
|
const emptyInvestigationInfo = ArcInvestigation_InvestigationInfo_create("", "", "", "", "", (0, List_js_1.empty)());
|
|
113
116
|
const loop = (lastLine_mut, ontologySourceReferences_mut, investigationInfo_mut, publications_mut, contacts_mut, studies_mut, remarks_mut, lineNumber_mut) => {
|
|
@@ -226,25 +229,38 @@ function ArcInvestigation_fromRows(rows) {
|
|
|
226
229
|
continue loop;
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
|
-
default:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
default:
|
|
233
|
+
if (en["System.Collections.IEnumerator.MoveNext"]()) {
|
|
234
|
+
lastLine_mut = (0, SparseTable_js_1.SparseRowModule_tryGetValueAt)(0, en["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
235
|
+
ontologySourceReferences_mut = ontologySourceReferences;
|
|
236
|
+
investigationInfo_mut = investigationInfo;
|
|
237
|
+
publications_mut = publications;
|
|
238
|
+
contacts_mut = contacts;
|
|
239
|
+
studies_mut = studies;
|
|
240
|
+
remarks_mut = remarks;
|
|
241
|
+
lineNumber_mut = lineNumber;
|
|
242
|
+
continue loop;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
let patternInput_5;
|
|
246
|
+
const tupledArg = (0, List_js_1.unzip)(studies);
|
|
247
|
+
patternInput_5 = [(0, List_js_1.reverse)(tupledArg[0]), (0, Seq2_js_1.List_distinctBy)((a_1) => a_1.Identifier, (0, List_js_1.concat)(tupledArg[1]), {
|
|
248
|
+
Equals: (x, y) => (x === y),
|
|
249
|
+
GetHashCode: Util_js_1.stringHash,
|
|
250
|
+
})];
|
|
251
|
+
return ArcInvestigation_fromParts(investigationInfo, ontologySourceReferences, publications, contacts, patternInput_5[0], patternInput_5[1], remarks);
|
|
252
|
+
}
|
|
238
253
|
}
|
|
239
254
|
break;
|
|
240
255
|
}
|
|
241
256
|
};
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
throw new Error("
|
|
257
|
+
let arcInvestigation;
|
|
258
|
+
en["System.Collections.IEnumerator.MoveNext"]();
|
|
259
|
+
arcInvestigation = loop((0, SparseTable_js_1.SparseRowModule_tryGetValueAt)(0, en["System.Collections.Generic.IEnumerator`1.get_Current"]()), (0, List_js_1.empty)(), emptyInvestigationInfo, (0, List_js_1.empty)(), (0, List_js_1.empty)(), (0, List_js_1.empty)(), (0, List_js_1.empty)(), 1);
|
|
260
|
+
if (arcInvestigation.Identifier === "") {
|
|
261
|
+
throw new Error("Mandatory Investigation identifier is not present");
|
|
247
262
|
}
|
|
263
|
+
return arcInvestigation;
|
|
248
264
|
}
|
|
249
265
|
function ArcInvestigation_toRows(investigation) {
|
|
250
266
|
let remarks, rows;
|
|
@@ -476,5 +476,5 @@ function fromFsCells(cells) {
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
function toFsCells(commentKeys) {
|
|
479
|
-
return (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Data"), new FsCell_fs_js_1.FsCell("Data Format"), new FsCell_fs_js_1.FsCell("Data Selector Format")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Explication"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Unit"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Object Type"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Description")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Generated By")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Label")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((ck) => (new FsCell_fs_js_1.FsCell(ck)), commentKeys)))))))))))))))));
|
|
479
|
+
return (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Data"), new FsCell_fs_js_1.FsCell("Data Format"), new FsCell_fs_js_1.FsCell("Data Selector Format")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Explication"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Unit"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Object Type"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Description")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Generated By")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Label")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((ck) => (new FsCell_fs_js_1.FsCell(`Comment [${ck}]`)), commentKeys)))))))))))))))));
|
|
480
480
|
}
|
|
@@ -36,7 +36,7 @@ const Types_js_1 = require("@fable-org/fable-library-js/Types.js");
|
|
|
36
36
|
const Reflection_js_1 = require("@fable-org/fable-library-js/Reflection.js");
|
|
37
37
|
const CollectionAux_js_1 = require("../CollectionAux.js");
|
|
38
38
|
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
39
|
-
const
|
|
39
|
+
const Collections_js_1 = require("../../Core/Helper/Collections.js");
|
|
40
40
|
const String_js_1 = require("@fable-org/fable-library-js/String.js");
|
|
41
41
|
const Comment_js_1 = require("../../Core/Comment.js");
|
|
42
42
|
const Comment_js_2 = require("./Comment.js");
|
|
@@ -319,10 +319,7 @@ function SparseTable__TryGetValueDefault_5BAE6133(this$, defaultValue, key) {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
function SparseTable_Create_Z2192E64B(matrix, keys, commentKeys, length) {
|
|
322
|
-
return new SparseTable((0, Option_js_1.defaultArg)(matrix,
|
|
323
|
-
Equals: Util_js_1.equalArrays,
|
|
324
|
-
GetHashCode: Util_js_1.arrayHash,
|
|
325
|
-
})), (0, Option_js_1.defaultArg)(keys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(commentKeys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(length, 0));
|
|
322
|
+
return new SparseTable((0, Option_js_1.defaultArg)(matrix, (0, Collections_js_1.Dictionary_init)()), (0, Option_js_1.defaultArg)(keys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(commentKeys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(length, 0));
|
|
326
323
|
}
|
|
327
324
|
function SparseTable_AddRow(key, values, matrix) {
|
|
328
325
|
(0, Seq_js_1.iterate)((tupledArg) => {
|
package/dist/ts/esm/ts/ARC.js
CHANGED
|
@@ -8,15 +8,16 @@ import { PromiseBuilder__Delay_62FBFDE1, PromiseBuilder__Run_212F1D4B } from "./
|
|
|
8
8
|
import { promise } from "./fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js";
|
|
9
9
|
import { getAllFilePathsAsync } from "./ContractIO/FileSystemHelper.js";
|
|
10
10
|
import { toList, collect, empty, find, tryFind, iterate, map, singleton, append, delay, contains, toArray } from "@fable-org/fable-library-js/Seq.js";
|
|
11
|
-
import { defaultOf, disposeSafe, getEnumerator, safeHash, curry2, comparePrimitives, stringHash } from "@fable-org/fable-library-js/Util.js";
|
|
11
|
+
import { equals, defaultOf, disposeSafe, getEnumerator, safeHash, curry2, comparePrimitives, stringHash } from "@fable-org/fable-library-js/Util.js";
|
|
12
12
|
import { getStudyFolderPath, getAssayFolderPath } from "./FileSystem/Path.js";
|
|
13
13
|
import { ARCtrl_ArcAssay__ArcAssay_tryFromReadContract_Static_7570923F, ARCtrl_ArcAssay__ArcAssay_ToUpdateContract, ARCtrl_ArcAssay__ArcAssay_ToCreateContract_6FCE9E49, ARCtrl_ArcAssay__ArcAssay_ToDeleteContract } from "./Contract/ArcAssay.js";
|
|
14
14
|
import { ARCtrl_ArcInvestigation__ArcInvestigation_tryFromReadContract_Static_7570923F, ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract } from "./Contract/ArcInvestigation.js";
|
|
15
15
|
import { ARCtrl_ArcStudy__ArcStudy_tryFromReadContract_Static_7570923F, ARCtrl_ArcStudy__ArcStudy_ToCreateContract_6FCE9E49, ARCtrl_ArcStudy__ArcStudy_ToUpdateContract } from "./Contract/ArcStudy.js";
|
|
16
|
-
import {
|
|
16
|
+
import { item, equalsWith, tryPick, append as append_1, contains as contains_2, concat, fold, choose, map as map_1 } from "@fable-org/fable-library-js/Array.js";
|
|
17
17
|
import { toText, printf, toFail, join, replace } from "@fable-org/fable-library-js/String.js";
|
|
18
18
|
import { Run_datamapFileNameFromIdentifier, Run_fileNameFromIdentifier, Workflow_datamapFileNameFromIdentifier, Workflow_fileNameFromIdentifier, Assay_datamapFileNameFromIdentifier, Assay_fileNameFromIdentifier, Study_datamapFileNameFromIdentifier, Study_fileNameFromIdentifier, createMissingIdentifier } from "./Core/Helper/Identifier.js";
|
|
19
19
|
import { FSharpSet__Contains, unionMany, contains as contains_1, ofSeq } from "@fable-org/fable-library-js/Set.js";
|
|
20
|
+
import { ResizeArray_map, ResizeArray_iter } from "./Core/Helper/Collections.js";
|
|
20
21
|
import { DataMap__get_StaticHash, DataMap__set_StaticHash_Z524259A4, DataMap__get_DataContexts } from "./Core/DataMap.js";
|
|
21
22
|
import { FileSystemTree_Folder, FileSystemTree } from "./FileSystem/FileSystemTree.js";
|
|
22
23
|
import { tryISAReadContractFromPath } from "./Contract/ARC.js";
|
|
@@ -33,8 +34,7 @@ import { Dictionary_tryGet } from "./fable_modules/FsSpreadsheet.6.3.1/Cells/FsC
|
|
|
33
34
|
import { ARCtrl_DataMap__DataMap_tryFromReadContractForRun_Static, ARCtrl_DataMap__DataMap_tryFromReadContractForWorkflow_Static, ARCtrl_DataMap__DataMap_tryFromReadContractForStudy_Static, ARCtrl_DataMap__DataMap_tryFromReadContractForAssay_Static, ARCtrl_DataMap__DataMap_ToUpdateContractForRun_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForRun_Z721C83C5, ARCtrl_DataMap__DataMap_ToUpdateContractForWorkflow_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForWorkflow_Z721C83C5, ARCtrl_DataMap__DataMap_ToUpdateContractForAssay_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForAssay_Z721C83C5, ARCtrl_DataMap__DataMap_ToUpdateContractForStudy_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForStudy_Z721C83C5 } from "./Contract/Datamap.js";
|
|
34
35
|
import { ARCtrl_ArcWorkflow__ArcWorkflow_tryFromReadContract_Static_7570923F, ARCtrl_ArcWorkflow__ArcWorkflow_ToUpdateContract, ARCtrl_ArcWorkflow__ArcWorkflow_ToCreateContract_6FCE9E49 } from "./Contract/ArcWorkflow.js";
|
|
35
36
|
import { ARCtrl_ArcRun__ArcRun_tryFromReadContract_Static_7570923F, ARCtrl_ArcRun__ArcRun_ToUpdateContract, ARCtrl_ArcRun__ArcRun_ToCreateContract_6FCE9E49 } from "./Contract/ArcRun.js";
|
|
36
|
-
import { Clone_createCloneContract_5000466F, Init_createAddRemoteContract_Z721C83C5,
|
|
37
|
-
import { ResizeArray_map } from "./Core/Helper/Collections.js";
|
|
37
|
+
import { Clone_createCloneContract_5000466F, Init_createAddRemoteContract_Z721C83C5, gitattributesContract, gitignoreContract, Init_createInitContract_6DFDD678 } from "./Contract/Git.js";
|
|
38
38
|
import { ofSeq as ofSeq_1 } from "@fable-org/fable-library-js/Map.js";
|
|
39
39
|
import { fromString } from "./fable_modules/Thoth.Json.JavaScript.0.3.0/Decode.fs.js";
|
|
40
40
|
import { ROCrate_encoder_8A8D439, ROCrate_get_decoder, ROCrate_get_decoderDeprecated } from "./ROCrateIO.js";
|
|
@@ -53,7 +53,7 @@ export class ARC extends ArcInvestigation {
|
|
|
53
53
|
this._fs = ((fs_1 = defaultArg(fs, FileSystem.create({
|
|
54
54
|
tree: FileSystemTree_Folder("", []),
|
|
55
55
|
})), ARCAux_updateFSByISA(this$.contents, fs_1)));
|
|
56
|
-
this["init@
|
|
56
|
+
this["init@90"] = 1;
|
|
57
57
|
}
|
|
58
58
|
get FileSystem() {
|
|
59
59
|
const this$ = this;
|
|
@@ -287,12 +287,12 @@ export class ARC extends ArcInvestigation {
|
|
|
287
287
|
}
|
|
288
288
|
switch (matchResult) {
|
|
289
289
|
case 0: {
|
|
290
|
-
|
|
290
|
+
ResizeArray_iter((c) => {
|
|
291
291
|
if (c.AsData.FilePath != null) {
|
|
292
292
|
const newFilePath = dataNameFunction(c.AsData);
|
|
293
293
|
c.AsData.FilePath = newFilePath;
|
|
294
294
|
}
|
|
295
|
-
});
|
|
295
|
+
}, col_2.Cells);
|
|
296
296
|
break;
|
|
297
297
|
}
|
|
298
298
|
case 1: {
|
|
@@ -313,19 +313,19 @@ export class ARC extends ArcInvestigation {
|
|
|
313
313
|
}, DataMap__get_DataContexts(dm));
|
|
314
314
|
};
|
|
315
315
|
iterate((s) => {
|
|
316
|
-
const
|
|
316
|
+
const f_1 = (d) => d.GetAbsolutePathForStudy(s.Identifier, checkExistenceFromRoot);
|
|
317
317
|
const source_1 = s.Tables;
|
|
318
|
-
iterate(curry2(updateTable)(
|
|
318
|
+
iterate(curry2(updateTable)(f_1), source_1);
|
|
319
319
|
if (s.DataMap != null) {
|
|
320
|
-
updateDataMap(
|
|
320
|
+
updateDataMap(f_1, value_3(s.DataMap));
|
|
321
321
|
}
|
|
322
322
|
}, this$.Studies);
|
|
323
|
-
iterate((
|
|
324
|
-
const
|
|
325
|
-
const source_3 =
|
|
326
|
-
iterate(curry2(updateTable)(
|
|
327
|
-
if (
|
|
328
|
-
updateDataMap(
|
|
323
|
+
iterate((a_1) => {
|
|
324
|
+
const f_2 = (d_1) => d_1.GetAbsolutePathForAssay(a_1.Identifier, checkExistenceFromRoot);
|
|
325
|
+
const source_3 = a_1.Tables;
|
|
326
|
+
iterate(curry2(updateTable)(f_2), source_3);
|
|
327
|
+
if (a_1.DataMap != null) {
|
|
328
|
+
updateDataMap(f_2, value_3(a_1.DataMap));
|
|
329
329
|
}
|
|
330
330
|
}, this$.Assays);
|
|
331
331
|
}
|
|
@@ -381,7 +381,7 @@ export class ARC extends ArcInvestigation {
|
|
|
381
381
|
const registeredStudy = value_3(registeredStudyOpt);
|
|
382
382
|
registeredStudy.UpdateReferenceByStudyFile(study, true);
|
|
383
383
|
}
|
|
384
|
-
const datamap =
|
|
384
|
+
const datamap = ARCAux_getStudyDataMapFromContracts(study.Identifier, contracts);
|
|
385
385
|
if (study.DataMap == null) {
|
|
386
386
|
study.DataMap = datamap;
|
|
387
387
|
}
|
|
@@ -663,9 +663,10 @@ export class ARC extends ArcInvestigation {
|
|
|
663
663
|
}));
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
GetGitInitContracts(branch, repositoryAddress, defaultGitignore) {
|
|
666
|
+
GetGitInitContracts(branch, repositoryAddress, defaultGitignore, defaultGitattributes) {
|
|
667
667
|
const defaultGitignore_1 = defaultArg(defaultGitignore, false);
|
|
668
|
-
|
|
668
|
+
const defaultGitattributes_1 = defaultArg(defaultGitattributes, false);
|
|
669
|
+
return toArray(delay(() => append(singleton(Init_createInitContract_6DFDD678(unwrap(branch))), delay(() => append(defaultGitignore_1 ? singleton(gitignoreContract) : empty(), delay(() => append(defaultGitattributes_1 ? singleton(gitattributesContract) : empty(), delay(() => ((repositoryAddress != null) ? singleton(Init_createAddRemoteContract_Z721C83C5(value_3(repositoryAddress))) : empty())))))))));
|
|
669
670
|
}
|
|
670
671
|
static getCloneContract(remoteUrl, merge, branch, token, nolfs) {
|
|
671
672
|
return Clone_createCloneContract_5000466F(remoteUrl, unwrap(merge), unwrap(branch), unwrap(token), unwrap(nolfs));
|
|
@@ -820,15 +821,18 @@ export class ARC extends ArcInvestigation {
|
|
|
820
821
|
static fromROCrateJsonString(s) {
|
|
821
822
|
let arg;
|
|
822
823
|
try {
|
|
823
|
-
let
|
|
824
|
+
let patternInput;
|
|
824
825
|
const matchValue = fromString(ROCrate_get_decoder(), s);
|
|
825
826
|
if (matchValue.tag === /* Error */ 1) {
|
|
826
827
|
throw new Error((arg = matchValue.fields[0], toText(printf("Error decoding string: %O"))(arg)));
|
|
827
828
|
}
|
|
828
829
|
else {
|
|
829
|
-
|
|
830
|
+
patternInput = matchValue.fields[0];
|
|
830
831
|
}
|
|
831
|
-
|
|
832
|
+
let fileSystem;
|
|
833
|
+
const paths = Array.from(patternInput[1]);
|
|
834
|
+
fileSystem = FileSystem.fromFilePaths(paths);
|
|
835
|
+
return ARC.fromArcInvestigation(patternInput[0], undefined, fileSystem);
|
|
832
836
|
}
|
|
833
837
|
catch (ex) {
|
|
834
838
|
const arg_1 = ex.message;
|
|
@@ -913,7 +917,14 @@ export function ARCAux_getRunDataMapFromContracts(runIdentifier, contracts) {
|
|
|
913
917
|
return tryPick((c) => ARCtrl_DataMap__DataMap_tryFromReadContractForRun_Static(runIdentifier, c), contracts);
|
|
914
918
|
}
|
|
915
919
|
export function ARCAux_getArcInvestigationFromContracts(contracts) {
|
|
916
|
-
|
|
920
|
+
const matchValue = choose(ARCtrl_ArcInvestigation__ArcInvestigation_tryFromReadContract_Static_7570923F, contracts);
|
|
921
|
+
if (!equalsWith(equals, matchValue, defaultOf()) && (matchValue.length === 1)) {
|
|
922
|
+
return item(0, matchValue);
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
const arg = matchValue.length | 0;
|
|
926
|
+
return toFail(printf("Could not find investigation in contracts. Expected exactly one investigation, but found %d."))(arg);
|
|
927
|
+
}
|
|
917
928
|
}
|
|
918
929
|
export function ARCAux_updateFSByISA(isa, fs) {
|
|
919
930
|
let assaysFolder;
|