@nfdi4plants/arctrl 1.0.0-beta.5 → 1.0.0-beta.6

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.
@@ -1,5 +1,5 @@
1
1
  import { map as map_1, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.5.0/Option.js";
2
- import { concat, collect, append as append_4, tryFind, removeAt, tryFindIndex, item as item_1, map as map_2, delay, toList, fold, length, forAll, contains, filter, toArray } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
2
+ import { concat, collect, append as append_4, tryFind, removeAt, tryFindIndex, choose, item, map as map_2, delay, toList, fold, length, forAll, contains, filter, toArray } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
3
3
  import { defaultOf, safeHash, equals, disposeSafe, getEnumerator, stringHash } from "../../../fable_modules/fable-library.4.5.0/Util.js";
4
4
  import { addRangeInPlace, tryFind as tryFind_1, removeInPlace, equalsWith, append as append_3, contains as contains_1, map } from "../../../fable_modules/fable-library.4.5.0/Array.js";
5
5
  import { distinctBy, Array_distinct } from "../../../fable_modules/fable-library.4.5.0/Seq2.js";
@@ -10,7 +10,7 @@ import { Value_fromString_Z721C83C5, Value__get_Text } from "../JsonTypes/Value.
10
10
  import { AnnotationValue } from "../JsonTypes/AnnotationValue.js";
11
11
  import { ArcTablesAux_applyIOMap, ArcTablesAux_getIOMap, ArcTables_$reflection, ArcTables } from "./ArcTables.js";
12
12
  import { AssayMaterials_get_empty, AssayMaterials_create_Z253F0553 } from "../JsonTypes/AssayMaterials.js";
13
- import { HashCodes_boxHashOption, HashCodes_boxHashArray, Option_fromValueWithDefault } from "../Helper.js";
13
+ import { ResizeArray_map, HashCodes_boxHashOption, HashCodes_boxHashArray, Option_fromValueWithDefault } from "../Helper.js";
14
14
  import { unzip, ofSeq, map as map_3, toArray as toArray_1, ofArray, empty } from "../../../fable_modules/fable-library.4.5.0/List.js";
15
15
  import { getSources, getProtocols, getUnits, getCharacteristics, getData, getMaterials, getSamples } from "../JsonTypes/ProcessSequence.js";
16
16
  import { Assay_create_3D372A24 } from "../JsonTypes/Assay.js";
@@ -510,21 +510,21 @@ export class ArcAssay extends ArcTables {
510
510
  else {
511
511
  return false;
512
512
  }
513
- }, true, toList(delay(() => map_2((i_1) => equals(item_1(i_1, a), item_1(i_1, b)), rangeDouble(0, 1, length(a) - 1))))))), (a_1 = this$.Performers, (b_1 = other.Performers, (length(a_1) === length(b_1)) && fold((acc_1, e_1) => {
513
+ }, true, toList(delay(() => map_2((i_1) => equals(item(i_1, a), item(i_1, b)), rangeDouble(0, 1, length(a) - 1))))))), (a_1 = this$.Performers, (b_1 = other.Performers, (length(a_1) === length(b_1)) && fold((acc_1, e_1) => {
514
514
  if (acc_1) {
515
515
  return e_1;
516
516
  }
517
517
  else {
518
518
  return false;
519
519
  }
520
- }, true, toList(delay(() => map_2((i_2) => equals(item_1(i_2, a_1), item_1(i_2, b_1)), rangeDouble(0, 1, length(a_1) - 1))))))), (a_2 = this$.Comments, (b_2 = other.Comments, (length(a_2) === length(b_2)) && fold((acc_2, e_2) => {
520
+ }, true, toList(delay(() => map_2((i_2) => equals(item(i_2, a_1), item(i_2, b_1)), rangeDouble(0, 1, length(a_1) - 1))))))), (a_2 = this$.Comments, (b_2 = other.Comments, (length(a_2) === length(b_2)) && fold((acc_2, e_2) => {
521
521
  if (acc_2) {
522
522
  return e_2;
523
523
  }
524
524
  else {
525
525
  return false;
526
526
  }
527
- }, true, toList(delay(() => map_2((i_3) => equals(item_1(i_3, a_2), item_1(i_3, b_2)), rangeDouble(0, 1, length(a_2) - 1)))))))]);
527
+ }, true, toList(delay(() => map_2((i_3) => equals(item(i_3, a_2), item(i_3, b_2)), rangeDouble(0, 1, length(a_2) - 1)))))))]);
528
528
  }
