@nfdi4plants/arctrl 2.0.0-alpha.3 → 2.0.0-alpha.5

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.
Files changed (122) hide show
  1. package/ARC.js +178 -21
  2. package/Contract/ARC.js +9 -1
  3. package/Contract/Contract.js +3 -0
  4. package/Contract/Datamap.js +180 -0
  5. package/Contract/Git.js +3 -0
  6. package/Core/ArcTypes.js +189 -120
  7. package/Core/Conversion.js +177 -106
  8. package/Core/Data.js +119 -0
  9. package/Core/{Process/DataFile.js → DataFile.js} +3 -3
  10. package/Core/Helper/Identifier.js +40 -0
  11. package/Core/Helper/Regex.js +13 -0
  12. package/Core/OntologyAnnotation.js +28 -6
  13. package/Core/Process/ColumnIndex.js +13 -3
  14. package/Core/Process/ProcessInput.js +5 -5
  15. package/Core/Process/ProcessOutput.js +5 -5
  16. package/Core/Process/Value.js +1 -1
  17. package/Core/Table/ArcTable.js +24 -2
  18. package/Core/Table/ArcTableAux.js +56 -5
  19. package/Core/Table/ArcTables.js +1 -1
  20. package/Core/Table/CompositeCell.js +67 -10
  21. package/Core/Table/CompositeColumn.js +9 -0
  22. package/Core/Table/CompositeHeader.js +108 -94
  23. package/Core/Table/DataMap.js +166 -0
  24. package/FileSystem/DefaultGitattributes.js +3 -0
  25. package/FileSystem/FileSystemTree.js +18 -4
  26. package/Json/Assay.js +4 -4
  27. package/Json/Process/Data.js +56 -18
  28. package/Json/Process/DataFile.js +5 -5
  29. package/Json/Process/PropertyValue.js +124 -4
  30. package/Json/Study.js +4 -4
  31. package/Json/Table/CompositeCell.js +7 -6
  32. package/Json/Table/CompositeHeader.js +4 -3
  33. package/Spreadsheet/AnnotationTable/ArcTable.js +10 -13
  34. package/Spreadsheet/AnnotationTable/CompositeCell.js +32 -50
  35. package/Spreadsheet/AnnotationTable/CompositeColumn.js +16 -10
  36. package/Spreadsheet/AnnotationTable/CompositeHeader.js +290 -135
  37. package/Spreadsheet/ArcAssay.js +2 -2
  38. package/Spreadsheet/ArcInvestigation.js +2 -2
  39. package/Spreadsheet/ArcStudy.js +2 -2
  40. package/Spreadsheet/DataMap.js +31 -0
  41. package/Spreadsheet/DataMapTable/DataMapColumn.js +36 -0
  42. package/Spreadsheet/DataMapTable/DataMapHeader.js +417 -0
  43. package/Spreadsheet/DataMapTable/DataMapTable.js +98 -0
  44. package/Spreadsheet/Metadata/Assays.js +2 -2
  45. package/Spreadsheet/Metadata/SparseTable.js +7 -7
  46. package/Spreadsheet/Metadata/Study.js +1 -1
  47. package/Spreadsheet/Template.js +2 -2
  48. package/Xlsx.js +29 -6
  49. package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsSpreadsheet.fableproj +9 -3
  50. package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsWorksheet.fs +1 -0
  51. package/fable_modules/FsSpreadsheet.6.1.2/Json/Cell.fs +23 -0
  52. package/fable_modules/FsSpreadsheet.6.1.2/Json/Cell.fs.js +21 -0
  53. package/fable_modules/FsSpreadsheet.6.1.2/Json/Row.fs +23 -0
  54. package/fable_modules/FsSpreadsheet.6.1.2/Json/Row.fs.js +19 -0
  55. package/fable_modules/FsSpreadsheet.6.1.2/Json/Table.fs +24 -0
  56. package/fable_modules/FsSpreadsheet.6.1.2/Json/Table.fs.js +15 -0
  57. package/fable_modules/FsSpreadsheet.6.1.2/Json/Value.fs +70 -0
  58. package/fable_modules/FsSpreadsheet.6.1.2/Json/Value.fs.js +48 -0
  59. package/fable_modules/FsSpreadsheet.6.1.2/Json/Workbook.fs +20 -0
  60. package/fable_modules/FsSpreadsheet.6.1.2/Json/Workbook.fs.js +21 -0
  61. package/fable_modules/FsSpreadsheet.6.1.2/Json/Worksheet.fs +49 -0
  62. package/fable_modules/FsSpreadsheet.6.1.2/Json/Worksheet.fs.js +44 -0
  63. package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +3 -3
  64. package/fable_modules/project_cracked.json +1 -1
  65. package/package.json +1 -1
  66. package/Core/Process/Data.js +0 -55
  67. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Cells/FsCell.fs +0 -0
  68. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Cells/FsCell.fs.js +0 -0
  69. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Cells/FsCellsCollection.fs +0 -0
  70. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Cells/FsCellsCollection.fs.js +0 -0
  71. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/CellBuilder.fs +0 -0
  72. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/CellBuilder.fs.js +0 -0
  73. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/ColumnBuilder.fs +0 -0
  74. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/ColumnBuilder.fs.js +0 -0
  75. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/DSL.fs +0 -0
  76. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/DSL.fs.js +0 -0
  77. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Expression.fs +0 -0
  78. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Expression.fs.js +0 -0
  79. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Operators.fs +0 -0
  80. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Operators.fs.js +0 -0
  81. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/RowBuilder.fs +0 -0
  82. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/RowBuilder.fs.js +0 -0
  83. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/SheetBuilder.fs +0 -0
  84. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/SheetBuilder.fs.js +0 -0
  85. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/TableBuilder.fs +0 -0
  86. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/TableBuilder.fs.js +0 -0
  87. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Transform.fs +0 -0
  88. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Transform.fs.js +0 -0
  89. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Types.fs +0 -0
  90. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/Types.fs.js +0 -0
  91. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/WorkbookBuilder.fs +0 -0
  92. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/DSL/WorkbookBuilder.fs.js +0 -0
  93. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsAddress.fs +0 -0
  94. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsAddress.fs.js +0 -0
  95. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsColumn.fs +0 -0
  96. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsColumn.fs.js +0 -0
  97. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsRow.fs +0 -0
  98. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsRow.fs.js +0 -0
  99. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsWorkbook.fs +0 -0
  100. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsWorkbook.fs.js +0 -0
  101. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/FsWorksheet.fs.js +0 -0
  102. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRange.fs +0 -0
  103. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRange.fs.js +0 -0
  104. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeAddress.fs +0 -0
  105. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeAddress.fs.js +0 -0
  106. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeBase.fs +0 -0
  107. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeBase.fs.js +0 -0
  108. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeColumn.fs +0 -0
  109. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeColumn.fs.js +0 -0
  110. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeRow.fs +0 -0
  111. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Ranges/FsRangeRow.fs.js +0 -0
  112. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/SheetBuilder.fs +0 -0
  113. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/SheetBuilder.fs.js +0 -0
  114. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Tables/FsTable.fs +0 -0
  115. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Tables/FsTable.fs.js +0 -0
  116. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Tables/FsTableField.fs +0 -0
  117. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Tables/FsTableField.fs.js +0 -0
  118. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Tables/FsTableRow.fs +0 -0
  119. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/Tables/FsTableRow.fs.js +0 -0
  120. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  121. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +0 -0
  122. /package/fable_modules/{FsSpreadsheet.5.1.3 → FsSpreadsheet.6.1.2}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
