@nfdi4plants/arctrl 1.0.0 → 1.0.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/ISA/ISA/ArcTypes/ArcTable.js +29 -19
- package/ISA/ISA/ArcTypes/ArcTableAux.js +7 -2
- package/ISA/ISA/ArcTypes/ArcTables.js +2 -2
- package/ISA/ISA/ArcTypes/ArcTypes.js +1 -2
- package/ISA/ISA/ArcTypes/CompositeCell.js +2 -3
- package/ISA/ISA/Helper.js +4 -0
- package/ISA/ISA/JsonTypes/AnnotationValue.js +1 -13
- package/ISA/ISA/JsonTypes/Component.js +2 -3
- package/ISA/ISA/JsonTypes/MaterialAttribute.js +1 -1
- package/ISA/ISA/JsonTypes/OntologyAnnotation.js +11 -35
- package/ISA/ISA/JsonTypes/ProtocolParameter.js +1 -1
- package/ISA/ISA/JsonTypes/Value.js +2 -3
- package/ISA/ISA.Json/Ontology.js +13 -9
- package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +1 -1
- package/ISA/ISA.Spreadsheet/ArcStudy.js +6 -5
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dictionary } from "../../../fable_modules/fable-library.4.5.0/MutableMap.js";
|
|
2
|
-
import { compareArrays, safeHash, disposeSafe, getEnumerator,
|
|
2
|
+
import { compareArrays, safeHash, disposeSafe, getEnumerator, comparePrimitives, equals, arrayHash, equalArrays } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
3
3
|
import { value as value_9, map as map_2, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
4
4
|
import { Unchecked_extendToRowCount, ProcessParsing_processToRows, ProcessParsing_alignByHeaders, ProcessParsing_mergeIdenticalProcesses, ProcessParsing_getProcessGetter, Unchecked_removeRowCells_withIndexChange, 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 } from "./ArcTableAux.js";
|
|
5
5
|
import { item, append as append_1, indexed as indexed_1, choose, toList, zip, fold, filter, length, tryFindIndex, empty, singleton, collect, removeAt, map, delay, toArray } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
@@ -189,7 +189,7 @@ export class ArcTable {
|
|
|
189
189
|
return newTable;
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
AddColumn(header, cells, index, forceReplace) {
|
|
192
|
+
AddColumn(header, cells, index, forceReplace, SkipFillMissing) {
|
|
193
193
|
const this$ = this;
|
|
194
194
|
const index_1 = defaultArg(index, this$.ColumnCount) | 0;
|
|
195
195
|
const cells_1 = defaultArg(cells, []);
|
|
@@ -197,16 +197,18 @@ export class ArcTable {
|
|
|
197
197
|
SanityChecks_validateColumnIndex(index_1, this$.ColumnCount, true);
|
|
198
198
|
SanityChecks_validateColumn(CompositeColumn.create(header, cells_1));
|
|
199
199
|
Unchecked_addColumn(header, cells_1, index_1, forceReplace_1, false, this$.Headers, this$.Values);
|
|
200
|
-
|
|
200
|
+
if (!equals(SkipFillMissing, true)) {
|
|
201
|
+
Unchecked_fillMissingCells(this$.Headers, this$.Values);
|
|
202
|
+
}
|
|
201
203
|
}
|
|
202
204
|
static addColumn(header, cells, index, forceReplace) {
|
|
203
205
|
return (table) => {
|
|
204
206
|
const newTable = table.Copy();
|
|
205
|
-
newTable.AddColumn(header,
|
|
207
|
+
newTable.AddColumn(header, cells, index, forceReplace);
|
|
206
208
|
return newTable;
|
|
207
209
|
};
|
|
208
210
|
}
|
|
209
|
-
UpdateColumn(columnIndex, header, cells) {
|
|
211
|
+
UpdateColumn(columnIndex, header, cells, SkipFillMissing) {
|
|
210
212
|
const this$ = this;
|
|
211
213
|
SanityChecks_validateColumnIndex(columnIndex, this$.ColumnCount, false);
|
|
212
214
|
const column = CompositeColumn.create(header, unwrap(cells));
|
|
@@ -222,18 +224,20 @@ export class ArcTable {
|
|
|
222
224
|
iterateIndexed((rowIndex, v) => {
|
|
223
225
|
Unchecked_setCellAt(columnIndex, rowIndex, v, this$.Values);
|
|
224
226
|
}, column.Cells);
|
|
225
|
-
|
|
227
|
+
if (!equals(SkipFillMissing, true)) {
|
|
228
|
+
Unchecked_fillMissingCells(this$.Headers, this$.Values);
|
|
229
|
+
}
|
|
226
230
|
}
|
|
227
231
|
static updateColumn(columnIndex, header, cells) {
|
|
228
232
|
return (table) => {
|
|
229
233
|
const newTable = table.Copy();
|
|
230
|
-
newTable.UpdateColumn(columnIndex, header,
|
|
234
|
+
newTable.UpdateColumn(columnIndex, header, cells);
|
|
231
235
|
return newTable;
|
|
232
236
|
};
|
|
233
237
|
}
|
|
234
238
|
InsertColumn(index, header, cells) {
|
|
235
239
|
const this$ = this;
|
|
236
|
-
this$.AddColumn(header,
|
|
240
|
+
this$.AddColumn(header, cells, index, false);
|
|
237
241
|
}
|
|
238
242
|
static insertColumn(index, header, cells) {
|
|
239
243
|
return (table) => {
|
|
@@ -244,7 +248,7 @@ export class ArcTable {
|
|
|
244
248
|
}
|
|
245
249
|
AppendColumn(header, cells) {
|
|
246
250
|
const this$ = this;
|
|
247
|
-
this$.AddColumn(header,
|
|
251
|
+
this$.AddColumn(header, cells, this$.ColumnCount, false);
|
|
248
252
|
}
|
|
249
253
|
static appendColumn(header, cells) {
|
|
250
254
|
return (table) => {
|
|
@@ -253,7 +257,7 @@ export class ArcTable {
|
|
|
253
257
|
return newTable;
|
|
254
258
|
};
|
|
255
259
|
}
|
|
256
|
-
AddColumns(columns, index, forceReplace) {
|
|
260
|
+
AddColumns(columns, index, forceReplace, SkipFillMissing) {
|
|
257
261
|
const this$ = this;
|
|
258
262
|
let index_1 = defaultArg(index, this$.ColumnCount);
|
|
259
263
|
const forceReplace_1 = defaultArg(forceReplace, false);
|
|
@@ -277,12 +281,14 @@ export class ArcTable {
|
|
|
277
281
|
index_1 = ((index_1 + 1) | 0);
|
|
278
282
|
}
|
|
279
283
|
});
|
|
280
|
-
|
|
284
|
+
if (!equals(SkipFillMissing, true)) {
|
|
285
|
+
Unchecked_fillMissingCells(this$.Headers, this$.Values);
|
|
286
|
+
}
|
|
281
287
|
}
|
|
282
|
-
static addColumns(columns, index) {
|
|
288
|
+
static addColumns(columns, index, SkipFillMissing) {
|
|
283
289
|
return (table) => {
|
|
284
290
|
const newTable = table.Copy();
|
|
285
|
-
newTable.AddColumns(columns, index);
|
|
291
|
+
newTable.AddColumns(columns, unwrap(index), void 0, unwrap(SkipFillMissing));
|
|
286
292
|
return newTable;
|
|
287
293
|
};
|
|
288
294
|
}
|
|
@@ -552,15 +558,17 @@ export class ArcTable {
|
|
|
552
558
|
return newTable;
|
|
553
559
|
};
|
|
554
560
|
}
|
|
555
|
-
GetRow(rowIndex) {
|
|
561
|
+
GetRow(rowIndex, SkipValidation) {
|
|
556
562
|
const this$ = this;
|
|
557
|
-
|
|
563
|
+
if (!equals(SkipValidation, true)) {
|
|
564
|
+
SanityChecks_validateRowIndex(rowIndex, this$.RowCount, false);
|
|
565
|
+
}
|
|
558
566
|
return toArray(delay(() => map((columnIndex) => value_9(this$.TryGetCellAt(columnIndex, rowIndex)), rangeDouble(0, 1, this$.ColumnCount - 1))));
|
|
559
567
|
}
|
|
560
568
|
static getRow(index) {
|
|
561
569
|
return (table) => table.GetRow(index);
|
|
562
570
|
}
|
|
563
|
-
Join(table, joinOptions, forceReplace) {
|
|
571
|
+
Join(table, joinOptions, forceReplace, SkipFillMissing) {
|
|
564
572
|
const this$ = this;
|
|
565
573
|
const joinOptions_1 = defaultArg(joinOptions, "headers");
|
|
566
574
|
const forceReplace_1 = defaultArg(forceReplace, false);
|
|
@@ -596,12 +604,14 @@ export class ArcTable {
|
|
|
596
604
|
index = ((index + 1) | 0);
|
|
597
605
|
}
|
|
598
606
|
});
|
|
599
|
-
|
|
607
|
+
if (!equals(SkipFillMissing, true)) {
|
|
608
|
+
Unchecked_fillMissingCells(this$.Headers, this$.Values);
|
|
609
|
+
}
|
|
600
610
|
}
|
|
601
611
|
static join(table, joinOptions, forceReplace) {
|
|
602
612
|
return (this$) => {
|
|
603
613
|
const copy = this$.Copy();
|
|
604
|
-
copy.Join(table,
|
|
614
|
+
copy.Join(table, joinOptions, forceReplace);
|
|
605
615
|
return copy;
|
|
606
616
|
};
|
|
607
617
|
}
|
|
@@ -728,7 +738,7 @@ export class ArcTable {
|
|
|
728
738
|
}
|
|
729
739
|
}, Protocol_create_Z7DFD6E67(void 0, this$.Name), source))) : List_distinct(initialize_1(this$.RowCount, (i) => {
|
|
730
740
|
let row;
|
|
731
|
-
const source_2 = this$.GetRow(i);
|
|
741
|
+
const source_2 = this$.GetRow(i, true);
|
|
732
742
|
row = zip(this$.Headers, source_2);
|
|
733
743
|
return toProtocol(this$.Name, row);
|
|
734
744
|
}), {
|
|
@@ -345,8 +345,13 @@ export function Unchecked_addColumn(newHeader, newCells, index, forceReplace, on
|
|
|
345
345
|
if (hasDuplicateUnique != null) {
|
|
346
346
|
Unchecked_removeColumnCells(index_1, values);
|
|
347
347
|
}
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
const f = (index_1 >= startColCount) ? ((tupledArg) => ((values_1) => {
|
|
349
|
+
const value = addToDict(values_1, [tupledArg[0], tupledArg[1]], tupledArg[2]);
|
|
350
|
+
})) : ((tupledArg_1) => ((cells) => {
|
|
351
|
+
Unchecked_setCellAt(tupledArg_1[0], tupledArg_1[1], tupledArg_1[2], cells);
|
|
352
|
+
}));
|
|
353
|
+
iterateIndexed((rowIndex_3, cell_1) => {
|
|
354
|
+
f([index_1, rowIndex_3, cell_1])(values);
|
|
350
355
|
}, newCells);
|
|
351
356
|
}
|
|
352
357
|
}
|
|
@@ -326,7 +326,7 @@ export class ArcTables {
|
|
|
326
326
|
AddColumnAt(tableIndex, header, cells, columnIndex, forceReplace) {
|
|
327
327
|
const this$ = this;
|
|
328
328
|
this$.MapTableAt(tableIndex, (table) => {
|
|
329
|
-
table.AddColumn(header,
|
|
329
|
+
table.AddColumn(header, cells, columnIndex, forceReplace);
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
AddColumn(tableName, header, cells, columnIndex, forceReplace) {
|
|
@@ -348,7 +348,7 @@ export class ArcTables {
|
|
|
348
348
|
UpdateColumnAt(tableIndex, columnIndex, header, cells) {
|
|
349
349
|
const this$ = this;
|
|
350
350
|
this$.MapTableAt(tableIndex, (table) => {
|
|
351
|
-
table.UpdateColumn(columnIndex, header,
|
|
351
|
+
table.UpdateColumn(columnIndex, header, cells);
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
UpdateColumn(tableName, columnIndex, header, cells) {
|
|
@@ -7,7 +7,6 @@ import { printf, toText } from "../../../fable_modules/fable-library.4.5.0/Strin
|
|
|
7
7
|
import { ActivePatterns_$007CRegex$007C_$007C } from "../Regex.js";
|
|
8
8
|
import { OntologyAnnotation } from "../JsonTypes/OntologyAnnotation.js";
|
|
9
9
|
import { Value } from "../JsonTypes/Value.js";
|
|
10
|
-
import { AnnotationValue } from "../JsonTypes/AnnotationValue.js";
|
|
11
10
|
import { ArcTablesAux_applyIOMap, ArcTablesAux_getIOMap, ArcTables_$reflection, ArcTables } from "./ArcTables.js";
|
|
12
11
|
import { AssayMaterials_get_empty, AssayMaterials_create_Z253F0553 } from "../JsonTypes/AssayMaterials.js";
|
|
13
12
|
import { ResizeArray_choose, ResizeArray_filter, ResizeArray_map, HashCodes_boxHashOption, HashCodes_boxHashArray, Option_fromValueWithDefault } from "../Helper.js";
|
|
@@ -450,7 +449,7 @@ export class ArcAssay extends ArcTables {
|
|
|
450
449
|
let v;
|
|
451
450
|
const value = (r.groups && r.groups.value) || "";
|
|
452
451
|
v = Value.fromString(value);
|
|
453
|
-
return new OntologyAnnotation(oa.ID,
|
|
452
|
+
return new OntologyAnnotation(oa.ID, v.Text, oa.TermSourceREF, oa.TermAccessionNumber, oa.Comments);
|
|
454
453
|
}
|
|
455
454
|
else {
|
|
456
455
|
return OntologyAnnotation.fromString(name);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { int32ToString } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
2
2
|
import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
3
3
|
import { OntologyAnnotation_$reflection, OntologyAnnotation } from "../JsonTypes/OntologyAnnotation.js";
|
|
4
|
-
import { AnnotationValue } from "../JsonTypes/AnnotationValue.js";
|
|
5
4
|
import { Union } from "../../../fable_modules/fable-library.4.5.0/Types.js";
|
|
6
5
|
import { union_type, string_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
|
|
7
6
|
|
|
@@ -110,11 +109,11 @@ export class CompositeCell extends Union {
|
|
|
110
109
|
}
|
|
111
110
|
ToUnitizedCell() {
|
|
112
111
|
const this$ = this;
|
|
113
|
-
return (this$.tag === 1) ? (new CompositeCell(2, ["", OntologyAnnotation.create(void 0,
|
|
112
|
+
return (this$.tag === 1) ? (new CompositeCell(2, ["", OntologyAnnotation.create(void 0, this$.fields[0])])) : ((this$.tag === 0) ? (new CompositeCell(2, ["", this$.fields[0]])) : this$);
|
|
114
113
|
}
|
|
115
114
|
ToTermCell() {
|
|
116
115
|
const this$ = this;
|
|
117
|
-
return (this$.tag === 2) ? (new CompositeCell(0, [this$.fields[1]])) : ((this$.tag === 1) ? (new CompositeCell(0, [OntologyAnnotation.create(void 0,
|
|
116
|
+
return (this$.tag === 2) ? (new CompositeCell(0, [this$.fields[1]])) : ((this$.tag === 1) ? (new CompositeCell(0, [OntologyAnnotation.create(void 0, this$.fields[0])])) : this$);
|
|
118
117
|
}
|
|
119
118
|
ToFreeTextCell() {
|
|
120
119
|
const this$ = this;
|
package/ISA/ISA/Helper.js
CHANGED
|
@@ -163,6 +163,10 @@ export function ResizeArray_distinct(a) {
|
|
|
163
163
|
return b;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
export function ResizeArray_isEmpty(a) {
|
|
167
|
+
return a.length === 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
166
170
|
export function HashCodes_boxHashOption(a) {
|
|
167
171
|
let copyOfStruct, copyOfStruct_1;
|
|
168
172
|
return (a != null) ? ((copyOfStruct = value_1(a), identityHash(copyOfStruct))) : ((copyOfStruct_1 = 0, numberHash(copyOfStruct_1)));
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Union } from "../../../fable_modules/fable-library.4.5.0/Types.js";
|
|
2
2
|
import { union_type, int32_type, float64_type, string_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
|
|
3
|
-
import { parse } from "../../../fable_modules/fable-library.4.5.0/Double.js";
|
|
4
|
-
import { parse as parse_1 } from "../../../fable_modules/fable-library.4.5.0/Int32.js";
|
|
5
3
|
import { int32ToString } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
6
4
|
|
|
7
5
|
export class AnnotationValue extends Union {
|
|
@@ -27,17 +25,7 @@ export function AnnotationValue_get_empty() {
|
|
|
27
25
|
* Create a ISAJson Annotation value from a ISATab string entry
|
|
28
26
|
*/
|
|
29
27
|
export function AnnotationValue_fromString_Z721C83C5(s) {
|
|
30
|
-
|
|
31
|
-
return new AnnotationValue(2, [parse_1(s, 511, false, 32)]);
|
|
32
|
-
}
|
|
33
|
-
catch (matchValue) {
|
|
34
|
-
try {
|
|
35
|
-
return new AnnotationValue(1, [parse(s)]);
|
|
36
|
-
}
|
|
37
|
-
catch (matchValue_1) {
|
|
38
|
-
return new AnnotationValue(0, [s]);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
28
|
+
return new AnnotationValue(0, [s]);
|
|
41
29
|
}
|
|
42
30
|
|
|
43
31
|
/**
|
|
@@ -3,7 +3,6 @@ import { record_type, option_type, string_type } from "../../../fable_modules/fa
|
|
|
3
3
|
import { Value as Value_1, Value_$reflection } from "./Value.js";
|
|
4
4
|
import { OntologyAnnotation, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
|
|
5
5
|
import { ActivePatterns_$007CRegex$007C_$007C } from "../Regex.js";
|
|
6
|
-
import { AnnotationValue } from "./AnnotationValue.js";
|
|
7
6
|
import { map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
8
7
|
import { Option_fromValueWithDefault } from "../Helper.js";
|
|
9
8
|
import { printf, toText } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
@@ -75,7 +74,7 @@ export function Component_decomposeName_Z721C83C5(name) {
|
|
|
75
74
|
let oa;
|
|
76
75
|
const termAnnotation = (unitr.groups && unitr.groups.ontology) || "";
|
|
77
76
|
oa = OntologyAnnotation.fromTermAnnotation(termAnnotation);
|
|
78
|
-
return [(value = ((unitr.groups && unitr.groups.value) || ""), Value_1.fromString(value)), new OntologyAnnotation(oa.ID,
|
|
77
|
+
return [(value = ((unitr.groups && unitr.groups.value) || ""), Value_1.fromString(value)), new OntologyAnnotation(oa.ID, (unitr.groups && unitr.groups.unit) || "", oa.TermSourceREF, oa.TermAccessionNumber, oa.Comments)];
|
|
79
78
|
}
|
|
80
79
|
else {
|
|
81
80
|
const activePatternResult_1 = ActivePatterns_$007CRegex$007C_$007C("(?<value>[^\\(]+) \\((?<ontology>[^(]*:[^)]*)\\)", name);
|
|
@@ -87,7 +86,7 @@ export function Component_decomposeName_Z721C83C5(name) {
|
|
|
87
86
|
let v_1;
|
|
88
87
|
const value_1 = (r.groups && r.groups.value) || "";
|
|
89
88
|
v_1 = Value_1.fromString(value_1);
|
|
90
|
-
return [new Value_1(0, [new OntologyAnnotation(oa_1.ID,
|
|
89
|
+
return [new Value_1(0, [new OntologyAnnotation(oa_1.ID, v_1.Text, oa_1.TermSourceREF, oa_1.TermAccessionNumber, oa_1.Comments)]), void 0];
|
|
91
90
|
}
|
|
92
91
|
else {
|
|
93
92
|
return [new Value_1(3, [name]), void 0];
|
|
@@ -67,7 +67,7 @@ export function MaterialAttribute__get_NameText(this$) {
|
|
|
67
67
|
* Returns the name of the characteristic as string
|
|
68
68
|
*/
|
|
69
69
|
export function MaterialAttribute__get_TryNameText(this$) {
|
|
70
|
-
return bind((oa) => oa.
|
|
70
|
+
return bind((oa) => oa.Name, this$.CharacteristicType);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export function MaterialAttribute__MapCategory_Z69DD836A(this$, f) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { value as value_4,
|
|
1
|
+
import { map as map_1, value as value_4, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
2
2
|
import { Pattern_TermAnnotationShortPattern, ActivePatterns_$007CRegex$007C_$007C, tryParseTermAnnotation } from "../Regex.js";
|
|
3
|
-
import { equals, stringHash
|
|
4
|
-
import {
|
|
5
|
-
import { filter, map as map_1, singleton, append, exists, tryFind } from "../../../fable_modules/fable-library.4.5.0/List.js";
|
|
3
|
+
import { equals, stringHash } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
4
|
+
import { filter, map, singleton, append, exists, tryFind } from "../../../fable_modules/fable-library.4.5.0/List.js";
|
|
6
5
|
import { record_type, array_type, option_type, string_type, getRecordFields, makeRecord } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
|
|
7
6
|
import { map as map_2, map2 } from "../../../fable_modules/fable-library.4.5.0/Array.js";
|
|
8
7
|
import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Helper.js";
|
|
@@ -35,29 +34,7 @@ export class OntologyAnnotation extends Record {
|
|
|
35
34
|
}
|
|
36
35
|
get NameText() {
|
|
37
36
|
const this$ = this;
|
|
38
|
-
return defaultArg(
|
|
39
|
-
switch (av.tag) {
|
|
40
|
-
case 1:
|
|
41
|
-
return av.fields[0].toString();
|
|
42
|
-
case 2:
|
|
43
|
-
return int32ToString(av.fields[0]);
|
|
44
|
-
default:
|
|
45
|
-
return av.fields[0];
|
|
46
|
-
}
|
|
47
|
-
}, this$.Name), "");
|
|
48
|
-
}
|
|
49
|
-
get TryNameText() {
|
|
50
|
-
const this$ = this;
|
|
51
|
-
return unwrap(map((av) => {
|
|
52
|
-
switch (av.tag) {
|
|
53
|
-
case 1:
|
|
54
|
-
return av.fields[0].toString();
|
|
55
|
-
case 2:
|
|
56
|
-
return int32ToString(av.fields[0]);
|
|
57
|
-
default:
|
|
58
|
-
return av.fields[0];
|
|
59
|
-
}
|
|
60
|
-
}, this$.Name));
|
|
37
|
+
return defaultArg(this$.Name, "");
|
|
61
38
|
}
|
|
62
39
|
get TermSourceREFString() {
|
|
63
40
|
const this$ = this;
|
|
@@ -71,8 +48,7 @@ export class OntologyAnnotation extends Record {
|
|
|
71
48
|
return `${"http://purl.obolibrary.org/obo/"}${termSourceRef}_${localTAN}`;
|
|
72
49
|
}
|
|
73
50
|
static fromString(termName, tsr, tan, comments) {
|
|
74
|
-
|
|
75
|
-
return OntologyAnnotation.make(void 0, name, tsr, tan, comments);
|
|
51
|
+
return OntologyAnnotation.make(void 0, termName, tsr, tan, comments);
|
|
76
52
|
}
|
|
77
53
|
static fromTermAnnotation(termAnnotation) {
|
|
78
54
|
const r = value_4(tryParseTermAnnotation(termAnnotation));
|
|
@@ -115,7 +91,7 @@ export class OntologyAnnotation extends Record {
|
|
|
115
91
|
static toString(oa, asOntobeePurlUrlIfShort) {
|
|
116
92
|
let url;
|
|
117
93
|
const asOntobeePurlUrlIfShort_1 = defaultArg(asOntobeePurlUrlIfShort, false);
|
|
118
|
-
const TermName = defaultArg(
|
|
94
|
+
const TermName = defaultArg(oa.Name, "");
|
|
119
95
|
const TermSourceREF = defaultArg(oa.TermSourceREF, "");
|
|
120
96
|
return {
|
|
121
97
|
TermAccessionNumber: asOntobeePurlUrlIfShort_1 ? ((url = oa.TermAccessionAndOntobeeUrlIfShort, (url === "") ? defaultArg(oa.TermAccessionNumber, "") : url)) : defaultArg(oa.TermAccessionNumber, ""),
|
|
@@ -140,8 +116,8 @@ export class OntologyAnnotation extends Record {
|
|
|
140
116
|
const this$ = this;
|
|
141
117
|
return stringHash(this$.NameText + this$.TermAccessionShort) | 0;
|
|
142
118
|
}
|
|
143
|
-
static
|
|
144
|
-
return oa.
|
|
119
|
+
static tryGetName(oa) {
|
|
120
|
+
return oa.Name;
|
|
145
121
|
}
|
|
146
122
|
static getNameText(oa) {
|
|
147
123
|
return oa.NameText;
|
|
@@ -159,7 +135,7 @@ export class OntologyAnnotation extends Record {
|
|
|
159
135
|
return append(onotolgyAnnotations, singleton(onotolgyAnnotation));
|
|
160
136
|
}
|
|
161
137
|
static updateBy(predicate, updateOption, design, annotations) {
|
|
162
|
-
return exists(predicate, annotations) ?
|
|
138
|
+
return exists(predicate, annotations) ? map((d) => {
|
|
163
139
|
if (predicate(d)) {
|
|
164
140
|
const this$ = updateOption;
|
|
165
141
|
const recordType_1 = d;
|
|
@@ -197,7 +173,7 @@ export class OntologyAnnotation extends Record {
|
|
|
197
173
|
}
|
|
198
174
|
Copy() {
|
|
199
175
|
const this$ = this;
|
|
200
|
-
const comments =
|
|
176
|
+
const comments = map_1((array) => map_2((c) => c.Copy(), array), this$.Comments);
|
|
201
177
|
return OntologyAnnotation.make(this$.ID, this$.Name, this$.TermSourceREF, this$.TermAccessionNumber, comments);
|
|
202
178
|
}
|
|
203
179
|
Print() {
|
|
@@ -215,6 +191,6 @@ export class OntologyAnnotation extends Record {
|
|
|
215
191
|
}
|
|
216
192
|
|
|
217
193
|
export function OntologyAnnotation_$reflection() {
|
|
218
|
-
return record_type("ARCtrl.ISA.OntologyAnnotation", [], OntologyAnnotation, () => [["ID", option_type(string_type)], ["Name", option_type(
|
|
194
|
+
return record_type("ARCtrl.ISA.OntologyAnnotation", [], OntologyAnnotation, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["TermSourceREF", option_type(string_type)], ["TermAccessionNumber", option_type(string_type)], ["Comments", option_type(array_type(Comment$_$reflection()))]]);
|
|
219
195
|
}
|
|
220
196
|
|
|
@@ -38,7 +38,7 @@ export class ProtocolParameter extends Record {
|
|
|
38
38
|
}
|
|
39
39
|
get TryNameText() {
|
|
40
40
|
const this$ = this;
|
|
41
|
-
return unwrap(bind((oa) => oa.
|
|
41
|
+
return unwrap(bind((oa) => oa.Name, this$.ParameterName));
|
|
42
42
|
}
|
|
43
43
|
MapCategory(f) {
|
|
44
44
|
const this$ = this;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { parse } from "../../../fable_modules/fable-library.4.5.0/Double.js";
|
|
2
2
|
import { parse as parse_1 } from "../../../fable_modules/fable-library.4.5.0/Int32.js";
|
|
3
3
|
import { OntologyAnnotation_$reflection, OntologyAnnotation } from "./OntologyAnnotation.js";
|
|
4
|
-
import {
|
|
4
|
+
import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
5
5
|
import { int32ToString } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
6
|
-
import { AnnotationValue_toString_Z6FAD7738 } from "./AnnotationValue.js";
|
|
7
6
|
import { Union, toString } from "../../../fable_modules/fable-library.4.5.0/Types.js";
|
|
8
7
|
import { printf, toText } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
9
8
|
import { union_type, string_type, float64_type, int32_type } from "../../../fable_modules/fable-library.4.5.0/Reflection.js";
|
|
@@ -56,7 +55,7 @@ export class Value extends Union {
|
|
|
56
55
|
return [value.fields[0], void 0, void 0];
|
|
57
56
|
default: {
|
|
58
57
|
const oa = value.fields[0];
|
|
59
|
-
return [
|
|
58
|
+
return [oa.Name, oa.TermAccessionNumber, oa.TermSourceREF];
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
package/ISA/ISA.Json/Ontology.js
CHANGED
|
@@ -166,24 +166,28 @@ export function OntologyAnnotation_encoder(options, oa) {
|
|
|
166
166
|
return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
|
|
167
167
|
}, oa["ID"])), delay(() => {
|
|
168
168
|
let value_5, s_2;
|
|
169
|
-
return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "OntologyAnnotation", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("annotationValue", (value_7) =>
|
|
169
|
+
return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "OntologyAnnotation", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("annotationValue", (value_7) => {
|
|
170
170
|
let s_3;
|
|
171
|
-
const
|
|
172
|
-
return (typeof
|
|
173
|
-
}, oa["
|
|
171
|
+
const value_8 = value_7;
|
|
172
|
+
return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
|
|
173
|
+
}, oa["Name"])), delay(() => append(singleton(tryInclude("termSource", (value_10) => {
|
|
174
174
|
let s_4;
|
|
175
|
-
const
|
|
176
|
-
return (typeof
|
|
175
|
+
const value_11 = value_10;
|
|
176
|
+
return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
|
|
177
|
+
}, oa["TermSourceREF"])), delay(() => append(singleton(tryInclude("termAccession", (value_13) => {
|
|
178
|
+
let s_5;
|
|
179
|
+
const value_14 = value_13;
|
|
180
|
+
return (typeof value_14 === "string") ? ((s_5 = value_14, s_5)) : nil;
|
|
177
181
|
}, oa["TermAccessionNumber"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))))));
|
|
178
182
|
}));
|
|
179
183
|
}))));
|
|
180
184
|
}
|
|
181
185
|
|
|
182
186
|
export function OntologyAnnotation_decoder(options) {
|
|
183
|
-
return (
|
|
187
|
+
return (path_4) => ((v) => object_11((get$) => {
|
|
184
188
|
let objectArg, objectArg_1, objectArg_2, objectArg_3, arg_9, decoder, objectArg_4;
|
|
185
|
-
return OntologyAnnotation.create(unwrap((objectArg = get$.Optional, objectArg.Field("@id", uri))), unwrap((objectArg_1 = get$.Optional, objectArg_1.Field("annotationValue",
|
|
186
|
-
},
|
|
189
|
+
return OntologyAnnotation.create(unwrap((objectArg = get$.Optional, objectArg.Field("@id", uri))), unwrap((objectArg_1 = get$.Optional, objectArg_1.Field("annotationValue", string))), unwrap((objectArg_2 = get$.Optional, objectArg_2.Field("termSource", string))), unwrap((objectArg_3 = get$.Optional, objectArg_3.Field("termAccession", string))), unwrap((arg_9 = ((decoder = decoder_1(options), (path_3) => ((value_3) => array(uncurry2(decoder), path_3, value_3)))), (objectArg_4 = get$.Optional, objectArg_4.Field("comments", uncurry2(arg_9))))));
|
|
190
|
+
}, path_4, v));
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
export function OntologyAnnotation_fromJsonString(s) {
|
|
@@ -98,7 +98,7 @@ export function tryFromFsWorksheet(sheet) {
|
|
|
98
98
|
else {
|
|
99
99
|
const t = matchValue;
|
|
100
100
|
const compositeColumns = composeColumns(map_1(fixDeprecatedIOHeader, t.GetColumns(sheet.CellCollection)));
|
|
101
|
-
return ArcTable.addColumns(compositeColumns)(ArcTable.init(sheet.Name));
|
|
101
|
+
return ArcTable.addColumns(compositeColumns, void 0, true)(ArcTable.init(sheet.Name));
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.5.0.1/FsWorksheet.fs.js";
|
|
2
|
-
import {
|
|
2
|
+
import { map, append, iterateIndexed } from "../../fable_modules/fable-library.4.5.0/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";
|
|
5
5
|
import { defaultArg } from "../../fable_modules/fable-library.4.5.0/Option.js";
|
|
@@ -8,6 +8,7 @@ import { ArcStudy } from "../ISA/ArcTypes/ArcTypes.js";
|
|
|
8
8
|
import { createMissingIdentifier } from "../ISA/Identifier.js";
|
|
9
9
|
import { empty } from "../../fable_modules/fable-library.4.5.0/List.js";
|
|
10
10
|
import { printf, toConsole } from "../../fable_modules/fable-library.4.5.0/String.js";
|
|
11
|
+
import { ResizeArray_iter, ResizeArray_isEmpty, ResizeArray_choose } from "../ISA/Helper.js";
|
|
11
12
|
import { toFsWorksheet, tryFromFsWorksheet } from "./AnnotationTable/ArcTable.js";
|
|
12
13
|
import { FsWorkbook } from "../../fable_modules/FsSpreadsheet.5.0.1/FsWorkbook.fs.js";
|
|
13
14
|
|
|
@@ -45,9 +46,9 @@ export function ARCtrl_ISA_ArcStudy__ArcStudy_fromFsWorkbook_Static_32154C9D(doc
|
|
|
45
46
|
patternInput = ArcStudy_fromMetadataSheet(matchValue);
|
|
46
47
|
}
|
|
47
48
|
const studyMetadata = patternInput[0];
|
|
48
|
-
const annotationTables =
|
|
49
|
-
if (!
|
|
50
|
-
studyMetadata.Tables =
|
|
49
|
+
const annotationTables = ResizeArray_choose(tryFromFsWorksheet, doc.GetWorksheets());
|
|
50
|
+
if (!ResizeArray_isEmpty(annotationTables)) {
|
|
51
|
+
studyMetadata.Tables = annotationTables;
|
|
51
52
|
}
|
|
52
53
|
return [studyMetadata, patternInput[1]];
|
|
53
54
|
}
|
|
@@ -56,7 +57,7 @@ export function ARCtrl_ISA_ArcStudy__ArcStudy_toFsWorkbook_Static_Z2A9662E9(stud
|
|
|
56
57
|
const doc = new FsWorkbook();
|
|
57
58
|
const metaDataSheet = ArcStudy_toMetadataSheet(study, assays);
|
|
58
59
|
doc.AddWorksheet(metaDataSheet);
|
|
59
|
-
|
|
60
|
+
ResizeArray_iter((arg) => {
|
|
60
61
|
const sheet = toFsWorksheet(arg);
|
|
61
62
|
doc.AddWorksheet(sheet);
|
|
62
63
|
}, study.Tables);
|