@nfdi4plants/arctrl 2.0.0-alpha.6 → 2.0.0-alpha.8
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/Core/Data.js +53 -4
- package/Core/DataContext.js +92 -0
- package/Core/Helper/Regex.js +26 -10
- package/Core/Helper/Url.js +38 -0
- package/Core/OntologyAnnotation.js +2 -1
- package/Core/Table/ArcTableAux.js +2 -2
- package/Core/Table/CompositeCell.js +4 -0
- package/Core/Table/DataMap.js +95 -82
- package/Json/Assay.js +51 -22
- package/Json/Comment.js +35 -6
- package/Json/IDTable.js +19 -0
- package/Json/Investigation.js +22 -5
- package/Json/OntologyAnnotation.js +61 -6
- package/Json/OntologySourceReference.js +29 -7
- package/Json/Person.js +38 -16
- package/Json/Process/AssayMaterials.js +2 -2
- package/Json/Process/Component.js +19 -5
- package/Json/Process/Data.js +23 -7
- package/Json/Process/DataFile.js +9 -0
- package/Json/Process/Factor.js +33 -6
- package/Json/Process/FactorValue.js +23 -6
- package/Json/Process/Material.js +22 -5
- package/Json/Process/MaterialAttribute.js +30 -7
- package/Json/Process/MaterialAttributeValue.js +27 -6
- package/Json/Process/MaterialType.js +5 -0
- package/Json/Process/Process.js +22 -5
- package/Json/Process/ProcessInput.js +13 -7
- package/Json/Process/ProcessOutput.js +16 -6
- package/Json/Process/ProcessParameterValue.js +18 -4
- package/Json/Process/ProcessSequence.js +4 -2
- package/Json/Process/PropertyValue.js +29 -4
- package/Json/Process/Protocol.js +88 -52
- package/Json/Process/ProtocolParameter.js +28 -6
- package/Json/Process/Sample.js +23 -7
- package/Json/Process/Source.js +23 -6
- package/Json/Process/StudyMaterials.js +2 -2
- package/Json/Process/Value.js +3 -3
- package/Json/Publication.js +21 -8
- package/Json/Study.js +86 -56
- package/Json/Table/CellTable.js +4 -1
- package/Json/Table/Templates.js +10 -2
- package/Json.js +9 -9
- package/Spreadsheet/DataMapTable/DataMapColumn.js +36 -30
- package/Spreadsheet/DataMapTable/DataMapHeader.js +146 -122
- package/Spreadsheet/DataMapTable/DataMapTable.js +17 -12
- package/Template.Web.js +1 -1
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +1 -1
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"]();
|
|
@@ -247,6 +260,10 @@ export function ARCtrl_ArcStudy__ArcStudy_toJsonString_Static_71136F3F(spaces) {
|
|
|
247
260
|
};
|
|
248
261
|
}
|
|
249
262
|
|
|
263
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToJsonString_71136F3F(this$, spaces) {
|
|
264
|
+
return ARCtrl_ArcStudy__ArcStudy_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
265
|
+
}
|
|
266
|
+
|
|
250
267
|
export function ARCtrl_ArcStudy__ArcStudy_fromCompressedJsonString_Static_Z721C83C5(s) {
|
|
251
268
|
try {
|
|
252
269
|
const matchValue = fromString(decode(Study_decoderCompressed), s);
|
|
@@ -264,17 +281,11 @@ export function ARCtrl_ArcStudy__ArcStudy_fromCompressedJsonString_Static_Z721C8
|
|
|
264
281
|
}
|
|
265
282
|
|
|
266
283
|
export function ARCtrl_ArcStudy__ArcStudy_toCompressedJsonString_Static_71136F3F(spaces) {
|
|
267
|
-
return (obj) => toString(defaultArg(spaces, 0),
|
|
284
|
+
return (obj) => toString(defaultArg(spaces, 0), encode_1(Study_encoderCompressed, obj));
|
|
268
285
|
}
|
|
269
286
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
*/
|
|
273
|
-
export function ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086(assays, spaces) {
|
|
274
|
-
return (obj) => {
|
|
275
|
-
const value = Study_ROCrate_encoder(assays, obj);
|
|
276
|
-
return toString(defaultSpaces(spaces), value);
|
|
277
|
-
};
|
|
287
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToCompressedJsonString_71136F3F(this$, spaces) {
|
|
288
|
+
return ARCtrl_ArcStudy__ArcStudy_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
278
289
|
}
|
|
279
290
|
|
|
280
291
|
export function ARCtrl_ArcStudy__ArcStudy_fromROCrateJsonString_Static_Z721C83C5(s) {
|
|
@@ -287,13 +298,20 @@ export function ARCtrl_ArcStudy__ArcStudy_fromROCrateJsonString_Static_Z721C83C5
|
|
|
287
298
|
}
|
|
288
299
|
}
|
|
289
300
|
|
|
290
|
-
|
|
301
|
+
/**
|
|
302
|
+
* exports in json-ld format
|
|
303
|
+
*/
|
|
304
|
+
export function ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086(assays, spaces) {
|
|
291
305
|
return (obj) => {
|
|
292
|
-
const value =
|
|
306
|
+
const value = Study_ROCrate_encoder(assays, obj);
|
|
293
307
|
return toString(defaultSpaces(spaces), value);
|
|
294
308
|
};
|
|
295
309
|
}
|
|
296
310
|
|
|
311
|
+
export function ARCtrl_ArcStudy__ArcStudy_ToROCrateJsonString_3BA23086(this$, assays, spaces) {
|
|
312
|
+
return ARCtrl_ArcStudy__ArcStudy_toROCrateJsonString_Static_3BA23086(unwrap(assays), unwrap(spaces))(this$);
|
|
313
|
+
}
|
|
314
|
+
|
|
297
315
|
export function ARCtrl_ArcStudy__ArcStudy_fromISAJsonString_Static_Z721C83C5(s) {
|
|
298
316
|
const matchValue = fromString(Study_ISAJson_decoder, s);
|
|
299
317
|
if (matchValue.tag === 1) {
|
|
@@ -304,3 +322,15 @@ export function ARCtrl_ArcStudy__ArcStudy_fromISAJsonString_Static_Z721C83C5(s)
|
|
|
304
322
|
}
|
|
305
323
|
}
|
|
306
324
|
|
|
325
|
+
export function ARCtrl_ArcStudy__ArcStudy_toISAJsonString_Static_Z3FD920F1(assays, spaces, useIDReferencing) {
|
|
326
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
327
|
+
return (obj) => {
|
|
328
|
+
const value = Study_ISAJson_encoder(idMap, assays, obj);
|
|
329
|
+
return toString(defaultSpaces(spaces), value);
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
|
|
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$);
|
|
335
|
+
}
|
|
336
|
+
|
package/Json/Table/CellTable.js
CHANGED
|
@@ -35,6 +35,9 @@ export function encodeCell(otm, cc) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export function decodeCell(ot) {
|
|
38
|
-
return object((get$) =>
|
|
38
|
+
return object((get$) => {
|
|
39
|
+
const i = get$.Required.Raw(int) | 0;
|
|
40
|
+
return item(i, ot).Copy();
|
|
41
|
+
});
|
|
39
42
|
}
|
|
40
43
|
|
package/Json/Table/Templates.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toString } from "../../fable_modules/fable-library-js.4.16.0/Types.js";
|
|
2
2
|
import { Json } from "../../fable_modules/Thoth.Json.Core.0.2.1/Types.fs.js";
|
|
3
|
-
import {
|
|
3
|
+
import { array as array_1, datetimeUtc, guid, object, string, succeed, andThen } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
4
4
|
import { Template, Organisation } from "../../Core/Template.js";
|
|
5
5
|
import { ArcTable_decoderCompressed, ArcTable_encoderCompressed, ArcTable_decoder, ArcTable_encoder } from "./ArcTable.js";
|
|
6
6
|
import { defaultSpaces, dateTime, tryIncludeSeq } from "../Encode.js";
|
|
@@ -45,7 +45,7 @@ export function Templates_encoder(templates) {
|
|
|
45
45
|
return new Json(6, [map(Template_encoder, templates)]);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export const Templates_decoder =
|
|
48
|
+
export const Templates_decoder = array_1(Template_decoder);
|
|
49
49
|
|
|
50
50
|
export function Templates_fromJsonString(jsonString) {
|
|
51
51
|
try {
|
|
@@ -85,6 +85,10 @@ export function ARCtrl_Template__Template_toJsonString_Static_71136F3F(spaces) {
|
|
|
85
85
|
return (template) => toString_2(defaultSpaces(spaces), Template_encoder(template));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
export function ARCtrl_Template__Template_toJsonString_71136F3F(this$, spaces) {
|
|
89
|
+
return ARCtrl_Template__Template_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
90
|
+
}
|
|
91
|
+
|
|
88
92
|
export function ARCtrl_Template__Template_fromCompressedJsonString_Static_Z721C83C5(s) {
|
|
89
93
|
try {
|
|
90
94
|
const matchValue = fromString(decode(Template_decoderCompressed), s);
|
|
@@ -105,3 +109,7 @@ export function ARCtrl_Template__Template_toCompressedJsonString_Static_71136F3F
|
|
|
105
109
|
return (obj) => toString_2(defaultArg(spaces, 0), encode(Template_encoderCompressed, obj));
|
|
106
110
|
}
|
|
107
111
|
|
|
112
|
+
export function ARCtrl_Template__Template_toCompressedJsonString_71136F3F(this$, spaces) {
|
|
113
|
+
return ARCtrl_Template__Template_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(this$);
|
|
114
|
+
}
|
|
115
|
+
|
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,36 +1,42 @@
|
|
|
1
1
|
import { toFsCells, fromFsCells } from "./DataMapHeader.js";
|
|
2
|
-
import { singleton
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { item as item_1, map as map_2 } from "../../fable_modules/fable-library-js.4.16.0/Array.js";
|
|
10
|
-
import { toFsCells as toFsCells_1 } from "../AnnotationTable/CompositeCell.js";
|
|
2
|
+
import { transpose, singleton, ofArray, map } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
3
|
+
import { tryFind, singleton as singleton_1, append, delay, map as map_1, collect, toList } from "../../fable_modules/fable-library-js.4.16.0/Seq.js";
|
|
4
|
+
import { distinct } from "../../fable_modules/fable-library-js.4.16.0/Seq2.js";
|
|
5
|
+
import { bind, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
6
|
+
import { stringHash } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
7
|
+
import { FsCell } from "../../fable_modules/FsSpreadsheet.6.1.2/Cells/FsCell.fs.js";
|
|
8
|
+
import { DataContext__get_GeneratedBy, DataContext__get_Description, DataContext__get_ObjectType, DataContext__get_Unit, DataContext__get_Explication } from "../../Core/DataContext.js";
|
|
11
9
|
|
|
12
|
-
export function
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export function setFromFsColumns(dc, columns) {
|
|
11
|
+
const cellParser = fromFsCells(map((c) => c.Item(1), columns));
|
|
12
|
+
for (let i = 0; i <= (dc.length - 1); i++) {
|
|
13
|
+
cellParser(dc[i])(map((c_1) => c_1.Item(i + 2), columns));
|
|
14
|
+
}
|
|
15
|
+
return dc;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
export function toFsColumns(
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
export function toFsColumns(dc) {
|
|
19
|
+
const commentKeys = toList(distinct(collect((dc_1) => map_1((c) => defaultArg(c.Name, ""), dc_1.Comments), dc), {
|
|
20
|
+
Equals: (x, y) => (x === y),
|
|
21
|
+
GetHashCode: stringHash,
|
|
22
|
+
}));
|
|
23
|
+
const headers = toFsCells(commentKeys);
|
|
24
|
+
const createTerm = (oa) => {
|
|
25
|
+
if (oa == null) {
|
|
26
|
+
return ofArray([new FsCell(""), new FsCell(""), new FsCell("")]);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const oa_1 = oa;
|
|
30
|
+
return ofArray([new FsCell(defaultArg(oa_1.Name, "")), new FsCell(defaultArg(oa_1.TermSourceREF, "")), new FsCell(defaultArg(oa_1.TermAccessionNumber, ""))]);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const createText = (s) => singleton(new FsCell(defaultArg(s, "")));
|
|
34
|
+
return transpose(toList(delay(() => append(singleton_1(headers), delay(() => map_1((dc_4) => {
|
|
35
|
+
const dc_3 = dc_4;
|
|
36
|
+
return toList(delay(() => {
|
|
37
|
+
let dc_2;
|
|
38
|
+
return append((dc_2 = dc_3, ofArray([new FsCell(defaultArg(dc_2.Name, "")), new FsCell(defaultArg(dc_2.Format, "")), new FsCell(defaultArg(dc_2.SelectorFormat, ""))])), delay(() => append(createTerm(DataContext__get_Explication(dc_3)), delay(() => append(createTerm(DataContext__get_Unit(dc_3)), delay(() => append(createTerm(DataContext__get_ObjectType(dc_3)), delay(() => append(createText(DataContext__get_Description(dc_3)), delay(() => append(createText(DataContext__get_GeneratedBy(dc_3)), delay(() => map((key) => (new FsCell(defaultArg(bind((c_2) => c_2.Value, tryFind((c_1) => (defaultArg(c_1.Name, "") === key), dc_3.Comments)), ""))), commentKeys)))))))))))));
|
|
39
|
+
}));
|
|
40
|
+
}, dc))))));
|
|
35
41
|
}
|
|
36
42
|
|