package/Core/Data.js ADDED
@@ -0,0 +1,119 @@
1
+ import { defaultArg, unwrap } from "../fable_modules/fable-library-js.4.16.0/Option.js";
2
+ import { ResizeArray_map } from "./Helper/Collections.js";
3
+ import { hash, boxHashSeq, boxHashOption, boxHashArray } from "./Helper/HashCodes.js";
4
+ import { toString } from "../fable_modules/fable-library-js.4.16.0/Types.js";
5
+ import { printf, toText } from "../fable_modules/fable-library-js.4.16.0/String.js";
6
+ import { DataFile__get_AsString } from "./DataFile.js";
7
+ import { class_type } from "../fable_modules/fable-library-js.4.16.0/Reflection.js";
8
+
9
+ export class Data {
10
+ constructor(id, name, dataType, format, selectorFormat, comments) {
11
+ this._id = id;
12
+ this._name = name;
13
+ this._dataType = dataType;
14
+ this._format = format;
15
+ this._selectorFormat = selectorFormat;
16
+ this._comments = defaultArg(comments, []);
17
+ }
18
+ get ID() {
19
+ const this$ = this;
20
+ return unwrap(this$._id);
21
+ }
22
+ set ID(id) {
23
+ const this$ = this;
24
+ this$._id = id;
25
+ }
26
+ get Name() {
27
+ const this$ = this;
28
+ return unwrap(this$._name);
29
+ }
30
+ set Name(name) {
31
+ const this$ = this;
32
+ this$._name = name;
33
+ }
34
+ get DataType() {
35
+ const this$ = this;
36
+ return unwrap(this$._dataType);
37
+ }
38
+ set DataType(dataType) {
39
+ const this$ = this;
40
+ this$._dataType = dataType;
41
+ }
42
+ get Format() {
43
+ const this$ = this;
44
+ return unwrap(this$._format);
45
+ }
46
+ set Format(format) {
47
+ const this$ = this;
48
+ this$._format = format;
49
+ }
50
+ get SelectorFormat() {
51
+ const this$ = this;
52
+ return unwrap(this$._selectorFormat);
53
+ }
54
+ set SelectorFormat(selectorFormat) {
55
+ const this$ = this;
56
+ this$._selectorFormat = selectorFormat;
57
+ }
58
+ get Comments() {
59
+ const this$ = this;
60
+ return this$._comments;
61
+ }
62
+ set Comments(comments) {
63
+ const this$ = this;
64
+ this$._comments = comments;
65
+ }
66
+ static make(id, name, dataType, format, selectorFormat, comments) {
67
+ return new Data(unwrap(id), unwrap(name), unwrap(dataType), unwrap(format), unwrap(selectorFormat), unwrap(comments));
68
+ }
69
+ static create(Id, Name, DataType, Format, SelectorFormat, Comments) {
70
+ return Data.make(Id, Name, DataType, Format, SelectorFormat, Comments);
71
+ }
72
+ static get empty() {
73
+ return Data.create();
74
+ }
75
+ get NameText() {
76
+ const this$ = this;
77
+ return defaultArg(this$.Name, "");
78
+ }
79
+ Copy() {
80
+ const this$ = this;
81
+ const nextComments = ResizeArray_map((c) => c.Copy(), this$.Comments);
82
+ return new Data(unwrap(this$.ID), unwrap(this$.Name), unwrap(this$.DataType), unwrap(this$.Format), unwrap(this$.SelectorFormat), nextComments);
83
+ }
84
+ GetHashCode() {
85
+ const this$ = this;
86
+ return boxHashArray([boxHashOption(this$.ID), boxHashOption(this$.Name), boxHashOption(this$.DataType), boxHashOption(this$.Format), boxHashOption(this$.SelectorFormat), boxHashSeq(this$.Comments)]) | 0;
87
+ }
88
+ Equals(obj) {
89
+ const this$ = this;
90
+ return hash(this$) === hash(obj);
91
+ }
92
+ Print() {
93
+ const this$ = this;
94
+ return toString(this$);
95
+ }
96
+ PrintCompact() {
97
+ const this$ = this;
98
+ const matchValue = this$.DataType;
99
+ if (matchValue == null) {
100
+ const arg_2 = this$.NameText;
101
+ return toText(printf("%s"))(arg_2);
102
+ }
103
+ else {
104
+ const t = matchValue;
105
+ const arg = this$.NameText;
106
+ const arg_1 = DataFile__get_AsString(t);
107
+ return toText(printf("%s [%s]"))(arg)(arg_1);
108
+ }
109
+ }
110
+ }
111
+
112
+ export function Data_$reflection() {
113
+ return class_type("ARCtrl.Data", void 0, Data);
114
+ }
115
+
116
+ export function Data_$ctor_5909441C(id, name, dataType, format, selectorFormat, comments) {
117
+ return new Data(id, name, dataType, format, selectorFormat, comments);
118
+ }
119
+
@@ -1,5 +1,5 @@
1
- import { Union } from "../../fable_modules/fable-library-js.4.16.0/Types.js";
2
- import { union_type } from "../../fable_modules/fable-library-js.4.16.0/Reflection.js";
1
+ import { Union } from "../fable_modules/fable-library-js.4.16.0/Types.js";
2
+ import { union_type } from "../fable_modules/fable-library-js.4.16.0/Reflection.js";
3
3
 
