@nfdi4plants/arctrl 1.0.0-alpha8 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARC.js +5 -6
- package/ISA/ISA/ArcTypes/ArcTable.js +141 -37
- package/ISA/ISA/ArcTypes/ArcTableAux.js +13 -14
- package/ISA/ISA/ArcTypes/ArcTables.js +380 -277
- package/ISA/ISA/ArcTypes/ArcTypes.js +128 -318
- package/ISA/ISA/ArcTypes/CompositeColumn.js +7 -1
- package/ISA/ISA/ArcTypes/CompositeHeader.js +311 -1
- package/ISA/ISA/Helper.js +15 -3
- package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +17 -15
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +2 -2
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +4 -4
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +6 -6
- package/ISA/ISA.Spreadsheet/ArcAssay.js +6 -9
- package/ISA/ISA.Spreadsheet/ArcInvestigation.js +4 -4
- package/ISA/ISA.Spreadsheet/ArcStudy.js +5 -5
- package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +9 -9
- package/README.md +3 -0
- package/Templates/Template.Json.js +7 -3
- package/Templates/Template.Spreadsheet.js +23 -7
- package/Templates/Template.Web.js +1 -1
- package/Templates/Templates.js +82 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCell.fs +85 -36
- package/fable_modules/FsSpreadsheet.5.0.0/Cells/FsCell.fs.js +272 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs +1 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs.js +18 -18
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs +1 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs.js +2 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs +1 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs.js +4 -4
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs +3 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs +2 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs +10 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs.js +5 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs +4 -4
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs.js +3 -3
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs +20 -4
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs.js +26 -6
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +3 -3
- package/fable_modules/project_cracked.json +1 -1
- package/index.js +1 -0
- package/package.json +1 -1
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +0 -240
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsSpreadsheet.fableproj +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.
|
|
1
|
+
import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.5.0.0/FsWorksheet.fs.js";
|
|
2
2
|
import { iterate, isEmpty, choose, map, append, iterateIndexed } from "../../fable_modules/fable-library.4.1.4/Seq.js";
|
|
3
3
|
import { SparseRowModule_fromFsRow, SparseRowModule_fromValues, SparseRowModule_writeToSheet } from "./Metadata/SparseTable.js";
|
|
4
4
|
import { fromRows as fromRows_1, toRows } from "./Metadata/Study.js";
|
|
@@ -9,8 +9,8 @@ import { createMissingIdentifier } from "../ISA/Identifier.js";
|
|
|
9
9
|
import { empty } from "../../fable_modules/fable-library.4.1.4/List.js";
|
|
10
10
|
import { printf, toConsole } from "../../fable_modules/fable-library.4.1.4/String.js";
|
|
11
11
|
import { toFsWorksheet, tryFromFsWorksheet } from "./AnnotationTable/ArcTable.js";
|
|
12
|
-
import {
|
|
13
|
-
import { FsWorkbook } from "../../fable_modules/FsSpreadsheet.
|
|
12
|
+
import { ArcTables } from "../ISA/ArcTypes/ArcTables.js";
|
|
13
|
+
import { FsWorkbook } from "../../fable_modules/FsSpreadsheet.5.0.0/FsWorkbook.fs.js";
|
|
14
14
|
|
|
15
15
|
export function ArcStudy_toMetadataSheet(study, assays) {
|
|
16
16
|
let source_1;
|
|
@@ -48,8 +48,8 @@ export function ARCtrl_ISA_ArcStudy__ArcStudy_fromFsWorkbook_Static_32154C9D(doc
|
|
|
48
48
|
const studyMetadata = patternInput[0];
|
|
49
49
|
const sheets = choose(tryFromFsWorksheet, doc.GetWorksheets());
|
|
50
50
|
if (!isEmpty(sheets)) {
|
|
51
|
-
const updatedTables =
|
|
52
|
-
studyMetadata.Tables =
|
|
51
|
+
const updatedTables = ArcTables.updateReferenceTablesBySheets(new ArcTables(studyMetadata.Tables), new ArcTables(Array.from(sheets)), true);
|
|
52
|
+
studyMetadata.Tables = updatedTables.Tables;
|
|
53
53
|
}
|
|
54
54
|
return [studyMetadata, patternInput[1]];
|
|
55
55
|
}
|
|
@@ -2,12 +2,12 @@ import { append as append_1, delay, tryItem, length as length_1, isEmpty, iterat
|
|
|
2
2
|
import { defaultArg, map as map_1 } from "../../../fable_modules/fable-library.4.1.4/Option.js";
|
|
3
3
|
import { tryFind, ofSeq } from "../../../fable_modules/fable-library.4.1.4/Map.js";
|
|
4
4
|
import { arrayHash, equalArrays, equals, comparePrimitives } from "../../../fable_modules/fable-library.4.1.4/Util.js";
|
|
5
|
-
import { RowBuilder_get_Empty, RowBuilder__Combine_19F30600, RowBuilder_$ctor } from "../../../fable_modules/FsSpreadsheet.
|
|
6
|
-
import { CellBuilder_$ctor,
|
|
7
|
-
import { Messages_format, SheetEntity$1_some_2B595 } from "../../../fable_modules/FsSpreadsheet.
|
|
8
|
-
import { DataType } from "../../../fable_modules/FsSpreadsheet.
|
|
5
|
+
import { RowBuilder_get_Empty, RowBuilder__Combine_19F30600, RowBuilder_$ctor } from "../../../fable_modules/FsSpreadsheet.5.0.0/DSL/RowBuilder.fs.js";
|
|
6
|
+
import { CellBuilder_$ctor, CellBuilder__AsCellElement_6F87C2ED } from "../../../fable_modules/FsSpreadsheet.5.0.0/DSL/CellBuilder.fs.js";
|
|
7
|
+
import { Messages_format, SheetEntity$1_some_2B595 } from "../../../fable_modules/FsSpreadsheet.5.0.0/DSL/Types.fs.js";
|
|
8
|
+
import { DataType } from "../../../fable_modules/FsSpreadsheet.5.0.0/Cells/FsCell.fs.js";
|
|
9
9
|
import { map as map_2, toArray, initialize as initialize_1, exists, find, cons, append, empty, singleton } from "../../../fable_modules/fable-library.4.1.4/List.js";
|
|
10
|
-
import { ColumnIndex, RowElement } from "../../../fable_modules/FsSpreadsheet.
|
|
10
|
+
import { ColumnIndex, RowElement } from "../../../fable_modules/FsSpreadsheet.5.0.0/DSL/Types.fs.js";
|
|
11
11
|
import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
|
|
12
12
|
import { record_type, list_type, class_type, tuple_type, int32_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
|
|
13
13
|
import { Seq_trySkip, Dictionary_tryGetValue } from "../CollectionAux.js";
|
|
@@ -40,11 +40,11 @@ export function SparseRowModule_getAllValues(i) {
|
|
|
40
40
|
|
|
41
41
|
export function SparseRowModule_fromFsRow(r) {
|
|
42
42
|
return choose((c) => {
|
|
43
|
-
if (c.Value
|
|
43
|
+
if (equals(c.Value, "")) {
|
|
44
44
|
return void 0;
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
return [c.ColumnNumber - 1, c.
|
|
47
|
+
return [c.ColumnNumber - 1, c.ValueAsString()];
|
|
48
48
|
}
|
|
49
49
|
}, r.Cells);
|
|
50
50
|
}
|
|
@@ -67,7 +67,7 @@ export function SparseRowModule_toDSLRow(vs) {
|
|
|
67
67
|
const v = _arg;
|
|
68
68
|
if (v == null) {
|
|
69
69
|
let c_1;
|
|
70
|
-
const this$_5 =
|
|
70
|
+
const this$_5 = CellBuilder__AsCellElement_6F87C2ED(CellBuilder_$ctor(), SheetEntity$1_some_2B595(singleton([new DataType(0, []), ""])));
|
|
71
71
|
let matchResult, errs_1, f_1, ms_2_1;
|
|
72
72
|
switch (this$_5.tag) {
|
|
73
73
|
case 1: {
|
|
@@ -137,7 +137,7 @@ export function SparseRowModule_toDSLRow(vs) {
|
|
|
137
137
|
else {
|
|
138
138
|
const v_1 = v;
|
|
139
139
|
let c;
|
|
140
|
-
const this$_2 =
|
|
140
|
+
const this$_2 = CellBuilder__AsCellElement_6F87C2ED(CellBuilder_$ctor(), SheetEntity$1_some_2B595(singleton([new DataType(0, []), v_1])));
|
|
141
141
|
let matchResult_2, errs, f, ms_2;
|
|
142
142
|
switch (this$_2.tag) {
|
|
143
143
|
case 1: {
|
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# ARCtrl
|
|
2
2
|
Top level ARC DataModel and API function descriptions.
|
|
3
3
|
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
4
7
|
- [ARCtrl](#arctrl)
|
|
5
8
|
- [Jargon/Nomenclature](#jargonnomenclature)
|
|
6
9
|
- [API Design](#api-design)
|
|
@@ -9,8 +9,9 @@ import { toString as toString_1, datetime, list as list_1, guid, object } from "
|
|
|
9
9
|
import { ofArray, map } from "../fable_modules/fable-library.4.1.4/List.js";
|
|
10
10
|
import { Process_decoder, Process_encoder } from "../ISA/ISA.Json/Process.js";
|
|
11
11
|
import { map as map_1, delay, toList } from "../fable_modules/fable-library.4.1.4/Seq.js";
|
|
12
|
-
import {
|
|
12
|
+
import { ArcTables } from "../ISA/ISA/ArcTypes/ArcTables.js";
|
|
13
13
|
import { printf, toFail } from "../fable_modules/fable-library.4.1.4/String.js";
|
|
14
|
+
import { FSharpMap__get_Values } from "../fable_modules/fable-library.4.1.4/Map.js";
|
|
14
15
|
import { defaultArg } from "../fable_modules/fable-library.4.1.4/Option.js";
|
|
15
16
|
|
|
16
17
|
export const Organisation_encode = toString;
|
|
@@ -36,7 +37,10 @@ export const Template_decode = (() => {
|
|
|
36
37
|
const oaDecoder = OntologyAnnotation_decoder(ConverterOptions_$ctor());
|
|
37
38
|
return (path_10) => ((v) => object_1((get$) => {
|
|
38
39
|
let objectArg, arg_3, d, decoder, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6, objectArg_7, objectArg_8, objectArg_9;
|
|
39
|
-
return Template.create((objectArg = get$.Required, objectArg.Field("id", guid_1)), (arg_3 = ((d = ((decoder = Process_decoder(ConverterOptions_$ctor()), (path_1) => ((value_1) => list_2(uncurry2(decoder), path_1, value_1)))), (path_2) => ((value_2) => map_2((ps) =>
|
|
40
|
+
return Template.create((objectArg = get$.Required, objectArg.Field("id", guid_1)), (arg_3 = ((d = ((decoder = Process_decoder(ConverterOptions_$ctor()), (path_1) => ((value_1) => list_2(uncurry2(decoder), path_1, value_1)))), (path_2) => ((value_2) => map_2((ps) => {
|
|
41
|
+
const arctbls = ArcTables.fromProcesses(ps);
|
|
42
|
+
return arctbls.Tables[0];
|
|
43
|
+
}, uncurry2(d), path_2, value_2)))), (objectArg_1 = get$.Required, objectArg_1.Field("table", uncurry2(arg_3)))), (objectArg_2 = get$.Required, objectArg_2.Field("name", string)), (objectArg_3 = get$.Required, objectArg_3.Field("description", string)), (objectArg_4 = get$.Required, objectArg_4.Field("organisation", uncurry2(Organisation_decode))), (objectArg_5 = get$.Required, objectArg_5.Field("version", string)), (objectArg_6 = get$.Required, objectArg_6.Field("authors", (path_6, value_6) => array_1(uncurry2(personDecoder), path_6, value_6))), (objectArg_7 = get$.Required, objectArg_7.Field("endpoint_repositories", (path_7, value_7) => array_1(uncurry2(oaDecoder), path_7, value_7))), (objectArg_8 = get$.Required, objectArg_8.Field("tags", (path_8, value_8) => array_1(uncurry2(oaDecoder), path_8, value_8))), (objectArg_9 = get$.Required, objectArg_9.Field("last_updated", datetimeUtc)));
|
|
40
44
|
}, path_10, v));
|
|
41
45
|
})();
|
|
42
46
|
|
|
@@ -69,7 +73,7 @@ export function Templates_fromJsonString(jsonString) {
|
|
|
69
73
|
return toFail(printf("Error. Given json string cannot be parsed to Templates map: %A"))(matchValue.fields[0]);
|
|
70
74
|
}
|
|
71
75
|
else {
|
|
72
|
-
return matchValue.fields[0];
|
|
76
|
+
return Array.from(FSharpMap__get_Values(matchValue.fields[0]));
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { toString, Record, FSharpException } from "../fable_modules/fable-library.4.1.4/Types.js";
|
|
2
|
+
import { record_type, list_type, string_type, class_type } from "../fable_modules/fable-library.4.1.4/Reflection.js";
|
|
1
3
|
import { toArray as toArray_1, append as append_1, reverse, map, empty, ofArray } from "../fable_modules/fable-library.4.1.4/List.js";
|
|
2
4
|
import { toRows, fromRows, toSparseTable, fromSparseTable } from "../ISA/ISA.Spreadsheet/Metadata/OntologyAnnotation.js";
|
|
3
|
-
import { toString, Record } from "../fable_modules/fable-library.4.1.4/Types.js";
|
|
4
|
-
import { record_type, list_type, string_type } from "../fable_modules/fable-library.4.1.4/Reflection.js";
|
|
5
5
|
import { Comment$_$reflection } from "../ISA/ISA/JsonTypes/Comment.js";
|
|
6
6
|
import { Comment_fromString } from "../ISA/ISA.Spreadsheet/Metadata/Comment.js";
|
|
7
7
|
import { SparseRowModule_fromFsRow, SparseRowModule_writeToSheet, SparseRowModule_fromValues, SparseRowModule_tryGetValueAt, SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValueDefault_5BAE6133 } from "../ISA/ISA.Spreadsheet/Metadata/SparseTable.js";
|
|
@@ -15,11 +15,21 @@ import { toArray } from "../fable_modules/fable-library.4.1.4/Option.js";
|
|
|
15
15
|
import { toRows as toRows_1, fromRows as fromRows_1 } from "../ISA/ISA.Spreadsheet/Metadata/Contacts.js";
|
|
16
16
|
import { parse } from "../fable_modules/fable-library.4.1.4/Guid.js";
|
|
17
17
|
import { Template, Organisation } from "./Template.js";
|
|
18
|
-
import { FsWorksheet } from "../fable_modules/FsSpreadsheet.
|
|
19
|
-
import { printf, toFail } from "../fable_modules/fable-library.4.1.4/String.js";
|
|
18
|
+
import { FsWorksheet } from "../fable_modules/FsSpreadsheet.5.0.0/FsWorksheet.fs.js";
|
|
20
19
|
import { toFsWorksheet, tryFromFsWorksheet } from "../ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js";
|
|
21
20
|
import { now } from "../fable_modules/fable-library.4.1.4/Date.js";
|
|
22
|
-
import { FsWorkbook } from "../fable_modules/FsSpreadsheet.
|
|
21
|
+
import { FsWorkbook } from "../fable_modules/FsSpreadsheet.5.0.0/FsWorkbook.fs.js";
|
|
22
|
+
|
|
23
|
+
export class TemplateReadError extends FSharpException {
|
|
24
|
+
constructor(Data0) {
|
|
25
|
+
super();
|
|
26
|
+
this.Data0 = Data0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function TemplateReadError_$reflection() {
|
|
31
|
+
return class_type("ARCtrl.Template.Spreadsheet.TemplateReadError", void 0, TemplateReadError, class_type("System.Exception"));
|
|
32
|
+
}
|
|
23
33
|
|
|
24
34
|
export const Metadata_ER_labels = ofArray(["ER", "ER Term Accession Number", "ER Term Source REF"]);
|
|
25
35
|
|
|
@@ -275,7 +285,7 @@ export function Template_fromMetadataSheet(sheet) {
|
|
|
275
285
|
* Reads an assay from a spreadsheet
|
|
276
286
|
*/
|
|
277
287
|
export function Template_fromFsWorkbook(doc) {
|
|
278
|
-
let matchValue_2, matchValue_4, ws_3, matchValue_5,
|
|
288
|
+
let matchValue_2, matchValue_4, ws_3, matchValue_5, ws_2, matchValue_3;
|
|
279
289
|
let patternInput;
|
|
280
290
|
const matchValue = doc.TryGetWorksheetByName("isa_template");
|
|
281
291
|
if (matchValue == null) {
|
|
@@ -301,7 +311,13 @@ export function Template_fromFsWorkbook(doc) {
|
|
|
301
311
|
else {
|
|
302
312
|
return void 0;
|
|
303
313
|
}
|
|
304
|
-
}, sheets), (matchValue_4 == null) ?
|
|
314
|
+
}, sheets), (matchValue_4 == null) ? (() => {
|
|
315
|
+
throw new TemplateReadError(`No worksheet or table with name \`${templateInfo.Table}\` found`);
|
|
316
|
+
})() : ((ws_3 = matchValue_4, (matchValue_5 = tryFromFsWorksheet(ws_3), (matchValue_5 == null) ? (() => {
|
|
317
|
+
throw new TemplateReadError(`Ws with name \`${ws_3.Name}\` could not be converted to a table`);
|
|
318
|
+
})() : matchValue_5))))) : ((ws_2 = matchValue_2, (matchValue_3 = tryFromFsWorksheet(ws_2), (matchValue_3 == null) ? (() => {
|
|
319
|
+
throw new TemplateReadError(`Ws with name \`${ws_2.Name}\` could not be converted to a table`);
|
|
320
|
+
})() : matchValue_3)))), now());
|
|
305
321
|
}
|
|
306
322
|
|
|
307
323
|
export function Template_toFsWorkbook(template) {
|
|
@@ -17,7 +17,7 @@ export class JsWeb {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
}
|
|
19
19
|
static getTemplates(url) {
|
|
20
|
-
return startAsPromise(singleton.Delay(() => singleton.Bind(getTemplates(url), (_arg) => singleton.Return(
|
|
20
|
+
return startAsPromise(singleton.Delay(() => singleton.Bind(getTemplates(url), (_arg) => singleton.Return(_arg))));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defaultArg } from "../fable_modules/fable-library.4.1.4/Option.js";
|
|
2
|
+
import { append, addRangeInPlace, collect, contains as contains_1 } from "../fable_modules/fable-library.4.1.4/Array.js";
|
|
3
|
+
import { uncurry2, safeHash, equals } from "../fable_modules/fable-library.4.1.4/Util.js";
|
|
4
|
+
import { Array_distinct } from "../fable_modules/fable-library.4.1.4/Seq2.js";
|
|
5
|
+
import { class_type } from "../fable_modules/fable-library.4.1.4/Reflection.js";
|
|
6
|
+
|
|
7
|
+
export function TemplatesAux_getComparer(matchAll) {
|
|
8
|
+
if (defaultArg(matchAll, false)) {
|
|
9
|
+
return (e) => ((e_1) => (e && e_1));
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return (e_2) => ((e_3) => (e_2 || e_3));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function TemplatesAux_filterOnTags(tagGetter, queryTags, comparer, templates) {
|
|
17
|
+
return templates.filter((t) => {
|
|
18
|
+
const templateTags = tagGetter(t);
|
|
19
|
+
let isValid = void 0;
|
|
20
|
+
for (let idx = 0; idx <= (queryTags.length - 1); idx++) {
|
|
21
|
+
const contains = contains_1(queryTags[idx], templateTags, {
|
|
22
|
+
Equals: equals,
|
|
23
|
+
GetHashCode: safeHash,
|
|
24
|
+
});
|
|
25
|
+
const isValid_1 = isValid;
|
|
26
|
+
if (isValid_1 != null) {
|
|
27
|
+
const maybe = isValid_1;
|
|
28
|
+
isValid = comparer(maybe, contains);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
isValid = contains;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return defaultArg(isValid, false);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class Templates {
|
|
39
|
+
constructor() {
|
|
40
|
+
}
|
|
41
|
+
static getDistinctTags(templates) {
|
|
42
|
+
return Array_distinct(collect((t) => t.Tags, templates), {
|
|
43
|
+
Equals: equals,
|
|
44
|
+
GetHashCode: safeHash,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
static getDistinctEndpointRepositories(templates) {
|
|
48
|
+
return Array_distinct(collect((t) => t.EndpointRepositories, templates), {
|
|
49
|
+
Equals: equals,
|
|
50
|
+
GetHashCode: safeHash,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
static getDistinctOntologyAnnotations(templates) {
|
|
54
|
+
const oas = [];
|
|
55
|
+
for (let idx = 0; idx <= (templates.length - 1); idx++) {
|
|
56
|
+
const t = templates[idx];
|
|
57
|
+
addRangeInPlace(t.Tags, oas);
|
|
58
|
+
addRangeInPlace(t.EndpointRepositories, oas);
|
|
59
|
+
}
|
|
60
|
+
return Array_distinct(Array.from(oas), {
|
|
61
|
+
Equals: equals,
|
|
62
|
+
GetHashCode: safeHash,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
static filterByTags(queryTags, matchAll) {
|
|
66
|
+
return (templates) => TemplatesAux_filterOnTags((t) => t.Tags, queryTags, uncurry2(TemplatesAux_getComparer(matchAll)), templates);
|
|
67
|
+
}
|
|
68
|
+
static filterByEndpointRepositories(queryTags, matchAll) {
|
|
69
|
+
return (templates) => TemplatesAux_filterOnTags((t) => t.EndpointRepositories, queryTags, uncurry2(TemplatesAux_getComparer(matchAll)), templates);
|
|
70
|
+
}
|
|
71
|
+
static filterByOntologyAnnotation(queryTags, matchAll) {
|
|
72
|
+
return (templates) => TemplatesAux_filterOnTags((t) => append(t.Tags, t.EndpointRepositories), queryTags, uncurry2(TemplatesAux_getComparer(matchAll)), templates);
|
|
73
|
+
}
|
|
74
|
+
static filterByDataPLANT(templates) {
|
|
75
|
+
return templates.filter((t) => t.Organisation.IsOfficial());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function Templates_$reflection() {
|
|
80
|
+
return class_type("ARCtrl.Template.Templates", void 0, Templates);
|
|
81
|
+
}
|
|
82
|
+
|
|
@@ -4,6 +4,15 @@ open System
|
|
|
4
4
|
|
|
5
5
|
open Fable.Core
|
|
6
6
|
|
|
7
|
+
//type Hyperlink = {
|
|
8
|
+
// Text: string
|
|
9
|
+
// Hyperlink: string
|
|
10
|
+
//} with
|
|
11
|
+
// static member create(text, hyperlink) = {
|
|
12
|
+
// Text = text
|
|
13
|
+
// Hyperlink = hyperlink
|
|
14
|
+
// }
|
|
15
|
+
|
|
7
16
|
/// <summary>
|
|
8
17
|
/// Possible DataTypes used in a FsCell.
|
|
9
18
|
/// </summary>
|
|
@@ -12,6 +21,7 @@ type DataType =
|
|
|
12
21
|
| Boolean
|
|
13
22
|
| Number
|
|
14
23
|
| Date
|
|
24
|
+
//| Hyperlink
|
|
15
25
|
| Empty
|
|
16
26
|
|
|
17
27
|
/// <summary>
|
|
@@ -20,34 +30,40 @@ type DataType =
|
|
|
20
30
|
static member inline InferCellValue (value : 'T) =
|
|
21
31
|
let value = box value
|
|
22
32
|
match value with
|
|
23
|
-
|
|
24
|
-
| :?
|
|
25
|
-
| :? bool as
|
|
26
|
-
| :?
|
|
27
|
-
| :?
|
|
28
|
-
| :?
|
|
29
|
-
| :?
|
|
30
|
-
| :?
|
|
31
|
-
| :?
|
|
32
|
-
| :?
|
|
33
|
-
| :?
|
|
34
|
-
| :?
|
|
35
|
-
| :?
|
|
36
|
-
| :?
|
|
37
|
-
| :?
|
|
38
|
-
| :?
|
|
39
|
-
|
|
|
33
|
+
//| :? Hyperlink as hpl -> DataType.Hyperlink, value
|
|
34
|
+
| :? char as c -> DataType.String, value
|
|
35
|
+
| :? bool as true -> DataType.Boolean, true
|
|
36
|
+
| :? bool as false -> DataType.Boolean, false
|
|
37
|
+
| :? byte as i -> DataType.Number, value
|
|
38
|
+
| :? sbyte as i -> DataType.Number, value
|
|
39
|
+
| :? int as i -> DataType.Number, value
|
|
40
|
+
| :? int16 as i -> DataType.Number, value
|
|
41
|
+
| :? int64 as i -> DataType.Number, value
|
|
42
|
+
| :? uint as i -> DataType.Number, value
|
|
43
|
+
| :? uint16 as i -> DataType.Number,value
|
|
44
|
+
| :? uint64 as i -> DataType.Number,value
|
|
45
|
+
| :? single as i -> DataType.Number,value
|
|
46
|
+
| :? float as i -> DataType.Number,value
|
|
47
|
+
| :? decimal as i -> DataType.Number,value
|
|
48
|
+
| :? System.DateTime as d -> DataType.Date,value
|
|
49
|
+
| :? string as s -> DataType.String,value
|
|
50
|
+
| _ -> DataType.String,value
|
|
40
51
|
|
|
41
52
|
// Type based on the type XLCell used in ClosedXml
|
|
42
53
|
/// <summary>
|
|
43
54
|
/// Creates an FsCell of `DataType` dataType, with value of type `string`, and `FsAddress` address.
|
|
44
55
|
/// </summary>
|
|
45
56
|
|
|
57
|
+
module FsCellAux =
|
|
58
|
+
|
|
59
|
+
let boolConverter (bool:bool) =
|
|
60
|
+
match bool with | true -> "1" | false -> "0"
|
|
61
|
+
|
|
46
62
|
[<AttachMembers>]
|
|
47
|
-
type FsCell (value :
|
|
63
|
+
type FsCell (value : obj, ?dataType : DataType, ?address : FsAddress) =
|
|
48
64
|
|
|
49
65
|
// TODO: Maybe save as IConvertible
|
|
50
|
-
let mutable _cellValue =
|
|
66
|
+
let mutable _cellValue : obj = value
|
|
51
67
|
let mutable _dataType = dataType |> Option.defaultValue DataType.String
|
|
52
68
|
let mutable _comment = ""
|
|
53
69
|
let mutable _hyperlink = ""
|
|
@@ -58,9 +74,9 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
58
74
|
let mutable _rowIndex : int = address |> Option.map (fun a -> a.RowNumber) |> Option.defaultValue 0
|
|
59
75
|
let mutable _columnIndex : int = address |> Option.map (fun a -> a.ColumnNumber) |> Option.defaultValue 0
|
|
60
76
|
|
|
61
|
-
|
|
77
|
+
new(value: IConvertible, ?dataType : DataType, ?address : FsAddress) = FsCell(box value, ?dataType = dataType, ?address = address)
|
|
62
78
|
/// Creates an empty FsCell, set at row 0, column 0 (1-based).
|
|
63
|
-
static member empty () = FsCell ("", DataType.Empty, FsAddress(0,0))
|
|
79
|
+
static member inline empty () = FsCell ("", DataType.Empty, FsAddress(0,0))
|
|
64
80
|
|
|
65
81
|
///// Creates an FsCell of `DataType` `Number`, with the given value, set at row 1, column 1 (1-based).
|
|
66
82
|
//new (value : int) = FsCell (string value, DataType.Number, FsAddress(0,0))
|
|
@@ -158,8 +174,8 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
158
174
|
/// <summary>
|
|
159
175
|
/// Creates an FsCell with the given DataType, rowNumber, colNumber, and value.
|
|
160
176
|
/// </summary>
|
|
161
|
-
static member createWithDataType (dataType : DataType) (rowNumber : int) (colNumber : int) value =
|
|
162
|
-
|
|
177
|
+
static member createWithDataType (dataType : DataType) (rowNumber : int) (colNumber : int) (value: obj) =
|
|
178
|
+
FsCell(value, dataType, FsAddress(rowNumber, colNumber))
|
|
163
179
|
|
|
164
180
|
//how 2:
|
|
165
181
|
//return (format.ToUpper()) switch
|
|
@@ -222,8 +238,17 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
222
238
|
/// <summary>
|
|
223
239
|
/// Gets the value as string
|
|
224
240
|
/// </summary>
|
|
225
|
-
member self.ValueAsString() =
|
|
226
|
-
self.Value
|
|
241
|
+
member self.ValueAsString() : string =
|
|
242
|
+
let v = self.Value
|
|
243
|
+
match self.DataType with
|
|
244
|
+
| DataType.String | DataType.Date | DataType.Boolean | DataType.Empty ->
|
|
245
|
+
v.ToString()
|
|
246
|
+
| Number ->
|
|
247
|
+
// Example: 4.123:
|
|
248
|
+
// - (4.123)ToString() will parse floats in germany to "4,123" which is not allowed by Excel.
|
|
249
|
+
// - string(4.123) will parse floats in germany to "4.123" which is allowed by Excel.
|
|
250
|
+
// TODO: Maybe swap to (90.213).ToString(new Globalization.CultureInfo("en-US") ) // val it: string = "90.213"
|
|
251
|
+
string v
|
|
227
252
|
|
|
228
253
|
/// <summary>
|
|
229
254
|
/// Gets the value as string
|
|
@@ -235,7 +260,10 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
235
260
|
/// Gets the value as bool
|
|
236
261
|
/// </summary>
|
|
237
262
|
member self.ValueAsBool() =
|
|
238
|
-
|
|
263
|
+
match (string self.Value).ToLower() with
|
|
264
|
+
| "1" | "true" | "true()" -> true
|
|
265
|
+
| "0" | "false" | "false()" -> false
|
|
266
|
+
| anyElse -> raise (System.FormatException($"String '{anyElse}' was not recognized as a valid Boolean"))
|
|
239
267
|
|
|
240
268
|
/// <summary>
|
|
241
269
|
/// Gets the value as bool
|
|
@@ -247,7 +275,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
247
275
|
/// Gets the value as float
|
|
248
276
|
/// </summary>
|
|
249
277
|
member self.ValueAsFloat() =
|
|
250
|
-
Double.Parse (self.Value)
|
|
278
|
+
Double.Parse (string self.Value)
|
|
251
279
|
|
|
252
280
|
/// <summary>
|
|
253
281
|
/// Gets the value as float
|
|
@@ -259,7 +287,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
259
287
|
/// Gets the value as int
|
|
260
288
|
/// </summary>
|
|
261
289
|
member self.ValueAsInt() =
|
|
262
|
-
Int32.Parse (self.Value)
|
|
290
|
+
Int32.Parse (string self.Value)
|
|
263
291
|
|
|
264
292
|
/// <summary>
|
|
265
293
|
/// Gets the value as int
|
|
@@ -271,7 +299,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
271
299
|
/// Gets the value as uint
|
|
272
300
|
/// </summary>
|
|
273
301
|
member self.ValueAsUInt() =
|
|
274
|
-
UInt32.Parse (self.Value)
|
|
302
|
+
UInt32.Parse (string self.Value)
|
|
275
303
|
|
|
276
304
|
/// <summary>
|
|
277
305
|
/// Gets the value as uint
|
|
@@ -283,7 +311,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
283
311
|
/// Gets the value as long
|
|
284
312
|
/// </summary>
|
|
285
313
|
member self.ValueAsLong() =
|
|
286
|
-
Int64.Parse (self.Value)
|
|
314
|
+
Int64.Parse (string self.Value)
|
|
287
315
|
|
|
288
316
|
/// <summary>
|
|
289
317
|
/// Gets the value as long
|
|
@@ -295,7 +323,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
295
323
|
/// Gets the value as ulong
|
|
296
324
|
/// </summary>
|
|
297
325
|
member self.ValueAsULong() =
|
|
298
|
-
UInt64.Parse (self.Value)
|
|
326
|
+
UInt64.Parse (string self.Value)
|
|
299
327
|
|
|
300
328
|
/// <summary>
|
|
301
329
|
/// Gets the value as ulong
|
|
@@ -307,7 +335,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
307
335
|
/// Gets the value as double
|
|
308
336
|
/// </summary>
|
|
309
337
|
member self.ValueAsDouble() =
|
|
310
|
-
Double.Parse (self.Value)
|
|
338
|
+
Double.Parse (string self.Value)
|
|
311
339
|
|
|
312
340
|
/// <summary>
|
|
313
341
|
/// Gets the value as double
|
|
@@ -319,7 +347,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
319
347
|
/// Gets the value as decimal
|
|
320
348
|
/// </summary>
|
|
321
349
|
member self.ValueAsDecimal() =
|
|
322
|
-
Decimal.Parse (self.Value)
|
|
350
|
+
Decimal.Parse (string self.Value)
|
|
323
351
|
|
|
324
352
|
/// <summary>
|
|
325
353
|
/// Gets the value as decimal
|
|
@@ -331,7 +359,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
331
359
|
/// Gets the value as DateTime
|
|
332
360
|
/// </summary>
|
|
333
361
|
member self.ValueAsDateTime() =
|
|
334
|
-
DateTime.Parse (self.Value)
|
|
362
|
+
DateTime.Parse (string self.Value)
|
|
335
363
|
|
|
336
364
|
/// <summary>
|
|
337
365
|
/// Gets the value as DateTime
|
|
@@ -343,7 +371,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
343
371
|
/// Gets the value as Guid
|
|
344
372
|
/// </summary>
|
|
345
373
|
member self.ValueAsGuid() =
|
|
346
|
-
Guid.Parse (self.Value)
|
|
374
|
+
Guid.Parse (string self.Value)
|
|
347
375
|
|
|
348
376
|
/// <summary>
|
|
349
377
|
/// Gets the value as Guid
|
|
@@ -355,7 +383,7 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
355
383
|
/// Gets the value as char
|
|
356
384
|
/// </summary>
|
|
357
385
|
member self.ValueAsChar() =
|
|
358
|
-
Char.Parse (self.Value)
|
|
386
|
+
Char.Parse (string self.Value)
|
|
359
387
|
|
|
360
388
|
/// <summary>
|
|
361
389
|
/// Gets the value as char
|
|
@@ -385,3 +413,24 @@ type FsCell (value : IConvertible, ?dataType : DataType, ?address : FsAddress) =
|
|
|
385
413
|
static member setValueAs<'T> value (cell : FsCell)=
|
|
386
414
|
cell.SetValueAs<'T>(value)
|
|
387
415
|
cell
|
|
416
|
+
|
|
417
|
+
member this.StructurallyEquals (other: FsCell) =
|
|
418
|
+
let r =
|
|
419
|
+
[|
|
|
420
|
+
this.Value = other.Value
|
|
421
|
+
this.DataType = other.DataType
|
|
422
|
+
[|
|
|
423
|
+
this.Address.Address = other.Address.Address
|
|
424
|
+
this.Address.ColumnNumber = other.Address.ColumnNumber
|
|
425
|
+
this.Address.RowNumber = other.Address.RowNumber
|
|
426
|
+
this.Address.FixedColumn = other.Address.FixedColumn
|
|
427
|
+
this.Address.FixedRow = other.Address.FixedRow
|
|
428
|
+
|]
|
|
429
|
+
|> Seq.forall (fun x -> x=true)
|
|
430
|
+
this.ColumnNumber = other.ColumnNumber
|
|
431
|
+
this.RowNumber = other.RowNumber
|
|
432
|
+
|]
|
|
433
|
+
|> Seq.forall (fun x -> x=true)
|
|
434
|
+
r
|
|
435
|
+
|
|
436
|
+
|