@nfdi4plants/arctrl 2.0.0-alpha.7 → 2.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 +12 -14
- package/Contract/ArcAssay.js +1 -1
- package/Contract/ArcInvestigation.js +9 -12
- package/Contract/ArcStudy.js +1 -1
- package/Core/ArcTypes.js +53 -53
- package/Core/Conversion.js +28 -42
- package/Json/Assay.js +37 -24
- package/Json/Comment.js +19 -2
- package/Json/IDTable.js +19 -0
- package/Json/Investigation.js +7 -6
- package/Json/OntologyAnnotation.js +45 -2
- package/Json/OntologySourceReference.js +13 -3
- package/Json/Person.js +25 -15
- package/Json/Process/AssayMaterials.js +2 -2
- package/Json/Process/Component.js +12 -7
- package/Json/Process/Data.js +17 -9
- package/Json/Process/Factor.js +28 -5
- package/Json/Process/FactorValue.js +21 -9
- package/Json/Process/Material.js +16 -8
- package/Json/Process/MaterialAttribute.js +28 -10
- package/Json/Process/MaterialAttributeValue.js +21 -9
- package/Json/Process/Process.js +16 -8
- package/Json/Process/ProcessInput.js +11 -10
- package/Json/Process/ProcessOutput.js +10 -9
- package/Json/Process/ProcessParameterValue.js +12 -7
- package/Json/Process/ProcessSequence.js +4 -2
- package/Json/Process/PropertyValue.js +29 -4
- package/Json/Process/Protocol.js +79 -51
- package/Json/Process/ProtocolParameter.js +23 -6
- package/Json/Process/Sample.js +16 -8
- package/Json/Process/Source.js +17 -9
- package/Json/Process/StudyMaterials.js +2 -2
- package/Json/Process/Value.js +3 -3
- package/Json/Publication.js +8 -7
- package/Json/Study.js +64 -50
- package/Json.js +9 -9
- package/Spreadsheet/AnnotationTable/ArcTable.js +33 -23
- package/Spreadsheet/AnnotationTable/CompositeCell.js +22 -27
- package/Spreadsheet/AnnotationTable/CompositeColumn.js +38 -25
- package/Spreadsheet/AnnotationTable/CompositeHeader.js +181 -339
- package/Spreadsheet/ArcInvestigation.js +5 -21
- package/Xlsx.js +1 -4
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OntologyAnnotation_ISAJson_decoder, OntologyAnnotation_ISAJson_encoder, OntologyAnnotation_ROCrate_genID } from "../OntologyAnnotation.js";
|
|
2
|
+
import { ofArray, choose } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
2
3
|
import { equals } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
3
4
|
import { Json } from "../../fable_modules/Thoth.Json.Core.0.2.1/Types.fs.js";
|
|
4
5
|
import { defaultSpaces, tryInclude } from "../Encode.js";
|
|
5
|
-
import {
|
|
6
|
+
import { encode } from "../IDTable.js";
|
|
6
7
|
import { object } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
7
8
|
import { ProtocolParameter } from "../../Core/Process/ProtocolParameter.js";
|
|
8
9
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
@@ -10,8 +11,18 @@ import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/Stri
|
|
|
10
11
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
11
12
|
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
12
13
|
|
|
13
|
-
export function
|
|
14
|
-
|
|
14
|
+
export function ProtocolParameter_ISAJson_genID(p) {
|
|
15
|
+
const matchValue = p.ParameterName;
|
|
16
|
+
if (matchValue == null) {
|
|
17
|
+
return "#EmptyProtocolParameter";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return `#ProtocolParameter/${OntologyAnnotation_ROCrate_genID(matchValue)}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function ProtocolParameter_ISAJson_encoder(idMap, value) {
|
|
25
|
+
const f = (value_1) => (new Json(5, [choose((tupledArg) => {
|
|
15
26
|
const v = tupledArg[1];
|
|
16
27
|
if (equals(v, new Json(3, []))) {
|
|
17
28
|
return void 0;
|
|
@@ -19,7 +30,13 @@ export function ProtocolParameter_ISAJson_encoder(value) {
|
|
|
19
30
|
else {
|
|
20
31
|
return [tupledArg[0], v];
|
|
21
32
|
}
|
|
22
|
-
},
|
|
33
|
+
}, ofArray([tryInclude("@id", (value_2) => (new Json(0, [value_2])), ProtocolParameter_ISAJson_genID(value_1)), tryInclude("parameterName", (oa) => OntologyAnnotation_ISAJson_encoder(idMap, oa), value_1.ParameterName)]))]));
|
|
34
|
+
if (idMap != null) {
|
|
35
|
+
return encode(ProtocolParameter_ISAJson_genID, f, value, idMap);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return f(value);
|
|
39
|
+
}
|
|
23
40
|
}
|
|
24
41
|
|
|
25
42
|
export const ProtocolParameter_ISAJson_decoder = object((get$) => {
|
|
@@ -39,7 +56,7 @@ export function ARCtrl_Process_ProtocolParameter__ProtocolParameter_fromISAJsonS
|
|
|
39
56
|
|
|
40
57
|
export function ARCtrl_Process_ProtocolParameter__ProtocolParameter_toISAJsonString_Static_71136F3F(spaces) {
|
|
41
58
|
return (v) => {
|
|
42
|
-
const value = ProtocolParameter_ISAJson_encoder(v);
|
|
59
|
+
const value = ProtocolParameter_ISAJson_encoder(void 0, v);
|
|
43
60
|
return toString(defaultSpaces(spaces), value);
|
|
44
61
|
};
|
|
45
62
|
}
|
package/Json/Process/Sample.js
CHANGED
|
@@ -14,6 +14,7 @@ import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
|
|
|
14
14
|
import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
|
|
15
15
|
import { Source_ISAJson_decoder, Source_ISAJson_encoder, Source_ROCrate_decoder } from "./Source.js";
|
|
16
16
|
import { Sample } from "../../Core/Process/Sample.js";
|
|
17
|
+
import { encode } from "../IDTable.js";
|
|
17
18
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
18
19
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
19
20
|
|
|
@@ -79,8 +80,8 @@ export const Sample_ROCrate_decoder = object((get$) => {
|
|
|
79
80
|
return new Sample((objectArg_1 = get$.Optional, objectArg_1.Field("@id", Decode_uri)), (objectArg_2 = get$.Optional, objectArg_2.Field("name", string)), patternInput[0], patternInput[1], (arg_7 = list_6(Source_ROCrate_decoder), (objectArg_3 = get$.Optional, objectArg_3.Field("derivesFrom", arg_7))));
|
|
80
81
|
});
|
|
81
82
|
|
|
82
|
-
export function Sample_ISAJson_encoder(oa) {
|
|
83
|
-
|
|
83
|
+
export function Sample_ISAJson_encoder(idMap, oa) {
|
|
84
|
+
const f = (oa_1) => (new Json(5, [choose((tupledArg) => {
|
|
84
85
|
const v = tupledArg[1];
|
|
85
86
|
if (equals(v, new Json(3, []))) {
|
|
86
87
|
return void 0;
|
|
@@ -88,7 +89,13 @@ export function Sample_ISAJson_encoder(oa) {
|
|
|
88
89
|
else {
|
|
89
90
|
return [tupledArg[0], v];
|
|
90
91
|
}
|
|
91
|
-
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])),
|
|
92
|
+
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), Sample_ROCrate_genID(oa_1)), tryInclude("name", (value_2) => (new Json(0, [value_2])), oa_1.Name), tryIncludeListOpt("characteristics", (oa_2) => MaterialAttributeValue_ISAJson_encoder(idMap, oa_2), oa_1.Characteristics), tryIncludeListOpt("factorValues", (fv) => FactorValue_ISAJson_encoder(idMap, fv), oa_1.FactorValues), tryIncludeListOpt("derivesFrom", (oa_3) => Source_ISAJson_encoder(idMap, oa_3), oa_1.DerivesFrom)]))]));
|
|
93
|
+
if (idMap != null) {
|
|
94
|
+
return encode(Sample_ROCrate_genID, f, oa, idMap);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
return f(oa);
|
|
98
|
+
}
|
|
92
99
|
}
|
|
93
100
|
|
|
94
101
|
export const Sample_ISAJson_allowedFields = ofArray(["@id", "name", "characteristics", "factorValues", "derivesFrom", "@type", "@context"]);
|
|
@@ -108,15 +115,16 @@ export function ARCtrl_Process_Sample__Sample_fromISAJsonString_Static_Z721C83C5
|
|
|
108
115
|
}
|
|
109
116
|
}
|
|
110
117
|
|
|
111
|
-
export function
|
|
118
|
+
export function ARCtrl_Process_Sample__Sample_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
119
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
112
120
|
return (f) => {
|
|
113
|
-
const
|
|
114
|
-
return toString(defaultSpaces(spaces),
|
|
121
|
+
const value_1 = Sample_ISAJson_encoder(idMap, f);
|
|
122
|
+
return toString(defaultSpaces(spaces), value_1);
|
|
115
123
|
};
|
|
116
124
|
}
|
|
117
125
|
|
|
118
|
-
export function
|
|
119
|
-
return
|
|
126
|
+
export function ARCtrl_Process_Sample__Sample_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
127
|
+
return ARCtrl_Process_Sample__Sample_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
120
128
|
}
|
|
121
129
|
|
|
122
130
|
export function ARCtrl_Process_Sample__Sample_fromROCrateString_Static_Z721C83C5(s) {
|
package/Json/Process/Source.js
CHANGED
|
@@ -10,9 +10,10 @@ import { context_jsonvalue } from "../context/rocrate/isa_source_context.js";
|
|
|
10
10
|
import { list as list_2, string, object } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
11
11
|
import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
|
|
12
12
|
import { Source } from "../../Core/Process/Source.js";
|
|
13
|
+
import { encode } from "../IDTable.js";
|
|
13
14
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
15
|
+
import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
14
16
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
15
|
-
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
16
17
|
|
|
17
18
|
export function Source_ROCrate_genID(s) {
|
|
18
19
|
const matchValue = s.ID;
|
|
@@ -47,8 +48,8 @@ export const Source_ROCrate_decoder = object((get$) => {
|
|
|
47
48
|
return new Source((objectArg = get$.Optional, objectArg.Field("@id", Decode_uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (arg_5 = list_2(MaterialAttributeValue_ROCrate_decoder), (objectArg_2 = get$.Optional, objectArg_2.Field("characteristics", arg_5))));
|
|
48
49
|
});
|
|
49
50
|
|
|
50
|
-
export function Source_ISAJson_encoder(oa) {
|
|
51
|
-
|
|
51
|
+
export function Source_ISAJson_encoder(idMap, oa) {
|
|
52
|
+
const f = (oa_1) => (new Json(5, [choose((tupledArg) => {
|
|
52
53
|
const v = tupledArg[1];
|
|
53
54
|
if (equals(v, new Json(3, []))) {
|
|
54
55
|
return void 0;
|
|
@@ -56,7 +57,13 @@ export function Source_ISAJson_encoder(oa) {
|
|
|
56
57
|
else {
|
|
57
58
|
return [tupledArg[0], v];
|
|
58
59
|
}
|
|
59
|
-
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])),
|
|
60
|
+
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), Source_ROCrate_genID(oa_1)), tryInclude("name", (value_2) => (new Json(0, [value_2])), oa_1.Name), tryIncludeListOpt("characteristics", (oa_2) => MaterialAttributeValue_ISAJson_encoder(idMap, oa_2), oa_1.Characteristics)]))]));
|
|
61
|
+
if (idMap != null) {
|
|
62
|
+
return encode(Source_ROCrate_genID, f, oa, idMap);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return f(oa);
|
|
66
|
+
}
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
export const Source_ISAJson_allowedFields = ofArray(["@id", "name", "characteristics", "@type", "@context"]);
|
|
@@ -76,15 +83,16 @@ export function ARCtrl_Process_Source__Source_fromISAJsonString_Static_Z721C83C5
|
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
85
|
|
|
79
|
-
export function
|
|
86
|
+
export function ARCtrl_Process_Source__Source_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
87
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
80
88
|
return (f) => {
|
|
81
|
-
const
|
|
82
|
-
return toString(defaultSpaces(spaces),
|
|
89
|
+
const value_1 = Source_ISAJson_encoder(idMap, f);
|
|
90
|
+
return toString(defaultSpaces(spaces), value_1);
|
|
83
91
|
};
|
|
84
92
|
}
|
|
85
93
|
|
|
86
|
-
export function
|
|
87
|
-
return
|
|
94
|
+
export function ARCtrl_Process_Source__Source_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
95
|
+
return ARCtrl_Process_Source__Source_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
export function ARCtrl_Process_Source__Source_fromROCrateString_Static_Z721C83C5(s) {
|
|
@@ -7,7 +7,7 @@ import { Source_ISAJson_encoder } from "./Source.js";
|
|
|
7
7
|
import { Sample_ISAJson_encoder } from "./Sample.js";
|
|
8
8
|
import { Material_ISAJson_encoder } from "./Material.js";
|
|
9
9
|
|
|
10
|
-
export function encoder(ps) {
|
|
10
|
+
export function encoder(idMap, ps) {
|
|
11
11
|
const source = getSources(ps);
|
|
12
12
|
const samples = getSamples(ps);
|
|
13
13
|
const materials = getMaterials(ps);
|
|
@@ -19,6 +19,6 @@ export function encoder(ps) {
|
|
|
19
19
|
else {
|
|
20
20
|
return [tupledArg[0], v];
|
|
21
21
|
}
|
|
22
|
-
}, ofArray([tryIncludeList("sources", Source_ISAJson_encoder, source), tryIncludeList("samples", Sample_ISAJson_encoder, samples), tryIncludeList("otherMaterials", Material_ISAJson_encoder, materials)]))]);
|
|
22
|
+
}, ofArray([tryIncludeList("sources", (oa) => Source_ISAJson_encoder(idMap, oa), source), tryIncludeList("samples", (oa_1) => Sample_ISAJson_encoder(idMap, oa_1), samples), tryIncludeList("otherMaterials", (c) => Material_ISAJson_encoder(idMap, c), materials)]))]);
|
|
23
23
|
}
|
|
24
24
|
|
package/Json/Process/Value.js
CHANGED
|
@@ -8,14 +8,14 @@ import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/Stri
|
|
|
8
8
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
9
9
|
import { defaultSpaces } from "../Encode.js";
|
|
10
10
|
|
|
11
|
-
export function Value_ISAJson_encoder(value) {
|
|
11
|
+
export function Value_ISAJson_encoder(idMap, value) {
|
|
12
12
|
switch (value.tag) {
|
|
13
13
|
case 1:
|
|
14
14
|
return new Json(7, [value.fields[0] >>> 0]);
|
|
15
15
|
case 3:
|
|
16
16
|
return new Json(0, [value.fields[0]]);
|
|
17
17
|
case 0:
|
|
18
|
-
return OntologyAnnotation_ISAJson_encoder(value.fields[0]);
|
|
18
|
+
return OntologyAnnotation_ISAJson_encoder(idMap, value.fields[0]);
|
|
19
19
|
default:
|
|
20
20
|
return new Json(2, [value.fields[0]]);
|
|
21
21
|
}
|
|
@@ -35,7 +35,7 @@ export function ARCtrl_Process_Value__Value_fromISAJsonString_Static_Z721C83C5(s
|
|
|
35
35
|
|
|
36
36
|
export function ARCtrl_Process_Value__Value_toISAJsonString_Static_71136F3F(spaces) {
|
|
37
37
|
return (v) => {
|
|
38
|
-
const value = Value_ISAJson_encoder(v);
|
|
38
|
+
const value = Value_ISAJson_encoder(void 0, v);
|
|
39
39
|
return toString(defaultSpaces(spaces), value);
|
|
40
40
|
};
|
|
41
41
|
}
|
package/Json/Publication.js
CHANGED
|
@@ -6,7 +6,7 @@ import { OntologyAnnotation_ROCrate_decoderDefinedTerm, OntologyAnnotation_ROCra
|
|
|
6
6
|
import { Comment_ISAJson_encoder, Comment_ROCrate_decoderDisambiguatingDescription, Comment_ROCrate_encoderDisambiguatingDescription, Comment_decoder, Comment_encoder } from "./Comment.js";
|
|
7
7
|
import { string, object } from "../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
8
8
|
import { Publication } from "../Core/Publication.js";
|
|
9
|
-
import { unwrap } from "../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
9
|
+
import { defaultArg, unwrap } from "../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
10
10
|
import { Decode_noAdditionalProperties, Decode_resizeArray, Decode_uri } from "./Decode.js";
|
|
11
11
|
import { printf, toText, replace } from "../fable_modules/fable-library-js.4.16.0/String.js";
|
|
12
12
|
import { Person_ROCrate_decodeAuthorListString, Person_ROCrate_encodeAuthorListString } from "./Person.js";
|
|
@@ -70,7 +70,7 @@ export const Publication_ROCrate_decoder = object((get$) => {
|
|
|
70
70
|
return new Publication(unwrap((objectArg = get$.Optional, objectArg.Field("pubMedID", Decode_uri))), unwrap((objectArg_1 = get$.Optional, objectArg_1.Field("doi", string))), unwrap((objectArg_2 = get$.Optional, objectArg_2.Field("authorList", Person_ROCrate_decodeAuthorListString))), unwrap((objectArg_3 = get$.Optional, objectArg_3.Field("title", string))), unwrap((objectArg_4 = get$.Optional, objectArg_4.Field("status", OntologyAnnotation_ROCrate_decoderDefinedTerm))), unwrap((arg_11 = Decode_resizeArray(Comment_ROCrate_decoderDisambiguatingDescription), (objectArg_5 = get$.Optional, objectArg_5.Field("comments", arg_11)))));
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
export function Publication_ISAJson_encoder(oa) {
|
|
73
|
+
export function Publication_ISAJson_encoder(idMap, oa) {
|
|
74
74
|
return new Json(5, [choose((tupledArg) => {
|
|
75
75
|
const v = tupledArg[1];
|
|
76
76
|
if (equals(v, new Json(3, []))) {
|
|
@@ -79,7 +79,7 @@ export function Publication_ISAJson_encoder(oa) {
|
|
|
79
79
|
else {
|
|
80
80
|
return [tupledArg[0], v];
|
|
81
81
|
}
|
|
82
|
-
}, ofArray([tryInclude("pubMedID", (value) => (new Json(0, [value])), oa.PubMedID), tryInclude("doi", (value_2) => (new Json(0, [value_2])), oa.DOI), tryInclude("authorList", (value_4) => (new Json(0, [value_4])), oa.Authors), tryInclude("title", (value_6) => (new Json(0, [value_6])), oa.Title), tryInclude("status", OntologyAnnotation_encoder, oa.Status), tryIncludeSeq("comments", Comment_ISAJson_encoder, oa.Comments)]))]);
|
|
82
|
+
}, ofArray([tryInclude("pubMedID", (value) => (new Json(0, [value])), oa.PubMedID), tryInclude("doi", (value_2) => (new Json(0, [value_2])), oa.DOI), tryInclude("authorList", (value_4) => (new Json(0, [value_4])), oa.Authors), tryInclude("title", (value_6) => (new Json(0, [value_6])), oa.Title), tryInclude("status", OntologyAnnotation_encoder, oa.Status), tryIncludeSeq("comments", (comment) => Comment_ISAJson_encoder(idMap, comment), oa.Comments)]))]);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
export const Publication_ISAJson_allowedFields = ofArray(["pubMedID", "doi", "authorList", "title", "status", "comments"]);
|
|
@@ -141,14 +141,15 @@ export function ARCtrl_Publication__Publication_fromISAJsonString_Static_Z721C83
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
export function
|
|
144
|
+
export function ARCtrl_Publication__Publication_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
145
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
145
146
|
return (obj) => {
|
|
146
|
-
const value = Publication_ISAJson_encoder(obj);
|
|
147
|
+
const value = Publication_ISAJson_encoder(idMap, obj);
|
|
147
148
|
return toString(defaultSpaces(spaces), value);
|
|
148
149
|
};
|
|
149
150
|
}
|
|
150
151
|
|
|
151
|
-
export function
|
|
152
|
-
return
|
|
152
|
+
export function ARCtrl_Publication__Publication_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
153
|
+
return ARCtrl_Publication__Publication_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
153
154
|
}
|
|
154
155
|
|
package/Json/Study.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Option_fromValueWithDefault, ResizeArray_map } from "../Core/Helper/Collections.js";
|
|
2
|
-
import { defaultArgWith, map, bind, unwrap, value as
|
|
2
|
+
import { defaultArgWith, map, bind, unwrap, value as value_17, defaultArg } from "../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
3
3
|
import { empty, map as map_1, singleton, ofArray, choose, tryFind } from "../fable_modules/fable-library-js.4.16.0/List.js";
|
|
4
4
|
import { ArcStudy, ArcAssay } from "../Core/ArcTypes.js";
|
|
5
5
|
import { disposeSafe, getEnumerator, equals } from "../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
@@ -19,22 +19,23 @@ import { list as list_1 } from "../fable_modules/Thoth.Json.Core.0.2.1/Encode.fs
|
|
|
19
19
|
import { Process_ISAJson_decoder, Process_ISAJson_encoder, Process_ROCrate_decoder, Process_ROCrate_encoder } from "./Process/Process.js";
|
|
20
20
|
import { Assay_ISAJson_decoder, Assay_ISAJson_encoder, Assay_ROCrate_decoder, Assay_ROCrate_encoder } from "./Assay.js";
|
|
21
21
|
import { context_jsonvalue } from "./context/rocrate/isa_study_context.js";
|
|
22
|
-
import {
|
|
23
|
-
import { Protocol_ISAJson_encoder } from "./Process/Protocol.js";
|
|
24
|
-
import { encoder } from "./Process/StudyMaterials.js";
|
|
22
|
+
import { getProtocols, getCharacteristics, getFactors, getUnits } from "../Core/Process/ProcessSequence.js";
|
|
25
23
|
import { Factor_ISAJson_encoder } from "./Process/Factor.js";
|
|
26
24
|
import { MaterialAttribute_ISAJson_encoder } from "./Process/MaterialAttribute.js";
|
|
25
|
+
import { encoder as encoder_4 } from "./Process/StudyMaterials.js";
|
|
26
|
+
import { Protocol_ISAJson_encoder } from "./Process/Protocol.js";
|
|
27
|
+
import { encode } from "./IDTable.js";
|
|
27
28
|
import { isEmpty } from "../fable_modules/fable-library-js.4.16.0/Seq.js";
|
|
28
29
|
import { fromString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
29
30
|
import { toString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
30
|
-
import { encode, decode } from "./Table/Compression.js";
|
|
31
|
+
import { encode as encode_1, decode } from "./Table/Compression.js";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* Get registered assays or get assays from `assays` if IsSome
|
|
34
35
|
*/
|
|
35
36
|
export function Study_Helper_getAssayInformation(assays, study) {
|
|
36
37
|
if (assays != null) {
|
|
37
|
-
return ResizeArray_map((assayId) => defaultArg(tryFind((a) => (a.Identifier === assayId),
|
|
38
|
+
return ResizeArray_map((assayId) => defaultArg(tryFind((a) => (a.Identifier === assayId), value_17(assays)), ArcAssay.init(assayId)), study.RegisteredAssayIdentifiers);
|
|
38
39
|
}
|
|
39
40
|
else {
|
|
40
41
|
return study.GetRegisteredAssaysOrIdentifier();
|
|
@@ -121,48 +122,60 @@ export const Study_ROCrate_decoder = object((get$) => {
|
|
|
121
122
|
/**
|
|
122
123
|
* If assays.IsSome then try to get registered assays from external list, otherwise try to access investigation or create empty defaults.
|
|
123
124
|
*/
|
|
124
|
-
export function Study_ISAJson_encoder(assays, s) {
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
125
|
+
export function Study_ISAJson_encoder(idMap, assays, s) {
|
|
126
|
+
const f = (s_1) => {
|
|
127
|
+
let studyName, studyName_1, studyName_2;
|
|
128
|
+
const study = s_1.Copy(true);
|
|
129
|
+
const fileName = Study_fileNameFromIdentifier(study.Identifier);
|
|
130
|
+
let assays_1;
|
|
131
|
+
const n = [];
|
|
132
|
+
let enumerator = getEnumerator(Study_Helper_getAssayInformation(assays, study));
|
|
133
|
+
try {
|
|
134
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
135
|
+
const a = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
136
|
+
const assay = a.Copy();
|
|
137
|
+
let enumerator_1 = getEnumerator(assay.Performers);
|
|
138
|
+
try {
|
|
139
|
+
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
140
|
+
const person_1 = Person_setSourceAssayComment(enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"](), assay.Identifier);
|
|
141
|
+
void (study.Contacts.push(person_1));
|
|
142
|
+
}
|
|
139
143
|
}
|
|
144
|
+
finally {
|
|
145
|
+
disposeSafe(enumerator_1);
|
|
146
|
+
}
|
|
147
|
+
assay.Performers = [];
|
|
148
|
+
void (n.push(assay));
|
|
140
149
|
}
|
|
141
|
-
finally {
|
|
142
|
-
disposeSafe(enumerator_1);
|
|
143
|
-
}
|
|
144
|
-
assay.Performers = [];
|
|
145
|
-
void (n.push(assay));
|
|
146
150
|
}
|
|
151
|
+
finally {
|
|
152
|
+
disposeSafe(enumerator);
|
|
153
|
+
}
|
|
154
|
+
assays_1 = n;
|
|
155
|
+
const processes = ARCtrl_ArcTables__ArcTables_GetProcesses(study);
|
|
156
|
+
const encodedUnits = tryIncludeList("unitCategories", (oa) => OntologyAnnotation_ISAJson_encoder(idMap, oa), getUnits(processes));
|
|
157
|
+
const encodedFactors = tryIncludeList("factors", (value_1) => Factor_ISAJson_encoder(idMap, value_1), getFactors(processes));
|
|
158
|
+
const encodedCharacteristics = tryIncludeList("characteristicCategories", (value_3) => MaterialAttribute_ISAJson_encoder(idMap, value_3), getCharacteristics(processes));
|
|
159
|
+
const encodedMaterials = tryInclude("materials", (ps) => encoder_4(idMap, ps), Option_fromValueWithDefault(empty(), processes));
|
|
160
|
+
let encodedProtocols;
|
|
161
|
+
const value_5 = getProtocols(processes);
|
|
162
|
+
encodedProtocols = tryIncludeList("protocols", (studyName = s_1.Identifier, (oa_1) => Protocol_ISAJson_encoder(studyName, void 0, void 0, idMap, oa_1)), value_5);
|
|
163
|
+
return new Json(5, [choose((tupledArg) => {
|
|
164
|
+
const v = tupledArg[1];
|
|
165
|
+
if (equals(v, new Json(3, []))) {
|
|
166
|
+
return void 0;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return [tupledArg[0], v];
|
|
170
|
+
}
|
|
171
|
+
}, ofArray([["@id", new Json(0, [Study_ROCrate_genID(study)])], ["filename", new Json(0, [fileName])], ["identifier", new Json(0, [study.Identifier])], tryInclude("title", (value_9) => (new Json(0, [value_9])), study.Title), tryInclude("description", (value_11) => (new Json(0, [value_11])), study.Description), tryInclude("submissionDate", (value_13) => (new Json(0, [value_13])), study.SubmissionDate), tryInclude("publicReleaseDate", (value_15) => (new Json(0, [value_15])), study.PublicReleaseDate), tryIncludeSeq("publications", (oa_2) => Publication_ISAJson_encoder(idMap, oa_2), study.Publications), tryIncludeSeq("people", (person_2) => Person_ISAJson_encoder(idMap, person_2), study.Contacts), tryIncludeSeq("studyDesignDescriptors", (oa_3) => OntologyAnnotation_ISAJson_encoder(idMap, oa_3), study.StudyDesignDescriptors), encodedProtocols, encodedMaterials, tryIncludeList("processSequence", (studyName_1 = s_1.Identifier, (oa_4) => Process_ISAJson_encoder(studyName_1, void 0, idMap, oa_4)), processes), tryIncludeSeq("assays", (studyName_2 = s_1.Identifier, (a_2) => Assay_ISAJson_encoder(studyName_2, idMap, a_2)), assays_1), encodedFactors, encodedCharacteristics, encodedUnits, tryIncludeSeq("comments", (comment) => Comment_ISAJson_encoder(idMap, comment), study.Comments)]))]);
|
|
172
|
+
};
|
|
173
|
+
if (idMap != null) {
|
|
174
|
+
return encode(Study_ROCrate_genID, f, s, idMap);
|
|
147
175
|
}
|
|
148
|
-
|
|
149
|
-
|
|
176
|
+
else {
|
|
177
|
+
return f(s);
|
|
150
178
|
}
|
|
151
|
-
assays_1 = n;
|
|
152
|
-
const processes = ARCtrl_ArcTables__ArcTables_GetProcesses(study);
|
|
153
|
-
const protocols = getProtocols(processes);
|
|
154
|
-
const factors = getFactors(processes);
|
|
155
|
-
const characteristics = getCharacteristics(processes);
|
|
156
|
-
const units = getUnits(processes);
|
|
157
|
-
return new Json(5, [choose((tupledArg) => {
|
|
158
|
-
const v = tupledArg[1];
|
|
159
|
-
if (equals(v, new Json(3, []))) {
|
|
160
|
-
return void 0;
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
return [tupledArg[0], v];
|
|
164
|
-
}
|
|
165
|
-
}, ofArray([["filename", new Json(0, [fileName])], ["identifier", new Json(0, [study.Identifier])], tryInclude("title", (value_2) => (new Json(0, [value_2])), study.Title), tryInclude("description", (value_4) => (new Json(0, [value_4])), study.Description), tryInclude("submissionDate", (value_6) => (new Json(0, [value_6])), study.SubmissionDate), tryInclude("publicReleaseDate", (value_8) => (new Json(0, [value_8])), study.PublicReleaseDate), tryIncludeSeq("publications", Publication_ISAJson_encoder, study.Publications), tryIncludeSeq("people", Person_ISAJson_encoder, study.Contacts), tryIncludeSeq("studyDesignDescriptors", OntologyAnnotation_ISAJson_encoder, study.StudyDesignDescriptors), tryIncludeList("protocols", Protocol_ISAJson_encoder, protocols), tryInclude("materials", encoder, Option_fromValueWithDefault(empty(), processes)), tryIncludeList("factors", Factor_ISAJson_encoder, factors), tryIncludeList("characteristicCategories", MaterialAttribute_ISAJson_encoder, characteristics), tryIncludeList("unitCategories", OntologyAnnotation_ISAJson_encoder, units), tryIncludeList("processSequence", Process_ISAJson_encoder, processes), tryIncludeSeq("assays", Assay_ISAJson_encoder, assays_1), tryIncludeSeq("comments", Comment_ISAJson_encoder, study.Comments)]))]);
|
|
166
179
|
}
|
|
167
180
|
|
|
168
181
|
export const Study_ISAJson_allowedFields = ofArray(["@id", "filename", "identifier", "title", "description", "submissionDate", "publicReleaseDate", "publications", "people", "studyDesignDescriptors", "protocols", "materials", "assays", "factors", "characteristicCategories", "unitCategories", "processSequence", "comments", "@type", "@context"]);
|
|
@@ -187,7 +200,7 @@ export const Study_ISAJson_decoder = Decode_objectNoAdditionalProperties(Study_I
|
|
|
187
200
|
personsRaw = objectArg_4.Field("people", arg_10);
|
|
188
201
|
const persons = [];
|
|
189
202
|
if (personsRaw != null) {
|
|
190
|
-
let enumerator = getEnumerator(
|
|
203
|
+
let enumerator = getEnumerator(value_17(personsRaw));
|
|
191
204
|
try {
|
|
192
205
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
193
206
|
const person = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -196,7 +209,7 @@ export const Study_ISAJson_decoder = Decode_objectNoAdditionalProperties(Study_I
|
|
|
196
209
|
try {
|
|
197
210
|
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
198
211
|
const assayIdentifier = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
199
|
-
const enumerator_2 = getEnumerator(
|
|
212
|
+
const enumerator_2 = getEnumerator(value_17(assays));
|
|
200
213
|
try {
|
|
201
214
|
while (enumerator_2["System.Collections.IEnumerator.MoveNext"]()) {
|
|
202
215
|
const assay = enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -268,7 +281,7 @@ export function ARCtrl_ArcStudy__ArcStudy_fromCompressedJsonString_Static_Z721C8
|
|
|
268
281
|
}
|
|
269
282
|
|
|
270
283
|
export function ARCtrl_ArcStudy__ArcStudy_toCompressedJsonString_Static_71136F3F(spaces) {
|
|
271
|
-
return (obj) => toString(defaultArg(spaces, 0),
|
|
284
|
+
return (obj) => toString(defaultArg(spaces, 0), encode_1(Study_encoderCompressed, obj));
|
|
272
285
|
}
|
|
273
286
|
|
|
274
287
|
export function ARCtrl_ArcStudy__ArcStudy_ToCompressedJsonString_71136F3F(this$, spaces) {
|
|
@@ -309,14 +322,15 @@ export function ARCtrl_ArcStudy__ArcStudy_fromISAJsonString_Static_Z721C83C5(s)
|
|
|
309
322
|
}
|
|
310
323
|
}
|
|
311
324
|
|
|
312
|
-
export function
|
|
325
|
+
export function ARCtrl_ArcStudy__ArcStudy_toISAJsonString_Static_Z3FD920F1(assays, spaces, useIDReferencing) {
|
|
326
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
313
327
|
return (obj) => {
|
|
314
|
-
const value = Study_ISAJson_encoder(assays, obj);
|
|
328
|
+
const value = Study_ISAJson_encoder(idMap, assays, obj);
|
|
315
329
|
return toString(defaultSpaces(spaces), value);
|
|
316
330
|
};
|
|
317
331
|
}
|
|
318
332
|
|
|
319
|
-
export function
|
|
320
|
-
return
|
|
333
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToISAJsonString_Z3FD920F1(this$, assays, spaces, useIDReferencing) {
|
|
334
|
+
return ARCtrl_ArcStudy__ArcStudy_toISAJsonString_Static_Z3FD920F1(unwrap(assays), unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
321
335
|
}
|
|
322
336
|
|
package/Json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ARCtrl_OntologyAnnotation__OntologyAnnotation_toROCrateJsonString_Static_71136F3F, ARCtrl_OntologyAnnotation__OntologyAnnotation_toISAJsonString_Static_71136F3F, ARCtrl_OntologyAnnotation__OntologyAnnotation_toJsonString_Static_71136F3F, ARCtrl_OntologyAnnotation__OntologyAnnotation_fromROCrateJsonString_Static_Z721C83C5, ARCtrl_OntologyAnnotation__OntologyAnnotation_fromISAJsonString_Static_Z721C83C5, ARCtrl_OntologyAnnotation__OntologyAnnotation_fromJsonString_Static_Z721C83C5 } from "./Json/OntologyAnnotation.js";
|
|
2
2
|
import { unwrap } from "./fable_modules/fable-library-js.4.16.0/Option.js";
|
|
3
3
|
import { class_type } from "./fable_modules/fable-library-js.4.16.0/Reflection.js";
|
|
4
|
-
import { ARCtrl_ArcAssay__ArcAssay_toROCrateJsonString_Static_5CABCA47,
|
|
5
|
-
import { ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086,
|
|
6
|
-
import { ARCtrl_ArcInvestigation__ArcInvestigation_toROCrateJsonString_Static_71136F3F,
|
|
4
|
+
import { ARCtrl_ArcAssay__ArcAssay_toROCrateJsonString_Static_5CABCA47, ARCtrl_ArcAssay__ArcAssay_toISAJsonString_Static_Z3B036AA, ARCtrl_ArcAssay__ArcAssay_toCompressedJsonString_Static_71136F3F, ARCtrl_ArcAssay__ArcAssay_toJsonString_Static_71136F3F, ARCtrl_ArcAssay__ArcAssay_fromROCrateJsonString_Static_Z721C83C5, ARCtrl_ArcAssay__ArcAssay_fromISAJsonString_Static_Z721C83C5, ARCtrl_ArcAssay__ArcAssay_fromCompressedJsonString_Static_Z721C83C5, ARCtrl_ArcAssay__ArcAssay_fromJsonString_Static_Z721C83C5 } from "./Json/Assay.js";
|
|
5
|
+
import { ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086, ARCtrl_ArcStudy__ArcStudy_toISAJsonString_Static_Z3FD920F1, ARCtrl_ArcStudy__ArcStudy_toCompressedJsonString_Static_71136F3F, ARCtrl_ArcStudy__ArcStudy_toJsonString_Static_71136F3F, ARCtrl_ArcStudy__ArcStudy_fromROCrateJsonString_Static_Z721C83C5, ARCtrl_ArcStudy__ArcStudy_fromISAJsonString_Static_Z721C83C5, ARCtrl_ArcStudy__ArcStudy_fromCompressedJsonString_Static_Z721C83C5, ARCtrl_ArcStudy__ArcStudy_fromJsonString_Static_Z721C83C5 } from "./Json/Study.js";
|
|
6
|
+
import { ARCtrl_ArcInvestigation__ArcInvestigation_toROCrateJsonString_Static_71136F3F, ARCtrl_ArcInvestigation__ArcInvestigation_toISAJsonString_Static_Z3B036AA, ARCtrl_ArcInvestigation__ArcInvestigation_toCompressedJsonString_Static_71136F3F, ARCtrl_ArcInvestigation__ArcInvestigation_toJsonString_Static_71136F3F, ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateJsonString_Static_Z721C83C5, ARCtrl_ArcInvestigation__ArcInvestigation_fromISAJsonString_Static_Z721C83C5, ARCtrl_ArcInvestigation__ArcInvestigation_fromCompressedJsonString_Static_Z721C83C5, ARCtrl_ArcInvestigation__ArcInvestigation_fromJsonString_Static_Z721C83C5 } from "./Json/Investigation.js";
|
|
7
7
|
import { ARC } from "./ARC.js";
|
|
8
8
|
|
|
9
9
|
export class JsonHelper_OntologyAnnotationJson {
|
|
@@ -58,8 +58,8 @@ export class JsonHelper_AssayJson {
|
|
|
58
58
|
toCompressedJsonString(assay, spaces) {
|
|
59
59
|
return ARCtrl_ArcAssay__ArcAssay_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(assay);
|
|
60
60
|
}
|
|
61
|
-
toISAJsonString(assay, spaces) {
|
|
62
|
-
return
|
|
61
|
+
toISAJsonString(assay, spaces, useIDReferencing) {
|
|
62
|
+
return ARCtrl_ArcAssay__ArcAssay_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(assay);
|
|
63
63
|
}
|
|
64
64
|
toROCrateJsonString(assay, studyName, spaces) {
|
|
65
65
|
return ARCtrl_ArcAssay__ArcAssay_toROCrateJsonString_Static_5CABCA47(studyName, unwrap(spaces))(assay);
|
|
@@ -95,8 +95,8 @@ export class JsonHelper_StudyJson {
|
|
|
95
95
|
toCompressedJsonString(study, spaces) {
|
|
96
96
|
return ARCtrl_ArcStudy__ArcStudy_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(study);
|
|
97
97
|
}
|
|
98
|
-
toISAJsonString(study, assays, spaces) {
|
|
99
|
-
return
|
|
98
|
+
toISAJsonString(study, assays, spaces, useIDReferencing) {
|
|
99
|
+
return ARCtrl_ArcStudy__ArcStudy_toISAJsonString_Static_Z3FD920F1(unwrap(assays), unwrap(spaces), unwrap(useIDReferencing))(study);
|
|
100
100
|
}
|
|
101
101
|
toROCrateJsonString(study, assays, spaces) {
|
|
102
102
|
return ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086(unwrap(assays), unwrap(spaces))(study);
|
|
@@ -132,8 +132,8 @@ export class JsonHelper_InvestigationJson {
|
|
|
132
132
|
toCompressedJsonString(investigation, spaces) {
|
|
133
133
|
return ARCtrl_ArcInvestigation__ArcInvestigation_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(investigation);
|
|
134
134
|
}
|
|
135
|
-
toISAJsonString(investigation, spaces) {
|
|
136
|
-
return
|
|
135
|
+
toISAJsonString(investigation, spaces, useIDReferencing) {
|
|
136
|
+
return ARCtrl_ArcInvestigation__ArcInvestigation_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(investigation);
|
|
137
137
|
}
|
|
138
138
|
toROCrateJsonString(investigation, spaces) {
|
|
139
139
|
return ARCtrl_ArcInvestigation__ArcInvestigation_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(investigation);
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { iterateIndexed, length, sortBy, collect
|
|
2
|
-
import { map as map_1
|
|
3
|
-
import {
|
|
1
|
+
import { iterateIndexed, length, sortBy, collect as collect_1, exists, toArray, ofArray, empty, tail, head, isEmpty, cons, singleton, fold, map, reverse } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
2
|
+
import { item, map as map_1 } from "../../fable_modules/fable-library-js.4.16.0/Array.js";
|
|
3
|
+
import { singleton as singleton_1, collect, map as map_2, delay, toArray as toArray_1, tryFind } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
|
|
4
|
+
import { toStringCellColumns, fixDeprecatedIOHeader, fromStringCellColumns } from "./CompositeColumn.js";
|
|
4
5
|
import { printf, toFail } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
6
|
+
import { Dictionary_tryGet, FsCellsCollection__TryGetCell_Z37302880 } from "../../fable_modules/FsSpreadsheet.6.1.2/Cells/FsCellsCollection.fs.js";
|
|
7
|
+
import { rangeDouble } from "../../fable_modules/fable-library-js.4.16.0/Range.js";
|
|
8
|
+
import { FsAddress_$ctor_Z37302880, FsAddress__get_ColumnNumber, FsAddress__get_RowNumber } from "../../fable_modules/FsSpreadsheet.6.1.2/FsAddress.fs.js";
|
|
9
|
+
import { FsRangeAddress_$ctor_7E77A4A0, FsRangeAddress__get_LastAddress } from "../../fable_modules/FsSpreadsheet.6.1.2/Ranges/FsRangeAddress.fs.js";
|
|
10
|
+
import { FsRangeBase__Cell_Z3407A44B, FsRangeBase__get_RangeAddress } from "../../fable_modules/FsSpreadsheet.6.1.2/Ranges/FsRangeBase.fs.js";
|
|
5
11
|
import { ArcTable } from "../../Core/Table/ArcTable.js";
|
|
6
12
|
import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.6.1.2/FsWorksheet.fs.js";
|
|
7
13
|
import { comparePrimitives } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
8
|
-
import { FsRangeAddress_$ctor_7E77A4A0 } from "../../fable_modules/FsSpreadsheet.6.1.2/Ranges/FsRangeAddress.fs.js";
|
|
9
|
-
import { FsAddress_$ctor_Z37302880 } from "../../fable_modules/FsSpreadsheet.6.1.2/FsAddress.fs.js";
|
|
10
|
-
import { Dictionary_tryGet } from "../../fable_modules/FsSpreadsheet.6.1.2/Cells/FsCellsCollection.fs.js";
|
|
11
14
|
import { addToDict } from "../../fable_modules/fable-library-js.4.16.0/MapUtil.js";
|
|
12
|
-
import { FsRangeBase__Cell_Z3407A44B } from "../../fable_modules/FsSpreadsheet.6.1.2/Ranges/FsRangeBase.fs.js";
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Iterates over elements of the input list and groups adjacent elements.
|
|
@@ -64,11 +66,11 @@ export function classifyColumnOrder(column) {
|
|
|
64
66
|
|
|
65
67
|
export const helperColumnStrings = ofArray(["Term Source REF", "Term Accession Number", "Unit", "Data Format", "Data Selector Format"]);
|
|
66
68
|
|
|
67
|
-
export function groupColumnsByHeader(
|
|
68
|
-
return Aux_List_groupWhen((c) => {
|
|
69
|
-
const v = c
|
|
69
|
+
export function groupColumnsByHeader(stringCellColumns) {
|
|
70
|
+
return map_1(toArray, toArray(Aux_List_groupWhen((c) => {
|
|
71
|
+
const v = item(0, c);
|
|
70
72
|
return !exists((s) => (v.indexOf(s) === 0), helperColumnStrings);
|
|
71
|
-
},
|
|
73
|
+
}, ofArray(stringCellColumns))));
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
/**
|
|
@@ -81,8 +83,8 @@ export function tryAnnotationTable(sheet) {
|
|
|
81
83
|
/**
|
|
82
84
|
* Groups and parses a collection of single columns into the according ISA composite columns
|
|
83
85
|
*/
|
|
84
|
-
export function composeColumns(
|
|
85
|
-
return
|
|
86
|
+
export function composeColumns(stringCellColumns) {
|
|
87
|
+
return map_1(fromStringCellColumns, groupColumnsByHeader(stringCellColumns));
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
/**
|
|
@@ -96,7 +98,16 @@ export function tryFromFsWorksheet(sheet) {
|
|
|
96
98
|
}
|
|
97
99
|
else {
|
|
98
100
|
const t = matchValue;
|
|
99
|
-
const compositeColumns = composeColumns(map_1(fixDeprecatedIOHeader,
|
|
101
|
+
const compositeColumns = composeColumns(map_1(fixDeprecatedIOHeader, toArray_1(delay(() => map_2((c) => toArray_1(delay(() => collect((r) => {
|
|
102
|
+
const matchValue_1 = FsCellsCollection__TryGetCell_Z37302880(sheet.CellCollection, r, c);
|
|
103
|
+
if (matchValue_1 == null) {
|
|
104
|
+
return singleton_1("");
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const cell = matchValue_1;
|
|
108
|
+
return singleton_1(cell.ValueAsString());
|
|
109
|
+
}
|
|
110
|
+
}, rangeDouble(1, 1, FsAddress__get_RowNumber(FsRangeAddress__get_LastAddress(FsRangeBase__get_RangeAddress(t))))))), rangeDouble(1, 1, FsAddress__get_ColumnNumber(FsRangeAddress__get_LastAddress(FsRangeBase__get_RangeAddress(t)))))))));
|
|
100
111
|
return ArcTable.addColumns(compositeColumns, void 0, true)(ArcTable.init(sheet.Name));
|
|
101
112
|
}
|
|
102
113
|
}
|
|
@@ -114,30 +125,29 @@ export function toFsWorksheet(table) {
|
|
|
114
125
|
return ws;
|
|
115
126
|
}
|
|
116
127
|
else {
|
|
117
|
-
const columns =
|
|
128
|
+
const columns = collect_1(toStringCellColumns, sortBy(classifyColumnOrder, ofArray(table.Columns), {
|
|
118
129
|
Compare: comparePrimitives,
|
|
119
130
|
}));
|
|
120
131
|
const maxRow = length(head(columns)) | 0;
|
|
121
132
|
const maxCol = length(columns) | 0;
|
|
122
133
|
const fsTable = ws.Table("annotationTable", FsRangeAddress_$ctor_7E77A4A0(FsAddress_$ctor_Z37302880(1, 1), FsAddress_$ctor_Z37302880(maxRow, maxCol)));
|
|
123
134
|
iterateIndexed((colI, col) => {
|
|
124
|
-
iterateIndexed((rowI,
|
|
135
|
+
iterateIndexed((rowI, stringCell) => {
|
|
125
136
|
let value;
|
|
126
|
-
const v = cell.ValueAsString();
|
|
127
137
|
if (rowI === 0) {
|
|
128
|
-
const matchValue = Dictionary_tryGet(
|
|
138
|
+
const matchValue = Dictionary_tryGet(stringCell, stringCount);
|
|
129
139
|
if (matchValue == null) {
|
|
130
|
-
addToDict(stringCount,
|
|
131
|
-
value =
|
|
140
|
+
addToDict(stringCount, stringCell, "");
|
|
141
|
+
value = stringCell;
|
|
132
142
|
}
|
|
133
143
|
else {
|
|
134
144
|
const spaces = matchValue;
|
|
135
|
-
stringCount.set(
|
|
136
|
-
value = ((
|
|
145
|
+
stringCount.set(stringCell, spaces + " ");
|
|
146
|
+
value = ((stringCell + " ") + spaces);
|
|
137
147
|
}
|
|
138
148
|
}
|
|
139
149
|
else {
|
|
140
|
-
value =
|
|
150
|
+
value = stringCell;
|
|
141
151
|
}
|
|
142
152
|
const address = FsAddress_$ctor_Z37302880(rowI + 1, colI + 1);
|
|
143
153
|
FsRangeBase__Cell_Z3407A44B(fsTable, address, ws.CellCollection).SetValueAs(value);
|