@nfdi4plants/arctrl 1.0.0-beta.8 → 1.0.0
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 +9 -8
- package/Contracts/Contracts.ArcTypes.js +12 -9
- package/ISA/ISA/ArcTypes/ArcTable.js +17 -17
- package/ISA/ISA/ArcTypes/ArcTableAux.js +13 -11
- package/ISA/ISA/ArcTypes/ArcTables.js +6 -6
- package/ISA/ISA/ArcTypes/ArcTypes.js +209 -185
- package/ISA/ISA/ArcTypes/CompositeHeader.js +2 -2
- package/ISA/ISA/ArcTypes/CompositeRow.js +4 -4
- package/ISA/ISA/Fable.js +83 -10
- package/ISA/ISA/Helper.js +11 -4
- package/ISA/ISA/Identifier.js +10 -8
- package/ISA/ISA/JsonTypes/ColumnIndex.js +2 -2
- package/ISA/ISA/JsonTypes/Component.js +24 -16
- package/ISA/ISA/JsonTypes/OntologyAnnotation.js +3 -2
- package/ISA/ISA/JsonTypes/Process.js +7 -6
- package/ISA/ISA/JsonTypes/ProcessParameterValue.js +70 -92
- package/ISA/ISA/JsonTypes/ProtocolParameter.js +51 -79
- package/ISA/ISA/JsonTypes/Value.js +100 -165
- package/ISA/ISA/Regex.js +12 -6
- package/ISA/ISA.Json/ArcTypes/ArcAssay.js +197 -0
- package/ISA/ISA.Json/ArcTypes/ArcInvestigation.js +79 -0
- package/ISA/ISA.Json/ArcTypes/ArcStudy.js +77 -0
- package/ISA/ISA.Json/ArcTypes/ArcTable.js +57 -0
- package/ISA/ISA.Json/ArcTypes/CompositeCell.js +51 -0
- package/ISA/ISA.Json/ArcTypes/CompositeHeader.js +82 -0
- package/ISA/ISA.Json/ArcTypes/IOType.js +35 -0
- package/ISA/ISA.Json/Assay.js +0 -18
- package/ISA/ISA.Json/Investigation.js +17 -35
- package/ISA/ISA.Json/Process.js +3 -3
- package/ISA/ISA.Json/Study.js +0 -18
- package/ISA/ISA.Spreadsheet/ArcAssay.js +3 -3
- package/ISA/ISA.Spreadsheet/ArcInvestigation.js +21 -5
- package/ISA/ISA.Spreadsheet/ArcStudy.js +3 -5
- package/ISA/ISA.Spreadsheet/Metadata/Conversions.js +3 -3
- package/SemVer.js +5 -7
- package/Templates/Template.Json.js +12 -17
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { OntologySourceReference_encoder, OntologyAnnotation_encoder, OntologySourceReference_decoder, OntologyAnnotation_decoder } from "../Ontology.js";
|
|
2
|
+
import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor } from "../ConverterOptions.js";
|
|
3
|
+
import { fromString, object as object_1, string, list as list_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
|
|
4
|
+
import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
5
|
+
import { ArcTable_encoder, ArcTable_decoder } from "./ArcTable.js";
|
|
6
|
+
import { encoder, decoder as decoder_1 } from "../Person.js";
|
|
7
|
+
import { encoder as encoder_1, decoder as decoder_2 } from "../Comment.js";
|
|
8
|
+
import { Factor_encoder, Factor_decoder } from "../Factor.js";
|
|
9
|
+
import { encoder as encoder_2, decoder as decoder_3 } from "../Publication.js";
|
|
10
|
+
import { value as value_3, map, defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
11
|
+
import { toArray } from "../../../fable_modules/fable-library.4.5.0/List.js";
|
|
12
|
+
import { toString, object, seq } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
|
|
13
|
+
import { empty, singleton, append, delay, toList, map as map_1 } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
14
|
+
import { ArcAssay } from "../../ISA/ArcTypes/ArcTypes.js";
|
|
15
|
+
import { Assay_decoder, Assay_encoder } from "../Assay.js";
|
|
16
|
+
import { fromJsonString } from "../Decode.js";
|
|
17
|
+
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
18
|
+
|
|
19
|
+
export const JsonHelper_DecodeOa = OntologyAnnotation_decoder(ConverterOptions_$ctor());
|
|
20
|
+
|
|
21
|
+
export const JsonHelper_DecodeTables = (path) => ((value) => list_1(uncurry2(ArcTable_decoder), path, value));
|
|
22
|
+
|
|
23
|
+
export const JsonHelper_DecodePersons = (() => {
|
|
24
|
+
const decoder = decoder_1(ConverterOptions_$ctor());
|
|
25
|
+
return (path) => ((value) => list_1(uncurry2(decoder), path, value));
|
|
26
|
+
})();
|
|
27
|
+
|
|
28
|
+
export const JsonHelper_DecodeComments = (() => {
|
|
29
|
+
const decoder = decoder_2(ConverterOptions_$ctor());
|
|
30
|
+
return (path) => ((value) => list_1(uncurry2(decoder), path, value));
|
|
31
|
+
})();
|
|
32
|
+
|
|
33
|
+
export const JsonHelper_DecodeFactors = (() => {
|
|
34
|
+
const decoder = Factor_decoder(ConverterOptions_$ctor());
|
|
35
|
+
return (path) => ((value) => list_1(uncurry2(decoder), path, value));
|
|
36
|
+
})();
|
|
37
|
+
|
|
38
|
+
export const JsonHelper_DecodePublications = (() => {
|
|
39
|
+
const decoder = decoder_3(ConverterOptions_$ctor());
|
|
40
|
+
return (path) => ((value) => list_1(uncurry2(decoder), path, value));
|
|
41
|
+
})();
|
|
42
|
+
|
|
43
|
+
export const JsonHelper_DecodeOntologySourceReferences = (() => {
|
|
44
|
+
const decoder = OntologySourceReference_decoder(ConverterOptions_$ctor());
|
|
45
|
+
return (path) => ((value) => list_1(uncurry2(decoder), path, value));
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
export function JsonHelper_tryGetTables(get$, fieldName) {
|
|
49
|
+
let objectArg;
|
|
50
|
+
return defaultArg(map((collection) => Array.from(collection), (objectArg = get$.Optional, objectArg.Field(fieldName, uncurry2(JsonHelper_DecodeTables)))), []);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function JsonHelper_tryGetPersons(get$, fieldName) {
|
|
54
|
+
let objectArg;
|
|
55
|
+
return defaultArg(map(toArray, (objectArg = get$.Optional, objectArg.Field(fieldName, uncurry2(JsonHelper_DecodePersons)))), new Array(0));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function JsonHelper_tryGetComments(get$, fieldName) {
|
|
59
|
+
let objectArg;
|
|
60
|
+
return defaultArg(map(toArray, (objectArg = get$.Optional, objectArg.Field(fieldName, uncurry2(JsonHelper_DecodeComments)))), new Array(0));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function JsonHelper_tryGetPublications(get$, fieldName) {
|
|
64
|
+
let objectArg;
|
|
65
|
+
return defaultArg(map(toArray, (objectArg = get$.Optional, objectArg.Field(fieldName, uncurry2(JsonHelper_DecodePublications)))), new Array(0));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function JsonHelper_tryGetOAs(get$, fieldName) {
|
|
69
|
+
let objectArg;
|
|
70
|
+
return defaultArg(map(toArray, (objectArg = get$.Optional, objectArg.Field(fieldName, (path, value) => list_1(uncurry2(JsonHelper_DecodeOa), path, value)))), new Array(0));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function JsonHelper_tryGetFactors(get$, fieldName) {
|
|
74
|
+
let objectArg;
|
|
75
|
+
return defaultArg(map(toArray, (objectArg = get$.Optional, objectArg.Field(fieldName, uncurry2(JsonHelper_DecodeFactors)))), new Array(0));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function JsonHelper_tryGetStringResizeArray(get$, fieldName) {
|
|
79
|
+
let objectArg;
|
|
80
|
+
return defaultArg(map((collection) => Array.from(collection), (objectArg = get$.Optional, objectArg.Field(fieldName, (path_1, value_1) => list_1(string, path_1, value_1)))), []);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function JsonHelper_tryGetOntologySourceReferences(get$, fieldName) {
|
|
84
|
+
let objectArg;
|
|
85
|
+
return defaultArg(map(toArray, (objectArg = get$.Optional, objectArg.Field(fieldName, uncurry2(JsonHelper_DecodeOntologySourceReferences)))), new Array(0));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function JsonHelper_EncoderOA(t) {
|
|
89
|
+
return OntologyAnnotation_encoder(ConverterOptions_$ctor(), t);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function JsonHelper_EncoderOAs(t) {
|
|
93
|
+
return seq(map_1(JsonHelper_EncoderOA, t));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function JsonHelper_EncoderTables(t) {
|
|
97
|
+
return seq(map_1(ArcTable_encoder, t));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function JsonHelper_EncoderPerson(t) {
|
|
101
|
+
return encoder(ConverterOptions_$ctor(), t);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function JsonHelper_EncoderPersons(t) {
|
|
105
|
+
return seq(map_1(JsonHelper_EncoderPerson, t));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function JsonHelper_EncoderComment(t) {
|
|
109
|
+
return encoder_1(ConverterOptions_$ctor(), t);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function JsonHelper_EncoderComments(t) {
|
|
113
|
+
return seq(map_1(JsonHelper_EncoderComment, t));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function JsonHelper_EncoderPublication(t) {
|
|
117
|
+
return encoder_2(ConverterOptions_$ctor(), t);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function JsonHelper_EncoderPublications(t) {
|
|
121
|
+
return seq(map_1(JsonHelper_EncoderPublication, t));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function JsonHelper_EncoderFactor(t) {
|
|
125
|
+
return Factor_encoder(ConverterOptions_$ctor(), t);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function JsonHelper_EncoderFactors(t) {
|
|
129
|
+
return seq(map_1(JsonHelper_EncoderFactor, t));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function JsonHelper_EncoderOntologySourceReference(t) {
|
|
133
|
+
return OntologySourceReference_encoder(ConverterOptions_$ctor(), t);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function JsonHelper_EncoderOntologySourceReferences(t) {
|
|
137
|
+
return seq(map_1(JsonHelper_EncoderOntologySourceReference, t));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function ArcAssay_encoder(assay) {
|
|
141
|
+
return object(toList(delay(() => append(singleton(["Identifier", assay.Identifier]), delay(() => append((assay.MeasurementType != null) ? singleton(["MeasurementType", JsonHelper_EncoderOA(value_3(assay.MeasurementType))]) : empty(), delay(() => append((assay.TechnologyType != null) ? singleton(["TechnologyType", JsonHelper_EncoderOA(value_3(assay.TechnologyType))]) : empty(), delay(() => append((assay.TechnologyPlatform != null) ? singleton(["TechnologyPlatform", JsonHelper_EncoderOA(value_3(assay.TechnologyPlatform))]) : empty(), delay(() => append((assay.Tables.length !== 0) ? singleton(["Tables", JsonHelper_EncoderTables(assay.Tables)]) : empty(), delay(() => append((assay.Performers.length !== 0) ? singleton(["Performers", JsonHelper_EncoderPersons(assay.Performers)]) : empty(), delay(() => ((assay.Comments.length !== 0) ? singleton(["Comments", JsonHelper_EncoderComments(assay.Comments)]) : empty()))))))))))))))));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const ArcAssay_decoder = (path_1) => ((v) => object_1((get$) => {
|
|
145
|
+
let identifier;
|
|
146
|
+
const objectArg = get$.Required;
|
|
147
|
+
identifier = objectArg.Field("Identifier", string);
|
|
148
|
+
let measurementType;
|
|
149
|
+
const objectArg_1 = get$.Optional;
|
|
150
|
+
measurementType = objectArg_1.Field("MeasurementType", uncurry2(JsonHelper_DecodeOa));
|
|
151
|
+
let technologyType;
|
|
152
|
+
const objectArg_2 = get$.Optional;
|
|
153
|
+
technologyType = objectArg_2.Field("TechnologyType", uncurry2(JsonHelper_DecodeOa));
|
|
154
|
+
let technologyPlatform;
|
|
155
|
+
const objectArg_3 = get$.Optional;
|
|
156
|
+
technologyPlatform = objectArg_3.Field("TechnologyPlatform", uncurry2(JsonHelper_DecodeOa));
|
|
157
|
+
const tables = JsonHelper_tryGetTables(get$, "Tables");
|
|
158
|
+
const performers = JsonHelper_tryGetPersons(get$, "Performers");
|
|
159
|
+
const comments = JsonHelper_tryGetComments(get$, "Comments");
|
|
160
|
+
return ArcAssay.make(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments);
|
|
161
|
+
}, path_1, v));
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* exports in json-ld format
|
|
165
|
+
*/
|
|
166
|
+
export function ArcAssay_toStringLD(a) {
|
|
167
|
+
let returnVal;
|
|
168
|
+
return toString(2, Assay_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToAssay()));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function ArcAssay_fromJsonString(s) {
|
|
172
|
+
const a = fromJsonString(uncurry2(Assay_decoder(ConverterOptions_$ctor())), s);
|
|
173
|
+
return ArcAssay.fromAssay(a);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function ArcAssay_toJsonString(a) {
|
|
177
|
+
return toString(2, Assay_encoder(ConverterOptions_$ctor(), a.ToAssay()));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function ARCtrl_ISA_ArcAssay__ArcAssay_fromArcJsonString_Static_Z721C83C5(jsonString) {
|
|
181
|
+
const matchValue = fromString(uncurry2(ArcAssay_decoder), jsonString);
|
|
182
|
+
if (matchValue.tag === 1) {
|
|
183
|
+
return toFail(printf("Error. Unable to parse json string to ArcAssay: %s"))(matchValue.fields[0]);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
return matchValue.fields[0];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function ARCtrl_ISA_ArcAssay__ArcAssay_ToArcJsonString_71136F3F(this$, spaces) {
|
|
191
|
+
return toString(defaultArg(spaces, 0), ArcAssay_encoder(this$));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function ARCtrl_ISA_ArcAssay__ArcAssay_toArcJsonString_Static_1C75D08D(a) {
|
|
195
|
+
return ARCtrl_ISA_ArcAssay__ArcAssay_ToArcJsonString_71136F3F(a);
|
|
196
|
+
}
|
|
197
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { toString, seq, object } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
|
|
2
|
+
import { map, empty, singleton, append, delay, toList } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
3
|
+
import { map as map_1, defaultArg, value as value_9 } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
4
|
+
import { JsonHelper_tryGetComments, JsonHelper_tryGetStringResizeArray, ArcAssay_decoder, JsonHelper_tryGetPersons, JsonHelper_tryGetPublications, JsonHelper_tryGetOntologySourceReferences, JsonHelper_EncoderComments, ArcAssay_encoder, JsonHelper_EncoderPersons, JsonHelper_EncoderPublications, JsonHelper_EncoderOntologySourceReferences } from "./ArcAssay.js";
|
|
5
|
+
import { ArcStudy_decoder, ArcStudy_encoder } from "./ArcStudy.js";
|
|
6
|
+
import { fromString, list, string, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
|
|
7
|
+
import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
8
|
+
import { ArcInvestigation } from "../../ISA/ArcTypes/ArcTypes.js";
|
|
9
|
+
import { decoder as decoder_2, encoder } from "../Investigation.js";
|
|
10
|
+
import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor } from "../ConverterOptions.js";
|
|
11
|
+
import { fromJsonString } from "../Decode.js";
|
|
12
|
+
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
13
|
+
|
|
14
|
+
export function ArcInvestigation_encoder(inv) {
|
|
15
|
+
return object(toList(delay(() => append(singleton(["Identifier", inv.Identifier]), delay(() => append((inv.Title != null) ? singleton(["Title", value_9(inv.Title)]) : empty(), delay(() => append((inv.Description != null) ? singleton(["Description", value_9(inv.Description)]) : empty(), delay(() => append((inv.SubmissionDate != null) ? singleton(["SubmissionDate", value_9(inv.SubmissionDate)]) : empty(), delay(() => append((inv.PublicReleaseDate != null) ? singleton(["PublicReleaseDate", value_9(inv.PublicReleaseDate)]) : empty(), delay(() => append((inv.OntologySourceReferences.length !== 0) ? singleton(["OntologySourceReferences", JsonHelper_EncoderOntologySourceReferences(inv.OntologySourceReferences)]) : empty(), delay(() => append((inv.Publications.length !== 0) ? singleton(["Publications", JsonHelper_EncoderPublications(inv.Publications)]) : empty(), delay(() => append((inv.Contacts.length !== 0) ? singleton(["Contacts", JsonHelper_EncoderPersons(inv.Contacts)]) : empty(), delay(() => append((inv.Assays.length !== 0) ? singleton(["Assays", seq(map(ArcAssay_encoder, inv.Assays))]) : empty(), delay(() => append((inv.Studies.length !== 0) ? singleton(["Studies", seq(map(ArcStudy_encoder, inv.Studies))]) : empty(), delay(() => append((inv.RegisteredStudyIdentifiers.length !== 0) ? singleton(["RegisteredStudyIdentifiers", seq(map((value_5) => value_5, inv.RegisteredStudyIdentifiers))]) : empty(), delay(() => ((inv.Comments.length !== 0) ? singleton(["Comments", JsonHelper_EncoderComments(inv.Comments)]) : empty()))))))))))))))))))))))))));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ArcInvestigation_decoder = (path_7) => ((v) => object_1((get$_2) => {
|
|
19
|
+
let objectArg, objectArg_1;
|
|
20
|
+
let identifier;
|
|
21
|
+
const objectArg_2 = get$_2.Required;
|
|
22
|
+
identifier = objectArg_2.Field("Identifier", string);
|
|
23
|
+
let title;
|
|
24
|
+
const objectArg_3 = get$_2.Optional;
|
|
25
|
+
title = objectArg_3.Field("Title", string);
|
|
26
|
+
let description;
|
|
27
|
+
const objectArg_4 = get$_2.Optional;
|
|
28
|
+
description = objectArg_4.Field("Description", string);
|
|
29
|
+
let submissionDate;
|
|
30
|
+
const objectArg_5 = get$_2.Optional;
|
|
31
|
+
submissionDate = objectArg_5.Field("SubmissionDate", string);
|
|
32
|
+
let publicReleaseDate;
|
|
33
|
+
const objectArg_6 = get$_2.Optional;
|
|
34
|
+
publicReleaseDate = objectArg_6.Field("PublicReleaseDate", string);
|
|
35
|
+
const ontologySourceReferences = JsonHelper_tryGetOntologySourceReferences(get$_2, "OntologySourceReferences");
|
|
36
|
+
const publications = JsonHelper_tryGetPublications(get$_2, "Publications");
|
|
37
|
+
const contacts = JsonHelper_tryGetPersons(get$_2, "Contacts");
|
|
38
|
+
const assays = defaultArg(map_1((collection) => Array.from(collection), (objectArg = get$_2.Optional, objectArg.Field("Assays", (path, value) => list(uncurry2(ArcAssay_decoder), path, value)))), []);
|
|
39
|
+
const studies = defaultArg(map_1((collection_1) => Array.from(collection_1), (objectArg_1 = get$_2.Optional, objectArg_1.Field("Studies", (path_1, value_1) => list(uncurry2(ArcStudy_decoder), path_1, value_1)))), []);
|
|
40
|
+
const registeredStudyIdentifiers = JsonHelper_tryGetStringResizeArray(get$_2, "RegisteredStudyIdentifiers");
|
|
41
|
+
const comments = JsonHelper_tryGetComments(get$_2, "Comments");
|
|
42
|
+
return ArcInvestigation.make(identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications, contacts, assays, studies, registeredStudyIdentifiers, comments, []);
|
|
43
|
+
}, path_7, v));
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* exports in json-ld format
|
|
47
|
+
*/
|
|
48
|
+
export function ArcInvestigation_toStringLD(a) {
|
|
49
|
+
let returnVal;
|
|
50
|
+
return toString(2, encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToInvestigation()));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function ArcInvestigation_fromJsonString(s) {
|
|
54
|
+
const i = fromJsonString(uncurry2(decoder_2(ConverterOptions_$ctor())), s);
|
|
55
|
+
return ArcInvestigation.fromInvestigation(i);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function ArcInvestigation_toJsonString(a) {
|
|
59
|
+
return toString(2, encoder(ConverterOptions_$ctor(), a.ToInvestigation()));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function ARCtrl_ISA_ArcInvestigation__ArcInvestigation_fromArcJsonString_Static_Z721C83C5(jsonString) {
|
|
63
|
+
const matchValue = fromString(uncurry2(ArcInvestigation_decoder), jsonString);
|
|
64
|
+
if (matchValue.tag === 1) {
|
|
65
|
+
return toFail(printf("Error. Unable to parse json string to ArcInvestigation: %s"))(matchValue.fields[0]);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return matchValue.fields[0];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function ARCtrl_ISA_ArcInvestigation__ArcInvestigation_ToArcJsonString_71136F3F(this$, spaces) {
|
|
73
|
+
return toString(defaultArg(spaces, 0), ArcInvestigation_encoder(this$));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function ARCtrl_ISA_ArcInvestigation__ArcInvestigation_toArcJsonString_Static_Z4D87C88C(a) {
|
|
77
|
+
return ARCtrl_ISA_ArcInvestigation__ArcInvestigation_ToArcJsonString_71136F3F(a);
|
|
78
|
+
}
|
|
79
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { toString, seq, object } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
|
|
2
|
+
import { map, empty, singleton, append, delay, toList } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
3
|
+
import { defaultArg, value as value_7 } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
4
|
+
import { JsonHelper_tryGetComments, JsonHelper_tryGetFactors, JsonHelper_tryGetStringResizeArray, JsonHelper_tryGetTables, JsonHelper_tryGetOAs, JsonHelper_tryGetPersons, JsonHelper_tryGetPublications, JsonHelper_EncoderComments, JsonHelper_EncoderFactors, JsonHelper_EncoderTables, JsonHelper_EncoderOAs, JsonHelper_EncoderPersons, JsonHelper_EncoderPublications } from "./ArcAssay.js";
|
|
5
|
+
import { fromString, string, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
|
|
6
|
+
import { ArcStudy } from "../../ISA/ArcTypes/ArcTypes.js";
|
|
7
|
+
import { Study_decoder, Study_encoder } from "../Study.js";
|
|
8
|
+
import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor } from "../ConverterOptions.js";
|
|
9
|
+
import { fromJsonString } from "../Decode.js";
|
|
10
|
+
import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
11
|
+
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
12
|
+
|
|
13
|
+
export function ArcStudy_encoder(study) {
|
|
14
|
+
return object(toList(delay(() => append(singleton(["Identifier", study.Identifier]), delay(() => append((study.Title != null) ? singleton(["Title", value_7(study.Title)]) : empty(), delay(() => append((study.Description != null) ? singleton(["Description", value_7(study.Description)]) : empty(), delay(() => append((study.SubmissionDate != null) ? singleton(["SubmissionDate", value_7(study.SubmissionDate)]) : empty(), delay(() => append((study.PublicReleaseDate != null) ? singleton(["PublicReleaseDate", value_7(study.PublicReleaseDate)]) : empty(), delay(() => append((study.Publications.length !== 0) ? singleton(["Publications", JsonHelper_EncoderPublications(study.Publications)]) : empty(), delay(() => append((study.Contacts.length !== 0) ? singleton(["Contacts", JsonHelper_EncoderPersons(study.Contacts)]) : empty(), delay(() => append((study.StudyDesignDescriptors.length !== 0) ? singleton(["StudyDesignDescriptors", JsonHelper_EncoderOAs(study.StudyDesignDescriptors)]) : empty(), delay(() => append((study.TableCount !== 0) ? singleton(["Tables", JsonHelper_EncoderTables(study.Tables)]) : empty(), delay(() => append((study.RegisteredAssayIdentifiers.length !== 0) ? singleton(["RegisteredAssayIdentifiers", seq(map((value_5) => value_5, study.RegisteredAssayIdentifiers))]) : empty(), delay(() => append((study.Factors.length !== 0) ? singleton(["Factors", JsonHelper_EncoderFactors(study.Factors)]) : empty(), delay(() => ((study.Comments.length !== 0) ? singleton(["Comments", JsonHelper_EncoderComments(study.Comments)]) : empty()))))))))))))))))))))))))));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const ArcStudy_decoder = (path_5) => ((v) => object_1((get$) => {
|
|
18
|
+
let identifier;
|
|
19
|
+
const objectArg = get$.Required;
|
|
20
|
+
identifier = objectArg.Field("Identifier", string);
|
|
21
|
+
let title;
|
|
22
|
+
const objectArg_1 = get$.Optional;
|
|
23
|
+
title = objectArg_1.Field("Title", string);
|
|
24
|
+
let description;
|
|
25
|
+
const objectArg_2 = get$.Optional;
|
|
26
|
+
description = objectArg_2.Field("Description", string);
|
|
27
|
+
let submissionDate;
|
|
28
|
+
const objectArg_3 = get$.Optional;
|
|
29
|
+
submissionDate = objectArg_3.Field("SubmissionDate", string);
|
|
30
|
+
let publicReleaseDate;
|
|
31
|
+
const objectArg_4 = get$.Optional;
|
|
32
|
+
publicReleaseDate = objectArg_4.Field("PublicReleaseDate", string);
|
|
33
|
+
const publications = JsonHelper_tryGetPublications(get$, "Publications");
|
|
34
|
+
const contacts = JsonHelper_tryGetPersons(get$, "Contacts");
|
|
35
|
+
const studyDesignDescriptors = JsonHelper_tryGetOAs(get$, "StudyDesignDescriptors");
|
|
36
|
+
const tables = JsonHelper_tryGetTables(get$, "Tables");
|
|
37
|
+
const registeredAssayIdentifiers = JsonHelper_tryGetStringResizeArray(get$, "RegisteredAssayIdentifiers");
|
|
38
|
+
const factors = JsonHelper_tryGetFactors(get$, "Factors");
|
|
39
|
+
const comments = JsonHelper_tryGetComments(get$, "Comments");
|
|
40
|
+
return ArcStudy.make(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, registeredAssayIdentifiers, factors, comments);
|
|
41
|
+
}, path_5, v));
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* exports in json-ld format
|
|
45
|
+
*/
|
|
46
|
+
export function ArcStudy_toStringLD(a, assays) {
|
|
47
|
+
let returnVal;
|
|
48
|
+
return toString(2, Study_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToStudy(assays)));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function ArcStudy_fromJsonString(s) {
|
|
52
|
+
const s_1 = fromJsonString(uncurry2(Study_decoder(ConverterOptions_$ctor())), s);
|
|
53
|
+
return ArcStudy.fromStudy(s_1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function ArcStudy_toJsonString(a, assays) {
|
|
57
|
+
return toString(2, Study_encoder(ConverterOptions_$ctor(), a.ToStudy(assays)));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ARCtrl_ISA_ArcStudy__ArcStudy_fromArcJsonString_Static_Z721C83C5(jsonString) {
|
|
61
|
+
const matchValue = fromString(uncurry2(ArcStudy_decoder), jsonString);
|
|
62
|
+
if (matchValue.tag === 1) {
|
|
63
|
+
return toFail(printf("Error. Unable to parse json string to ArcStudy: %s"))(matchValue.fields[0]);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return matchValue.fields[0];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function ARCtrl_ISA_ArcStudy__ArcStudy_ToArcJsonString_71136F3F(this$, spaces) {
|
|
71
|
+
return toString(defaultArg(spaces, 0), ArcStudy_encoder(this$));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function ARCtrl_ISA_ArcStudy__ArcStudy_toArcJsonString_Static_1B3D5E9B(a) {
|
|
75
|
+
return ARCtrl_ISA_ArcStudy__ArcStudy_ToArcJsonString_71136F3F(a);
|
|
76
|
+
}
|
|
77
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { toString, tuple2, map as map_1, list, object } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
|
|
2
|
+
import { collect, empty, map, singleton, append, delay, toList } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
|
|
3
|
+
import { CompositeHeader_decoder, CompositeHeader_encoder } from "./CompositeHeader.js";
|
|
4
|
+
import { CompositeCell_decoder, CompositeCell_encoder } from "./CompositeCell.js";
|
|
5
|
+
import { empty as empty_2, ofSeq } from "../../../fable_modules/fable-library.4.5.0/Map.js";
|
|
6
|
+
import { arrayHash, equalArrays, uncurry2, compareArrays } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
7
|
+
import { fromString, string, int, tuple2 as tuple2_1, map$0027, list as list_1, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
|
|
8
|
+
import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
9
|
+
import { empty as empty_1 } from "../../../fable_modules/fable-library.4.5.0/List.js";
|
|
10
|
+
import { Dictionary } from "../../../fable_modules/fable-library.4.5.0/MutableMap.js";
|
|
11
|
+
import { ArcTable } from "../../ISA/ArcTypes/ArcTable.js";
|
|
12
|
+
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
13
|
+
|
|
14
|
+
export function ArcTable_encoder(table) {
|
|
15
|
+
return object(toList(delay(() => append(singleton(["name", table.Name]), delay(() => append((table.Headers.length !== 0) ? singleton(["header", list(toList(delay(() => map(CompositeHeader_encoder, table.Headers))))]) : empty(), delay(() => ((table.Values.size !== 0) ? singleton(["values", map_1((tupledArg) => tuple2((value) => value, (value_2) => value_2, tupledArg[0], tupledArg[1]), CompositeCell_encoder, ofSeq(toList(delay(() => collect((matchValue) => {
|
|
16
|
+
const activePatternResult = matchValue;
|
|
17
|
+
return singleton([activePatternResult[0], activePatternResult[1]]);
|
|
18
|
+
}, table.Values))), {
|
|
19
|
+
Compare: compareArrays,
|
|
20
|
+
}))]) : empty()))))))));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ArcTable_decoder = (path_2) => ((v) => object_1((get$) => {
|
|
24
|
+
let objectArg, arg_5, objectArg_1, objectArg_2;
|
|
25
|
+
let decodedHeader;
|
|
26
|
+
const collection = defaultArg((objectArg = get$.Optional, objectArg.Field("header", (path, value) => list_1(uncurry2(CompositeHeader_decoder), path, value))), empty_1());
|
|
27
|
+
decodedHeader = Array.from(collection);
|
|
28
|
+
const decodedValues = new Dictionary(defaultArg((arg_5 = map$0027(uncurry2(tuple2_1(uncurry2(int), uncurry2(int))), uncurry2((arg_2) => {
|
|
29
|
+
const clo = CompositeCell_decoder(arg_2);
|
|
30
|
+
return clo;
|
|
31
|
+
})), (objectArg_1 = get$.Optional, objectArg_1.Field("values", uncurry2(arg_5)))), empty_2({
|
|
32
|
+
Compare: compareArrays,
|
|
33
|
+
})), {
|
|
34
|
+
Equals: equalArrays,
|
|
35
|
+
GetHashCode: arrayHash,
|
|
36
|
+
});
|
|
37
|
+
return ArcTable.create((objectArg_2 = get$.Required, objectArg_2.Field("name", string)), decodedHeader, decodedValues);
|
|
38
|
+
}, path_2, v));
|
|
39
|
+
|
|
40
|
+
export function ARCtrl_ISA_ArcTable__ArcTable_fromJsonString_Static_Z721C83C5(jsonString) {
|
|
41
|
+
const matchValue = fromString(uncurry2(ArcTable_decoder), jsonString);
|
|
42
|
+
if (matchValue.tag === 1) {
|
|
43
|
+
return toFail(printf("Error. Unable to parse json string to ArcTable: %s"))(matchValue.fields[0]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return matchValue.fields[0];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function ARCtrl_ISA_ArcTable__ArcTable_ToJsonString_71136F3F(this$, spaces) {
|
|
51
|
+
return toString(defaultArg(spaces, 0), ArcTable_encoder(this$));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function ARCtrl_ISA_ArcTable__ArcTable_toJsonString_Static_1B2566EA(a) {
|
|
55
|
+
return ARCtrl_ISA_ArcTable__ArcTable_ToJsonString_71136F3F(a);
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "../Ontology.js";
|
|
2
|
+
import { ConverterOptions_$ctor } from "../ConverterOptions.js";
|
|
3
|
+
import { ofArray, singleton } from "../../../fable_modules/fable-library.4.5.0/List.js";
|
|
4
|
+
import { toString, list, object } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
|
|
5
|
+
import { fromString, index, string, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
|
|
6
|
+
import { CompositeCell } from "../../ISA/ArcTypes/CompositeCell.js";
|
|
7
|
+
import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
8
|
+
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
9
|
+
import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
10
|
+
|
|
11
|
+
export function CompositeCell_encoder(cc) {
|
|
12
|
+
const oaToJsonString = (oa) => OntologyAnnotation_encoder(ConverterOptions_$ctor(), oa);
|
|
13
|
+
const patternInput = (cc.tag === 0) ? ["Term", singleton(oaToJsonString(cc.fields[0]))] : ((cc.tag === 2) ? ["Unitized", ofArray([cc.fields[0], oaToJsonString(cc.fields[1])])] : ["FreeText", singleton(cc.fields[0])]);
|
|
14
|
+
return object([["celltype", patternInput[0]], ["values", list(patternInput[1])]]);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const CompositeCell_decoder = (path_7) => ((v_1) => object_1((get$) => {
|
|
18
|
+
let objectArg_1, arg_5, decoder_1, objectArg_2, objectArg_3, arg_9, decoder_3, objectArg_4;
|
|
19
|
+
let matchValue;
|
|
20
|
+
const objectArg = get$.Required;
|
|
21
|
+
matchValue = objectArg.Field("celltype", string);
|
|
22
|
+
switch (matchValue) {
|
|
23
|
+
case "FreeText":
|
|
24
|
+
return new CompositeCell(1, [(objectArg_1 = get$.Required, objectArg_1.Field("values", (path_2, value_2) => index(0, string, path_2, value_2)))]);
|
|
25
|
+
case "Term":
|
|
26
|
+
return new CompositeCell(0, [(arg_5 = ((decoder_1 = OntologyAnnotation_decoder(ConverterOptions_$ctor()), (path_3) => ((value_3) => index(0, uncurry2(decoder_1), path_3, value_3)))), (objectArg_2 = get$.Required, objectArg_2.Field("values", uncurry2(arg_5))))]);
|
|
27
|
+
case "Unitized":
|
|
28
|
+
return new CompositeCell(2, [(objectArg_3 = get$.Required, objectArg_3.Field("values", (path_4, value_4) => index(0, string, path_4, value_4))), (arg_9 = ((decoder_3 = OntologyAnnotation_decoder(ConverterOptions_$ctor()), (path_6) => ((value_6) => index(1, uncurry2(decoder_3), path_6, value_6)))), (objectArg_4 = get$.Required, objectArg_4.Field("values", uncurry2(arg_9))))]);
|
|
29
|
+
default:
|
|
30
|
+
return toFail(printf("Error reading CompositeCell from json string: %A"))(matchValue);
|
|
31
|
+
}
|
|
32
|
+
}, path_7, v_1));
|
|
33
|
+
|
|
34
|
+
export function ARCtrl_ISA_CompositeCell__CompositeCell_fromJsonString_Static_Z721C83C5(jsonString) {
|
|
35
|
+
const matchValue = fromString(uncurry2(CompositeCell_decoder), jsonString);
|
|
36
|
+
if (matchValue.tag === 1) {
|
|
37
|
+
return toFail(printf("Error. Unable to parse json string to CompositeCell: %s"))(matchValue.fields[0]);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return matchValue.fields[0];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function ARCtrl_ISA_CompositeCell__CompositeCell_ToJsonString_71136F3F(this$, spaces) {
|
|
45
|
+
return toString(defaultArg(spaces, 0), CompositeCell_encoder(this$));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function ARCtrl_ISA_CompositeCell__CompositeCell_toJsonString_Static_1B703D57(a) {
|
|
49
|
+
return ARCtrl_ISA_CompositeCell__CompositeCell_ToJsonString_71136F3F(a);
|
|
50
|
+
}
|
|
51
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "../Ontology.js";
|
|
2
|
+
import { ConverterOptions_$ctor } from "../ConverterOptions.js";
|
|
3
|
+
import { empty, singleton } from "../../../fable_modules/fable-library.4.5.0/List.js";
|
|
4
|
+
import { IOType_decoder, IOType_encoder } from "./IOType.js";
|
|
5
|
+
import { toString, list, object } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
|
|
6
|
+
import { fromString, index, string, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
|
|
7
|
+
import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
8
|
+
import { CompositeHeader } from "../../ISA/ArcTypes/CompositeHeader.js";
|
|
9
|
+
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
10
|
+
import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
11
|
+
|
|
12
|
+
export function CompositeHeader_encoder(ch) {
|
|
13
|
+
const oaToJsonString = (oa) => OntologyAnnotation_encoder(ConverterOptions_$ctor(), oa);
|
|
14
|
+
const patternInput = (ch.tag === 3) ? ["Parameter", singleton(oaToJsonString(ch.fields[0]))] : ((ch.tag === 2) ? ["Factor", singleton(oaToJsonString(ch.fields[0]))] : ((ch.tag === 1) ? ["Characteristic", singleton(oaToJsonString(ch.fields[0]))] : ((ch.tag === 0) ? ["Component", singleton(oaToJsonString(ch.fields[0]))] : ((ch.tag === 4) ? ["ProtocolType", empty()] : ((ch.tag === 8) ? ["ProtocolREF", empty()] : ((ch.tag === 5) ? ["ProtocolDescription", empty()] : ((ch.tag === 6) ? ["ProtocolUri", empty()] : ((ch.tag === 7) ? ["ProtocolVersion", empty()] : ((ch.tag === 9) ? ["Performer", empty()] : ((ch.tag === 10) ? ["Date", empty()] : ((ch.tag === 11) ? ["Input", singleton(IOType_encoder(ch.fields[0]))] : ((ch.tag === 12) ? ["Output", singleton(IOType_encoder(ch.fields[0]))] : [ch.fields[0], empty()]))))))))))));
|
|
15
|
+
return object([["headertype", patternInput[0]], ["values", list(patternInput[1])]]);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const CompositeHeader_decoder = (path_3) => ((v) => object_1((get$) => {
|
|
19
|
+
let headerType;
|
|
20
|
+
const objectArg = get$.Required;
|
|
21
|
+
headerType = objectArg.Field("headertype", string);
|
|
22
|
+
const oa = () => {
|
|
23
|
+
let arg_3;
|
|
24
|
+
const decoder = OntologyAnnotation_decoder(ConverterOptions_$ctor());
|
|
25
|
+
arg_3 = ((path_1) => ((value_1) => index(0, uncurry2(decoder), path_1, value_1)));
|
|
26
|
+
const objectArg_1 = get$.Required;
|
|
27
|
+
return objectArg_1.Field("values", uncurry2(arg_3));
|
|
28
|
+
};
|
|
29
|
+
const io = () => {
|
|
30
|
+
const objectArg_2 = get$.Required;
|
|
31
|
+
return objectArg_2.Field("values", (path_2, value_2) => index(0, uncurry2(IOType_decoder), path_2, value_2));
|
|
32
|
+
};
|
|
33
|
+
switch (headerType) {
|
|
34
|
+
case "Characteristic":
|
|
35
|
+
return new CompositeHeader(1, [oa()]);
|
|
36
|
+
case "Parameter":
|
|
37
|
+
return new CompositeHeader(3, [oa()]);
|
|
38
|
+
case "Component":
|
|
39
|
+
return new CompositeHeader(0, [oa()]);
|
|
40
|
+
case "Factor":
|
|
41
|
+
return new CompositeHeader(2, [oa()]);
|
|
42
|
+
case "Input":
|
|
43
|
+
return new CompositeHeader(11, [io()]);
|
|
44
|
+
case "Output":
|
|
45
|
+
return new CompositeHeader(12, [io()]);
|
|
46
|
+
case "ProtocolType":
|
|
47
|
+
return new CompositeHeader(4, []);
|
|
48
|
+
case "ProtocolREF":
|
|
49
|
+
return new CompositeHeader(8, []);
|
|
50
|
+
case "ProtocolDescription":
|
|
51
|
+
return new CompositeHeader(5, []);
|
|
52
|
+
case "ProtocolUri":
|
|
53
|
+
return new CompositeHeader(6, []);
|
|
54
|
+
case "ProtocolVersion":
|
|
55
|
+
return new CompositeHeader(7, []);
|
|
56
|
+
case "Performer":
|
|
57
|
+
return new CompositeHeader(9, []);
|
|
58
|
+
case "Date":
|
|
59
|
+
return new CompositeHeader(10, []);
|
|
60
|
+
default:
|
|
61
|
+
return new CompositeHeader(13, [headerType]);
|
|
62
|
+
}
|
|
63
|
+
}, path_3, v));
|
|
64
|
+
|
|
65
|
+
export function ARCtrl_ISA_CompositeHeader__CompositeHeader_fromJsonString_Static_Z721C83C5(jsonString) {
|
|
66
|
+
const matchValue = fromString(uncurry2(CompositeHeader_decoder), jsonString);
|
|
67
|
+
if (matchValue.tag === 1) {
|
|
68
|
+
return toFail(printf("Error. Unable to parse json string to CompositeHeader: %s"))(matchValue.fields[0]);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return matchValue.fields[0];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function ARCtrl_ISA_CompositeHeader__CompositeHeader_ToJsonString_71136F3F(this$, spaces) {
|
|
76
|
+
return toString(defaultArg(spaces, 0), CompositeHeader_encoder(this$));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function ARCtrl_ISA_CompositeHeader__CompositeHeader_toJsonString_Static_Z331CE692(a) {
|
|
80
|
+
return ARCtrl_ISA_CompositeHeader__CompositeHeader_ToJsonString_71136F3F(a);
|
|
81
|
+
}
|
|
82
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { toString } from "../../../fable_modules/fable-library.4.5.0/Types.js";
|
|
2
|
+
import { fromString, string, succeed, andThen } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
|
|
3
|
+
import { uncurry2, uncurry3 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
|
|
4
|
+
import { IOType } from "../../ISA/ArcTypes/CompositeHeader.js";
|
|
5
|
+
import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
|
|
6
|
+
import { toString as toString_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
|
|
7
|
+
import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
|
|
8
|
+
|
|
9
|
+
export function IOType_encoder(io) {
|
|
10
|
+
return toString(io);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const IOType_decoder = (path_1) => ((value_1) => andThen(uncurry3((s) => {
|
|
14
|
+
const output = IOType.ofString(s);
|
|
15
|
+
return (arg10$0040) => ((arg20$0040) => succeed(output, arg10$0040, arg20$0040));
|
|
16
|
+
}), string, path_1, value_1));
|
|
17
|
+
|
|
18
|
+
export function ARCtrl_ISA_IOType__IOType_fromJsonString_Static_Z721C83C5(jsonString) {
|
|
19
|
+
const matchValue = fromString(uncurry2(IOType_decoder), jsonString);
|
|
20
|
+
if (matchValue.tag === 1) {
|
|
21
|
+
return toFail(printf("Error. Unable to parse json string to IOType: %s"))(matchValue.fields[0]);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return matchValue.fields[0];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function ARCtrl_ISA_IOType__IOType_ToJsonString_71136F3F(this$, spaces) {
|
|
29
|
+
return toString_1(defaultArg(spaces, 0), IOType_encoder(this$));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function ARCtrl_ISA_IOType__IOType_toJsonString_Static_Z359DBB26(a) {
|
|
33
|
+
return ARCtrl_ISA_IOType__IOType_ToJsonString_71136F3F(a);
|
|
34
|
+
}
|
|
35
|
+
|
package/ISA/ISA.Json/Assay.js
CHANGED
|
@@ -14,7 +14,6 @@ import { Process_decoder, Process_encoder } from "./Process.js";
|
|
|
14
14
|
import { decoder as decoder_5, encoder } from "./Comment.js";
|
|
15
15
|
import { fromJsonString, uri } from "./Decode.js";
|
|
16
16
|
import { Assay } from "../ISA/JsonTypes/Assay.js";
|
|
17
|
-
import { ArcAssay } from "../ISA/ArcTypes/ArcTypes.js";
|
|
18
17
|
|
|
19
18
|
export function AssayMaterials_encoder(options, oa) {
|
|
20
19
|
return object_22(choose((tupledArg) => {
|
|
@@ -104,20 +103,3 @@ export function Assay_toStringLD(a) {
|
|
|
104
103
|
return toString(2, Assay_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a));
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
export function ArcAssay_fromJsonString(s) {
|
|
108
|
-
const a = fromJsonString(uncurry2(Assay_decoder(ConverterOptions_$ctor())), s);
|
|
109
|
-
return ArcAssay.fromAssay(a);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function ArcAssay_toJsonString(a) {
|
|
113
|
-
return toString(2, Assay_encoder(ConverterOptions_$ctor(), a.ToAssay()));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* exports in json-ld format
|
|
118
|
-
*/
|
|
119
|
-
export function ArcAssay_toStringLD(a) {
|
|
120
|
-
let returnVal;
|
|
121
|
-
return toString(2, Assay_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToAssay()));
|
|
122
|
-
}
|
|
123
|
-
|