529
529
  ReferenceEquals(other) {
530
530
  const this$ = this;
@@ -697,23 +697,8 @@ export class ArcStudy extends ArcTables {
697
697
  else {
698
698
  throw new Error("Cannot execute this function. Object is not part of ArcInvestigation.");
699
699
  }
700
- const assays = [];
701
- let enumerator = getEnumerator(inv.Assays);
702
- try {
703
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
704
- const assay = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
705
- if (contains(assay.Identifier, this$.RegisteredAssayIdentifiers, {
706
- Equals: (x, y) => (x === y),
707
- GetHashCode: stringHash,
708
- })) {
709
- void (assays.push(assay));
710
- }
711
- }
712
- }
713
- finally {
714
- disposeSafe(enumerator);
715
- }
716
- return assays;
700
+ const collection = choose((assayIdentifier) => inv.TryGetAssay(assayIdentifier), this$.RegisteredAssayIdentifiers);
701
+ return Array.from(collection);
717
702
  }
718
703
  AddRegisteredAssay(assay) {
719
704
  const this$ = this;
@@ -812,12 +797,19 @@ export class ArcStudy extends ArcTables {
812
797
  const this$ = this;
813
798
  const matchValue = this$.Investigation;
814
799
  if (matchValue == null) {
815
- const collection = map_2((identifier) => ArcAssay.init(identifier), this$.RegisteredAssayIdentifiers);
816
- return Array.from(collection);
800
+ return ResizeArray_map((identifier_1) => ArcAssay.init(identifier_1), this$.RegisteredAssayIdentifiers);
817
801
  }
818
802
  else {
819
803
  const i = matchValue;
820
- return this$.RegisteredAssays;
804
+ return ResizeArray_map((identifier) => {
805
+ const matchValue_1 = i.TryGetAssay(identifier);
806
+ if (matchValue_1 == null) {
807
+ return ArcAssay.init(identifier);
808
+ }
809
+ else {
810
+ return matchValue_1;
811
+ }
812
+ }, this$.RegisteredAssayIdentifiers);
821
813
  }
822
814
  }
823
815
  static getRegisteredAssaysOrIdentifier() {
@@ -1154,49 +1146,49 @@ export class ArcStudy extends ArcTables {
1154
1146
  else {
1155
1147
  return false;
1156
1148
  }
1157
- }, true, toList(delay(() => map_2((i_1) => equals(item_1(i_1, a), item_1(i_1, b)), rangeDouble(0, 1, length(a) - 1))))))), (a_1 = this$.Contacts, (b_1 = other.Contacts, (length(a_1) === length(b_1)) && fold((acc_1, e_1) => {
1149
+ }, true, toList(delay(() => map_2((i_1) => equals(item(i_1, a), item(i_1, b)), rangeDouble(0, 1, length(a) - 1))))))), (a_1 = this$.Contacts, (b_1 = other.Contacts, (length(a_1) === length(b_1)) && fold((acc_1, e_1) => {
1158
1150
  if (acc_1) {
1159
1151
  return e_1;
1160
1152
  }
1161
1153
  else {
1162
1154
  return false;
1163
1155
  }
1164
- }, true, toList(delay(() => map_2((i_2) => equals(item_1(i_2, a_1), item_1(i_2, b_1)), rangeDouble(0, 1, length(a_1) - 1))))))), (a_2 = this$.StudyDesignDescriptors, (b_2 = other.StudyDesignDescriptors, (length(a_2) === length(b_2)) && fold((acc_2, e_2) => {
1156
+ }, true, toList(delay(() => map_2((i_2) => equals(item(i_2, a_1), item(i_2, b_1)), rangeDouble(0, 1, length(a_1) - 1))))))), (a_2 = this$.StudyDesignDescriptors, (b_2 = other.StudyDesignDescriptors, (length(a_2) === length(b_2)) && fold((acc_2, e_2) => {
1165
1157
  if (acc_2) {
1166
1158
  return e_2;
1167
1159
  }
1168
1160
  else {
1169
1161
  return false;
1170
1162
  }
1171
- }, true, toList(delay(() => map_2((i_3) => equals(item_1(i_3, a_2), item_1(i_3, b_2)), rangeDouble(0, 1, length(a_2) - 1))))))), (a_3 = this$.Tables, (b_3 = other.Tables, (length(a_3) === length(b_3)) && fold((acc_3, e_3) => {
1163
+ }, true, toList(delay(() => map_2((i_3) => equals(item(i_3, a_2), item(i_3, b_2)), rangeDouble(0, 1, length(a_2) - 1))))))), (a_3 = this$.Tables, (b_3 = other.Tables, (length(a_3) === length(b_3)) && fold((acc_3, e_3) => {
1172
1164
  if (acc_3) {
1173
1165
  return e_3;
1174
1166
  }
1175
1167
  else {
1176
1168
  return false;
1177
1169
  }
1178
- }, true, toList(delay(() => map_2((i_4) => equals(item_1(i_4, a_3), item_1(i_4, b_3)), rangeDouble(0, 1, length(a_3) - 1))))))), (a_4 = this$.RegisteredAssayIdentifiers, (b_4 = other.RegisteredAssayIdentifiers, (length(a_4) === length(b_4)) && fold((acc_4, e_4) => {
1170
+ }, true, toList(delay(() => map_2((i_4) => equals(item(i_4, a_3), item(i_4, b_3)), rangeDouble(0, 1, length(a_3) - 1))))))), (a_4 = this$.RegisteredAssayIdentifiers, (b_4 = other.RegisteredAssayIdentifiers, (length(a_4) === length(b_4)) && fold((acc_4, e_4) => {
1179
1171
  if (acc_4) {
1180
1172
  return e_4;
1181
1173
  }
1182
1174
  else {
1183
1175
  return false;
1184
1176
  }
1185
- }, true, toList(delay(() => map_2((i_5) => (item_1(i_5, a_4) === item_1(i_5, b_4)), rangeDouble(0, 1, length(a_4) - 1))))))), (a_5 = this$.Factors, (b_5 = other.Factors, (length(a_5) === length(b_5)) && fold((acc_5, e_5) => {
1177
+ }, true, toList(delay(() => map_2((i_5) => (item(i_5, a_4) === item(i_5, b_4)), rangeDouble(0, 1, length(a_4) - 1))))))), (a_5 = this$.Factors, (b_5 = other.Factors, (length(a_5) === length(b_5)) && fold((acc_5, e_5) => {
1186
1178
  if (acc_5) {
1187
1179
  return e_5;
1188
1180
  }
1189
1181
  else {
1190
1182
  return false;
1191
1183
  }
1192
- }, true, toList(delay(() => map_2((i_6) => equals(item_1(i_6, a_5), item_1(i_6, b_5)), rangeDouble(0, 1, length(a_5) - 1))))))), (a_6 = this$.Comments, (b_6 = other.Comments, (length(a_6) === length(b_6)) && fold((acc_6, e_6) => {
1184
+ }, true, toList(delay(() => map_2((i_6) => equals(item(i_6, a_5), item(i_6, b_5)), rangeDouble(0, 1, length(a_5) - 1))))))), (a_6 = this$.Comments, (b_6 = other.Comments, (length(a_6) === length(b_6)) && fold((acc_6, e_6) => {
1193
1185
  if (acc_6) {
1194
1186
  return e_6;
1195
1187
  }
1196
1188
  else {
1197
1189
  return false;
1198
1190
  }
1199
- }, true, toList(delay(() => map_2((i_7) => equals(item_1(i_7, a_6), item_1(i_7, b_6)), rangeDouble(0, 1, length(a_6) - 1)))))))]);
1191
+ }, true, toList(delay(() => map_2((i_7) => equals(item(i_7, a_6), item(i_7, b_6)), rangeDouble(0, 1, length(a_6) - 1)))))))]);
1200
1192
  }