4
4
  export class DataFile extends Union {
5
5
  constructor(tag, fields) {
@@ -13,7 +13,7 @@ export class DataFile extends Union {
13
13
  }
14
14
 
15
15
  export function DataFile_$reflection() {
16
- return union_type("ARCtrl.Process.DataFile", [], DataFile, () => [[], [], []]);
16
+ return union_type("ARCtrl.DataFile", [], DataFile, () => [[], [], []]);
17
17
  }
18
18
 
19
19
  export function DataFile_get_RawDataFileJson() {
@@ -89,6 +89,26 @@ export function Assay_tryFileNameFromIdentifier(identifier) {
89
89
  }
90
90
  }
91
91
 
92
+ /**
93
+ * On writing a xlsx file we unify our output to a relative path to ARC root. So: `assays/assayIdentifier/isa.datamap.xlsx`.
94
+ */
95
+ export function Assay_datamapFileNameFromIdentifier(identifier) {
96
+ checkValidCharacters(identifier);
97
+ return combineMany(["assays", identifier, "isa.datamap.xlsx"]);
98
+ }
99
+
100
+ /**
101
+ * On writing a xlsx file we unify our output to a relative path to ARC root. So: `assays/assayIdentifier/isa.datamap.xlsx`.
102
+ */
103
+ export function Assay_tryDatamapFileNameFromIdentifier(identifier) {
104
+ if (tryCheckValidCharacters(identifier)) {
105
+ return combineMany(["assays", identifier, "isa.datamap.xlsx"]);
106
+ }
107
+ else {
108
+ return void 0;
109
+ }
110
+ }
111
+
92
112
  /**
93
113
  * On read-in the FileName can be any combination of "studies" (study folder name), studyIdentifier and "isa.study.xlsx" (the actual file name).
94
114
  *
@@ -141,3 +161,23 @@ export function Study_tryFileNameFromIdentifier(identifier) {
141
161
  }
142
162
  }
143
163
 
164
+ /**
165
+ * On writing a xlsx file we unify our output to a relative path to ARC root. So: `studies/studyIdentifier/isa.investigation.xlsx`.
166
+ */
167
+ export function Study_datamapFileNameFromIdentifier(identifier) {
168
+ checkValidCharacters(identifier);
169
+ return combineMany(["studies", identifier, "isa.datamap.xlsx"]);
170
+ }
171
+
172
+ /**
173
+ * On writing a xlsx file we unify our output to a relative path to ARC root. So: `studies/studyIdentifier/isa.investigation.xlsx`.
174
+ */
175
+ export function Study_tryDatamapFileNameFromIdentifier(identifier) {
176
+ if (tryCheckValidCharacters(identifier)) {
177
+ return combineMany(["studies", identifier, "isa.datamap.xlsx"]);
178
+ }
179
+ else {
180
+ return void 0;
181
+ }
182
+ }
183
+
@@ -20,6 +20,8 @@ export const Pattern_InputPattern = `Input\\s\\[(?<${"iotype"}>.+)\\]`;
20
20
 
21
21
  export const Pattern_OutputPattern = `Output\\s\\[(?<${"iotype"}>.+)\\]`;
22
22
 
23
+ export const Pattern_CommentPattern = `Comment\\s\\[(?<${"commentKey"}>.+)\\]`;
24
+
23
25
  /**
24
26
  * Matches, if the input string matches the given regex pattern.
25
27
  */
@@ -324,6 +326,17 @@ export function ActivePatterns_$007CAutoGeneratedTableName$007C_$007C(input) {
324
326
  }
325
327
  }
326
328
 
329
+ export function ActivePatterns_$007CComment$007C_$007C(input) {
330
+ const activePatternResult = ActivePatterns_$007CRegex$007C_$007C(Pattern_CommentPattern, input);
331
+ if (activePatternResult != null) {
332
+ const r = activePatternResult;
333
+ return (r.groups && r.groups.commentKey) || "";
334
+ }
335
+ else {
336
+ return void 0;
337
+ }
338
+ }
339
+
327
340
  export function tryParseReferenceColumnHeader(str) {
328
341
  const matchValue = str.trim();
329
342
  const activePatternResult = ActivePatterns_$007CReferenceColumnHeader$007C_$007C(matchValue);
@@ -4,8 +4,9 @@ import { StringBuilder__Append_Z721C83C5, StringBuilder_$ctor } from "../fable_m
4
4
  import { printf, toText, join } from "../fable_modules/fable-library-js.4.16.0/String.js";
5
5
  import { toArray, empty, singleton, append, delay, toList } from "../fable_modules/fable-library-js.4.16.0/Seq.js";
6
6
  import { toString } from "../fable_modules/fable-library-js.4.16.0/Types.js";
7
- import { hash, boxHashOption, boxHashArray } from "./Helper/HashCodes.js";
7
+ import { hash as hash_1, boxHashOption, boxHashArray } from "./Helper/HashCodes.js";
8
8
  import { ResizeArray_map } from "./Helper/Collections.js";
9
+ import { safeHash } from "../fable_modules/fable-library-js.4.16.0/Util.js";
9
10
  import { class_type } from "../fable_modules/fable-library-js.4.16.0/Reflection.js";
10
11
 
11
12
  export class OntologyAnnotation {
@@ -67,10 +68,15 @@ export class OntologyAnnotation {
67
68
  return `${"http://purl.obolibrary.org/obo/"}${termSourceRef}_${localTAN}`;
68
69
  }
69
70
  static fromTermAnnotation(tan, name) {
70
- const name_1 = defaultArg(name, "");
71
- const r = value_4(tryParseTermAnnotation(tan));
72
- const accession = (r.IDSpace + ":") + r.LocalID;
73
- return OntologyAnnotation.create(name_1, r.IDSpace, accession);
71
+ const matchValue = tryParseTermAnnotation(tan);
72
+ if (matchValue == null) {
73
+ return OntologyAnnotation.create(name, void 0, tan);
74
+ }
75
+ else {
76
+ const r = matchValue;
77
+ const accession = (r.IDSpace + ":") + r.LocalID;
78
+ return OntologyAnnotation.create(name, r.IDSpace, accession);
79
+ }
74
80
  }
75
81
  get TermAccessionShort() {
76
82
  const this$ = this;
@@ -136,6 +142,10 @@ export class OntologyAnnotation {
136
142
  StringBuilder__Append_Z721C83C5(sb, "}");
137
143
  return toString(sb);
138
144
  }
145
+ isEmpty() {
146
+ const this$ = this;
147
+ return (((this$.Name == null) && (this$.TermSourceREF == null)) && (this$.TermAccessionNumber == null)) && (this$.Comments.length === 0);
148
+ }
139
149
  GetHashCode() {
140
150
  const this$ = this;
141
151
  return boxHashArray(toArray(delay(() => append(singleton(boxHashOption(this$.Name)), delay(() => {
@@ -157,7 +167,7 @@ export class OntologyAnnotation {
157
167
  }
158
168
  Equals(obj) {
159
169
  const this$ = this;
160
- return hash(this$) === hash(obj);
170
+ return hash_1(this$) === hash_1(obj);
161
171
  }
162
172
  Copy() {
163
173
  const this$ = this;
@@ -175,6 +185,18 @@ export class OntologyAnnotation {
175
185
  const this$ = this;
176
186
  return "OA " + this$.NameText;
177
187
  }
188
+ CompareTo(obj) {
189
+ const this$ = this;
190
+ if (obj instanceof OntologyAnnotation) {
191
+ const oa = obj;
192
+ const hash = safeHash(this$) | 0;
193
+ const otherHash = safeHash(oa) | 0;
194
+ return ((hash === otherHash) ? 0 : ((hash < otherHash) ? -1 : 1)) | 0;
195
+ }
196
+ else {
197
+ return 1;
198
+ }
199
+ }
178
200
  }
179
201
 
180
202
  export function OntologyAnnotation_$reflection() {
@@ -1,9 +1,10 @@
1
1
  import { tryParse } from "../../fable_modules/fable-library-js.4.16.0/Int32.js";
2
2
  import { FSharpRef } from "../../fable_modules/fable-library-js.4.16.0/Types.js";
3
3
  import { Comment$ } from "../Comment.js";
4
- import { int32ToString } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
5
- import { value, bind } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
4
+ import { equals, int32ToString } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
6
5
  import { tryItem } from "../CommentList.js";
6
+ import { findIndex } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
7
+ import { value, bind } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
7
8
  import { Factor } from "./Factor.js";
8
9
  import { MaterialAttribute_fromString_5980DC03 } from "./MaterialAttribute.js";
9
10
  import { ProtocolParameter } from "./ProtocolParameter.js";
@@ -30,7 +31,16 @@ export function createOrderComment(index) {
30
31
  }
31
32
 
32
33
  export function tryGetIndex(comments) {
33
- return bind(tryInt, tryItem(orderName, comments));
34
+ const matchValue = tryItem(orderName, comments);
35
+ if (matchValue != null) {
36
+ const ci = matchValue;
37
+ const i = findIndex((c) => equals(c.Name, orderName), comments) | 0;
38
+ comments.splice(i, 1);
39
+ return tryInt(ci);
40
+ }
41
+ else {
42
+ return void 0;
43
+ }
34
44
  }
35
45
 
36
46
  export function setOntologyAnnotationIndexInplace(i, oa) {
@@ -2,12 +2,12 @@ import { Union, toString } from "../../fable_modules/fable-library-js.4.16.0/Typ
2
2
  import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
3
3
  import { Source_create_Z5CA08497, Source_getUnits_53E41069, Source_setCharacteristicValues, Source_get_empty, Source_$reflection } from "./Source.js";
4
4
  import { Sample_create_62424AD2, Sample_getUnits_53716792, Sample_setCharacteristicValues, Sample_$reflection } from "./Sample.js";
5
- import { Data_create_Z2AF98BBE, Data_$reflection } from "./Data.js";
5
+ import { Data, Data_$reflection } from "../Data.js";
6
6
  import { Material_create_Z66909A6D, Material_getUnits_ZBCDEB61, Material_setCharacteristicValues, Material_$reflection } from "./Material.js";
7
7
  import { union_type } from "../../fable_modules/fable-library-js.4.16.0/Reflection.js";
8
8
  import { unwrap, map, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
9
9
  import { empty, choose } from "../../fable_modules/fable-library-js.4.16.0/List.js";
10
- import { DataFile } from "./DataFile.js";
10
+ import { DataFile } from "../DataFile.js";
11
11
 
12
12
  export class ProcessInput extends Union {
13
13
  constructor(tag, fields) {
@@ -284,14 +284,14 @@ export function ProcessInput_createMaterial_4452CB4C(name, characteristics, deri
284
284
  }
285
285
 
286
286
  export function ProcessInput_createImageFile_Z721C83C5(name) {
287
- return new ProcessInput(2, [Data_create_Z2AF98BBE(void 0, name, new DataFile(2, []))]);
287
+ return new ProcessInput(2, [Data.create(void 0, name, new DataFile(2, []))]);
288
288
  }
289
289
 
290
290
  export function ProcessInput_createRawData_Z721C83C5(name) {
291
- return new ProcessInput(2, [Data_create_Z2AF98BBE(void 0, name, new DataFile(0, []))]);
291
+ return new ProcessInput(2, [Data.create(void 0, name, new DataFile(0, []))]);
292
292
  }
293
293
 
294
294
  export function ProcessInput_createDerivedData_Z721C83C5(name) {
295
- return new ProcessInput(2, [Data_create_Z2AF98BBE(void 0, name, new DataFile(1, []))]);
295
+ return new ProcessInput(2, [Data.create(void 0, name, new DataFile(1, []))]);
296
296
  }
297
297
 
@@ -1,12 +1,12 @@
1
1
  import { Union, toString } from "../../fable_modules/fable-library-js.4.16.0/Types.js";
2
2
  import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
3
3
  import { Sample_create_62424AD2, Sample_getUnits_53716792, Sample_setFactorValues, Sample_get_empty, Sample_$reflection } from "./Sample.js";
4
- import { Data_create_Z2AF98BBE, Data_$reflection } from "./Data.js";
4
+ import { Data, Data_$reflection } from "../Data.js";
5
5
  import { Material_create_Z66909A6D, Material_getUnits_ZBCDEB61, Material_$reflection } from "./Material.js";
6
6
  import { union_type } from "../../fable_modules/fable-library-js.4.16.0/Reflection.js";
7
7
  import { unwrap, map, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
8
8
  import { empty, choose } from "../../fable_modules/fable-library-js.4.16.0/List.js";
9
- import { DataFile } from "./DataFile.js";
9
+ import { DataFile } from "../DataFile.js";
10
10
 
11
11
  export class ProcessOutput extends Union {
12
12
  constructor(tag, fields) {
@@ -250,14 +250,14 @@ export function ProcessOutput_createMaterial_4452CB4C(name, characteristics, der
250
250
  }
251
251
 
252
252
  export function ProcessOutput_createImageFile_Z721C83C5(name) {
253
- return new ProcessOutput(1, [Data_create_Z2AF98BBE(void 0, name, new DataFile(2, []))]);
253
+ return new ProcessOutput(1, [Data.create(void 0, name, new DataFile(2, []))]);
254
254
  }
255
255
 
256
256
  export function ProcessOutput_createRawData_Z721C83C5(name) {
257
- return new ProcessOutput(1, [Data_create_Z2AF98BBE(void 0, name, new DataFile(0, []))]);
257
+ return new ProcessOutput(1, [Data.create(void 0, name, new DataFile(0, []))]);
258
258
  }
259
259
 
260
260
  export function ProcessOutput_createDerivedData_Z721C83C5(name) {
261
- return new ProcessOutput(1, [Data_create_Z2AF98BBE(void 0, name, new DataFile(1, []))]);
261
+ return new ProcessOutput(1, [Data.create(void 0, name, new DataFile(1, []))]);
262
262
  }
263
263
 
@@ -31,7 +31,7 @@ export class Value extends Union {
31
31
  matchValue_1 = [tryParse_1(value, new FSharpRef(() => outArg_1, (v_2) => {
32
32
  outArg_1 = v_2;
33
33
  })), outArg_1];
34
- return matchValue_1[0] ? (new Value(2, [matchValue_1[1]])) : (new Value(0, [OntologyAnnotation.create(value)]));
34
+ return matchValue_1[0] ? (new Value(2, [matchValue_1[1]])) : (new Value(3, [value]));
35
35
  }
36
36
  }
37
37
  static fromOptions(value, termSource, termAccesssion) {
@@ -1,4 +1,4 @@
1
- import { boxHashValues, Unchecked_alignByHeaders, Unchecked_extendToRowCount, Unchecked_removeRowCells_withIndexChange, Unchecked_addRows, Unchecked_addRow, Unchecked_getEmptyCellForHeader, Unchecked_removeColumnCells_withIndexChange, tryFindDuplicateUniqueInArray, Unchecked_removeColumnCells, Unchecked_removeHeader, Unchecked_fillMissingCells, Unchecked_addColumn, tryFindDuplicateUnique, Unchecked_setCellAt, SanityChecks_validateColumn, SanityChecks_validateRowIndex, SanityChecks_validateColumnIndex, Unchecked_tryGetCellAt, getRowCount, getColumnCount, SanityChecks_validate } from "./ArcTableAux.js";
1
+ import { boxHashValues, Unchecked_alignByHeaders, Unchecked_extendToRowCount, Unchecked_removeRowCells_withIndexChange, Unchecked_addRows, Unchecked_addRow, Unchecked_getEmptyCellForHeader, Unchecked_moveColumnTo, Unchecked_removeColumnCells_withIndexChange, tryFindDuplicateUniqueInArray, Unchecked_removeColumnCells, Unchecked_removeHeader, Unchecked_fillMissingCells, Unchecked_addColumn, tryFindDuplicateUnique, Unchecked_setCellAt, SanityChecks_validateColumn, SanityChecks_validateRowIndex, SanityChecks_validateColumnIndex, Unchecked_tryGetCellAt, getRowCount, getColumnCount, SanityChecks_validate } from "./ArcTableAux.js";
2
2
  import { Dictionary } from "../../fable_modules/fable-library-js.4.16.0/MutableMap.js";
3
3
  import { compareArrays, safeHash, comparePrimitives, equals, arrayHash, equalArrays } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
4
4
  import { value as value_3, map as map_2, unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
@@ -398,6 +398,27 @@ export class ArcTable {
398
398
  static getOutputColumn() {
399
399
  return (table) => table.GetOutputColumn();
400
400
  }
401
+ MoveColumn(startCol, endCol) {
402
+ const this$ = this;
403
+ if (startCol === endCol) {
404
+ }
405
+ else if ((startCol < 0) ? true : (startCol >= this$.ColumnCount)) {
406
+ toFail(printf("Cannt move column. Invalid start column index: %i"))(startCol);
407
+ }
408
+ else if ((endCol < 0) ? true : (endCol >= this$.ColumnCount)) {
409
+ toFail(printf("Cannt move column. Invalid end column index: %i"))(endCol);
410
+ }
411
+ else {
412
+ Unchecked_moveColumnTo(this$.RowCount, startCol, endCol, this$.Headers, this$.Values);
413
+ }
414
+ }
415
+ static moveColumn(startCol, endCol) {
416
+ return (table) => {
417
+ const newTable = table.Copy();
418
+ newTable.MoveColumn(startCol, endCol);
419
+ return newTable;
420
+ };
421
+ }
401
422
  AddRow(cells, index) {
402
423
  const this$ = this;
403
424
  const index_1 = defaultArg(index, this$.RowCount) | 0;
@@ -713,7 +734,8 @@ export class ArcTable {
713
734
  }
714
735
  toString() {
715
736
  const this$ = this;
716
- return join("\n", toList(delay(() => append_1(singleton(`Table: ${this$.Name}`), delay(() => append_1(singleton("-------------"), delay(() => append_1(singleton(join("\t|\t", map(toString, this$.Headers))), delay(() => map((rowI) => join("\t|\t", map(toString, this$.GetRow(rowI))), rangeDouble(0, 1, this$.RowCount - 1)))))))))));
737
+ const rowCount = this$.RowCount | 0;
738
+ return join("\n", toList(delay(() => append_1(singleton(`Table: ${this$.Name}`), delay(() => append_1(singleton("-------------"), delay(() => append_1(singleton(join("\t|\t", map(toString, this$.Headers))), delay(() => ((rowCount > 50) ? append_1(map((rowI) => join("\t|\t", map(toString, this$.GetRow(rowI))), rangeDouble(0, 1, 19)), delay(() => append_1(singleton("..."), delay(() => map((rowI_1) => join("\t|\t", map(toString, this$.GetRow(rowI_1))), rangeDouble(rowCount - 20, 1, rowCount - 1)))))) : ((rowCount === 0) ? singleton("No rows") : map((rowI_2) => join("\t|\t", map(toString, this$.GetRow(rowI_2))), rangeDouble(0, 1, rowCount - 1)))))))))))));
717
739
  }
718
740
  StructurallyEquals(other) {
719
741
  let a, b;
@@ -1,4 +1,4 @@
1
- import { head as head_1, toArray, filter, tryFindIndex, maxBy } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
1
+ import { toList, head as head_1, toArray, filter, tryFindIndex, maxBy } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
2
2
  import { arrayHash, equalArrays, numberHash, disposeSafe, getEnumerator, compare, equals, safeHash, comparePrimitives } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
3
3
  import { addToDict, getItemFromDict } from "../../fable_modules/fable-library-js.4.16.0/MapUtil.js";
4
4
  import { value as value_2 } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
@@ -7,11 +7,13 @@ import { printf, toConsole } from "../../fable_modules/fable-library-js.4.16.0/S
7
7
  import { List_tryPickAndRemove, Dictionary_tryFind } from "../Helper/Collections.js";
8
8
  import { CompositeCell } from "./CompositeCell.js";
9
9
  import { max } from "../../fable_modules/fable-library-js.4.16.0/Double.js";
10
- import { item, map, iterateIndexed } from "../../fable_modules/fable-library-js.4.16.0/Array.js";
10
+ import { setItem, item, map, iterateIndexed } from "../../fable_modules/fable-library-js.4.16.0/Array.js";
11
11
  import { tryFind, ofArray } from "../../fable_modules/fable-library-js.4.16.0/Map.js";
12
12
  import { Array_groupBy } from "../../fable_modules/fable-library-js.4.16.0/Seq2.js";
13
13
  import { FSharpSet__Contains, ofArray as ofArray_1 } from "../../fable_modules/fable-library-js.4.16.0/Set.js";
14
14
  import { toString } from "../../fable_modules/fable-library-js.4.16.0/Types.js";
15
+ import { rangeDouble } from "../../fable_modules/fable-library-js.4.16.0/Range.js";
16
+ import { op_UnaryNegation_Int32 } from "../../fable_modules/fable-library-js.4.16.0/Int32.js";
15
17
  import { Dictionary } from "../../fable_modules/fable-library-js.4.16.0/MutableMap.js";
16
18
 
17
19
  export function getColumnCount(headers) {
@@ -151,7 +153,7 @@ export function SanityChecks_validateColumn(column) {
151
153
  }
152
154
 
153
155
  export function SanityChecks_validate(headers, values, raiseException) {
154
- let clo;
156
+ let clo, clo_1;
155
157
  let isValid = true;
156
158
  let en = getEnumerator(values);
157
159
  while (isValid && en["System.Collections.IEnumerator.MoveNext"]()) {
@@ -162,12 +164,23 @@ export function SanityChecks_validate(headers, values, raiseException) {
162
164
  let copyOfStruct_1 = en["System.Collections.Generic.IEnumerator`1.get_Current"]();
163
165
  cell = copyOfStruct_1[1];
164
166
  const header = headers[matchValue[0]];
165
- if (!header.IsTermColumn && !cell.isFreeText) {
167
+ const headerIsData = header.IsDataColumn;
168
+ const headerIsFreetext = !header.IsTermColumn && !header.IsDataColumn;
169
+ const cellIsNotFreetext = !cell.isFreeText;
170
+ if (headerIsData && (!cell.isData && cellIsNotFreetext)) {
166
171
  (raiseException ? ((message) => {
167
172
  throw new Error(message);
168
173
  }) : ((clo = toConsole(printf("%s")), (arg) => {
169
174
  clo(arg);
170
- })))(`Invalid combination of header \`${header}\` and cell \`${cell}\`.`);
175
+ })))(`Invalid combination of header \`${header}\` and cell \`${cell}\`. Data header should contain either Data or Freetext cells.`);
176
+ isValid = false;
177
+ }
178
+ if (headerIsFreetext && cellIsNotFreetext) {
179
+ (raiseException ? ((message_1) => {
180
+ throw new Error(message_1);
181
+ }) : ((clo_1 = toConsole(printf("%s")), (arg_1) => {
182
+ clo_1(arg_1);
183
+ })))(`Invalid combination of header \`${header}\` and cell \`${cell}\`. Freetext header should not contain non-freetext cells.`);
171
184
  isValid = false;
172
185
  }
173
186
  }
@@ -461,6 +474,44 @@ export function Unchecked_compositeHeaderMainColumnEqual(ch1, ch2) {
461
474
  return toString(ch1) === toString(ch2);
462
475
  }
463
476
 
477
+ /**
478
+ * Moves a column from one position to another
479
+ *
480
+ * This function moves the column from `fromCol` to `toCol` and shifts all columns in between accordingly
481
+ */
482
+ export function Unchecked_moveColumnTo(rowCount, fromCol, toCol, headers, values) {
483
+ const patternInput = (fromCol < toCol) ? [-1, fromCol + 1, toCol] : [1, fromCol - 1, toCol];
484
+ const shiftStart = patternInput[1] | 0;
485
+ const shiftEnd = patternInput[2] | 0;
486
+ const shift = patternInput[0] | 0;
487
+ const header = headers[fromCol];
488
+ const enumerator = getEnumerator(toList(rangeDouble(shiftStart, op_UnaryNegation_Int32(shift), shiftEnd)));
489
+ try {
490
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
491
+ const c = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]() | 0;
492
+ setItem(headers, c + shift, headers[c]);
493
+ }
494
+ }
495
+ finally {
496
+ disposeSafe(enumerator);
497
+ }
498
+ setItem(headers, toCol, header);
499
+ for (let r = 0; r <= (rowCount - 1); r++) {
500
+ const cell = getItemFromDict(values, [fromCol, r]);
501
+ const enumerator_1 = getEnumerator(toList(rangeDouble(shiftStart, op_UnaryNegation_Int32(shift), shiftEnd)));
502
+ try {
503
+ while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
504
+ const c_1 = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]() | 0;
505
+ values.set([c_1 + shift, r], getItemFromDict(values, [c_1, r]));
506
+ }
507
+ }
508
+ finally {
509
+ disposeSafe(enumerator_1);
510
+ }
511
+ values.set([toCol, r], cell);
512
+ }
513
+ }
514
+
464
515
  /**
465
516
  * From a list of rows consisting of headers and values, creates a list of combined headers and the values as a sparse matrix
466
517
  *
@@ -199,7 +199,7 @@ export function ArcTablesAux_SanityChecks_validateNewNamesUnique(newNames, exist
199
199
 
200
200
  export class ArcTables {
201
201
  constructor(initTables) {
202
- this.tables = initTables;
202
+ this.tables = ((ArcTablesAux_SanityChecks_validateNamesUnique(map_1((t) => t.Name, initTables)), initTables));
203
203
  }
204
204
  get Tables() {
205
205
  const this$ = this;