1201
1193
  ReferenceEquals(other) {
1202
1194
  const this$ = this;
@@ -1257,7 +1249,7 @@ export class ArcInvestigation {
1257
1249
  const registeredStudyIdentifiers_1 = defaultArg(registeredStudyIdentifiers, []);
1258
1250
  const comments_1 = defaultArg(comments, []);
1259
1251
  const remarks_1 = defaultArg(remarks, []);
1260
- this["identifier@1144"] = identifier;
1252
+ this["identifier@1148"] = identifier;
1261
1253
  this["Title@"] = title;
1262
1254
  this["Description@"] = description;
1263
1255
  this["SubmissionDate@"] = submissionDate;
@@ -1270,15 +1262,15 @@ export class ArcInvestigation {
1270
1262
  this["RegisteredStudyIdentifiers@"] = registeredStudyIdentifiers_1;
1271
1263
  this["Comments@"] = comments_1;
1272
1264
  this["Remarks@"] = remarks_1;
1273
- this["init@1125"] = 1;
1265
+ this["init@1129"] = 1;
1274
1266
  }
1275
1267
  get Identifier() {
1276
1268
  const this$ = this;
1277
- return this$["identifier@1144"];
1269
+ return this$["identifier@1148"];
1278
1270
  }
1279
1271
  set Identifier(i) {
1280
1272
  const this$ = this;
1281
- this$["identifier@1144"] = i;
1273
+ this$["identifier@1148"] = i;
1282
1274
  }
1283
1275
  get Title() {
1284
1276
  const __ = this;
@@ -1427,10 +1419,43 @@ export class ArcInvestigation {
1427
1419
  return newInvestigation.InitAssay(assayIdentifier);
1428
1420
  };
1429
1421
  }
1422
+ DeleteAssayAt(index) {
1423
+ const this$ = this;
1424
+ this$.Assays.splice(index, 1);
1425
+ }
1426
+ static deleteAssayAt(index) {
1427
+ return (inv) => {
1428
+ const newInvestigation = inv.Copy();
1429
+ newInvestigation.DeleteAssayAt(index);
1430
+ return newInvestigation;
1431
+ };
1432
+ }
1433
+ DeleteAssay(assayIdentifier) {
1434
+ const this$ = this;
1435
+ const index = this$.GetAssayIndex(assayIdentifier) | 0;
1436
+ this$.DeleteAssayAt(index);
1437
+ }
1438
+ static deleteAssay(assayIdentifier) {
1439
+ return (inv) => {
1440
+ const newInv = inv.Copy();
1441
+ newInv.DeleteAssay(assayIdentifier);
1442
+ return newInv;
1443
+ };
1444
+ }
1430
1445
  RemoveAssayAt(index) {
1431
1446
  const this$ = this;
1447
+ const ident = this$.GetAssayAt(index).Identifier;
1432
1448
  this$.Assays.splice(index, 1);
1433
- this$.DeregisterMissingAssays();
1449
+ let enumerator = getEnumerator(this$.Studies);
1450
+ try {
1451
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
1452
+ const study = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
1453
+ study.DeregisterAssay(ident);
1454
+ }
1455
+ }
1456
+ finally {
1457
+ disposeSafe(enumerator);
1458
+ }
1434
1459
  }
1435
1460
  static removeAssayAt(index) {
1436
1461
  return (inv) => {
@@ -1515,9 +1540,19 @@ export class ArcInvestigation {
1515
1540
  return newInvestigation.GetAssay(assayIdentifier);
1516
1541
  };
1517
1542
  }
1543
+ TryGetAssay(assayIdentifier) {
1544
+ const this$ = this;
1545
+ return tryFind((a) => (a.Identifier === assayIdentifier), this$.Assays);
1546
+ }
1547
+ static tryGetAssay(assayIdentifier) {
1548
+ return (inv) => {
1549
+ const newInvestigation = inv.Copy();
1550
+ return newInvestigation.TryGetAssay(assayIdentifier);
1551
+ };
1552
+ }
1518
1553
  get RegisteredStudies() {
1519
1554
  const this$ = this;
1520
- const collection = map_2((identifier) => this$.GetStudy(identifier), this$.RegisteredStudyIdentifiers);
1555
+ const collection = choose((identifier) => this$.TryGetStudy(identifier), this$.RegisteredStudyIdentifiers);
1521
1556
  return Array.from(collection);
1522
1557
  }
1523
1558
  get StudyCount() {
@@ -1526,7 +1561,7 @@ export class ArcInvestigation {
1526
1561
  }
1527
1562
  get StudyIdentifiers() {
1528
1563
  const this$ = this;
1529
- return map_2((x) => x.Identifier, this$.Studies);
1564
+ return toArray(map_2((x) => x.Identifier, this$.Studies));
1530
1565
  }
1531
1566
  AddStudy(study) {
1532
1567
  const this$ = this;
@@ -1597,9 +1632,34 @@ export class ArcInvestigation {
1597
1632
  return copy;
1598
1633
  };
1599
1634
  }
1635
+ DeleteStudyAt(index) {
1636
+ const this$ = this;
1637
+ this$.Studies.splice(index, 1);
1638
+ }
1639
+ static deleteStudyAt(index) {
1640
+ return (i) => {
1641
+ const copy = i.Copy();
1642
+ copy.DeleteStudyAt(index);
1643
+ return copy;
1644
+ };
1645
+ }
1646
+ DeleteStudy(studyIdentifier) {
1647
+ const this$ = this;
1648
+ const index = this$.Studies.findIndex((s) => (s.Identifier === studyIdentifier)) | 0;
1649
+ this$.DeleteStudyAt(index);
1650
+ }
1651
+ static deleteStudy(studyIdentifier) {
1652
+ return (i) => {
1653
+ const copy = i.Copy();
1654
+ copy.DeleteStudy(studyIdentifier);
1655
+ return copy;
1656
+ };
1657
+ }
1600
1658
  RemoveStudyAt(index) {
1601
1659
  const this$ = this;
1660
+ const ident = this$.GetStudyAt(index).Identifier;
1602
1661
  this$.Studies.splice(index, 1);
1662
+ this$.DeregisterStudy(ident);
1603
1663
  }
1604
1664
  static removeStudyAt(index) {
1605
1665
  return (inv) => {
@@ -1610,10 +1670,8 @@ export class ArcInvestigation {
1610
1670
  }
1611
1671
  RemoveStudy(studyIdentifier) {
1612
1672
  const this$ = this;
1613
- removeInPlace(this$.GetStudy(studyIdentifier), this$.Studies, {
1614
- Equals: equals,
1615
- GetHashCode: safeHash,
1616
- });
1673
+ const index = this$.GetStudyIndex(studyIdentifier) | 0;
1674
+ this$.RemoveStudyAt(index);
1617
1675
  }
1618
1676
  static removeStudy(studyIdentifier) {
1619
1677
  return (inv) => {
@@ -1684,6 +1742,16 @@ export class ArcInvestigation {
1684
1742
  return newInv.GetStudy(studyIdentifier);
1685
1743
  };
1686
1744
  }
1745
+ TryGetStudy(studyIdentifier) {
1746
+ const this$ = this;
1747
+ return tryFind((s) => (s.Identifier === studyIdentifier), this$.Studies);
1748
+ }
1749
+ static tryGetStudy(studyIdentifier) {
1750
+ return (inv) => {
1751
+ const newInv = inv.Copy();
1752
+ return newInv.TryGetStudy(studyIdentifier);
1753
+ };
1754
+ }
1687
1755
  RegisterAssayAt(studyIndex, assayIdentifier) {
1688
1756
  const this$ = this;
1689
1757
  const study = this$.GetStudyAt(studyIndex);
@@ -1745,6 +1813,20 @@ export class ArcInvestigation {
1745
1813
  return copy;
1746
1814
  };
1747
1815
  }
1816
+ DeregisterStudy(studyIdentifier) {
1817
+ const this$ = this;
1818
+ removeInPlace(studyIdentifier, this$.RegisteredStudyIdentifiers, {
1819
+ Equals: (x, y) => (x === y),
1820
+ GetHashCode: stringHash,
1821
+ });
1822
+ }
1823
+ static deregisterStudy(studyIdentifier) {
1824
+ return (i) => {
1825
+ const copy = i.Copy();
1826
+ copy.DeregisterStudy(studyIdentifier);
1827
+ return copy;
1828
+ };
1829
+ }
1748
1830
  GetAllPersons() {
1749
1831
  const this$ = this;
1750
1832
  const persons = [];
@@ -1921,56 +2003,56 @@ export class ArcInvestigation {
1921
2003
  else {
1922
2004
  return false;
1923
2005
  }
1924
- }, true, toList(delay(() => map_2((i_1) => equals(item_1(i_1, a), item_1(i_1, b)), rangeDouble(0, 1, length(a) - 1))))))), (a_1 = this$.Contacts, (b_1 = other.Contacts, (length(a_1) === length(b_1)) && fold((acc_1, e_1) => {
2006
+ }, true, toList(delay(() => map_2((i_1) => equals(item(i_1, a), item(i_1, b)), rangeDouble(0, 1, length(a) - 1))))))), (a_1 = this$.Contacts, (b_1 = other.Contacts, (length(a_1) === length(b_1)) && fold((acc_1, e_1) => {
1925
2007
  if (acc_1) {
1926
2008
  return e_1;
1927
2009
  }
1928
2010
  else {
1929
2011
  return false;
1930
2012
  }
1931
- }, true, toList(delay(() => map_2((i_2) => equals(item_1(i_2, a_1), item_1(i_2, b_1)), rangeDouble(0, 1, length(a_1) - 1))))))), (a_2 = this$.OntologySourceReferences, (b_2 = other.OntologySourceReferences, (length(a_2) === length(b_2)) && fold((acc_2, e_2) => {
2013
+ }, true, toList(delay(() => map_2((i_2) => equals(item(i_2, a_1), item(i_2, b_1)), rangeDouble(0, 1, length(a_1) - 1))))))), (a_2 = this$.OntologySourceReferences, (b_2 = other.OntologySourceReferences, (length(a_2) === length(b_2)) && fold((acc_2, e_2) => {
1932
2014
  if (acc_2) {
1933
2015
  return e_2;
1934
2016
  }
1935
2017
  else {
1936
2018
  return false;
1937
2019
  }
1938
- }, true, toList(delay(() => map_2((i_3) => equals(item_1(i_3, a_2), item_1(i_3, b_2)), rangeDouble(0, 1, length(a_2) - 1))))))), (a_3 = this$.Assays, (b_3 = other.Assays, (length(a_3) === length(b_3)) && fold((acc_3, e_3) => {
2020
+ }, true, toList(delay(() => map_2((i_3) => equals(item(i_3, a_2), item(i_3, b_2)), rangeDouble(0, 1, length(a_2) - 1))))))), (a_3 = this$.Assays, (b_3 = other.Assays, (length(a_3) === length(b_3)) && fold((acc_3, e_3) => {
1939
2021
  if (acc_3) {
1940
2022
  return e_3;
1941
2023
  }
1942
2024
  else {
1943
2025
  return false;
1944
2026
  }
1945
- }, true, toList(delay(() => map_2((i_4) => equals(item_1(i_4, a_3), item_1(i_4, b_3)), rangeDouble(0, 1, length(a_3) - 1))))))), (a_4 = this$.Studies, (b_4 = other.Studies, (length(a_4) === length(b_4)) && fold((acc_4, e_4) => {
2027
+ }, true, toList(delay(() => map_2((i_4) => equals(item(i_4, a_3), item(i_4, b_3)), rangeDouble(0, 1, length(a_3) - 1))))))), (a_4 = this$.Studies, (b_4 = other.Studies, (length(a_4) === length(b_4)) && fold((acc_4, e_4) => {
1946
2028
  if (acc_4) {
1947
2029
  return e_4;
1948
2030
  }
1949
2031
  else {
1950
2032
  return false;
1951
2033
  }
1952
- }, true, toList(delay(() => map_2((i_5) => equals(item_1(i_5, a_4), item_1(i_5, b_4)), rangeDouble(0, 1, length(a_4) - 1))))))), (a_5 = this$.RegisteredStudyIdentifiers, (b_5 = other.RegisteredStudyIdentifiers, (length(a_5) === length(b_5)) && fold((acc_5, e_5) => {
2034
+ }, true, toList(delay(() => map_2((i_5) => equals(item(i_5, a_4), item(i_5, b_4)), rangeDouble(0, 1, length(a_4) - 1))))))), (a_5 = this$.RegisteredStudyIdentifiers, (b_5 = other.RegisteredStudyIdentifiers, (length(a_5) === length(b_5)) && fold((acc_5, e_5) => {
1953
2035
  if (acc_5) {
1954
2036
  return e_5;
1955
2037
  }
1956
2038
  else {
1957
2039
  return false;
1958
2040
  }
1959
- }, true, toList(delay(() => map_2((i_6) => (item_1(i_6, a_5) === item_1(i_6, b_5)), rangeDouble(0, 1, length(a_5) - 1))))))), (a_6 = this$.Comments, (b_6 = other.Comments, (length(a_6) === length(b_6)) && fold((acc_6, e_6) => {
2041
+ }, true, toList(delay(() => map_2((i_6) => (item(i_6, a_5) === item(i_6, b_5)), rangeDouble(0, 1, length(a_5) - 1))))))), (a_6 = this$.Comments, (b_6 = other.Comments, (length(a_6) === length(b_6)) && fold((acc_6, e_6) => {
1960
2042
  if (acc_6) {
1961
2043
  return e_6;
1962
2044
  }
1963
2045
  else {
1964
2046
  return false;
1965
2047
  }
1966
- }, true, toList(delay(() => map_2((i_7) => equals(item_1(i_7, a_6), item_1(i_7, b_6)), rangeDouble(0, 1, length(a_6) - 1))))))), (a_7 = this$.Remarks, (b_7 = other.Remarks, (length(a_7) === length(b_7)) && fold((acc_7, e_7) => {
2048
+ }, true, toList(delay(() => map_2((i_7) => equals(item(i_7, a_6), item(i_7, b_6)), rangeDouble(0, 1, length(a_6) - 1))))))), (a_7 = this$.Remarks, (b_7 = other.Remarks, (length(a_7) === length(b_7)) && fold((acc_7, e_7) => {
1967
2049
  if (acc_7) {
1968
2050
  return e_7;
1969
2051
  }
1970
2052
  else {
1971
2053
  return false;
1972
2054
  }
1973
- }, true, toList(delay(() => map_2((i_8) => equals(item_1(i_8, a_7), item_1(i_8, b_7)), rangeDouble(0, 1, length(a_7) - 1)))))))]);
2055
+ }, true, toList(delay(() => map_2((i_8) => equals(item(i_8, a_7), item(i_8, b_7)), rangeDouble(0, 1, length(a_7) - 1)))))))]);
1974
2056
  }
1975
2057
  ReferenceEquals(other) {
1976
2058
  const this$ = this;
package/ISA/ISA/Helper.js CHANGED
@@ -1,6 +1,6 @@
1
+ import { isIterable, defaultOf, numberHash, identityHash, structuralHash, equals, disposeSafe, getEnumerator } from "../../fable_modules/fable-library.4.5.0/Util.js";
1
2
  import { some, value as value_1 } from "../../fable_modules/fable-library.4.5.0/Option.js";
2
- import { isIterable, defaultOf, structuralHash, equals, numberHash, identityHash } from "../../fable_modules/fable-library.4.5.0/Util.js";
3
- import { exactlyOne, partition, fold } from "../../fable_modules/fable-library.4.5.0/Array.js";
3
+ import { exactlyOne, partition, fold, contains } from "../../fable_modules/fable-library.4.5.0/Array.js";
4
4
  import { empty, singleton, append, head, tail, isEmpty } from "../../fable_modules/fable-library.4.5.0/List.js";
5
5
  import { Dictionary } from "../../fable_modules/fable-library.4.5.0/MutableMap.js";
6
6
  import { isEmpty as isEmpty_1, iterate } from "../../fable_modules/fable-library.4.5.0/Seq.js";
@@ -9,6 +9,160 @@ import { Union, toString, FSharpRef } from "../../fable_modules/fable-library.4.
9
9
  import { append_generic, distinct_generic, isList_generic, isMap_generic } from "./Fable.js";
10
10
  import { union_type, makeUnion, option_type, makeGenericType, getUnionCases, name, obj_type } from "../../fable_modules/fable-library.4.5.0/Reflection.js";
11
11
 
12
+ export function ResizeArray_map(f, a) {
13
+ const b = [];
14
+ let enumerator = getEnumerator(a);
15
+ try {
16
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
17
+ const i = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
18
+ void (b.push(f(i)));
19
+ }
20
+ }
21
+ finally {
22
+ disposeSafe(enumerator);
23
+ }
24
+ return b;
25
+ }
26
+
27
+ export function ResizeArray_choose(f, a) {
28
+ const b = [];
29
+ let enumerator = getEnumerator(a);
30
+ try {
31
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
32
+ const matchValue = f(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]());
33
+ if (matchValue == null) {
34
+ }
35
+ else {
36
+ const x = value_1(matchValue);
37
+ void (b.push(x));
38
+ }
39
+ }
40
+ }
41
+ finally {
42
+ disposeSafe(enumerator);
43
+ }
44
+ return b;
45
+ }
46
+
47
+ export function ResizeArray_filter(f, a) {
48
+ const b = [];
49
+ let enumerator = getEnumerator(a);
50
+ try {
51
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
52
+ const i = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
53
+ if (f(i)) {
54
+ void (b.push(i));
55
+ }
56
+ }
57
+ }
58
+ finally {
59
+ disposeSafe(enumerator);
60
+ }
61
+ return b;
62
+ }
63
+
64
+ export function ResizeArray_fold(f, s, a) {
65
+ let state = s;
66
+ let enumerator = getEnumerator(a);
67
+ try {
68
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
69
+ const i = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
70
+ state = f(state, i);
71
+ }
72
+ }
73
+ finally {
74
+ disposeSafe(enumerator);
75
+ }
76
+ return state;
77
+ }
78
+
79
+ export function ResizeArray_foldBack(f, a, s) {
80
+ let state = s;
81
+ let enumerator = getEnumerator(a);
82
+ try {
83
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
84
+ const i = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
85
+ state = f(i, state);
86
+ }
87
+ }
88
+ finally {
89
+ disposeSafe(enumerator);
90
+ }
91
+ return state;
92
+ }
93
+
94
+ export function ResizeArray_iter(f, a) {
95
+ let enumerator = getEnumerator(a);
96
+ try {
97
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
98
+ f(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]());
99
+ }
100
+ }
101
+ finally {
102
+ disposeSafe(enumerator);
103
+ }
104
+ }
105
+
106
+ export function ResizeArray_reduce(f, a) {
107
+ switch (a.length) {
108
+ case 0:
109
+ throw new Error("ResizeArray.reduce: empty array");
110
+ case 1:
111
+ return a[0];
112
+ default: {
113
+ const a_5 = a;
114
+ let state = a_5[0];
115
+ for (let i = 1; i <= (a_5.length - 1); i++) {
116
+ state = f(state, a_5[i]);
117
+ }
118
+ return state;
119
+ }
120
+ }
121
+ }
122
+
123
+ export function ResizeArray_collect(f, a) {
124
+ const b = [];
125
+ let enumerator = getEnumerator(a);
126
+ try {
127
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
128
+ const enumerator_1 = getEnumerator(f(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]()));
129
+ try {
130
+ while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
131
+ const j = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
132
+ void (b.push(j));
133
+ }
134
+ }
135
+ finally {
136
+ disposeSafe(enumerator_1);
137
+ }
138
+ }
139
+ }
140
+ finally {
141
+ disposeSafe(enumerator);
142
+ }
143
+ return b;
144
+ }
145
+
146
+ export function ResizeArray_distinct(a) {
147
+ const b = [];
148
+ let enumerator = getEnumerator(a);
149
+ try {
150
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
151
+ const i = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
152
+ if (!contains(i, b, {
153
+ Equals: equals,
154
+ GetHashCode: structuralHash,
155
+ })) {
156
+ void (b.push(i));
157
+ }
158
+ }
159
+ }
160
+ finally {
161
+ disposeSafe(enumerator);
162
+ }
163
+ return b;
164
+ }
165
+
12
166
  export function HashCodes_boxHashOption(a) {
13
167
  let copyOfStruct, copyOfStruct_1;
14
168
  return (a != null) ? ((copyOfStruct = value_1(a), identityHash(copyOfStruct))) : ((copyOfStruct_1 = 0, numberHash(copyOfStruct_1)));
@@ -4,7 +4,7 @@ import { combineMany } from "../../FileSystem/Path.js";
4
4
 
5
5
  export function checkValidCharacters(identifier) {
6
6
  if (!isMatch(/^[a-zA-Z0-9_\- ]+$/gu, identifier)) {
7
- throw new Error("New identifier contains forbidden characters! Allowed characters are: letters, digits, underscore (_), dash (-) and whitespace ( ).");
7
+ throw new Error(`New identifier "${identifier}"contains forbidden characters! Allowed characters are: letters, digits, underscore (_), dash (-) and whitespace ( ).`);
8
8
  }
9
9
  }
10
10
 
@@ -9,7 +9,7 @@ import { value as value_1, defaultArg } from "../../fable_modules/fable-library.
9
9
  import { List_distinctBy, List_distinct } from "../../fable_modules/fable-library.4.5.0/Seq2.js";
10
10
  import { comparePrimitives, getEnumerator, stringHash } from "../../fable_modules/fable-library.4.5.0/Util.js";
11
11
  import { Option_fromValueWithDefault } from "./Metadata/Conversions.js";
12
- import { ArcInvestigation } from "../ISA/ArcTypes/ArcTypes.js";
12
+ import { ArcStudy, ArcInvestigation } from "../ISA/ArcTypes/ArcTypes.js";
13
13
  import { toRows as toRows_1, fromRows as fromRows_1 } from "./Metadata/OntologySourceReference.js";
14
14
  import { toRows as toRows_2, fromRows as fromRows_2 } from "./Metadata/Publication.js";
15
15
  import { toRows as toRows_3, fromRows as fromRows_3 } from "./Metadata/Contacts.js";
@@ -244,7 +244,10 @@ export function fromRows(rows) {
244
244
 
245
245
  export function toRows(investigation) {
246
246
  let remarks, rows;
247
- return (remarks = ofArray(investigation.Remarks), (rows = delay(() => append_1(singleton(SparseRowModule_fromValues(["ONTOLOGY SOURCE REFERENCE"])), delay(() => append_1(toRows_1(ofArray(investigation.OntologySourceReferences)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION"])), delay(() => append_1(InvestigationInfo_toRows_Z4D87C88C(investigation), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION PUBLICATIONS"])), delay(() => append_1(toRows_2("Investigation Publication", ofArray(investigation.Publications)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION CONTACTS"])), delay(() => append_1(toRows_3("Investigation Person", ofArray(investigation.Contacts)), delay(() => collect((study) => append_1(singleton(SparseRowModule_fromValues(["STUDY"])), delay(() => toRows_4(study, void 0))), investigation.RegisteredStudies)))))))))))))))))), (() => {
247
+ return (remarks = ofArray(investigation.Remarks), (rows = delay(() => append_1(singleton(SparseRowModule_fromValues(["ONTOLOGY SOURCE REFERENCE"])), delay(() => append_1(toRows_1(ofArray(investigation.OntologySourceReferences)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION"])), delay(() => append_1(InvestigationInfo_toRows_Z4D87C88C(investigation), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION PUBLICATIONS"])), delay(() => append_1(toRows_2("Investigation Publication", ofArray(investigation.Publications)), delay(() => append_1(singleton(SparseRowModule_fromValues(["INVESTIGATION CONTACTS"])), delay(() => append_1(toRows_3("Investigation Person", ofArray(investigation.Contacts)), delay(() => collect((studyIdentifier) => {
248
+ const study = defaultArg(investigation.TryGetStudy(studyIdentifier), new ArcStudy(studyIdentifier));
249
+ return append_1(singleton(SparseRowModule_fromValues(["STUDY"])), delay(() => toRows_4(study, void 0)));
250
+ }, investigation.RegisteredStudyIdentifiers)))))))))))))))))), (() => {
248
251
  try {
249
252
  const rm = ofList(map((remark) => Remark.toTuple(remark), remarks), {
250
253
  Compare: comparePrimitives,
package/Path.js ADDED
@@ -0,0 +1,10 @@
1
+ import { combine } from "./FileSystem/Path.js";
2
+
3
+ export function getAssayFolderPath(assayIdentifier) {
4
+ return combine("assays", assayIdentifier);
5
+ }
6
+
7
+ export function getStudyFolderPath(studyIdentifier) {
8
+ return combine("studies", studyIdentifier);
9
+ }
10
+