diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index b9b06cea..a4ddebef 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -7,6 +7,12 @@
"commands": [
"fable"
]
+ },
+ "paket": {
+ "version": "7.2.1",
+ "commands": [
+ "paket"
+ ]
}
}
}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 6167018c..b21a6086 100644
--- a/.gitignore
+++ b/.gitignore
@@ -349,9 +349,11 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
+#Paket dependency manager
+paket-files/
# Custom ignored files
-pkg/
+dist/
tmp/
/tests/FileSystem/FileSystem.Tests/js
/tests/ISA/ISA.Json.Tests/js
@@ -361,3 +363,4 @@ tmp/
/tests/Python/ARCtrl
/tests/ARCtrl/js
/tests/FileSystem/js
+
diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets
new file mode 100644
index 00000000..4deb15bc
--- /dev/null
+++ b/.paket/Paket.Restore.targets
@@ -0,0 +1,557 @@
+
+
+
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+
+ $(MSBuildVersion)
+ 15.0.0
+ false
+ true
+
+ true
+ $(MSBuildThisFileDirectory)
+ $(MSBuildThisFileDirectory)..\
+ $(PaketRootPath)paket-files\paket.restore.cached
+ $(PaketRootPath)paket.lock
+ classic
+ proj
+ assembly
+ native
+ /Library/Frameworks/Mono.framework/Commands/mono
+ mono
+
+
+ $(PaketRootPath)paket.bootstrapper.exe
+ $(PaketToolsPath)paket.bootstrapper.exe
+ $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\
+
+ "$(PaketBootStrapperExePath)"
+ $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"
+
+
+
+
+ true
+ true
+
+
+ True
+
+
+ False
+
+ $(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/'))
+
+
+
+
+
+
+
+
+ $(PaketRootPath)paket
+ $(PaketToolsPath)paket
+
+
+
+
+
+ $(PaketRootPath)paket.exe
+ $(PaketToolsPath)paket.exe
+
+
+
+
+
+ <_DotnetToolsJson Condition="Exists('$(PaketRootPath)/.config/dotnet-tools.json')">$([System.IO.File]::ReadAllText("$(PaketRootPath)/.config/dotnet-tools.json"))
+ <_ConfigContainsPaket Condition=" '$(_DotnetToolsJson)' != ''">$(_DotnetToolsJson.Contains('"paket"'))
+ <_ConfigContainsPaket Condition=" '$(_ConfigContainsPaket)' == ''">false
+
+
+
+
+
+
+
+
+
+
+ <_PaketCommand>dotnet paket
+
+
+
+
+
+ $(PaketToolsPath)paket
+ $(PaketBootStrapperExeDir)paket
+
+
+ paket
+
+
+
+
+ <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))
+ <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"
+ <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"
+ <_PaketCommand Condition=" '$(_PaketCommand)' == '' ">"$(PaketExePath)"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(NoWarn);NU1603;NU1604;NU1605;NU1608
+ false
+ true
+
+
+
+
+
+
+
+
+ $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))
+
+
+
+
+
+
+ $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``))
+ $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``))
+
+
+
+
+ %(PaketRestoreCachedKeyValue.Value)
+ %(PaketRestoreCachedKeyValue.Value)
+
+
+
+
+ true
+ false
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached
+
+ $(MSBuildProjectFullPath).paket.references
+
+ $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references
+
+ $(MSBuildProjectDirectory)\paket.references
+
+ false
+ true
+ true
+ references-file-or-cache-not-found
+
+
+
+
+ $([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)'))
+ $([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)'))
+ references-file
+ false
+
+
+
+
+ false
+
+
+
+
+ true
+ target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths)
+
+
+
+
+
+
+
+
+
+
+ false
+ true
+
+
+
+
+
+
+
+
+
+
+ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)
+ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])
+ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])
+ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])
+ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])
+ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6])
+ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7])
+
+
+ %(PaketReferencesFileLinesInfo.PackageVersion)
+ All
+ runtime
+ $(ExcludeAssets);contentFiles
+ $(ExcludeAssets);build;buildMultitargeting;buildTransitive
+ true
+ true
+
+
+
+
+ $(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools
+
+
+
+
+
+
+
+
+ $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0])
+ $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1])
+
+
+ %(PaketCliToolFileLinesInfo.PackageVersion)
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+ <_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/>
+
+
+
+
+
+ $(MSBuildProjectDirectory)/$(MSBuildProjectFile)
+ true
+ false
+ true
+ false
+ true
+ false
+ true
+ false
+ true
+ false
+ true
+ $(PaketIntermediateOutputPath)\$(Configuration)
+ $(PaketIntermediateOutputPath)
+
+
+
+ <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ARCtrl.sln b/ARCtrl.sln
index 8c608dcc..c2979c8c 100644
--- a/ARCtrl.sln
+++ b/ARCtrl.sln
@@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.config\dotnet-tools.json = .config\dotnet-tools.json
global.json = global.json
package.json = package.json
+ paket.dependencies = paket.dependencies
README.md = README.md
RELEASE_NOTES.md = RELEASE_NOTES.md
EndProjectSection
@@ -97,10 +98,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.ISA.Spreadsheet", "s
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ISA.Spreadsheet.Tests", "tests\ISA\ISA.Spreadsheet.Tests\ISA.Spreadsheet.Tests.fsproj", "{656E8DAF-EFCF-472E-91D0-987D09B74523}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FileSystem", "FileSystem", "{E36B41EF-DD2A-45EB-912C-E637BBDBFDDE}"
-EndProject
-Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FileSystem.Tests", "tests\FileSystem\FileSystem.Tests\FileSystem.Tests.fsproj", "{D7397A55-93AE-4165-9E2D-D83A52C22D41}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "playground", "playground", "{45E972BE-0BFA-4DE3-B84A-D9F13C4E9D08}"
ProjectSection(SolutionItems) = preProject
playground\KevinF.fsx = playground\KevinF.fsx
@@ -118,6 +115,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.Tests", "tests\ARCtr
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.Contract", "src\Contract\ARCtrl.Contract.fsproj", "{1945EE8A-F105-43A9-91C9-8C4422B9873E}"
EndProject
+Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FileSystem.Tests", "tests\FileSystem\FileSystem.Tests.fsproj", "{D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -160,10 +159,6 @@ Global
{656E8DAF-EFCF-472E-91D0-987D09B74523}.Debug|Any CPU.Build.0 = Debug|Any CPU
{656E8DAF-EFCF-472E-91D0-987D09B74523}.Release|Any CPU.ActiveCfg = Release|Any CPU
{656E8DAF-EFCF-472E-91D0-987D09B74523}.Release|Any CPU.Build.0 = Release|Any CPU
- {D7397A55-93AE-4165-9E2D-D83A52C22D41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D7397A55-93AE-4165-9E2D-D83A52C22D41}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D7397A55-93AE-4165-9E2D-D83A52C22D41}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D7397A55-93AE-4165-9E2D-D83A52C22D41}.Release|Any CPU.Build.0 = Release|Any CPU
{9BE5D83D-EA90-4382-A132-174FD158227F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BE5D83D-EA90-4382-A132-174FD158227F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BE5D83D-EA90-4382-A132-174FD158227F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -176,6 +171,10 @@ Global
{1945EE8A-F105-43A9-91C9-8C4422B9873E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1945EE8A-F105-43A9-91C9-8C4422B9873E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1945EE8A-F105-43A9-91C9-8C4422B9873E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -197,12 +196,11 @@ Global
{04789F17-3DC2-4A09-848D-376E5D269740} = {D1BBD7AE-35C8-498F-BABA-C93FFAE68037}
{07C7942E-FC34-4C27-82C1-6B2972654BA7} = {C61B3F43-2255-4585-9110-F8AB74F02654}
{656E8DAF-EFCF-472E-91D0-987D09B74523} = {D1BBD7AE-35C8-498F-BABA-C93FFAE68037}
- {E36B41EF-DD2A-45EB-912C-E637BBDBFDDE} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
- {D7397A55-93AE-4165-9E2D-D83A52C22D41} = {E36B41EF-DD2A-45EB-912C-E637BBDBFDDE}
{913222CA-261F-49CB-A823-CC7C335F964A} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{9BE5D83D-EA90-4382-A132-174FD158227F} = {6DA2330B-D407-4FB1-AF05-B0184034EC44}
{801247D5-7EE5-49C8-AB26-F822A415BA49} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{1945EE8A-F105-43A9-91C9-8C4422B9873E} = {6DA2330B-D407-4FB1-AF05-B0184034EC44}
+ {D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1E354DE6-99BA-421E-9EF8-E808B855A85F}
diff --git a/README.md b/README.md
index 20fad725..2f41e7a2 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# ARCtrl
+# ARCtrl
Top level ARC DataModel and API function descriptions.
- [ARCtrl](#arctrl)
@@ -14,7 +14,7 @@ Top level ARC DataModel and API function descriptions.
[ISA README.md](src/ISA/README.md) :books:
-[Contracts README.md](src/ArcContract/README.md) :books:
+[Contracts README.md](src/Contract/README.md) :books:
# Jargon/Nomenclature
@@ -265,3 +265,13 @@ export class Study extends Record implements IEquatable, IComparable Shell.cleanDirs
}
diff --git a/build/Build.fsproj b/build/Build.fsproj
index 7f32a29b..202222b5 100644
--- a/build/Build.fsproj
+++ b/build/Build.fsproj
@@ -1,11 +1,11 @@
-
-
+
+
net6.0
Exe
-
+
@@ -16,7 +16,6 @@
-
@@ -27,7 +26,7 @@
-
+
-
-
+
+
\ No newline at end of file
diff --git a/build/ProjectInfo.fs b/build/ProjectInfo.fs
index fff0d93c..553c5c0b 100644
--- a/build/ProjectInfo.fs
+++ b/build/ProjectInfo.fs
@@ -9,7 +9,7 @@ let testProjects =
"tests/ISA/ISA.Tests"
"tests/ISA/ISA.Json.Tests"
"tests/ISA/ISA.Spreadsheet.Tests"
- "tests/FileSystem/FileSystem.Tests"
+ "tests/FileSystem"
]
let solutionFile = $"{project}.sln"
@@ -22,7 +22,7 @@ let gitHome = $"https://github.com/{gitOwner}"
let projectRepo = $"https://github.com/{gitOwner}/{project}"
-let pkgDir = "pkg"
+let pkgDir = "dist/pkg"
// Create RELEASE_NOTES.md if not existing. Or "release" would throw an error.
Fake.Extensions.Release.ReleaseNotes.ensure()
diff --git a/build/TestTasks.fs b/build/TestTasks.fs
index 7062c906..eb67904a 100644
--- a/build/TestTasks.fs
+++ b/build/TestTasks.fs
@@ -114,7 +114,7 @@ module RunTests =
run npm "run testJson" ""
run npm "run testSpreadsheet" ""
run npm "run testFS" ""
- run npm "run testJavaScript" ""
+ run npm "run testjs" ""
}
let runTestsDotnet = BuildTask.create "runTestsDotnet" [clean; build] {
diff --git a/build/paket.references b/build/paket.references
new file mode 100644
index 00000000..640cf914
--- /dev/null
+++ b/build/paket.references
@@ -0,0 +1 @@
+FSharp.Core
\ No newline at end of file
diff --git a/js/ARCtrl.js b/js/ARCtrl.js
deleted file mode 100644
index 52914cb9..00000000
--- a/js/ARCtrl.js
+++ /dev/null
@@ -1,179 +0,0 @@
-import { tryFind, append, exactlyOne, choose, map } from "./fable_modules/fable-library.4.1.4/Array.js";
-import { toFsWorkbook as toFsWorkbook_2, fromFsWorkbook } from "./ISA/ISA.Spreadsheet/ArcAssay.js";
-import { tryFromContract } from "./Contracts/Contracts.ArcAssay.js";
-import { toFsWorkbook as toFsWorkbook_1, fromFsWorkbook as fromFsWorkbook_1 } from "./ISA/ISA.Spreadsheet/ArcStudy.js";
-import { tryFromContract as tryFromContract_1 } from "./Contracts/Contracts.ArcStudy.js";
-import { toFsWorkbook, fromFsWorkbook as fromFsWorkbook_2 } from "./ISA/ISA.Spreadsheet/InvestigationFile/Investigation.js";
-import { tryFromContract as tryFromContract_2 } from "./Contracts/Contracts.ArcInvestigation.js";
-import { iterate, map as map_1, fold } from "./fable_modules/fable-library.4.1.4/Seq.js";
-import { createRunsFolder, createWorkflowsFolder, createInvestigationFile, createStudyFolder, createStudiesFolder, createAssayFolder, createAssaysFolder } from "./FileSystemTree.js";
-import { FileSystemTree } from "./FileSystem/FileSystemTree.js";
-import { FileSystem } from "./FileSystem/FileSystem.js";
-import { defaultArg, unwrap } from "./fable_modules/fable-library.4.1.4/Option.js";
-import { tryISAReadContractFromPath } from "./Contracts/Contracts.ARCtrl.js";
-import { printf, toConsole } from "./fable_modules/fable-library.4.1.4/String.js";
-import { addToDict } from "./fable_modules/fable-library.4.1.4/MapUtil.js";
-import { ArcInvestigation } from "./ISA/ISA/ArcTypes/ArcInvestigation.js";
-import { Assay_fileNameFromIdentifier, Study_fileNameFromIdentifier } from "./ISA/ISA/ArcTypes/Identifier.js";
-import { Dictionary_tryGet } from "./fable_modules/FsSpreadsheet.3.3.0/Cells/FsCellsCollection.fs.js";
-import { Contract } from "./Contract/Contract.js";
-import { class_type } from "./fable_modules/fable-library.4.1.4/Reflection.js";
-
-export function ARCAux_getArcAssaysFromContracts(contracts) {
- return map(fromFsWorkbook, choose(tryFromContract, contracts));
-}
-
-export function ARCAux_getArcStudiesFromContracts(contracts) {
- return map(fromFsWorkbook_1, choose(tryFromContract_1, contracts));
-}
-
-export function ARCAux_getArcInvestigationFromContracts(contracts) {
- return fromFsWorkbook_2(exactlyOne(choose(tryFromContract_2, contracts)));
-}
-
-export function ARCAux_updateFSByISA(isa, fs) {
- let patternInput;
- if (isa == null) {
- patternInput = [[], []];
- }
- else {
- const inv = isa;
- const arg = [[], []];
- patternInput = fold((tupledArg, s) => [append(tupledArg[0], [s.Identifier]), append(tupledArg[1], Array.from(map_1((a) => a.Identifier, s.Assays)))], [arg[0], arg[1]], inv.Studies);
- }
- const assays = createAssaysFolder(map(createAssayFolder, patternInput[1]));
- const studies = createStudiesFolder(map(createStudyFolder, patternInput[0]));
- const investigation = createInvestigationFile();
- let tree;
- const arg_1 = FileSystemTree.createRootFolder([investigation, assays, studies]);
- tree = FileSystem.create({
- tree: arg_1,
- });
- return fs.Union(tree);
-}
-
-export function ARCAux_updateFSByCWL(cwl, fs) {
- const workflows = createWorkflowsFolder([]);
- const runs = createRunsFolder([]);
- let tree;
- const arg = FileSystemTree.createRootFolder([workflows, runs]);
- tree = FileSystem.create({
- tree: arg,
- });
- return fs.Union(tree);
-}
-
-export class ARC {
- constructor(isa, cwl, fs) {
- let fs_2, fs_1;
- this["isa@59"] = isa;
- this["cwl@60"] = cwl;
- this["fs@61"] = ((fs_2 = ((fs_1 = defaultArg(fs, FileSystem.create({
- tree: new FileSystemTree(1, ["", []]),
- })), ARCAux_updateFSByISA(this["isa@59"], fs_1))), ARCAux_updateFSByCWL(this["cwl@60"], fs_2)));
- }
- get ISA() {
- const this$ = this;
- return unwrap(this$["isa@59"]);
- }
- get CWL() {
- const this$ = this;
- return this$["cwl@60"];
- }
- get FileSystem() {
- const this$ = this;
- return this$["fs@61"];
- }
- static fromFilePaths(filePaths) {
- return new ARC(void 0, void 0, FileSystem.fromFilePaths(filePaths));
- }
- GetReadContracts() {
- const this$ = this;
- return choose(tryISAReadContractFromPath, this$["fs@61"].Tree.ToFilePaths());
- }
- SetISAFromContracts(contracts, enableLogging) {
- const this$ = this;
- const enableLogging_1 = defaultArg(enableLogging, false);
- const investigation = ARCAux_getArcInvestigationFromContracts(contracts);
- const studies = ARCAux_getArcStudiesFromContracts(contracts);
- const assays = ARCAux_getArcAssaysFromContracts(contracts);
- const copy = investigation.Copy();
- iterate((studyRegisteredIdent) => {
- const studyOpt = tryFind((s) => (s.Identifier === studyRegisteredIdent), studies);
- if (studyOpt == null) {
- if (enableLogging_1) {
- toConsole(printf("Unable to find registered study \'%s\' in fullfilled READ contracts!"))(studyRegisteredIdent);
- }
- }
- else {
- const study = studyOpt;
- if (enableLogging_1) {
- toConsole(printf("Found study: %s"))(studyRegisteredIdent);
- }
- iterate((assayRegisteredIdent) => {
- const assayOpt = tryFind((a) => (a.Identifier === assayRegisteredIdent), assays);
- if (assayOpt == null) {
- if (enableLogging_1) {
- toConsole(printf("Unable to find registered assay \'%s\' in fullfilled READ contracts!"))(assayRegisteredIdent);
- }
- }
- else {
- const assay = assayOpt;
- if (enableLogging_1) {
- toConsole(printf("Found assay: %s - %s"))(studyRegisteredIdent)(assayRegisteredIdent);
- }
- study.AddAssay(assay);
- }
- }, copy.GetStudy(studyRegisteredIdent).AssayIdentifiers);
- investigation.SetStudy(studyRegisteredIdent, study);
- }
- }, copy.StudyIdentifiers);
- this$["isa@59"] = investigation;
- }
- UpdateFileSystem() {
- const this$ = this;
- let newFS;
- const fs = ARCAux_updateFSByISA(this$["isa@59"], this$["fs@61"]);
- newFS = ARCAux_updateFSByCWL(this$["cwl@60"], fs);
- this$["fs@61"] = newFS;
- }
- GetWriteContracts() {
- const this$ = this;
- const workbooks = new Map([]);
- const matchValue = this$.ISA;
- if (matchValue == null) {
- addToDict(workbooks, "isa.investigation.xlsx", ["ISA_Investigation", toFsWorkbook(ArcInvestigation.create("MISSING_IDENTIFIER_"))]);
- toConsole(printf("ARC contains no ISA part."));
- }
- else {
- const inv = matchValue;
- addToDict(workbooks, "isa.investigation.xlsx", ["ISA_Investigation", toFsWorkbook(inv)]);
- iterate((s) => {
- addToDict(workbooks, Study_fileNameFromIdentifier(s.Identifier), ["ISA_Study", toFsWorkbook_1(s)]);
- iterate((a) => {
- addToDict(workbooks, Assay_fileNameFromIdentifier(a.Identifier), ["ISA_Assay", toFsWorkbook_2(a)]);
- }, s.Assays);
- }, inv.Studies);
- }
- return map((fp) => {
- const matchValue_1 = Dictionary_tryGet(fp, workbooks);
- if (matchValue_1 == null) {
- return Contract.createCreate(fp, "PlainText");
- }
- else {
- const wb = matchValue_1[1];
- const dto = matchValue_1[0];
- return Contract.createCreate(fp, dto, wb);
- }
- }, this$["fs@61"].Tree.ToFilePaths(true));
- }
-}
-
-export function ARC_$reflection() {
- return class_type("ARCtrl.ARC", void 0, ARC);
-}
-
-export function ARC_$ctor_81B80F4(isa, cwl, fs) {
- return new ARC(isa, cwl, fs);
-}
-
diff --git a/js/ARCtrl_Lukas_03.08.23.zip b/js/ARCtrl_Lukas_03.08.23.zip
deleted file mode 100644
index 74f4681a..00000000
Binary files a/js/ARCtrl_Lukas_03.08.23.zip and /dev/null differ
diff --git a/js/Contract/Contract.js b/js/Contract/Contract.js
deleted file mode 100644
index c10d276a..00000000
--- a/js/Contract/Contract.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import { Record } from "../fable_modules/fable-library.4.1.4/Types.js";
-import { class_type, option_type, record_type, array_type, string_type } from "../fable_modules/fable-library.4.1.4/Reflection.js";
-import { defaultArg } from "../fable_modules/fable-library.4.1.4/Option.js";
-
-export class CLITool extends Record {
- constructor(Name, Arguments) {
- super();
- this.Name = Name;
- this.Arguments = Arguments;
- }
- static create(name, arguments$) {
- return new CLITool(name, arguments$);
- }
-}
-
-export function CLITool_$reflection() {
- return record_type("ARCtrl.Contract.CLITool", [], CLITool, () => [["Name", string_type], ["Arguments", array_type(string_type)]]);
-}
-
-export class Contract extends Record {
- constructor(Operation, Path, DTOType, DTO) {
- super();
- this.Operation = Operation;
- this.Path = Path;
- this.DTOType = DTOType;
- this.DTO = DTO;
- }
- static create(op, path, { dtoType, dto }) {
- return new Contract(op, path, dtoType, dto);
- }
- static createCreate(path, dtoType, dto) {
- return new Contract("CREATE", path, dtoType, dto);
- }
- static createUpdate(path, dtoType, dto) {
- return new Contract("UPDATE", path, dtoType, dto);
- }
- static createDelete(path) {
- return new Contract("DELETE", path, void 0, void 0);
- }
- static createRead(path, dtoType) {
- return new Contract("READ", path, dtoType, void 0);
- }
- static createExecute(dto, { path }) {
- return new Contract("EXECUTE", defaultArg(path, ""), "Cli", dto);
- }
-}
-
-export function Contract_$reflection() {
- return record_type("ARCtrl.Contract.Contract", [], Contract, () => [["Operation", string_type], ["Path", string_type], ["DTOType", option_type(string_type)], ["DTO", option_type(class_type("ARCtrl.Contract.DTO"))]]);
-}
-
diff --git a/js/Contracts/Contracts.ARCtrl.js b/js/Contracts/Contracts.ARCtrl.js
deleted file mode 100644
index 6e6a0beb..00000000
--- a/js/Contracts/Contracts.ARCtrl.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import { split as split_1 } from "../FileSystem/Path.js";
-import { $007CInvestigationPath$007C_$007C } from "./Contracts.ArcInvestigation.js";
-import { Contract } from "../Contract/Contract.js";
-import { $007CAssayPath$007C_$007C } from "./Contracts.ArcAssay.js";
-import { $007CStudyPath$007C_$007C } from "./Contracts.ArcStudy.js";
-
-/**
- * Tries to create READ contract with DTOType = ISA_Assay, ISA_Study or ISA_Investigation from given path relative to ARC root.
- */
-export function tryISAReadContractFromPath(path) {
- const split = split_1(path);
- const activePatternResult = $007CInvestigationPath$007C_$007C(split);
- if (activePatternResult != null) {
- const p = activePatternResult;
- return Contract.createRead(p, "ISA_Investigation");
- }
- else {
- const activePatternResult_1 = $007CAssayPath$007C_$007C(split);
- if (activePatternResult_1 != null) {
- const p_1 = activePatternResult_1;
- return Contract.createRead(p_1, "ISA_Assay");
- }
- else {
- const activePatternResult_2 = $007CStudyPath$007C_$007C(split);
- if (activePatternResult_2 != null) {
- const p_2 = activePatternResult_2;
- return Contract.createRead(p_2, "ISA_Study");
- }
- else {
- return void 0;
- }
- }
- }
-}
-
diff --git a/js/Contracts/Contracts.ArcAssay.js b/js/Contracts/Contracts.ArcAssay.js
deleted file mode 100644
index 30993b2e..00000000
--- a/js/Contracts/Contracts.ArcAssay.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import { some } from "../fable_modules/fable-library.4.1.4/Option.js";
-import { combineMany } from "../FileSystem/Path.js";
-import { equalsWith } from "../fable_modules/fable-library.4.1.4/Array.js";
-import { defaultOf } from "../fable_modules/fable-library.4.1.4/Util.js";
-
-export function tryFromContract(c) {
- let matchResult, fsworkbook;
- if (c.Operation === "READ") {
- if (c.DTOType != null) {
- if (c.DTOType === "ISA_Assay") {
- if (c.DTO != null) {
- matchResult = 0;
- fsworkbook = c.DTO;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return some(fsworkbook);
- default:
- return void 0;
- }
-}
-
-export function $007CAssayPath$007C_$007C(input) {
- let matchResult;
- if (!equalsWith((x, y) => (x === y), input, defaultOf()) && (input.length === 3)) {
- if (input[0] === "assays") {
- if (input[2] === "isa.assay.xlsx") {
- matchResult = 0;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0: {
- const anyAssayName = input[1];
- return combineMany(input);
- }
- default:
- return void 0;
- }
-}
-
diff --git a/js/Contracts/Contracts.ArcInvestigation.js b/js/Contracts/Contracts.ArcInvestigation.js
deleted file mode 100644
index bfe55a1f..00000000
--- a/js/Contracts/Contracts.ArcInvestigation.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import { some } from "../fable_modules/fable-library.4.1.4/Option.js";
-import { combineMany } from "../FileSystem/Path.js";
-import { equalsWith } from "../fable_modules/fable-library.4.1.4/Array.js";
-import { defaultOf } from "../fable_modules/fable-library.4.1.4/Util.js";
-
-export function tryFromContract(c) {
- let matchResult, fsworkbook;
- if (c.Operation === "READ") {
- if (c.DTOType != null) {
- if (c.DTOType === "ISA_Investigation") {
- if (c.DTO != null) {
- matchResult = 0;
- fsworkbook = c.DTO;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return some(fsworkbook);
- default:
- return void 0;
- }
-}
-
-export function $007CInvestigationPath$007C_$007C(input) {
- let matchResult;
- if (!equalsWith((x, y) => (x === y), input, defaultOf()) && (input.length === 1)) {
- if (input[0] === "isa.investigation.xlsx") {
- matchResult = 0;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return combineMany(input);
- default:
- return void 0;
- }
-}
-
diff --git a/js/Contracts/Contracts.ArcStudy.js b/js/Contracts/Contracts.ArcStudy.js
deleted file mode 100644
index cc62a643..00000000
--- a/js/Contracts/Contracts.ArcStudy.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import { some } from "../fable_modules/fable-library.4.1.4/Option.js";
-import { combineMany } from "../FileSystem/Path.js";
-import { equalsWith } from "../fable_modules/fable-library.4.1.4/Array.js";
-import { defaultOf } from "../fable_modules/fable-library.4.1.4/Util.js";
-
-export function tryFromContract(c) {
- let matchResult, fsworkbook;
- if (c.Operation === "READ") {
- if (c.DTOType != null) {
- if (c.DTOType === "ISA_Study") {
- if (c.DTO != null) {
- matchResult = 0;
- fsworkbook = c.DTO;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return some(fsworkbook);
- default:
- return void 0;
- }
-}
-
-export function $007CStudyPath$007C_$007C(input) {
- let matchResult;
- if (!equalsWith((x, y) => (x === y), input, defaultOf()) && (input.length === 3)) {
- if (input[0] === "studies") {
- if (input[2] === "isa.study.xlsx") {
- matchResult = 0;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0: {
- const anyStudyName = input[1];
- return combineMany(input);
- }
- default:
- return void 0;
- }
-}
-
diff --git a/js/FileSystem/Commit.js b/js/FileSystem/Commit.js
deleted file mode 100644
index f184e6a6..00000000
--- a/js/FileSystem/Commit.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Record } from "../fable_modules/fable-library.4.1.4/Types.js";
-import { record_type, class_type, string_type } from "../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class Commit extends Record {
- constructor(Hash, UserName, UserEmail, Date$, Message) {
- super();
- this.Hash = Hash;
- this.UserName = UserName;
- this.UserEmail = UserEmail;
- this.Date = Date$;
- this.Message = Message;
- }
-}
-
-export function Commit_$reflection() {
- return record_type("ARCtrl.FileSystem.Commit", [], Commit, () => [["Hash", string_type], ["UserName", string_type], ["UserEmail", string_type], ["Date", class_type("System.DateTime")], ["Message", string_type]]);
-}
-
diff --git a/js/FileSystem/FileSystem.js b/js/FileSystem/FileSystem.js
deleted file mode 100644
index 6d6f9fbf..00000000
--- a/js/FileSystem/FileSystem.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import { defaultArg } from "../fable_modules/fable-library.4.1.4/Option.js";
-import { FileSystemTree_$reflection, FileSystemTree } from "./FileSystemTree.js";
-import { append } from "../fable_modules/fable-library.4.1.4/Array.js";
-import { Record } from "../fable_modules/fable-library.4.1.4/Types.js";
-import { Commit_$reflection } from "./Commit.js";
-import { record_type, array_type } from "../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class FileSystem extends Record {
- constructor(Tree, History) {
- super();
- this.Tree = Tree;
- this.History = History;
- }
- static create({ tree, history }) {
- return new FileSystem(tree, defaultArg(history, []));
- }
- AddFile(path) {
- const this$ = this;
- return new FileSystem(this$.Tree.AddFile(path), this$.History);
- }
- static addFile(path) {
- return (fs) => fs.AddFile(path);
- }
- static fromFilePaths(paths) {
- const tree = FileSystemTree.fromFilePaths(paths);
- return FileSystem.create({
- tree: tree,
- });
- }
- Union(other) {
- const this$ = this;
- const tree = this$.Tree.Union(other.Tree);
- const history = append(this$.History, other.History);
- return FileSystem.create({
- tree: tree,
- history: history,
- });
- }
-}
-
-export function FileSystem_$reflection() {
- return record_type("ARCtrl.FileSystem.FileSystem", [], FileSystem, () => [["Tree", FileSystemTree_$reflection()], ["History", array_type(Commit_$reflection())]]);
-}
-
diff --git a/js/FileSystem/FileSystemTree.js b/js/FileSystem/FileSystemTree.js
deleted file mode 100644
index 1490f6f7..00000000
--- a/js/FileSystem/FileSystemTree.js
+++ /dev/null
@@ -1,157 +0,0 @@
-import { unwrap, defaultArg } from "../fable_modules/fable-library.4.1.4/Option.js";
-import { singleton, append, delay, toArray } from "../fable_modules/fable-library.4.1.4/Seq.js";
-import { append as append_1, choose, equalsWith, tail, head, map } from "../fable_modules/fable-library.4.1.4/Array.js";
-import { Array_distinct, Array_groupBy } from "../fable_modules/fable-library.4.1.4/Seq2.js";
-import { curry2, arrayHash, stringHash } from "../fable_modules/fable-library.4.1.4/Util.js";
-import { combineMany, split } from "./Path.js";
-import { empty, reverse, toArray as toArray_1, cons } from "../fable_modules/fable-library.4.1.4/List.js";
-import { Union } from "../fable_modules/fable-library.4.1.4/Types.js";
-import { union_type, array_type, string_type } from "../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class FileSystemTree extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["File", "Folder"];
- }
- get Name() {
- const this$ = this;
- let n;
- if (this$.tag === 1) {
- n = this$.fields[0];
- }
- else {
- n = this$.fields[0];
- }
- return n;
- }
- get isFolder() {
- const this$ = this;
- return this$.tag === 1;
- }
- get isFile() {
- const this$ = this;
- return this$.tag === 0;
- }
- static get ROOT_NAME() {
- return "root";
- }
- static createFile(name) {
- return new FileSystemTree(0, [name]);
- }
- static createFolder(name, children) {
- return new FileSystemTree(1, [name, defaultArg(children, [])]);
- }
- static createRootFolder(children) {
- return new FileSystemTree(1, [FileSystemTree.ROOT_NAME, children]);
- }
- AddFile(path) {
- const this$ = this;
- const existingPaths = this$.ToFilePaths();
- const filePaths = toArray(delay(() => append(singleton(path), delay(() => existingPaths))));
- return FileSystemTree.fromFilePaths(filePaths);
- }
- static addFile(path) {
- return (tree) => tree.AddFile(path);
- }
- static fromFilePaths(paths) {
- const loop = (paths_1, parent) => {
- const files = map((arg_1) => {
- const arg = head(arg_1);
- return FileSystemTree.createFile(arg);
- }, paths_1.filter((p) => (p.length === 1)));
- const folders = map((tupledArg) => {
- const parent_1 = FileSystemTree.createFolder(tupledArg[0], []);
- return loop(map(tail, tupledArg[1]), parent_1);
- }, Array_groupBy(head, paths_1.filter((p_1) => (p_1.length > 1)), {
- Equals: (x_3, y_2) => (x_3 === y_2),
- GetHashCode: stringHash,
- }));
- if (parent.tag === 1) {
- return FileSystemTree.createFolder(parent.fields[0], toArray(delay(() => append(files, delay(() => folders)))));
- }
- else {
- return parent;
- }
- };
- return loop(Array_distinct(map(split, paths), {
- Equals: (x, y) => equalsWith((x_1, y_1) => (x_1 === y_1), x, y),
- GetHashCode: arrayHash,
- }), FileSystemTree.createFolder(FileSystemTree.ROOT_NAME, []));
- }
- ToFilePaths(removeRoot) {
- const this$ = this;
- const res = [];
- const loop = (output, parent) => {
- if (parent.tag === 1) {
- parent.fields[1].forEach((filest) => {
- loop(cons(parent.fields[0], output), filest);
- });
- }
- else {
- const arg = combineMany(toArray_1(reverse(cons(parent.fields[0], output))));
- void (res.push(arg));
- }
- };
- if (defaultArg(removeRoot, true)) {
- if (this$.tag === 0) {
- void (res.push(this$.fields[0]));
- }
- else {
- const action_1 = curry2(loop)(empty());
- this$.fields[1].forEach(action_1);
- }
- }
- else {
- loop(empty(), this$);
- }
- return Array.from(res);
- }
- static toFilePaths(removeRoot) {
- return (root) => root.ToFilePaths(unwrap(removeRoot));
- }
- Filter(predicate) {
- const this$ = this;
- const loop = (parent) => {
- if (parent.tag === 1) {
- const filteredChildren = choose(loop, parent.fields[1]);
- if (filteredChildren.length === 0) {
- return void 0;
- }
- else {
- return new FileSystemTree(1, [parent.fields[0], filteredChildren]);
- }
- }
- else {
- const n = parent.fields[0];
- if (predicate(n)) {
- return new FileSystemTree(0, [n]);
- }
- else {
- return void 0;
- }
- }
- };
- return loop(this$);
- }
- static filter(predicate) {
- return (tree) => tree.Filter(predicate);
- }
- Union(otherFST) {
- let array_1;
- const this$ = this;
- const arg = Array_distinct((array_1 = this$.ToFilePaths(), append_1(otherFST.ToFilePaths(), array_1)), {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- });
- return FileSystemTree.fromFilePaths(arg);
- }
-}
-
-export function FileSystemTree_$reflection() {
- return union_type("ARCtrl.FileSystem.FileSystemTree", [], FileSystemTree, () => [[["name", string_type]], [["name", string_type], ["children", array_type(FileSystemTree_$reflection())]]]);
-}
-
diff --git a/js/FileSystem/Path.js b/js/FileSystem/Path.js
deleted file mode 100644
index 5558d04f..00000000
--- a/js/FileSystem/Path.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import { trim, join, trimStart, trimEnd, split as split_1 } from "../fable_modules/fable-library.4.1.4/String.js";
-import { last, mapIndexed } from "../fable_modules/fable-library.4.1.4/Array.js";
-
-export const seperators = ["/", "\\"];
-
-export function split(path) {
- return split_1(path, seperators, void 0, 3);
-}
-
-export function combine(path1, path2) {
- return (trimEnd(path1, ...seperators) + "/") + trimStart(path2, ...seperators);
-}
-
-export function combineMany(paths) {
- return join("/", mapIndexed((i, p) => {
- if (i === 0) {
- return trimEnd(p, ...seperators);
- }
- else if (i === (paths.length - 1)) {
- return trimStart(p, ...seperators);
- }
- else {
- return trim(p, ...seperators);
- }
- }, paths));
-}
-
-export function getFileName(path) {
- return last(split(path));
-}
-
-/**
- * Checks if `path` points to a file with the name `fileName`
- */
-export function isFile(fileName, path) {
- return getFileName(path) === fileName;
-}
-
diff --git a/js/FileSystemTree.js b/js/FileSystemTree.js
deleted file mode 100644
index 3326fd3d..00000000
--- a/js/FileSystemTree.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import { FileSystemTree } from "./FileSystem/FileSystemTree.js";
-import { append } from "./fable_modules/fable-library.4.1.4/Array.js";
-
-export function createGitKeepFile() {
- return FileSystemTree.createFile(".gitkeep");
-}
-
-export function createReadmeFile() {
- return FileSystemTree.createFile("README.md");
-}
-
-export function createEmptyFolder(name) {
- return FileSystemTree.createFolder(name, [createGitKeepFile()]);
-}
-
-export function createAssayFolder(assayName) {
- const dataset = createEmptyFolder("dataset");
- const protocols = createEmptyFolder("protocols");
- const readme = createReadmeFile();
- const assayFile = FileSystemTree.createFile("isa.assay.xlsx");
- return FileSystemTree.createFolder(assayName, [dataset, protocols, assayFile, readme]);
-}
-
-export function createStudyFolder(studyName) {
- const resources = createEmptyFolder("resources");
- const protocols = createEmptyFolder("protocols");
- const readme = createReadmeFile();
- const studyFile = FileSystemTree.createFile("isa.study.xlsx");
- return FileSystemTree.createFolder(studyName, [resources, protocols, studyFile, readme]);
-}
-
-export function createInvestigationFile() {
- return FileSystemTree.createFile("isa.investigation.xlsx");
-}
-
-export function createAssaysFolder(assays) {
- return FileSystemTree.createFolder("assays", append([createGitKeepFile()], assays));
-}
-
-export function createStudiesFolder(studies) {
- return FileSystemTree.createFolder("studies", append([createGitKeepFile()], studies));
-}
-
-export function createWorkflowsFolder(workflows) {
- return FileSystemTree.createFolder("workflows", append([createGitKeepFile()], workflows));
-}
-
-export function createRunsFolder(runs) {
- return FileSystemTree.createFolder("runs", append([createGitKeepFile()], runs));
-}
-
diff --git a/js/ISA/ISA.Json/Assay.js b/js/ISA/ISA.Json/Assay.js
deleted file mode 100644
index 56eaa72a..00000000
--- a/js/ISA/ISA.Json/Assay.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import { toString, nil, object as object_22 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { ofArray, choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { tryInclude } from "./GEncode.js";
-import { Data_decoder, Data_encoder, Sample_decoder, Sample_encoder } from "./Data.js";
-import { MaterialAttribute_decoder, MaterialAttribute_encoder, Material_decoder, Material_encoder } from "./Material.js";
-import { string, list as list_1, object as object_23 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { AssayMaterials } from "../ISA/JsonTypes/AssayMaterials.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { Process_decoder, Process_encoder } from "./Process.js";
-import { decoder as decoder_5, encoder } from "./Comment.js";
-import { fromString, uri } from "./Decode.js";
-import { Assay } from "../ISA/JsonTypes/Assay.js";
-import { ArcAssay } from "../ISA/ArcTypes/ArcAssay.js";
-
-export function AssayMaterials_encoder(options, oa) {
- return object_22(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, ofArray([tryInclude("samples", (oa_1) => Sample_encoder(options, oa_1), oa["Samples"]), tryInclude("otherMaterials", (oa_2) => Material_encoder(options, oa_2), oa["OtherMaterials"])])));
-}
-
-export function AssayMaterials_decoder(options) {
- return (path_2) => ((v) => object_23((get$) => {
- let objectArg, objectArg_1;
- return new AssayMaterials((objectArg = get$.Optional, objectArg.Field("samples", (path, value) => list_1((s, json) => Sample_decoder(options, s, json), path, value))), (objectArg_1 = get$.Optional, objectArg_1.Field("otherMaterials", (path_1, value_1) => list_1((s_1, json_1) => Material_decoder(options, s_1, json_1), path_1, value_1))));
- }, path_2, v));
-}
-
-export function Assay_genID(a) {
- const matchValue = a.ID;
- if (matchValue == null) {
- const matchValue_1 = a.FileName;
- if (matchValue_1 == null) {
- return "#EmptyAssay";
- }
- else {
- return matchValue_1;
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Assay_encoder(options, oa) {
- return object_22(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Assay_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Assay", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("filename", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["FileName"])), delay(() => append(singleton(tryInclude("measurementType", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["MeasurementType"])), delay(() => append(singleton(tryInclude("technologyType", (oa_2) => OntologyAnnotation_encoder(options, oa_2), oa["TechnologyType"])), delay(() => append(singleton(tryInclude("technologyPlatform", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, oa["TechnologyPlatform"])), delay(() => append(singleton(tryInclude("dataFiles", (oa_3) => Data_encoder(options, oa_3), oa["DataFiles"])), delay(() => append(singleton(tryInclude("materials", (oa_4) => AssayMaterials_encoder(options, oa_4), oa["Materials"])), delay(() => append(singleton(tryInclude("characteristicCategories", (oa_5) => MaterialAttribute_encoder(options, oa_5), oa["CharacteristicCategories"])), delay(() => append(singleton(tryInclude("unitCategories", (oa_6) => OntologyAnnotation_encoder(options, oa_6), oa["UnitCategories"])), delay(() => append(singleton(tryInclude("processSequence", (oa_7) => Process_encoder(options, oa_7), oa["ProcessSequence"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))))))))))))))))));
- }));
- }))));
-}
-
-export function Assay_decoder(options) {
- return (path_7) => ((v) => object_23((get$) => {
- let objectArg, objectArg_1, arg_5, objectArg_2, arg_7, objectArg_3, objectArg_4, objectArg_5, arg_13, objectArg_6, arg_15, decoder_1, objectArg_7, arg_17, decoder_2, objectArg_8, arg_19, decoder_3, objectArg_9, arg_21, decoder_4, objectArg_10;
- return new Assay((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("filename", string)), (arg_5 = OntologyAnnotation_decoder(options), (objectArg_2 = get$.Optional, objectArg_2.Field("measurementType", uncurry2(arg_5)))), (arg_7 = OntologyAnnotation_decoder(options), (objectArg_3 = get$.Optional, objectArg_3.Field("technologyType", uncurry2(arg_7)))), (objectArg_4 = get$.Optional, objectArg_4.Field("technologyPlatform", string)), (objectArg_5 = get$.Optional, objectArg_5.Field("dataFiles", (path_2, value_2) => list_1((s_1, json_1) => Data_decoder(options, s_1, json_1), path_2, value_2))), (arg_13 = AssayMaterials_decoder(options), (objectArg_6 = get$.Optional, objectArg_6.Field("materials", uncurry2(arg_13)))), (arg_15 = ((decoder_1 = MaterialAttribute_decoder(options), (path_3) => ((value_3) => list_1(uncurry2(decoder_1), path_3, value_3)))), (objectArg_7 = get$.Optional, objectArg_7.Field("characteristicCategories", uncurry2(arg_15)))), (arg_17 = ((decoder_2 = OntologyAnnotation_decoder(options), (path_4) => ((value_4) => list_1(uncurry2(decoder_2), path_4, value_4)))), (objectArg_8 = get$.Optional, objectArg_8.Field("unitCategories", uncurry2(arg_17)))), (arg_19 = ((decoder_3 = Process_decoder(options), (path_5) => ((value_5) => list_1(uncurry2(decoder_3), path_5, value_5)))), (objectArg_9 = get$.Optional, objectArg_9.Field("processSequence", uncurry2(arg_19)))), (arg_21 = ((decoder_4 = decoder_5(options), (path_6) => ((value_6) => list_1(uncurry2(decoder_4), path_6, value_6)))), (objectArg_10 = get$.Optional, objectArg_10.Field("comments", uncurry2(arg_21)))));
- }, path_7, v));
-}
-
-export function Assay_fromString(s) {
- return fromString(uncurry2(Assay_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function Assay_toString(p) {
- return toString(2, Assay_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function Assay_toStringLD(a) {
- let returnVal;
- return toString(2, Assay_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a));
-}
-
-export function ArcAssay_fromString(s) {
- const arg = fromString(uncurry2(Assay_decoder(ConverterOptions_$ctor())), s);
- return ArcAssay.fromAssay(arg);
-}
-
-export function ArcAssay_toString(a) {
- return toString(2, Assay_encoder(ConverterOptions_$ctor(), a.ToAssay()));
-}
-
-/**
- * exports in json-ld format
- */
-export function ArcAssay_toStringLD(a) {
- let returnVal;
- return toString(2, Assay_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToAssay()));
-}
-
diff --git a/js/ISA/ISA.Json/Comment.js b/js/ISA/ISA.Json/Comment.js
deleted file mode 100644
index 0deb1ed2..00000000
--- a/js/ISA/ISA.Json/Comment.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { value as value_13 } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { toString as toString_1, nil, object as object_6 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { string, object as object_7 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { fromString as fromString_1, uri } from "./Decode.js";
-import { Comment$ } from "../ISA/JsonTypes/Comment.js";
-
-export function genID(c) {
- const matchValue = c.ID;
- if (matchValue == null) {
- const matchValue_1 = c.Name;
- if (matchValue_1 == null) {
- return "#EmptyComment";
- }
- else {
- const n = matchValue_1;
- const v = (c.Value != null) ? ("_" + replace(value_13(c.Value), " ", "_")) : "";
- return ("#Comment_" + replace(n, " ", "_")) + v;
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function encoder(options, comment) {
- return object_6(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = genID(comment), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, comment["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Comment", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("name", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, comment["Name"])), delay(() => singleton(tryInclude("value", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, comment["Value"]))))));
- }));
- }))));
-}
-
-export function decoder(options) {
- return (path_2) => ((v) => object_7((get$) => {
- let objectArg, objectArg_1, objectArg_2;
- return new Comment$((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("value", string)));
- }, path_2, v));
-}
-
-export function fromString(s) {
- return fromString_1(uncurry2(decoder(ConverterOptions_$ctor())), s);
-}
-
-export function toString(c) {
- return toString_1(2, encoder(ConverterOptions_$ctor(), c));
-}
-
-/**
- * exports in json-ld format
- */
-export function toStringLD(c) {
- let returnVal;
- return toString_1(2, encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), c));
-}
-
diff --git a/js/ISA/ISA.Json/ConverterOptions.js b/js/ISA/ISA.Json/ConverterOptions.js
deleted file mode 100644
index 0bec60e9..00000000
--- a/js/ISA/ISA.Json/ConverterOptions.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import { class_type } from "../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class ConverterOptions {
- constructor() {
- this.setID = false;
- this.includeType = false;
- }
-}
-
-export function ConverterOptions_$reflection() {
- return class_type("ARCtrl.ISA.Json.ConverterOptions", void 0, ConverterOptions);
-}
-
-export function ConverterOptions_$ctor() {
- return new ConverterOptions();
-}
-
-export function ConverterOptions__get_SetID(this$) {
- return this$.setID;
-}
-
-export function ConverterOptions__set_SetID_Z1FBCCD16(this$, setId) {
- this$.setID = setId;
-}
-
-export function ConverterOptions__get_IncludeType(this$) {
- return this$.includeType;
-}
-
-export function ConverterOptions__set_IncludeType_Z1FBCCD16(this$, iT) {
- this$.includeType = iT;
-}
-
diff --git a/js/ISA/ISA.Json/Data.js b/js/ISA/ISA.Json/Data.js
deleted file mode 100644
index b61e63d6..00000000
--- a/js/ISA/ISA.Json/Data.js
+++ /dev/null
@@ -1,271 +0,0 @@
-import { DataFile } from "../ISA/JsonTypes/DataFile.js";
-import { toString, object as object_10, nil } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { list as list_1, object as object_11, string } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { FSharpResult$2 } from "../../fable_modules/fable-library.4.1.4/Choice.js";
-import { ErrorReason } from "../../fable_modules/Thoth.Json.10.1.0/Types.fs.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { ofArray, choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { decoder as decoder_3, encoder } from "./Comment.js";
-import { fromString, uri, hasUnknownFields } from "./Decode.js";
-import { Data } from "../ISA/JsonTypes/Data.js";
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { MaterialAttributeValue_decoder, MaterialAttributeValue_encoder } from "./Material.js";
-import { Source } from "../ISA/JsonTypes/Source.js";
-import { FactorValue_decoder, FactorValue_encoder } from "./Factor.js";
-import { Sample } from "../ISA/JsonTypes/Sample.js";
-
-export function DataFile_encoder(options, value) {
- if (value instanceof DataFile) {
- if (value.tag === 1) {
- return "Derived Data File";
- }
- else if (value.tag === 2) {
- return "Image File";
- }
- else {
- return "Raw Data File";
- }
- }
- else {
- return nil;
- }
-}
-
-export function DataFile_decoder(options, s, json) {
- const matchValue = string(s, json);
- if (matchValue.tag === 1) {
- return new FSharpResult$2(1, [matchValue.fields[0]]);
- }
- else {
- switch (matchValue.fields[0]) {
- case "Raw Data File":
- return new FSharpResult$2(0, [new DataFile(0, [])]);
- case "Derived Data File":
- return new FSharpResult$2(0, [new DataFile(1, [])]);
- case "Image File":
- return new FSharpResult$2(0, [new DataFile(2, [])]);
- default: {
- const s_1 = matchValue.fields[0];
- return new FSharpResult$2(1, [[`Could not parse ${s_1}.`, new ErrorReason(0, [s_1, nil])]]);
- }
- }
- }
-}
-
-export function Data_genID(d) {
- const matchValue = d.ID;
- if (matchValue == null) {
- const matchValue_1 = d.Name;
- if (matchValue_1 == null) {
- return "#EmptyData";
- }
- else {
- return matchValue_1;
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Data_encoder(options, oa) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Data_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Data", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("name", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["Name"])), delay(() => append(singleton(tryInclude("type", (value_10) => DataFile_encoder(options, value_10), oa["DataType"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))));
- }));
- }))));
-}
-
-export function Data_decoder(options, s, json) {
- if (hasUnknownFields(ofArray(["@id", "name", "type", "comments", "@type"]), json)) {
- return new FSharpResult$2(1, [["Unknown fields in Data", new ErrorReason(0, [s, nil])]]);
- }
- else {
- return object_11((get$) => {
- let objectArg, objectArg_1, objectArg_2, arg_7, decoder, objectArg_3;
- return new Data((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("type", (s_2, json_2) => DataFile_decoder(options, s_2, json_2))), (arg_7 = ((decoder = decoder_3(options), (path_1) => ((value_1) => list_1(uncurry2(decoder), path_1, value_1)))), (objectArg_3 = get$.Optional, objectArg_3.Field("comments", uncurry2(arg_7)))));
- }, s, json);
- }
-}
-
-export function Data_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => Data_decoder(options, s_1, json)))), s);
-}
-
-export function Data_toString(m) {
- return toString(2, Data_encoder(ConverterOptions_$ctor(), m));
-}
-
-/**
- * exports in json-ld format
- */
-export function Data_toStringLD(d) {
- let returnVal;
- return toString(2, Data_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), d));
-}
-
-export function Source_genID(s) {
- const matchValue = s.ID;
- if (matchValue == null) {
- const matchValue_1 = s.Name;
- if (matchValue_1 == null) {
- return "#EmptySource";
- }
- else {
- return "#Source_" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Source_encoder(options, oa) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s_1;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Source_genID(oa), (typeof value === "string") ? ((s_1 = value, s_1)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_2;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_2 = value_3, s_2)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_3;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Source", (typeof value_5 === "string") ? ((s_3 = value_5, s_3)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("name", (value_7) => {
- let s_4;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_4 = value_8, s_4)) : nil;
- }, oa["Name"])), delay(() => singleton(tryInclude("characteristics", (oa_1) => MaterialAttributeValue_encoder(options, oa_1), oa["Characteristics"]))))));
- }));
- }))));
-}
-
-export function Source_decoder(options, s, json) {
- if (hasUnknownFields(ofArray(["@id", "name", "characteristics", "@type"]), json)) {
- return new FSharpResult$2(1, [["Unknown fields in Source", new ErrorReason(0, [s, nil])]]);
- }
- else {
- return object_11((get$) => {
- let objectArg, objectArg_1, arg_5, decoder, objectArg_2;
- return new Source((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (arg_5 = ((decoder = MaterialAttributeValue_decoder(options), (path_1) => ((value_1) => list_1(uncurry2(decoder), path_1, value_1)))), (objectArg_2 = get$.Optional, objectArg_2.Field("characteristics", uncurry2(arg_5)))));
- }, s, json);
- }
-}
-
-export function Source_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => Source_decoder(options, s_1, json)))), s);
-}
-
-export function Source_toString(m) {
- return toString(2, Source_encoder(ConverterOptions_$ctor(), m));
-}
-
-/**
- * exports in json-ld format
- */
-export function Source_toStringLD(s) {
- let returnVal;
- return toString(2, Source_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), s));
-}
-
-export function Sample_genID(s) {
- const matchValue = s.ID;
- if (matchValue == null) {
- const matchValue_1 = s.Name;
- if (matchValue_1 == null) {
- return "#EmptySample";
- }
- else {
- return "#Sample_" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return matchValue;
- }
-}
-
-export function Sample_encoder(options, oa) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s_1;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Sample_genID(oa), (typeof value === "string") ? ((s_1 = value, s_1)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_2;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_2 = value_3, s_2)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_3;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Sample", (typeof value_5 === "string") ? ((s_3 = value_5, s_3)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("name", (value_7) => {
- let s_4;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_4 = value_8, s_4)) : nil;
- }, oa["Name"])), delay(() => append(singleton(tryInclude("characteristics", (oa_1) => MaterialAttributeValue_encoder(options, oa_1), oa["Characteristics"])), delay(() => append(singleton(tryInclude("factorValues", (oa_2) => FactorValue_encoder(options, oa_2), oa["FactorValues"])), delay(() => singleton(tryInclude("derivesFrom", (oa_3) => Source_encoder(options, oa_3), oa["DerivesFrom"]))))))))));
- }));
- }))));
-}
-
-export function Sample_decoder(options, s, json) {
- if (hasUnknownFields(ofArray(["@id", "name", "characteristics", "factorValues", "derivesFrom", "@type"]), json)) {
- return new FSharpResult$2(1, [["Unknown fields in Sample", new ErrorReason(0, [s, nil])]]);
- }
- else {
- return object_11((get$) => {
- let objectArg, objectArg_1, arg_5, decoder, objectArg_2, arg_7, decoder_1, objectArg_3, objectArg_4;
- return new Sample((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (arg_5 = ((decoder = MaterialAttributeValue_decoder(options), (path_1) => ((value_1) => list_1(uncurry2(decoder), path_1, value_1)))), (objectArg_2 = get$.Optional, objectArg_2.Field("characteristics", uncurry2(arg_5)))), (arg_7 = ((decoder_1 = FactorValue_decoder(options), (path_2) => ((value_2) => list_1(uncurry2(decoder_1), path_2, value_2)))), (objectArg_3 = get$.Optional, objectArg_3.Field("factorValues", uncurry2(arg_7)))), (objectArg_4 = get$.Optional, objectArg_4.Field("derivesFrom", (path_3, value_3) => list_1((s_2, json_2) => Source_decoder(options, s_2, json_2), path_3, value_3))));
- }, s, json);
- }
-}
-
-export function Sample_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => Sample_decoder(options, s_1, json)))), s);
-}
-
-export function Sample_toString(m) {
- return toString(2, Sample_encoder(ConverterOptions_$ctor(), m));
-}
-
-/**
- * exports in json-ld format
- */
-export function Sample_toStringLD(s) {
- let returnVal;
- return toString(2, Sample_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), s));
-}
-
diff --git a/js/ISA/ISA.Json/Decode.js b/js/ISA/ISA.Json/Decode.js
deleted file mode 100644
index 5e635116..00000000
--- a/js/ISA/ISA.Json/Decode.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import { fromString as fromString_1, string } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { FSharpResult$2 } from "../../fable_modules/fable-library.4.1.4/Choice.js";
-import { printf, toText } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { ErrorReason } from "../../fable_modules/Thoth.Json.10.1.0/Types.fs.js";
-import { contains, exists } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { stringHash } from "../../fable_modules/fable-library.4.1.4/Util.js";
-
-export function isURI(s) {
- return true;
-}
-
-export function uri(s, json) {
- const matchValue = string(s, json);
- if (matchValue.tag === 1) {
- return new FSharpResult$2(1, [matchValue.fields[0]]);
- }
- else if (isURI(matchValue.fields[0])) {
- return new FSharpResult$2(0, [matchValue.fields[0]]);
- }
- else {
- const s_3 = matchValue.fields[0];
- return new FSharpResult$2(1, [[s_3, new ErrorReason(6, [toText(printf("Expected URI, got %s"))(s_3)])]]);
- }
-}
-
-export function fromString(decoder, s) {
- const matchValue = fromString_1(decoder, s);
- if (matchValue.tag === 1) {
- throw new Error(toText(printf("Error decoding string: %s"))(matchValue.fields[0]));
- }
- else {
- return matchValue.fields[0];
- }
-}
-
-export function getFieldNames(json) {
- return Object.getOwnPropertyNames(json);
-}
-
-export function hasUnknownFields(knownFields, json) {
- return exists((x) => !contains(x, knownFields, {
- Equals: (x_1, y) => (x_1 === y),
- GetHashCode: stringHash,
- }), getFieldNames(json));
-}
-
diff --git a/js/ISA/ISA.Json/Factor.js b/js/ISA/ISA.Json/Factor.js
deleted file mode 100644
index 00f11063..00000000
--- a/js/ISA/ISA.Json/Factor.js
+++ /dev/null
@@ -1,194 +0,0 @@
-import { Value } from "../ISA/JsonTypes/Value.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { object as object_8, toString, nil } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { array, object as object_9, string, float, int } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { FSharpResult$2 } from "../../fable_modules/fable-library.4.1.4/Choice.js";
-import { uri, fromString } from "./Decode.js";
-import { equals, uncurry2 } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID, ConverterOptions_$ctor } from "./ConverterOptions.js";
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { tryInclude } from "./GEncode.js";
-import { decoder as decoder_1, encoder } from "./Comment.js";
-import { Factor } from "../ISA/JsonTypes/Factor.js";
-import { FactorValue } from "../ISA/JsonTypes/FactorValue.js";
-
-export function Value_encoder(options, value) {
- if (value instanceof Value) {
- if (value.tag === 1) {
- return value.fields[0];
- }
- else if (value.tag === 3) {
- return value.fields[0];
- }
- else if (value.tag === 0) {
- return OntologyAnnotation_encoder(options, value.fields[0]);
- }
- else {
- return value.fields[0];
- }
- }
- else {
- return nil;
- }
-}
-
-export function Value_decoder(options, s, json) {
- const matchValue = int(s)(json);
- if (matchValue.tag === 1) {
- const matchValue_1 = float(s, json);
- if (matchValue_1.tag === 1) {
- const matchValue_2 = OntologyAnnotation_decoder(options)(s)(json);
- if (matchValue_2.tag === 1) {
- const matchValue_3 = string(s, json);
- if (matchValue_3.tag === 1) {
- return new FSharpResult$2(1, [matchValue_3.fields[0]]);
- }
- else {
- return new FSharpResult$2(0, [new Value(3, [matchValue_3.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new Value(0, [matchValue_2.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new Value(2, [matchValue_1.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new Value(1, [matchValue.fields[0]])]);
- }
-}
-
-export function Value_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => Value_decoder(options, s_1, json)))), s);
-}
-
-export function Value_toString(v) {
- return toString(2, Value_encoder(ConverterOptions_$ctor(), v));
-}
-
-export function Factor_genID(f) {
- const matchValue = f.ID;
- if (matchValue == null) {
- const matchValue_1 = f.Name;
- if (matchValue_1 == null) {
- return "#EmptyFactor";
- }
- else {
- return "#Factor_" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Factor_encoder(options, oa) {
- return object_8(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Factor_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Factor", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("factorName", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["Name"])), delay(() => append(singleton(tryInclude("factorType", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["FactorType"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))));
- }));
- }))));
-}
-
-export function Factor_decoder(options) {
- return (path_2) => ((v) => object_9((get$) => {
- let objectArg, objectArg_1, arg_5, objectArg_2, arg_7, decoder, objectArg_3;
- return new Factor((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("factorName", string)), (arg_5 = OntologyAnnotation_decoder(options), (objectArg_2 = get$.Optional, objectArg_2.Field("factorType", uncurry2(arg_5)))), (arg_7 = ((decoder = decoder_1(options), (path_1) => ((value_1) => array(uncurry2(decoder), path_1, value_1)))), (objectArg_3 = get$.Optional, objectArg_3.Field("comments", uncurry2(arg_7)))));
- }, path_2, v));
-}
-
-export function Factor_fromString(s) {
- return fromString(uncurry2(Factor_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function Factor_toString(f) {
- return toString(2, Factor_encoder(ConverterOptions_$ctor(), f));
-}
-
-/**
- * exports in json-ld format
- */
-export function Factor_toStringLD(f) {
- let returnVal;
- return toString(2, Factor_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), f));
-}
-
-export function FactorValue_genID(fv) {
- const matchValue = fv.ID;
- if (matchValue == null) {
- return "#EmptyFactorValue";
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function FactorValue_encoder(options, oa) {
- return object_8(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = FactorValue_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "FactorValue", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("category", (oa_1) => Factor_encoder(options, oa_1), oa["Category"])), delay(() => append(singleton(tryInclude("value", (value_7) => Value_encoder(options, value_7), oa["Value"])), delay(() => singleton(tryInclude("unit", (oa_2) => OntologyAnnotation_encoder(options, oa_2), oa["Unit"]))))))));
- }));
- }))));
-}
-
-export function FactorValue_decoder(options) {
- return (path) => ((v) => object_9((get$) => {
- let objectArg, arg_3, objectArg_1, objectArg_2, arg_7, objectArg_3;
- return new FactorValue((objectArg = get$.Optional, objectArg.Field("@id", uri)), (arg_3 = Factor_decoder(options), (objectArg_1 = get$.Optional, objectArg_1.Field("category", uncurry2(arg_3)))), (objectArg_2 = get$.Optional, objectArg_2.Field("value", (s_1, json_1) => Value_decoder(options, s_1, json_1))), (arg_7 = OntologyAnnotation_decoder(options), (objectArg_3 = get$.Optional, objectArg_3.Field("unit", uncurry2(arg_7)))));
- }, path, v));
-}
-
-export function FactorValue_fromString(s) {
- return fromString(uncurry2(FactorValue_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function FactorValue_toString(f) {
- return toString(2, FactorValue_encoder(ConverterOptions_$ctor(), f));
-}
-
-/**
- * exports in json-ld format
- */
-export function FactorValue_toStringLD(f) {
- let returnVal;
- return toString(2, FactorValue_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), f));
-}
-
diff --git a/js/ISA/ISA.Json/GEncode.js b/js/ISA/ISA.Json/GEncode.js
deleted file mode 100644
index fe977e63..00000000
--- a/js/ISA/ISA.Json/GEncode.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import { value as value_1 } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { isIterable } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { nil, seq } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { map } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-
-/**
- * Try to encode the given object using the given encoder, or return Encode.nil if the object is null
- *
- * If the object is a sequence, encode each element using the given encoder and return the resulting sequence
- */
-export function tryInclude(name, encoder, value) {
- let v, o;
- return [name, (value != null) ? (isIterable(value_1(value)) ? ((v = value_1(value), seq(map(encoder, v)))) : ((o = value_1(value), encoder(o)))) : nil];
-}
-
diff --git a/js/ISA/ISA.Json/Investigation.js b/js/ISA/ISA.Json/Investigation.js
deleted file mode 100644
index 40456453..00000000
--- a/js/ISA/ISA.Json/Investigation.js
+++ /dev/null
@@ -1,132 +0,0 @@
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { toString, nil, object as object_24 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { empty as empty_1, choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { OntologySourceReference_decoder, OntologySourceReference_encoder } from "./Ontology.js";
-import { decoder as decoder_5, encoder } from "./Publication.js";
-import { decoder as decoder_6, encoder as encoder_1 } from "./Person.js";
-import { Study_decoder, Study_encoder } from "./Study.js";
-import { decoder as decoder_7, encoder as encoder_2 } from "./Comment.js";
-import { list as list_1, string, object as object_25 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { Investigation } from "../ISA/JsonTypes/Investigation.js";
-import { fromString } from "./Decode.js";
-import { ArcInvestigation } from "../ISA/ArcTypes/ArcInvestigation.js";
-
-export function Investigation_genID(i) {
- const matchValue = i.ID;
- if (matchValue == null) {
- const matchValue_1 = i.FileName;
- if (matchValue_1 == null) {
- const matchValue_2 = i.Identifier;
- if (matchValue_2 == null) {
- const matchValue_3 = i.Title;
- if (matchValue_3 == null) {
- return "#EmptyStudy";
- }
- else {
- return "#Study_" + replace(matchValue_3, " ", "_");
- }
- }
- else {
- return "#Study_" + replace(matchValue_2, " ", "_");
- }
- }
- else {
- return "#Study_" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Investigation_encoder(options, oa) {
- return object_24(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Investigation_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Investigation", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("filename", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["FileName"])), delay(() => append(singleton(tryInclude("identifier", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, oa["Identifier"])), delay(() => append(singleton(tryInclude("title", (value_13) => {
- let s_5;
- const value_14 = value_13;
- return (typeof value_14 === "string") ? ((s_5 = value_14, s_5)) : nil;
- }, oa["Title"])), delay(() => append(singleton(tryInclude("description", (value_16) => {
- let s_6;
- const value_17 = value_16;
- return (typeof value_17 === "string") ? ((s_6 = value_17, s_6)) : nil;
- }, oa["Description"])), delay(() => append(singleton(tryInclude("submissionDate", (value_19) => {
- let s_7;
- const value_20 = value_19;
- return (typeof value_20 === "string") ? ((s_7 = value_20, s_7)) : nil;
- }, oa["SubmissionDate"])), delay(() => append(singleton(tryInclude("publicReleaseDate", (value_22) => {
- let s_8;
- const value_23 = value_22;
- return (typeof value_23 === "string") ? ((s_8 = value_23, s_8)) : nil;
- }, oa["PublicReleaseDate"])), delay(() => append(singleton(tryInclude("ontologySourceReferences", (osr) => OntologySourceReference_encoder(options, osr), oa["OntologySourceReferences"])), delay(() => append(singleton(tryInclude("publications", (oa_1) => encoder(options, oa_1), oa["Publications"])), delay(() => append(singleton(tryInclude("people", (oa_2) => encoder_1(options, oa_2), oa["Contacts"])), delay(() => append(singleton(tryInclude("studies", (oa_3) => Study_encoder(options, oa_3), oa["Studies"])), delay(() => singleton(tryInclude("comments", (comment) => encoder_2(options, comment), oa["Comments"]))))))))))))))))))))))));
- }));
- }))));
-}
-
-export function Investigation_decoder(options) {
- return (path_12) => ((v) => object_25((get$) => {
- let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6, arg_15, decoder, objectArg_7, arg_17, decoder_1, objectArg_8, arg_19, decoder_2, objectArg_9, arg_21, decoder_3, objectArg_10, arg_23, decoder_4, objectArg_11;
- return new Investigation((objectArg = get$.Optional, objectArg.Field("@id", string)), (objectArg_1 = get$.Optional, objectArg_1.Field("filename", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("identifier", string)), (objectArg_3 = get$.Optional, objectArg_3.Field("title", string)), (objectArg_4 = get$.Optional, objectArg_4.Field("description", string)), (objectArg_5 = get$.Optional, objectArg_5.Field("submissionDate", string)), (objectArg_6 = get$.Optional, objectArg_6.Field("publicReleaseDate", string)), (arg_15 = ((decoder = OntologySourceReference_decoder(options), (path_7) => ((value_7) => list_1(uncurry2(decoder), path_7, value_7)))), (objectArg_7 = get$.Optional, objectArg_7.Field("ontologySourceReferences", uncurry2(arg_15)))), (arg_17 = ((decoder_1 = decoder_5(options), (path_8) => ((value_8) => list_1(uncurry2(decoder_1), path_8, value_8)))), (objectArg_8 = get$.Optional, objectArg_8.Field("publications", uncurry2(arg_17)))), (arg_19 = ((decoder_2 = decoder_6(options), (path_9) => ((value_9) => list_1(uncurry2(decoder_2), path_9, value_9)))), (objectArg_9 = get$.Optional, objectArg_9.Field("people", uncurry2(arg_19)))), (arg_21 = ((decoder_3 = Study_decoder(options), (path_10) => ((value_10) => list_1(uncurry2(decoder_3), path_10, value_10)))), (objectArg_10 = get$.Optional, objectArg_10.Field("studies", uncurry2(arg_21)))), (arg_23 = ((decoder_4 = decoder_7(options), (path_11) => ((value_11) => list_1(uncurry2(decoder_4), path_11, value_11)))), (objectArg_11 = get$.Optional, objectArg_11.Field("comments", uncurry2(arg_23)))), empty_1());
- }, path_12, v));
-}
-
-export function Investigation_fromString(s) {
- return fromString(uncurry2(Investigation_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function Investigation_toString(p) {
- return toString(2, Investigation_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function Investigation_toStringLD(i) {
- let returnVal;
- return toString(2, Investigation_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), i));
-}
-
-export function ArcInvestigation_fromString(s) {
- const arg = fromString(uncurry2(Investigation_decoder(ConverterOptions_$ctor())), s);
- return ArcInvestigation.fromInvestigation(arg);
-}
-
-export function ArcInvestigation_toString(a) {
- return toString(2, Investigation_encoder(ConverterOptions_$ctor(), a.ToInvestigation()));
-}
-
-/**
- * exports in json-ld format
- */
-export function ArcInvestigation_toStringLD(a) {
- let returnVal;
- return toString(2, Investigation_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToInvestigation()));
-}
-
diff --git a/js/ISA/ISA.Json/Material.js b/js/ISA/ISA.Json/Material.js
deleted file mode 100644
index c2aed565..00000000
--- a/js/ISA/ISA.Json/Material.js
+++ /dev/null
@@ -1,233 +0,0 @@
-import { MaterialType } from "../ISA/JsonTypes/MaterialType.js";
-import { toString, object as object_10, nil } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { list as list_1, object as object_11, string } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { FSharpResult$2 } from "../../fable_modules/fable-library.4.1.4/Choice.js";
-import { ErrorReason } from "../../fable_modules/Thoth.Json.10.1.0/Types.fs.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { ofArray, choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { hasUnknownFields, fromString, uri } from "./Decode.js";
-import { MaterialAttribute } from "../ISA/JsonTypes/MaterialAttribute.js";
-import { Value_decoder, Value_encoder } from "./Factor.js";
-import { MaterialAttributeValue } from "../ISA/JsonTypes/MaterialAttributeValue.js";
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { Material } from "../ISA/JsonTypes/Material.js";
-
-export function MaterialType_encoder(options, value) {
- if (value instanceof MaterialType) {
- if (value.tag === 1) {
- return "Labeled Extract Name";
- }
- else {
- return "Extract Name";
- }
- }
- else {
- return nil;
- }
-}
-
-export function MaterialType_decoder(options, s, json) {
- const matchValue = string(s, json);
- if (matchValue.tag === 1) {
- return new FSharpResult$2(1, [matchValue.fields[0]]);
- }
- else {
- switch (matchValue.fields[0]) {
- case "Extract Name":
- return new FSharpResult$2(0, [new MaterialType(0, [])]);
- case "Labeled Extract Name":
- return new FSharpResult$2(0, [new MaterialType(1, [])]);
- default: {
- const s_1 = matchValue.fields[0];
- return new FSharpResult$2(1, [[`Could not parse ${s_1}No other value than "Extract Name" or "Labeled Extract Name" allowed for materialtype`, new ErrorReason(0, [s_1, nil])]]);
- }
- }
- }
-}
-
-export function MaterialAttribute_genID(m) {
- const matchValue = m.ID;
- if (matchValue == null) {
- return "#EmptyMaterialAttribute";
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function MaterialAttribute_encoder(options, oa) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = MaterialAttribute_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "MaterialAttribute", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => singleton(tryInclude("characteristicType", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["CharacteristicType"]))));
- }));
- }))));
-}
-
-export function MaterialAttribute_decoder(options) {
- return (path) => ((v) => object_11((get$) => {
- let objectArg, arg_3, objectArg_1;
- return new MaterialAttribute((objectArg = get$.Optional, objectArg.Field("@id", uri)), (arg_3 = OntologyAnnotation_decoder(options), (objectArg_1 = get$.Optional, objectArg_1.Field("characteristicType", uncurry2(arg_3)))));
- }, path, v));
-}
-
-export function MaterialAttribute_fromString(s) {
- return fromString(uncurry2(MaterialAttribute_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function MaterialAttribute_toString(m) {
- return toString(2, MaterialAttribute_encoder(ConverterOptions_$ctor(), m));
-}
-
-/**
- * exports in json-ld format
- */
-export function MaterialAttribute_toStringLD(m) {
- let returnVal;
- return toString(2, MaterialAttribute_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), m));
-}
-
-export function MaterialAttributeValue_genID(m) {
- const matchValue = m.ID;
- if (matchValue == null) {
- return "#EmptyMaterialAttributeValue";
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function MaterialAttributeValue_encoder(options, oa) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = MaterialAttributeValue_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "MaterialAttributeValue", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("category", (oa_1) => MaterialAttribute_encoder(options, oa_1), oa["Category"])), delay(() => append(singleton(tryInclude("value", (value_7) => Value_encoder(options, value_7), oa["Value"])), delay(() => singleton(tryInclude("unit", (oa_2) => OntologyAnnotation_encoder(options, oa_2), oa["Unit"]))))))));
- }));
- }))));
-}
-
-export function MaterialAttributeValue_decoder(options) {
- return (path) => ((v) => object_11((get$) => {
- let objectArg, arg_3, objectArg_1, objectArg_2, arg_7, objectArg_3;
- return new MaterialAttributeValue((objectArg = get$.Optional, objectArg.Field("@id", uri)), (arg_3 = MaterialAttribute_decoder(options), (objectArg_1 = get$.Optional, objectArg_1.Field("category", uncurry2(arg_3)))), (objectArg_2 = get$.Optional, objectArg_2.Field("value", (s_1, json_1) => Value_decoder(options, s_1, json_1))), (arg_7 = OntologyAnnotation_decoder(options), (objectArg_3 = get$.Optional, objectArg_3.Field("unit", uncurry2(arg_7)))));
- }, path, v));
-}
-
-export function MaterialAttributeValue_fromString(s) {
- return fromString(uncurry2(MaterialAttributeValue_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function MaterialAttributeValue_toString(m) {
- return toString(2, MaterialAttributeValue_encoder(ConverterOptions_$ctor(), m));
-}
-
-/**
- * exports in json-ld format
- */
-export function MaterialAttributeValue_toStringLD(m) {
- let returnVal;
- return toString(2, MaterialAttributeValue_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), m));
-}
-
-export function Material_genID(m) {
- const matchValue = m.ID;
- if (matchValue == null) {
- const matchValue_1 = m.Name;
- if (matchValue_1 == null) {
- return "#EmptyMaterial";
- }
- else {
- return "#Material_" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return matchValue;
- }
-}
-
-export function Material_encoder(options, oa) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Material_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Material", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("name", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["Name"])), delay(() => append(singleton(tryInclude("type", (value_10) => MaterialType_encoder(options, value_10), oa["MaterialType"])), delay(() => append(singleton(tryInclude("characteristics", (oa_1) => MaterialAttributeValue_encoder(options, oa_1), oa["Characteristics"])), delay(() => singleton(tryInclude("derivesFrom", (oa_2) => Material_encoder(options, oa_2), oa["DerivesFrom"]))))))))));
- }));
- }))));
-}
-
-export function Material_decoder(options, s, json) {
- if (hasUnknownFields(ofArray(["@id", "@type", "name", "type", "characteristics", "derivesFrom"]), json)) {
- return new FSharpResult$2(1, [["Unknown fields in material", new ErrorReason(0, [s, nil])]]);
- }
- else {
- return object_11((get$) => {
- let objectArg, objectArg_1, objectArg_2, arg_7, decoder, objectArg_3, objectArg_4;
- return new Material((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("type", (s_2, json_2) => MaterialType_decoder(options, s_2, json_2))), (arg_7 = ((decoder = MaterialAttributeValue_decoder(options), (path_1) => ((value_1) => list_1(uncurry2(decoder), path_1, value_1)))), (objectArg_3 = get$.Optional, objectArg_3.Field("characteristics", uncurry2(arg_7)))), (objectArg_4 = get$.Optional, objectArg_4.Field("derivesFrom", (path_2, value_2) => list_1((s_3, json_3) => Material_decoder(options, s_3, json_3), path_2, value_2))));
- }, s, json);
- }
-}
-
-export function Material_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => Material_decoder(options, s_1, json)))), s);
-}
-
-export function Material_toString(m) {
- return toString(2, Material_encoder(ConverterOptions_$ctor(), m));
-}
-
-/**
- * exports in json-ld format
- */
-export function Material_toStringLD(m) {
- let returnVal;
- return toString(2, Material_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), m));
-}
-
diff --git a/js/ISA/ISA.Json/Ontology.js b/js/ISA/ISA.Json/Ontology.js
deleted file mode 100644
index 2e01e30f..00000000
--- a/js/ISA/ISA.Json/Ontology.js
+++ /dev/null
@@ -1,236 +0,0 @@
-import { AnnotationValue } from "../ISA/JsonTypes/AnnotationValue.js";
-import { toString, object as object_10, nil } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { array, list as list_1, object as object_11, string, float, int } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { FSharpResult$2 } from "../../fable_modules/fable-library.4.1.4/Choice.js";
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { decoder as decoder_1, encoder } from "./Comment.js";
-import { fromString, uri } from "./Decode.js";
-import { OntologySourceReference } from "../ISA/JsonTypes/OntologySourceReference.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { ActivePatterns_$007CTermAnnotation$007C_$007C } from "../ISA/Regex.js";
-import { bind } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { OntologyAnnotation } from "../ISA/JsonTypes/OntologyAnnotation.js";
-
-export function AnnotationValue_encoder(options, value) {
- if (value instanceof AnnotationValue) {
- if (value.tag === 2) {
- return value.fields[0];
- }
- else if (value.tag === 0) {
- return value.fields[0];
- }
- else {
- return value.fields[0];
- }
- }
- else {
- return nil;
- }
-}
-
-export function AnnotationValue_decoder(options, s, json) {
- const matchValue = int(s)(json);
- if (matchValue.tag === 1) {
- const matchValue_1 = float(s, json);
- if (matchValue_1.tag === 1) {
- const matchValue_2 = string(s, json);
- if (matchValue_2.tag === 1) {
- return new FSharpResult$2(1, [matchValue_2.fields[0]]);
- }
- else {
- return new FSharpResult$2(0, [new AnnotationValue(0, [matchValue_2.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new AnnotationValue(1, [matchValue_1.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new AnnotationValue(2, [matchValue.fields[0]])]);
- }
-}
-
-export function OntologySourceReference_genID(o) {
- const matchValue = o.File;
- if (matchValue == null) {
- const matchValue_1 = o.Name;
- if (matchValue_1 == null) {
- return "#DummyOntologySourceRef";
- }
- else {
- return "#OntologySourceRef_" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return matchValue;
- }
-}
-
-export function OntologySourceReference_encoder(options, osr) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = OntologySourceReference_genID(osr), (typeof value === "string") ? ((s = value, s)) : nil)]) : empty(), delay(() => {
- let value_2, s_1;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_2 = "OntologySourceReference", (typeof value_2 === "string") ? ((s_1 = value_2, s_1)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("description", (value_4) => {
- let s_2;
- const value_5 = value_4;
- return (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil;
- }, osr["Description"])), delay(() => append(singleton(tryInclude("file", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, osr["File"])), delay(() => append(singleton(tryInclude("name", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, osr["Name"])), delay(() => append(singleton(tryInclude("version", (value_13) => {
- let s_5;
- const value_14 = value_13;
- return (typeof value_14 === "string") ? ((s_5 = value_14, s_5)) : nil;
- }, osr["Version"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), osr["Comments"]))))))))))));
- }));
- }))));
-}
-
-export function OntologySourceReference_decoder(options) {
- return (path_4) => ((v) => object_11((get$) => {
- let objectArg, objectArg_1, objectArg_2, objectArg_3, arg_9, decoder, objectArg_4;
- return new OntologySourceReference((objectArg = get$.Optional, objectArg.Field("description", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("file", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("name", string)), (objectArg_3 = get$.Optional, objectArg_3.Field("version", string)), (arg_9 = ((decoder = decoder_1(options), (path_3) => ((value_3) => list_1(uncurry2(decoder), path_3, value_3)))), (objectArg_4 = get$.Optional, objectArg_4.Field("comments", uncurry2(arg_9)))));
- }, path_4, v));
-}
-
-export function OntologySourceReference_fromString(s) {
- return fromString(uncurry2(OntologySourceReference_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function OntologySourceReference_toString(oa) {
- return toString(2, OntologySourceReference_encoder(ConverterOptions_$ctor(), oa));
-}
-
-/**
- * exports in json-ld format
- */
-export function OntologySourceReference_toStringLD(oa) {
- let returnVal;
- return toString(2, OntologySourceReference_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), oa));
-}
-
-export function OntologyAnnotation_genID(o) {
- const matchValue = o.ID;
- if (matchValue == null) {
- const matchValue_1 = o.TermAccessionNumber;
- if (matchValue_1 == null) {
- const matchValue_2 = o.TermSourceREF;
- if (matchValue_2 == null) {
- return "#DummyOntologyAnnotation";
- }
- else {
- return "#" + replace(matchValue_2, " ", "_");
- }
- }
- else {
- return matchValue_1;
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function OntologyAnnotation_encoder(options, oa) {
- return object_10(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = OntologyAnnotation_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "OntologyAnnotation", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("annotationValue", (value_7) => AnnotationValue_encoder(options, value_7), oa["Name"])), delay(() => append(singleton(tryInclude("termSource", (value_8) => {
- let s_3;
- const value_9 = value_8;
- return (typeof value_9 === "string") ? ((s_3 = value_9, s_3)) : nil;
- }, oa["TermSourceREF"])), delay(() => append(singleton(tryInclude("termAccession", (value_11) => {
- let s_4;
- const value_12 = value_11;
- return (typeof value_12 === "string") ? ((s_4 = value_12, s_4)) : nil;
- }, oa["TermAccessionNumber"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))))));
- }));
- }))));
-}
-
-export function OntologyAnnotation_localIDDecoder(s, json) {
- const matchValue = string(s, json);
- let matchResult, tan;
- if (matchValue.tag === 0) {
- const activePatternResult = ActivePatterns_$007CTermAnnotation$007C_$007C(matchValue.fields[0]);
- if (activePatternResult != null) {
- matchResult = 0;
- tan = activePatternResult;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return new FSharpResult$2(0, [tan.TermSourceREF]);
- default:
- return new FSharpResult$2(0, [""]);
- }
-}
-
-export function OntologyAnnotation_decoder(options) {
- return (path_3) => ((v) => object_11((get$) => {
- let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, arg_11, decoder, objectArg_5;
- return new OntologyAnnotation((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("annotationValue", (s_1, json_1) => AnnotationValue_decoder(options, s_1, json_1))), (objectArg_2 = get$.Optional, objectArg_2.Field("termSource", string)), bind((s_3) => {
- if (s_3 === "") {
- return void 0;
- }
- else {
- return s_3;
- }
- }, (objectArg_3 = get$.Optional, objectArg_3.Field("termAccession", OntologyAnnotation_localIDDecoder))), (objectArg_4 = get$.Optional, objectArg_4.Field("termAccession", string)), (arg_11 = ((decoder = decoder_1(options), (path_2) => ((value_2) => array(uncurry2(decoder), path_2, value_2)))), (objectArg_5 = get$.Optional, objectArg_5.Field("comments", uncurry2(arg_11)))));
- }, path_3, v));
-}
-
-export function OntologyAnnotation_fromString(s) {
- return fromString(uncurry2(OntologyAnnotation_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function OntologyAnnotation_toString(oa) {
- return toString(2, OntologyAnnotation_encoder(ConverterOptions_$ctor(), oa));
-}
-
-/**
- * exports in json-ld format
- */
-export function OntologyAnnotation_toStringLD(oa) {
- let returnVal;
- return toString(2, OntologyAnnotation_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), oa));
-}
-
diff --git a/js/ISA/ISA.Json/Person.js b/js/ISA/ISA.Json/Person.js
deleted file mode 100644
index 83e759ee..00000000
--- a/js/ISA/ISA.Json/Person.js
+++ /dev/null
@@ -1,199 +0,0 @@
-import { tryPick } from "../../fable_modules/fable-library.4.1.4/Array.js";
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { toString as toString_1, nil, object as object_22 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { decoder as decoder_3, encoder as encoder_1 } from "./Comment.js";
-import { array as array_1, string, object as object_23 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { fromString as fromString_1, uri } from "./Decode.js";
-import { Person } from "../ISA/JsonTypes/Person.js";
-
-export function genID(p) {
- const matchValue = p.ID;
- if (matchValue == null) {
- let orcid;
- const matchValue_1 = p.Comments;
- orcid = ((matchValue_1 == null) ? void 0 : tryPick((c) => {
- const matchValue_2 = c.Name;
- const matchValue_3 = c.Value;
- let matchResult, n, v;
- if (matchValue_2 != null) {
- if (matchValue_3 != null) {
- matchResult = 0;
- n = matchValue_2;
- v = matchValue_3;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- if (((n === "orcid") ? true : (n === "Orcid")) ? true : (n === "ORCID")) {
- return v;
- }
- else {
- return void 0;
- }
- default:
- return void 0;
- }
- }, matchValue_1));
- if (orcid == null) {
- const matchValue_5 = p.EMail;
- if (matchValue_5 == null) {
- const matchValue_6 = p.FirstName;
- const matchValue_7 = p.MidInitials;
- const matchValue_8 = p.LastName;
- let matchResult_1, fn, ln, mn, fn_1, ln_1, ln_2, fn_2;
- if (matchValue_6 == null) {
- if (matchValue_7 == null) {
- if (matchValue_8 != null) {
- matchResult_1 = 2;
- ln_2 = matchValue_8;
- }
- else {
- matchResult_1 = 4;
- }
- }
- else {
- matchResult_1 = 4;
- }
- }
- else if (matchValue_7 == null) {
- if (matchValue_8 == null) {
- matchResult_1 = 3;
- fn_2 = matchValue_6;
- }
- else {
- matchResult_1 = 1;
- fn_1 = matchValue_6;
- ln_1 = matchValue_8;
- }
- }
- else if (matchValue_8 != null) {
- matchResult_1 = 0;
- fn = matchValue_6;
- ln = matchValue_8;
- mn = matchValue_7;
- }
- else {
- matchResult_1 = 4;
- }
- switch (matchResult_1) {
- case 0:
- return (((("#" + replace(fn, " ", "_")) + "_") + replace(mn, " ", "_")) + "_") + replace(ln, " ", "_");
- case 1:
- return (("#" + replace(fn_1, " ", "_")) + "_") + replace(ln_1, " ", "_");
- case 2:
- return "#" + replace(ln_2, " ", "_");
- case 3:
- return "#" + replace(fn_2, " ", "_");
- default:
- return "#EmptyPerson";
- }
- }
- else {
- return matchValue_5;
- }
- }
- else {
- return orcid;
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function encoder(options, oa) {
- return object_22(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Person", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("firstName", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["FirstName"])), delay(() => append(singleton(tryInclude("lastName", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, oa["LastName"])), delay(() => append(singleton(tryInclude("midInitials", (value_13) => {
- let s_5;
- const value_14 = value_13;
- return (typeof value_14 === "string") ? ((s_5 = value_14, s_5)) : nil;
- }, oa["MidInitials"])), delay(() => append(singleton(tryInclude("email", (value_16) => {
- let s_6;
- const value_17 = value_16;
- return (typeof value_17 === "string") ? ((s_6 = value_17, s_6)) : nil;
- }, oa["EMail"])), delay(() => append(singleton(tryInclude("phone", (value_19) => {
- let s_7;
- const value_20 = value_19;
- return (typeof value_20 === "string") ? ((s_7 = value_20, s_7)) : nil;
- }, oa["Phone"])), delay(() => append(singleton(tryInclude("fax", (value_22) => {
- let s_8;
- const value_23 = value_22;
- return (typeof value_23 === "string") ? ((s_8 = value_23, s_8)) : nil;
- }, oa["Fax"])), delay(() => append(singleton(tryInclude("address", (value_25) => {
- let s_9;
- const value_26 = value_25;
- return (typeof value_26 === "string") ? ((s_9 = value_26, s_9)) : nil;
- }, oa["Address"])), delay(() => append(singleton(tryInclude("affiliation", (value_28) => {
- let s_10;
- const value_29 = value_28;
- return (typeof value_29 === "string") ? ((s_10 = value_29, s_10)) : nil;
- }, oa["Affiliation"])), delay(() => append(singleton(tryInclude("roles", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["Roles"])), delay(() => singleton(tryInclude("comments", (comment) => encoder_1(options, comment), oa["Comments"]))))))))))))))))))))));
- }));
- }))));
-}
-
-export function decoder(options) {
- return (path_10) => ((v) => object_23((get$) => {
- let objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6, objectArg_7, objectArg_8, arg_19, decoder_1, objectArg_9, arg_21, decoder_2, objectArg_10;
- let ID;
- const objectArg = get$.Optional;
- ID = objectArg.Field("@id", uri);
- let FirstName;
- const objectArg_1 = get$.Optional;
- FirstName = objectArg_1.Field("firstName", string);
- return new Person(ID, (objectArg_2 = get$.Optional, objectArg_2.Field("lastName", string)), FirstName, (objectArg_3 = get$.Optional, objectArg_3.Field("midInitials", string)), (objectArg_4 = get$.Optional, objectArg_4.Field("email", string)), (objectArg_5 = get$.Optional, objectArg_5.Field("phone", string)), (objectArg_6 = get$.Optional, objectArg_6.Field("fax", string)), (objectArg_7 = get$.Optional, objectArg_7.Field("address", string)), (objectArg_8 = get$.Optional, objectArg_8.Field("affiliation", string)), (arg_19 = ((decoder_1 = OntologyAnnotation_decoder(options), (path_8) => ((value_8) => array_1(uncurry2(decoder_1), path_8, value_8)))), (objectArg_9 = get$.Optional, objectArg_9.Field("roles", uncurry2(arg_19)))), (arg_21 = ((decoder_2 = decoder_3(options), (path_9) => ((value_9) => array_1(uncurry2(decoder_2), path_9, value_9)))), (objectArg_10 = get$.Optional, objectArg_10.Field("comments", uncurry2(arg_21)))));
- }, path_10, v));
-}
-
-export function fromString(s) {
- return fromString_1(uncurry2(decoder(ConverterOptions_$ctor())), s);
-}
-
-export function toString(p) {
- return toString_1(2, encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function toStringLD(p) {
- let returnVal;
- return toString_1(2, encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), p));
-}
-
diff --git a/js/ISA/ISA.Json/Process.js b/js/ISA/ISA.Json/Process.js
deleted file mode 100644
index 4e09e312..00000000
--- a/js/ISA/ISA.Json/Process.js
+++ /dev/null
@@ -1,291 +0,0 @@
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { ProtocolParameter_getNameText_Z3A4310A5 } from "../ISA/JsonTypes/ProtocolParameter.js";
-import { Value_getText_72E9EF0F } from "../ISA/JsonTypes/Value.js";
-import { list as list_2, toString, nil, object as object_22 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { map, choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { Protocol_decoder, Protocol_encoder, ProtocolParameter_decoder, ProtocolParameter_encoder } from "./Protocol.js";
-import { Value_decoder, Value_encoder } from "./Factor.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { list as list_1, string, object as object_23 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { ProcessParameterValue } from "../ISA/JsonTypes/ProcessParameterValue.js";
-import { uri, fromString } from "./Decode.js";
-import { ProcessInput } from "../ISA/JsonTypes/ProcessInput.js";
-import { Data_decoder, Sample_decoder, Source_decoder, Source_encoder, Data_encoder, Sample_encoder } from "./Data.js";
-import { Material_decoder, Material_encoder } from "./Material.js";
-import { FSharpResult$2 } from "../../fable_modules/fable-library.4.1.4/Choice.js";
-import { ProcessOutput } from "../ISA/JsonTypes/ProcessOutput.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { decoder as decoder_4, encoder } from "./Comment.js";
-import { Process } from "../ISA/JsonTypes/Process.js";
-
-export function ProcessParameterValue_genID(p) {
- const matchValue = p.Value;
- const matchValue_1 = p.Category;
- let matchResult, c, v;
- if (matchValue != null) {
- if (matchValue_1 != null) {
- matchResult = 0;
- c = matchValue_1;
- v = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return (("#Param_" + replace(ProtocolParameter_getNameText_Z3A4310A5(c), " ", "_")) + "_") + replace(Value_getText_72E9EF0F(v), " ", "_");
- default:
- return "#EmptyParameterValue";
- }
-}
-
-export function ProcessParameterValue_encoder(options, oa) {
- return object_22(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = ProcessParameterValue_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : empty(), delay(() => {
- let value_2, s_1;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_2 = "ProcessParameterValue", (typeof value_2 === "string") ? ((s_1 = value_2, s_1)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("category", (oa_1) => ProtocolParameter_encoder(options, oa_1), oa["Category"])), delay(() => append(singleton(tryInclude("value", (value_4) => Value_encoder(options, value_4), oa["Value"])), delay(() => singleton(tryInclude("unit", (oa_2) => OntologyAnnotation_encoder(options, oa_2), oa["Unit"]))))))));
- }));
- }))));
-}
-
-export function ProcessParameterValue_decoder(options) {
- return (path) => ((v) => object_23((get$) => {
- let arg_1, objectArg, objectArg_1, arg_5, objectArg_2;
- return new ProcessParameterValue((arg_1 = ProtocolParameter_decoder(options), (objectArg = get$.Optional, objectArg.Field("category", uncurry2(arg_1)))), (objectArg_1 = get$.Optional, objectArg_1.Field("value", (s, json) => Value_decoder(options, s, json))), (arg_5 = OntologyAnnotation_decoder(options), (objectArg_2 = get$.Optional, objectArg_2.Field("unit", uncurry2(arg_5)))));
- }, path, v));
-}
-
-export function ProcessParameterValue_fromString(s) {
- return fromString(uncurry2(ProcessParameterValue_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function ProcessParameterValue_toString(p) {
- return toString(2, ProcessParameterValue_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function ProcessParameterValue_toStringLD(p) {
- let returnVal;
- return toString(2, ProcessParameterValue_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), p));
-}
-
-export function ProcessInput_encoder(options, value) {
- if (value instanceof ProcessInput) {
- if (value.tag === 1) {
- return Sample_encoder(options, value.fields[0]);
- }
- else if (value.tag === 2) {
- return Data_encoder(options, value.fields[0]);
- }
- else if (value.tag === 3) {
- return Material_encoder(options, value.fields[0]);
- }
- else {
- return Source_encoder(options, value.fields[0]);
- }
- }
- else {
- return nil;
- }
-}
-
-export function ProcessInput_decoder(options, s, json) {
- const matchValue = Source_decoder(options, s, json);
- if (matchValue.tag === 1) {
- const matchValue_1 = Sample_decoder(options, s, json);
- if (matchValue_1.tag === 1) {
- const matchValue_2 = Data_decoder(options, s, json);
- if (matchValue_2.tag === 1) {
- const matchValue_3 = Material_decoder(options, s, json);
- if (matchValue_3.tag === 1) {
- return new FSharpResult$2(1, [matchValue_3.fields[0]]);
- }
- else {
- return new FSharpResult$2(0, [new ProcessInput(3, [matchValue_3.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new ProcessInput(2, [matchValue_2.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new ProcessInput(1, [matchValue_1.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new ProcessInput(0, [matchValue.fields[0]])]);
- }
-}
-
-export function ProcessInput_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => ProcessInput_decoder(options, s_1, json)))), s);
-}
-
-export function ProcessInput_toString(m) {
- return toString(2, ProcessInput_encoder(ConverterOptions_$ctor(), m));
-}
-
-export function ProcessInput_toStringLD(m) {
- let returnVal;
- return toString(2, ProcessInput_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), m));
-}
-
-export function ProcessOutput_encoder(options, value) {
- if (value instanceof ProcessOutput) {
- if (value.tag === 1) {
- return Data_encoder(options, value.fields[0]);
- }
- else if (value.tag === 2) {
- return Material_encoder(options, value.fields[0]);
- }
- else {
- return Sample_encoder(options, value.fields[0]);
- }
- }
- else {
- return nil;
- }
-}
-
-export function ProcessOutput_decoder(options, s, json) {
- const matchValue = Sample_decoder(options, s, json);
- if (matchValue.tag === 1) {
- const matchValue_1 = Data_decoder(options, s, json);
- if (matchValue_1.tag === 1) {
- const matchValue_2 = Material_decoder(options, s, json);
- if (matchValue_2.tag === 1) {
- return new FSharpResult$2(1, [matchValue_2.fields[0]]);
- }
- else {
- return new FSharpResult$2(0, [new ProcessOutput(2, [matchValue_2.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new ProcessOutput(1, [matchValue_1.fields[0]])]);
- }
- }
- else {
- return new FSharpResult$2(0, [new ProcessOutput(0, [matchValue.fields[0]])]);
- }
-}
-
-export function ProcessOutput_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => ProcessOutput_decoder(options, s_1, json)))), s);
-}
-
-export function ProcessOutput_toString(m) {
- return toString(2, ProcessOutput_encoder(ConverterOptions_$ctor(), m));
-}
-
-export function Process_genID(p) {
- const matchValue = p.ID;
- if (matchValue == null) {
- const matchValue_1 = p.Name;
- if (matchValue_1 == null) {
- return "#EmptyProcess";
- }
- else {
- return "#Process_" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Process_encoder(options, oa) {
- return object_22(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Process_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Process", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("name", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["Name"])), delay(() => append(singleton(tryInclude("executesProtocol", (oa_1) => Protocol_encoder(options, oa_1), oa["ExecutesProtocol"])), delay(() => append(singleton(tryInclude("parameterValues", (oa_2) => ProcessParameterValue_encoder(options, oa_2), oa["ParameterValues"])), delay(() => append(singleton(tryInclude("performer", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, oa["Performer"])), delay(() => append(singleton(tryInclude("date", (value_13) => {
- let s_5;
- const value_14 = value_13;
- return (typeof value_14 === "string") ? ((s_5 = value_14, s_5)) : nil;
- }, oa["Date"])), delay(() => append(singleton(tryInclude("previousProcess", (oa_3) => Process_encoder(options, oa_3), oa["PreviousProcess"])), delay(() => append(singleton(tryInclude("nextProcess", (oa_4) => Process_encoder(options, oa_4), oa["NextProcess"])), delay(() => append(singleton(tryInclude("inputs", (value_16) => ProcessInput_encoder(options, value_16), oa["Inputs"])), delay(() => append(singleton(tryInclude("outputs", (value_17) => ProcessOutput_encoder(options, value_17), oa["Outputs"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))))))))))))))))));
- }));
- }))));
-}
-
-export function Process_decoder(options) {
- return (path_7) => ((v) => object_23((get$) => {
- let objectArg, objectArg_1, arg_5, objectArg_2, arg_7, decoder, objectArg_3, objectArg_4, objectArg_5, arg_13, objectArg_6, arg_15, objectArg_7, objectArg_8, objectArg_9, arg_21, decoder_3, objectArg_10;
- return new Process((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (arg_5 = Protocol_decoder(options), (objectArg_2 = get$.Optional, objectArg_2.Field("executesProtocol", uncurry2(arg_5)))), (arg_7 = ((decoder = ProcessParameterValue_decoder(options), (path_1) => ((value_1) => list_1(uncurry2(decoder), path_1, value_1)))), (objectArg_3 = get$.Optional, objectArg_3.Field("parameterValues", uncurry2(arg_7)))), (objectArg_4 = get$.Optional, objectArg_4.Field("performer", string)), (objectArg_5 = get$.Optional, objectArg_5.Field("date", string)), (arg_13 = Process_decoder(options), (objectArg_6 = get$.Optional, objectArg_6.Field("previousProcess", uncurry2(arg_13)))), (arg_15 = Process_decoder(options), (objectArg_7 = get$.Optional, objectArg_7.Field("nextProcess", uncurry2(arg_15)))), (objectArg_8 = get$.Optional, objectArg_8.Field("inputs", (path_4, value_4) => list_1((s_1, json_1) => ProcessInput_decoder(options, s_1, json_1), path_4, value_4))), (objectArg_9 = get$.Optional, objectArg_9.Field("outputs", (path_5, value_5) => list_1((s_2, json_2) => ProcessOutput_decoder(options, s_2, json_2), path_5, value_5))), (arg_21 = ((decoder_3 = decoder_4(options), (path_6) => ((value_6) => list_1(uncurry2(decoder_3), path_6, value_6)))), (objectArg_10 = get$.Optional, objectArg_10.Field("comments", uncurry2(arg_21)))));
- }, path_7, v));
-}
-
-export function Process_fromString(s) {
- return fromString(uncurry2(Process_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function Process_toString(p) {
- return toString(2, Process_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function Process_toStringLD(p) {
- let returnVal;
- return toString(2, Process_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), p));
-}
-
-export function ProcessSequence_fromString(s) {
- let decoder;
- return fromString(uncurry2((decoder = Process_decoder(ConverterOptions_$ctor()), (path) => ((value) => list_1(uncurry2(decoder), path, value)))), s);
-}
-
-export function ProcessSequence_toString(p) {
- let options;
- return toString(2, list_2(map((options = ConverterOptions_$ctor(), (oa) => Process_encoder(options, oa)), p)));
-}
-
-/**
- * exports in json-ld format
- */
-export function ProcessSequence_toStringLD(p) {
- let options, returnVal;
- return toString(2, list_2(map((options = ((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal))), (oa) => Process_encoder(options, oa)), p)));
-}
-
diff --git a/js/ISA/ISA.Json/Protocol.js b/js/ISA/ISA.Json/Protocol.js
deleted file mode 100644
index caffa99f..00000000
--- a/js/ISA/ISA.Json/Protocol.js
+++ /dev/null
@@ -1,242 +0,0 @@
-import { value as value_19 } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { toString, nil, object as object_18 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { list as list_1, string, object as object_19 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { fromString, uri } from "./Decode.js";
-import { ProtocolParameter } from "../ISA/JsonTypes/ProtocolParameter.js";
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { Result_Map } from "../../fable_modules/fable-library.4.1.4/Choice.js";
-import { Component, Component_decomposeName_Z721C83C5 } from "../ISA/JsonTypes/Component.js";
-import { decoder as decoder_3, encoder } from "./Comment.js";
-import { Protocol } from "../ISA/JsonTypes/Protocol.js";
-
-export function ProtocolParameter_genID(pp) {
- const matchValue = pp.ID;
- if (matchValue == null) {
- const matchValue_1 = pp.ParameterName;
- let matchResult, n_1;
- if (matchValue_1 != null) {
- if (!(matchValue_1.ID == null)) {
- matchResult = 0;
- n_1 = matchValue_1;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return "#Param_" + value_19(n_1.ID);
- default:
- return "#EmptyProtocolParameter";
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function ProtocolParameter_encoder(options, oa) {
- return object_18(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = ProtocolParameter_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "ProtocolParameter", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => singleton(tryInclude("parameterName", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["ParameterName"]))));
- }));
- }))));
-}
-
-export function ProtocolParameter_decoder(options) {
- return (path) => ((v) => object_19((get$) => {
- let objectArg, arg_3, objectArg_1;
- return new ProtocolParameter((objectArg = get$.Optional, objectArg.Field("@id", uri)), (arg_3 = OntologyAnnotation_decoder(options), (objectArg_1 = get$.Optional, objectArg_1.Field("parameterName", uncurry2(arg_3)))));
- }, path, v));
-}
-
-export function ProtocolParameter_fromString(s) {
- return fromString(uncurry2(ProtocolParameter_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function ProtocolParameter_toString(p) {
- return toString(2, ProtocolParameter_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function ProtocolParameter_toStringLD(p) {
- let returnVal;
- return toString(2, ProtocolParameter_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), p));
-}
-
-export function Component_genID(c) {
- const matchValue = c.ComponentName;
- if (matchValue == null) {
- return "#EmptyComponent";
- }
- else {
- return "#Component_" + replace(matchValue, " ", "_");
- }
-}
-
-export function Component_encoder(options, oa) {
- return object_18(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Component_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : empty(), delay(() => {
- let value_2, s_1;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_2 = "Component", (typeof value_2 === "string") ? ((s_1 = value_2, s_1)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("componentName", (value_4) => {
- let s_2;
- const value_5 = value_4;
- return (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil;
- }, oa["ComponentName"])), delay(() => singleton(tryInclude("componentType", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["ComponentType"]))))));
- }));
- }))));
-}
-
-export function Component_decoder(options, s, json) {
- return Result_Map((c) => {
- let patternInput;
- const matchValue = c.ComponentName;
- if (matchValue == null) {
- patternInput = [void 0, void 0];
- }
- else {
- const tupledArg = Component_decomposeName_Z721C83C5(matchValue);
- patternInput = [tupledArg[0], tupledArg[1]];
- }
- return new Component(c.ComponentName, patternInput[0], patternInput[1], c.ComponentType);
- }, object_19((get$) => {
- let objectArg, arg_3, objectArg_1;
- return new Component((objectArg = get$.Optional, objectArg.Field("componentName", uri)), void 0, void 0, (arg_3 = OntologyAnnotation_decoder(options), (objectArg_1 = get$.Optional, objectArg_1.Field("componentType", uncurry2(arg_3)))));
- }, s, json));
-}
-
-export function Component_fromString(s) {
- let options;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1) => ((json) => Component_decoder(options, s_1, json)))), s);
-}
-
-export function Component_toString(p) {
- return toString(2, Component_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function Component_toStringLD(p) {
- let returnVal;
- return toString(2, Component_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), p));
-}
-
-export function Protocol_genID(p) {
- const matchValue = p.ID;
- if (matchValue == null) {
- const matchValue_1 = p.Uri;
- if (matchValue_1 == null) {
- const matchValue_2 = p.Name;
- if (matchValue_2 == null) {
- return "#EmptyProtocol";
- }
- else {
- return "#Protocol_" + replace(matchValue_2, " ", "_");
- }
- }
- else {
- return matchValue_1;
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Protocol_encoder(options, oa) {
- return object_18(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Protocol_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_1;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_2;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Protocol", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("name", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["Name"])), delay(() => append(singleton(tryInclude("protocolType", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["ProtocolType"])), delay(() => append(singleton(tryInclude("description", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, oa["Description"])), delay(() => append(singleton(tryInclude("uri", (value_13) => {
- let s_5;
- const value_14 = value_13;
- return (typeof value_14 === "string") ? ((s_5 = value_14, s_5)) : nil;
- }, oa["Uri"])), delay(() => append(singleton(tryInclude("version", (value_16) => {
- let s_6;
- const value_17 = value_16;
- return (typeof value_17 === "string") ? ((s_6 = value_17, s_6)) : nil;
- }, oa["Version"])), delay(() => append(singleton(tryInclude("parameters", (oa_2) => ProtocolParameter_encoder(options, oa_2), oa["Parameters"])), delay(() => append(singleton(tryInclude("components", (oa_3) => Component_encoder(options, oa_3), oa["Components"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))))))))))))));
- }));
- }))));
-}
-
-export function Protocol_decoder(options) {
- return (path_6) => ((v) => object_19((get$) => {
- let objectArg, objectArg_1, arg_5, objectArg_2, objectArg_3, objectArg_4, objectArg_5, arg_13, decoder, objectArg_6, objectArg_7, arg_17, decoder_2, objectArg_8;
- return new Protocol((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (arg_5 = OntologyAnnotation_decoder(options), (objectArg_2 = get$.Optional, objectArg_2.Field("protocolType", uncurry2(arg_5)))), (objectArg_3 = get$.Optional, objectArg_3.Field("description", string)), (objectArg_4 = get$.Optional, objectArg_4.Field("uri", uri)), (objectArg_5 = get$.Optional, objectArg_5.Field("version", string)), (arg_13 = ((decoder = ProtocolParameter_decoder(options), (path_3) => ((value_3) => list_1(uncurry2(decoder), path_3, value_3)))), (objectArg_6 = get$.Optional, objectArg_6.Field("parameters", uncurry2(arg_13)))), (objectArg_7 = get$.Optional, objectArg_7.Field("components", (path_4, value_4) => list_1((s_2, json_2) => Component_decoder(options, s_2, json_2), path_4, value_4))), (arg_17 = ((decoder_2 = decoder_3(options), (path_5) => ((value_5) => list_1(uncurry2(decoder_2), path_5, value_5)))), (objectArg_8 = get$.Optional, objectArg_8.Field("comments", uncurry2(arg_17)))));
- }, path_6, v));
-}
-
-export function Protocol_fromString(s) {
- return fromString(uncurry2(Protocol_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function Protocol_toString(p) {
- return toString(2, Protocol_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function Protocol_toStringLD(p) {
- let returnVal;
- return toString(2, Protocol_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), p));
-}
-
diff --git a/js/ISA/ISA.Json/Publication.js b/js/ISA/ISA.Json/Publication.js
deleted file mode 100644
index f58bf4d7..00000000
--- a/js/ISA/ISA.Json/Publication.js
+++ /dev/null
@@ -1,92 +0,0 @@
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { toString as toString_1, nil, object as object_12 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { decoder as decoder_2, encoder as encoder_1 } from "./Comment.js";
-import { array, string, object as object_13 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { fromString as fromString_1, uri } from "./Decode.js";
-import { Publication } from "../ISA/JsonTypes/Publication.js";
-
-export function genID(p) {
- const matchValue = p.DOI;
- if (matchValue == null) {
- const matchValue_1 = p.PubMedID;
- if (matchValue_1 == null) {
- const matchValue_2 = p.Title;
- if (matchValue_2 == null) {
- return "#EmptyPublication";
- }
- else {
- return "#Pub_" + replace(matchValue_2, " ", "_");
- }
- }
- else {
- return matchValue_1;
- }
- }
- else {
- return matchValue;
- }
-}
-
-export function encoder(options, oa) {
- return object_12(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : empty(), delay(() => {
- let value_2, s_1;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_2 = "Publication", (typeof value_2 === "string") ? ((s_1 = value_2, s_1)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("pubMedID", (value_4) => {
- let s_2;
- const value_5 = value_4;
- return (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil;
- }, oa["PubMedID"])), delay(() => append(singleton(tryInclude("doi", (value_7) => {
- let s_3;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_3 = value_8, s_3)) : nil;
- }, oa["DOI"])), delay(() => append(singleton(tryInclude("authorList", (value_10) => {
- let s_4;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_4 = value_11, s_4)) : nil;
- }, oa["Authors"])), delay(() => append(singleton(tryInclude("title", (value_13) => {
- let s_5;
- const value_14 = value_13;
- return (typeof value_14 === "string") ? ((s_5 = value_14, s_5)) : nil;
- }, oa["Title"])), delay(() => append(singleton(tryInclude("status", (oa_1) => OntologyAnnotation_encoder(options, oa_1), oa["Status"])), delay(() => singleton(tryInclude("comments", (comment) => encoder_1(options, comment), oa["Comments"]))))))))))))));
- }));
- }))));
-}
-
-export function decoder(options) {
- return (path_4) => ((v) => object_13((get$) => {
- let objectArg, objectArg_1, objectArg_2, objectArg_3, arg_9, objectArg_4, arg_11, decoder_1, objectArg_5;
- return new Publication((objectArg = get$.Optional, objectArg.Field("pubMedID", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("doi", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("authorList", string)), (objectArg_3 = get$.Optional, objectArg_3.Field("title", string)), (arg_9 = OntologyAnnotation_decoder(options), (objectArg_4 = get$.Optional, objectArg_4.Field("status", uncurry2(arg_9)))), (arg_11 = ((decoder_1 = decoder_2(options), (path_3) => ((value_3) => array(uncurry2(decoder_1), path_3, value_3)))), (objectArg_5 = get$.Optional, objectArg_5.Field("comments", uncurry2(arg_11)))));
- }, path_4, v));
-}
-
-export function fromString(s) {
- return fromString_1(uncurry2(decoder(ConverterOptions_$ctor())), s);
-}
-
-export function toString(p) {
- return toString_1(2, encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function toStringLD(p) {
- let returnVal;
- return toString_1(2, encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), p));
-}
-
diff --git a/js/ISA/ISA.Json/Study.js b/js/ISA/ISA.Json/Study.js
deleted file mode 100644
index a5d19f7a..00000000
--- a/js/ISA/ISA.Json/Study.js
+++ /dev/null
@@ -1,230 +0,0 @@
-import { toString, nil, object as object_36 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { ofArray, choose } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { tryInclude } from "./GEncode.js";
-import { Sample_decoder, Source_decoder, Sample_encoder, Source_encoder } from "./Data.js";
-import { MaterialAttribute_decoder, MaterialAttribute_encoder, Material_decoder, Material_encoder } from "./Material.js";
-import { string, list as list_1, object as object_37 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { StudyMaterials } from "../ISA/JsonTypes/StudyMaterials.js";
-import { replace } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { decoder as decoder_10, encoder } from "./Publication.js";
-import { decoder as decoder_11, encoder as encoder_1 } from "./Person.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { Protocol_decoder, Protocol_encoder } from "./Protocol.js";
-import { Process_decoder, Process_encoder } from "./Process.js";
-import { Assay_decoder, Assay_encoder } from "./Assay.js";
-import { Factor_decoder, Factor_encoder } from "./Factor.js";
-import { decoder as decoder_12, encoder as encoder_2 } from "./Comment.js";
-import { fromString, uri } from "./Decode.js";
-import { Study } from "../ISA/JsonTypes/Study.js";
-import { ArcStudy } from "../ISA/ArcTypes/ArcStudy.js";
-
-export function StudyMaterials_encoder(options, oa) {
- return object_36(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, ofArray([tryInclude("sources", (oa_1) => Source_encoder(options, oa_1), oa["Sources"]), tryInclude("samples", (oa_2) => Sample_encoder(options, oa_2), oa["Samples"]), tryInclude("otherMaterials", (oa_3) => Material_encoder(options, oa_3), oa["OtherMaterials"])])));
-}
-
-export function StudyMaterials_decoder(options) {
- return (path_3) => ((v) => object_37((get$) => {
- let objectArg, objectArg_1, objectArg_2;
- return new StudyMaterials((objectArg = get$.Optional, objectArg.Field("sources", (path, value) => list_1((s, json) => Source_decoder(options, s, json), path, value))), (objectArg_1 = get$.Optional, objectArg_1.Field("samples", (path_1, value_1) => list_1((s_1, json_1) => Sample_decoder(options, s_1, json_1), path_1, value_1))), (objectArg_2 = get$.Optional, objectArg_2.Field("otherMaterials", (path_2, value_2) => list_1((s_2, json_2) => Material_decoder(options, s_2, json_2), path_2, value_2))));
- }, path_3, v));
-}
-
-export function Study_genID(s) {
- const matchValue = s.ID;
- if (matchValue == null) {
- const matchValue_1 = s.FileName;
- if (matchValue_1 == null) {
- const matchValue_2 = s.Identifier;
- if (matchValue_2 == null) {
- const matchValue_3 = s.Title;
- if (matchValue_3 == null) {
- return "#EmptyStudy";
- }
- else {
- return "#Study_" + replace(matchValue_3, " ", "_");
- }
- }
- else {
- return "#Study_" + replace(matchValue_2, " ", "_");
- }
- }
- else {
- return "#Study" + replace(matchValue_1, " ", "_");
- }
- }
- else {
- return URIModule_toString(matchValue);
- }
-}
-
-export function Study_encoder(options, oa) {
- return object_36(choose((tupledArg) => {
- const v = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v];
- }
- }, toList(delay(() => {
- let value, s_1;
- return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = Study_genID(oa), (typeof value === "string") ? ((s_1 = value, s_1)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
- let s_2;
- const value_3 = value_2;
- return (typeof value_3 === "string") ? ((s_2 = value_3, s_2)) : nil;
- }, oa["ID"])), delay(() => {
- let value_5, s_3;
- return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "Study", (typeof value_5 === "string") ? ((s_3 = value_5, s_3)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("filename", (value_7) => {
- let s_4;
- const value_8 = value_7;
- return (typeof value_8 === "string") ? ((s_4 = value_8, s_4)) : nil;
- }, oa["FileName"])), delay(() => append(singleton(tryInclude("identifier", (value_10) => {
- let s_5;
- const value_11 = value_10;
- return (typeof value_11 === "string") ? ((s_5 = value_11, s_5)) : nil;
- }, oa["Identifier"])), delay(() => append(singleton(tryInclude("title", (value_13) => {
- let s_6;
- const value_14 = value_13;
- return (typeof value_14 === "string") ? ((s_6 = value_14, s_6)) : nil;
- }, oa["Title"])), delay(() => append(singleton(tryInclude("description", (value_16) => {
- let s_7;
- const value_17 = value_16;
- return (typeof value_17 === "string") ? ((s_7 = value_17, s_7)) : nil;
- }, oa["Description"])), delay(() => append(singleton(tryInclude("submissionDate", (value_19) => {
- let s_8;
- const value_20 = value_19;
- return (typeof value_20 === "string") ? ((s_8 = value_20, s_8)) : nil;
- }, oa["SubmissionDate"])), delay(() => append(singleton(tryInclude("publicReleaseDate", (value_22) => {
- let s_9;
- const value_23 = value_22;
- return (typeof value_23 === "string") ? ((s_9 = value_23, s_9)) : nil;
- }, oa["PublicReleaseDate"])), delay(() => append(singleton(tryInclude("publications", (oa_1) => encoder(options, oa_1), oa["Publications"])), delay(() => append(singleton(tryInclude("people", (oa_2) => encoder_1(options, oa_2), oa["Contacts"])), delay(() => append(singleton(tryInclude("studyDesignDescriptors", (oa_3) => OntologyAnnotation_encoder(options, oa_3), oa["StudyDesignDescriptors"])), delay(() => append(singleton(tryInclude("protocols", (oa_4) => Protocol_encoder(options, oa_4), oa["Protocols"])), delay(() => append(singleton(tryInclude("materials", (oa_5) => StudyMaterials_encoder(options, oa_5), oa["Materials"])), delay(() => append(singleton(tryInclude("processSequence", (oa_6) => Process_encoder(options, oa_6), oa["ProcessSequence"])), delay(() => append(singleton(tryInclude("assays", (oa_7) => Assay_encoder(options, oa_7), oa["Assays"])), delay(() => append(singleton(tryInclude("factors", (oa_8) => Factor_encoder(options, oa_8), oa["Factors"])), delay(() => append(singleton(tryInclude("characteristicCategories", (oa_9) => MaterialAttribute_encoder(options, oa_9), oa["CharacteristicCategories"])), delay(() => append(singleton(tryInclude("unitCategories", (oa_10) => OntologyAnnotation_encoder(options, oa_10), oa["UnitCategories"])), delay(() => singleton(tryInclude("comments", (comment) => encoder_2(options, comment), oa["Comments"]))))))))))))))))))))))))))))))))))));
- }));
- }))));
-}
-
-export function Study_decoder(options) {
- return (path_16) => ((v) => object_37((get$) => {
- let arg_33, decoder_8, objectArg_16, arg_35, decoder_9, objectArg_17;
- let ID;
- const objectArg = get$.Optional;
- ID = objectArg.Field("@id", uri);
- let FileName;
- const objectArg_1 = get$.Optional;
- FileName = objectArg_1.Field("filename", string);
- let Identifier;
- const objectArg_2 = get$.Optional;
- Identifier = objectArg_2.Field("identifier", string);
- let Title;
- const objectArg_3 = get$.Optional;
- Title = objectArg_3.Field("title", string);
- let Description;
- const objectArg_4 = get$.Optional;
- Description = objectArg_4.Field("description", string);
- let SubmissionDate;
- const objectArg_5 = get$.Optional;
- SubmissionDate = objectArg_5.Field("submissionDate", string);
- let PublicReleaseDate;
- const objectArg_6 = get$.Optional;
- PublicReleaseDate = objectArg_6.Field("publicReleaseDate", string);
- let Publications;
- let arg_15;
- const decoder = decoder_10(options);
- arg_15 = ((path_6) => ((value_6) => list_1(uncurry2(decoder), path_6, value_6)));
- const objectArg_7 = get$.Optional;
- Publications = objectArg_7.Field("publications", uncurry2(arg_15));
- let Contacts;
- let arg_17;
- const decoder_1 = decoder_11(options);
- arg_17 = ((path_7) => ((value_7) => list_1(uncurry2(decoder_1), path_7, value_7)));
- const objectArg_8 = get$.Optional;
- Contacts = objectArg_8.Field("people", uncurry2(arg_17));
- let StudyDesignDescriptors;
- let arg_19;
- const decoder_2 = OntologyAnnotation_decoder(options);
- arg_19 = ((path_8) => ((value_8) => list_1(uncurry2(decoder_2), path_8, value_8)));
- const objectArg_9 = get$.Optional;
- StudyDesignDescriptors = objectArg_9.Field("studyDesignDescriptors", uncurry2(arg_19));
- let Protocols;
- let arg_21;
- const decoder_3 = Protocol_decoder(options);
- arg_21 = ((path_9) => ((value_9) => list_1(uncurry2(decoder_3), path_9, value_9)));
- const objectArg_10 = get$.Optional;
- Protocols = objectArg_10.Field("protocols", uncurry2(arg_21));
- let Materials;
- const arg_23 = StudyMaterials_decoder(options);
- const objectArg_11 = get$.Optional;
- Materials = objectArg_11.Field("materials", uncurry2(arg_23));
- let Assays;
- let arg_25;
- const decoder_4 = Assay_decoder(options);
- arg_25 = ((path_10) => ((value_10) => list_1(uncurry2(decoder_4), path_10, value_10)));
- const objectArg_12 = get$.Optional;
- Assays = objectArg_12.Field("assays", uncurry2(arg_25));
- let Factors;
- let arg_27;
- const decoder_5 = Factor_decoder(options);
- arg_27 = ((path_11) => ((value_11) => list_1(uncurry2(decoder_5), path_11, value_11)));
- const objectArg_13 = get$.Optional;
- Factors = objectArg_13.Field("factors", uncurry2(arg_27));
- let CharacteristicCategories;
- let arg_29;
- const decoder_6 = MaterialAttribute_decoder(options);
- arg_29 = ((path_12) => ((value_12) => list_1(uncurry2(decoder_6), path_12, value_12)));
- const objectArg_14 = get$.Optional;
- CharacteristicCategories = objectArg_14.Field("characteristicCategories", uncurry2(arg_29));
- let UnitCategories;
- let arg_31;
- const decoder_7 = OntologyAnnotation_decoder(options);
- arg_31 = ((path_13) => ((value_13) => list_1(uncurry2(decoder_7), path_13, value_13)));
- const objectArg_15 = get$.Optional;
- UnitCategories = objectArg_15.Field("unitCategories", uncurry2(arg_31));
- return new Study(ID, FileName, Identifier, Title, Description, SubmissionDate, PublicReleaseDate, Publications, Contacts, StudyDesignDescriptors, Protocols, Materials, (arg_33 = ((decoder_8 = Process_decoder(options), (path_14) => ((value_14) => list_1(uncurry2(decoder_8), path_14, value_14)))), (objectArg_16 = get$.Optional, objectArg_16.Field("processSequence", uncurry2(arg_33)))), Assays, Factors, CharacteristicCategories, UnitCategories, (arg_35 = ((decoder_9 = decoder_12(options), (path_15) => ((value_15) => list_1(uncurry2(decoder_9), path_15, value_15)))), (objectArg_17 = get$.Optional, objectArg_17.Field("comments", uncurry2(arg_35)))));
- }, path_16, v));
-}
-
-export function Study_fromString(s) {
- return fromString(uncurry2(Study_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function Study_toString(p) {
- return toString(2, Study_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function Study_toStringLD(s) {
- let returnVal;
- return toString(2, Study_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), s));
-}
-
-export function ArcStudy_fromString(s) {
- const arg = fromString(uncurry2(Study_decoder(ConverterOptions_$ctor())), s);
- return ArcStudy.fromStudy(arg);
-}
-
-export function ArcStudy_toString(a) {
- return toString(2, Study_encoder(ConverterOptions_$ctor(), a.ToStudy()));
-}
-
-/**
- * exports in json-ld format
- */
-export function ArcStudy_toStringLD(a) {
- let returnVal;
- return toString(2, Study_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToStudy()));
-}
-
diff --git a/js/ISA/ISA.Json/Validation/Fable.js b/js/ISA/ISA.Json/Validation/Fable.js
deleted file mode 100644
index cd3ac1cf..00000000
--- a/js/ISA/ISA.Json/Validation/Fable.js
+++ /dev/null
@@ -1,69 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { bool_type, option_type, array_type, record_type, string_type, obj_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { map } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { singleton } from "../../../fable_modules/fable-library.4.1.4/AsyncBuilder.js";
-import { awaitPromise } from "../../../fable_modules/fable-library.4.1.4/Async.js";
-import * as JsonValidation from "../../../../src/ISA/ISA.Json/Validation/JsonValidation.js";
-import { value } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-
-export class ValidationError extends Record {
- constructor(path, property, message, schema, instance, name, argument, stack) {
- super();
- this.path = path;
- this.property = property;
- this.message = message;
- this.schema = schema;
- this.instance = instance;
- this.name = name;
- this.argument = argument;
- this.stack = stack;
- }
-}
-
-export function ValidationError_$reflection() {
- return record_type("ARCtrl.ISA.Json.Fable.ValidationError", [], ValidationError, () => [["path", obj_type], ["property", string_type], ["message", string_type], ["schema", obj_type], ["instance", obj_type], ["name", string_type], ["argument", obj_type], ["stack", string_type]]);
-}
-
-export function ValidationError__ToErrorString(this$) {
- return `Property ${this$.property} (${this$.instance}) ${this$.message}.`;
-}
-
-export class ValidatorResult extends Record {
- constructor(instance, schema, options, path, propertyPath, errors, throwError, throFirst, throwAll, disableFormat) {
- super();
- this.instance = instance;
- this.schema = schema;
- this.options = options;
- this.path = path;
- this.propertyPath = propertyPath;
- this.errors = errors;
- this.throwError = throwError;
- this.throFirst = throFirst;
- this.throwAll = throwAll;
- this.disableFormat = disableFormat;
- }
-}
-
-export function ValidatorResult_$reflection() {
- return record_type("ARCtrl.ISA.Json.Fable.ValidatorResult", [], ValidatorResult, () => [["instance", obj_type], ["schema", obj_type], ["options", obj_type], ["path", array_type(obj_type)], ["propertyPath", string_type], ["errors", array_type(ValidationError_$reflection())], ["throwError", option_type(obj_type)], ["throFirst", option_type(obj_type)], ["throwAll", option_type(obj_type)], ["disableFormat", bool_type]]);
-}
-
-export function ValidatorResult__ToValidationResult(this$) {
- if (this$.errors.length === 0) {
- return [true, []];
- }
- else {
- return [false, map(ValidationError__ToErrorString, this$.errors)];
- }
-}
-
-export function validate(schemaURL, objectString) {
- let validationResult = void 0;
- return singleton.Delay(() => singleton.Bind(awaitPromise(JsonValidation.validateAgainstSchema(objectString, schemaURL).then((o) => {
- validationResult = o;
- })), () => {
- const output = ValidatorResult__ToValidationResult(value(validationResult));
- return singleton.Return(output);
- }));
-}
-
diff --git a/js/ISA/ISA.Json/Validation/JsonSchemaValidation.js b/js/ISA/ISA.Json/Validation/JsonSchemaValidation.js
deleted file mode 100644
index e7248513..00000000
--- a/js/ISA/ISA.Json/Validation/JsonSchemaValidation.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import { singleton } from "../../../fable_modules/fable-library.4.1.4/AsyncBuilder.js";
-import { validate } from "./Fable.js";
-import { ValidationResult, ValidationResult_OfJSchemaOutput_Z6EC48F6B } from "./ValidationResult.js";
-
-export function Validation_validate(schemaURL, objectString) {
- return singleton.Delay(() => singleton.TryWith(singleton.Delay(() => singleton.Bind(validate(schemaURL, objectString), (_arg) => singleton.Return(ValidationResult_OfJSchemaOutput_Z6EC48F6B([_arg[0], _arg[1]])))), (_arg_1) => singleton.Return(new ValidationResult(1, [[_arg_1.message]]))));
-}
-
-export function Validation_validateAssay(assayString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/assay_schema.json", assayString);
-}
-
-export function Validation_validateComment(commentString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/comment_schema.json", commentString);
-}
-
-export function Validation_validateData(dataString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/data_schema.json", dataString);
-}
-
-export function Validation_validateFactor(factorString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/factor_schema.json", factorString);
-}
-
-export function Validation_validateFactorValue(factorValueString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/factor_value_schema.json", factorValueString);
-}
-
-export function Validation_validateInvestigation(investigationString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/investigation_schema.json", investigationString);
-}
-
-export function Validation_validateMaterialAttribute(materialAttributeString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/material_attribute_schema.json", materialAttributeString);
-}
-
-export function Validation_validateMaterialAttributeValue(materialAttributeValueString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/material_attribute_value_schema.json", materialAttributeValueString);
-}
-
-export function Validation_validateMaterial(materialString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/material_schema.json", materialString);
-}
-
-export function Validation_validateOntologyAnnotation(ontologyAnnotationString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/ontology_annotation_schema.json", ontologyAnnotationString);
-}
-
-export function Validation_validateOntologySourceReference(ontologySourceReferenceString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/ontology_source_reference_schema.json", ontologySourceReferenceString);
-}
-
-export function Validation_validatePerson(personString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/person_schema.json", personString);
-}
-
-export function Validation_validateProcessParameterValue(processParameterValueString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/process_parameter_value_schema.json", processParameterValueString);
-}
-
-export function Validation_validateProcess(processString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/process_schema.json", processString);
-}
-
-export function Validation_validateProtocolParameter(protocolParameterString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/protocol_parameter_schema.json", protocolParameterString);
-}
-
-export function Validation_validateProtocol(protocolString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/protocol_schema.json", protocolString);
-}
-
-export function Validation_validatePublication(publicationString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/publication_schema.json", publicationString);
-}
-
-export function Validation_validateSample(sampleString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/sample_schema.json", sampleString);
-}
-
-export function Validation_validateSource(sourceString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/source_schema.json", sourceString);
-}
-
-export function Validation_validateStudy(studyString) {
- return Validation_validate("https://raw.githubusercontent.com/HLWeil/isa-specs/anyof/source/_static/isajson/study_schema.json", studyString);
-}
-
diff --git a/js/ISA/ISA.Json/Validation/ValidationResult.js b/js/ISA/ISA.Json/Validation/ValidationResult.js
deleted file mode 100644
index 5597e4eb..00000000
--- a/js/ISA/ISA.Json/Validation/ValidationResult.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import { Union } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { union_type, array_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class ValidationResult extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Ok", "Failed"];
- }
-}
-
-export function ValidationResult_$reflection() {
- return union_type("ARCtrl.ISA.Json.ValidationTypes.ValidationResult", [], ValidationResult, () => [[], [["Item", array_type(string_type)]]]);
-}
-
-export function ValidationResult__get_Success(this$) {
- if (this$.tag === 0) {
- return true;
- }
- else {
- return false;
- }
-}
-
-export function ValidationResult__GetErrors(this$) {
- if (this$.tag === 1) {
- return this$.fields[0];
- }
- else {
- return [];
- }
-}
-
-export function ValidationResult_OfJSchemaOutput_Z6EC48F6B(output) {
- if (output[0]) {
- return new ValidationResult(0, []);
- }
- else {
- return new ValidationResult(1, [output[1]]);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/ArcAssay.js b/js/ISA/ISA.Spreadsheet/ArcAssay.js
deleted file mode 100644
index e52c9873..00000000
--- a/js/ISA/ISA.Spreadsheet/ArcAssay.js
+++ /dev/null
@@ -1,150 +0,0 @@
-import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.3.3.0/FsWorksheet.fs.js";
-import { iterate, isEmpty as isEmpty_1, choose, tryHead, head, exists, map, singleton, append, delay, iterateIndexed } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { SparseRowModule_tryGetValueAt, SparseRowModule_fromFsRow, SparseRowModule_fromValues, SparseRowModule_writeToSheet } from "./SparseTable.js";
-import { fromRows as fromRows_1, toRows as toRows_1 } from "./InvestigationFile/Assays.js";
-import { empty, isEmpty, toArray, ofArray, singleton as singleton_1 } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { fromRows as fromRows_2, toRows as toRows_2 } from "./InvestigationFile/Contacts.js";
-import { getEnumerator } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { ArcAssay } from "../ISA/ArcTypes/ArcAssay.js";
-import { createMissingIdentifier } from "../ISA/ArcTypes/Identifier.js";
-import { defaultArg } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { printf, toConsole } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { toFsWorksheet, tryFromFsWorksheet } from "./ArcTable.js";
-import { FsWorkbook } from "../../fable_modules/FsSpreadsheet.3.3.0/FsWorkbook.fs.js";
-
-export function toMetadataSheet(assay) {
- let assay_1;
- const sheet = new FsWorksheet("isa_assay");
- iterateIndexed((rowI, r) => {
- SparseRowModule_writeToSheet(rowI + 1, r, sheet);
- }, (assay_1 = assay, delay(() => append(singleton(SparseRowModule_fromValues(["ASSAY"])), delay(() => append(toRows_1("Assay", singleton_1(assay_1)), delay(() => append(singleton(SparseRowModule_fromValues(["ASSAY PERFORMERS"])), delay(() => toRows_2("Assay Person", ofArray(assay_1.Performers)))))))))));
- return sheet;
-}
-
-export function fromMetadataSheet(sheet) {
- const rows_1 = map(SparseRowModule_fromFsRow, sheet.Rows);
- const patternInput = exists((row) => {
- const s = head(row)[1];
- return s.indexOf("Assay") === 0;
- }, rows_1) ? ["Assay", "Assay Person"] : [void 0, void 0];
- const en = getEnumerator(rows_1);
- const loop = (lastLine_mut, assays_mut, contacts_mut, lineNumber_mut) => {
- let k;
- loop:
- while (true) {
- const lastLine = lastLine_mut, assays = assays_mut, contacts = contacts_mut, lineNumber = lineNumber_mut;
- let matchResult, k_2, k_3, k_4;
- if (lastLine != null) {
- if ((k = lastLine, (k === "ASSAY") ? true : (k === "ASSAY METADATA"))) {
- matchResult = 0;
- k_2 = lastLine;
- }
- else if (lastLine === "ASSAY PERFORMERS") {
- matchResult = 1;
- k_3 = lastLine;
- }
- else {
- matchResult = 2;
- k_4 = lastLine;
- }
- }
- else {
- matchResult = 2;
- k_4 = lastLine;
- }
- switch (matchResult) {
- case 0: {
- const patternInput_1 = fromRows_1(patternInput[0], lineNumber + 1, en);
- lastLine_mut = patternInput_1[0];
- assays_mut = patternInput_1[3];
- contacts_mut = contacts;
- lineNumber_mut = patternInput_1[1];
- continue loop;
- }
- case 1: {
- const patternInput_2 = fromRows_2(patternInput[1], lineNumber + 1, en);
- lastLine_mut = patternInput_2[0];
- assays_mut = assays;
- contacts_mut = patternInput_2[3];
- lineNumber_mut = patternInput_2[1];
- continue loop;
- }
- default: {
- let matchResult_1, assays_2, contacts_2;
- if (isEmpty(assays)) {
- if (isEmpty(contacts)) {
- matchResult_1 = 0;
- }
- else {
- matchResult_1 = 1;
- assays_2 = assays;
- contacts_2 = contacts;
- }
- }
- else {
- matchResult_1 = 1;
- assays_2 = assays;
- contacts_2 = contacts;
- }
- switch (matchResult_1) {
- case 0:
- return ArcAssay.create(createMissingIdentifier());
- default: {
- const arg = toArray(contacts_2);
- const arg_1 = defaultArg(tryHead(assays_2), ArcAssay.create(createMissingIdentifier()));
- return ArcAssay.setPerformers(arg, arg_1);
- }
- }
- }
- }
- break;
- }
- };
- if (en["System.Collections.IEnumerator.MoveNext"]()) {
- return loop(SparseRowModule_tryGetValueAt(0, en["System.Collections.Generic.IEnumerator`1.get_Current"]()), empty(), empty(), 1);
- }
- else {
- throw new Error("empty assay metadata sheet");
- }
-}
-
-/**
- * Reads an assay from a spreadsheet
- */
-export function fromFsWorkbook(doc) {
- let assayMetaData;
- const matchValue = doc.TryGetWorksheetByName("isa_assay");
- if (matchValue == null) {
- const matchValue_1 = doc.TryGetWorksheetByName("Assay");
- if (matchValue_1 == null) {
- toConsole(printf("Cannot retrieve metadata: Assay file does not contain \"%s\" or \"%s\" sheet."))("isa_assay")("Assay");
- assayMetaData = ArcAssay.create(createMissingIdentifier());
- }
- else {
- assayMetaData = fromMetadataSheet(matchValue_1);
- }
- }
- else {
- assayMetaData = fromMetadataSheet(matchValue);
- }
- const sheets = choose(tryFromFsWorksheet, doc.GetWorksheets());
- if (isEmpty_1(sheets)) {
- return assayMetaData;
- }
- else {
- assayMetaData.Tables = Array.from(sheets);
- return assayMetaData;
- }
-}
-
-export function toFsWorkbook(assay) {
- const doc = new FsWorkbook();
- const metaDataSheet = toMetadataSheet(assay);
- doc.AddWorksheet(metaDataSheet);
- iterate((arg_1) => {
- const arg = toFsWorksheet(arg_1);
- doc.AddWorksheet(arg);
- }, assay.Tables);
- return doc;
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/ArcStudy.js b/js/ISA/ISA.Spreadsheet/ArcStudy.js
deleted file mode 100644
index bed325ca..00000000
--- a/js/ISA/ISA.Spreadsheet/ArcStudy.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.3.3.0/FsWorksheet.fs.js";
-import { iterate, isEmpty, choose, map, singleton, append, delay, iterateIndexed } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { SparseRowModule_fromFsRow, SparseRowModule_fromValues, SparseRowModule_writeToSheet } from "./SparseTable.js";
-import { fromRows as fromRows_1, StudyInfo_toRows_1B3D5E9B } from "./InvestigationFile/Study.js";
-import { defaultArg } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { getEnumerator } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { ArcStudy } from "../ISA/ArcTypes/ArcStudy.js";
-import { createMissingIdentifier } from "../ISA/ArcTypes/Identifier.js";
-import { printf, toConsole } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { toFsWorksheet, tryFromFsWorksheet } from "./ArcTable.js";
-import { FsWorkbook } from "../../fable_modules/FsSpreadsheet.3.3.0/FsWorkbook.fs.js";
-
-export function toMetadataSheet(study) {
- const sheet = new FsWorksheet("isa_study");
- iterateIndexed((rowI, r) => {
- SparseRowModule_writeToSheet(rowI + 1, r, sheet);
- }, delay(() => append(singleton(SparseRowModule_fromValues(["STUDY"])), delay(() => StudyInfo_toRows_1B3D5E9B(study)))));
- return sheet;
-}
-
-export function fromMetadataSheet(sheet) {
- let en;
- return defaultArg((en = getEnumerator(map(SparseRowModule_fromFsRow, sheet.Rows)), (void en["System.Collections.IEnumerator.MoveNext"](), fromRows_1(2, en)[3])), ArcStudy.create(createMissingIdentifier()));
-}
-
-/**
- * Reads an assay from a spreadsheet
- */
-export function fromFsWorkbook(doc) {
- let studyMetadata;
- const matchValue = doc.TryGetWorksheetByName("isa_study");
- if (matchValue == null) {
- const matchValue_1 = doc.TryGetWorksheetByName("Study");
- if (matchValue_1 == null) {
- toConsole(printf("Cannot retrieve metadata: Study file does not contain \"%s\" or \"%s\" sheet."))("isa_study")("Study");
- studyMetadata = ArcStudy.create(createMissingIdentifier());
- }
- else {
- studyMetadata = fromMetadataSheet(matchValue_1);
- }
- }
- else {
- studyMetadata = fromMetadataSheet(matchValue);
- }
- const sheets = choose(tryFromFsWorksheet, doc.GetWorksheets());
- if (isEmpty(sheets)) {
- return studyMetadata;
- }
- else {
- studyMetadata.Tables = Array.from(sheets);
- return studyMetadata;
- }
-}
-
-export function toFsWorkbook(study) {
- const doc = new FsWorkbook();
- const metaDataSheet = toMetadataSheet(study);
- doc.AddWorksheet(metaDataSheet);
- iterate((arg_1) => {
- const arg = toFsWorksheet(arg_1);
- doc.AddWorksheet(arg);
- }, study.Tables);
- return doc;
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/ArcTable.js b/js/ISA/ISA.Spreadsheet/ArcTable.js
deleted file mode 100644
index 55837858..00000000
--- a/js/ISA/ISA.Spreadsheet/ArcTable.js
+++ /dev/null
@@ -1,137 +0,0 @@
-import { iterateIndexed, length, sortBy, collect, toArray, empty, tail, head, isEmpty, cons, singleton, fold, map, reverse } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { tryParseReferenceColumnHeader } from "../ISA/Regex.js";
-import { map as map_1, toList, tryFind } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { toFsColumns, fixDeprecatedIOHeader, fromFsColumns } from "./CompositeColumn.js";
-import { ArcTable } from "../ISA/ArcTypes/ArcTable.js";
-import { FsWorksheet } from "../../fable_modules/FsSpreadsheet.3.3.0/FsWorksheet.fs.js";
-import { comparePrimitives } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { FsRangeAddress_$ctor_7E77A4A0 } from "../../fable_modules/FsSpreadsheet.3.3.0/Ranges/FsRangeAddress.fs.js";
-import { FsAddress_$ctor_Z37302880 } from "../../fable_modules/FsSpreadsheet.3.3.0/FsAddress.fs.js";
-import { Dictionary_tryGet } from "../../fable_modules/FsSpreadsheet.3.3.0/Cells/FsCellsCollection.fs.js";
-import { addToDict } from "../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { FsRangeBase__Cell_Z3407A44B } from "../../fable_modules/FsSpreadsheet.3.3.0/Ranges/FsRangeBase.fs.js";
-
-/**
- * Iterates over elements of the input list and groups adjacent elements.
- * A new group is started when the specified predicate holds about the element
- * of the list (and at the beginning of the iteration).
- *
- * For example:
- * List.groupWhen isOdd [3;3;2;4;1;2] = [[3]; [3; 2; 4]; [1; 2]]
- */
-export function Aux_List_groupWhen(f, list) {
- return reverse(map(reverse, fold((acc, e) => {
- const matchValue = f(e);
- if (matchValue) {
- return cons(singleton(e), acc);
- }
- else if (!isEmpty(acc)) {
- return cons(cons(e, head(acc)), tail(acc));
- }
- else {
- return singleton(singleton(e));
- }
- }, empty(), list)));
-}
-
-export function classifyHeaderOrder(header) {
- switch (header.tag) {
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- return 2;
- case 0:
- case 1:
- case 2:
- case 3:
- case 13:
- return 3;
- case 12:
- return 4;
- default:
- return 1;
- }
-}
-
-export function classifyColumnOrder(column) {
- return classifyHeaderOrder(column.Header);
-}
-
-export function groupColumnsByHeader(columns) {
- return Aux_List_groupWhen((c) => {
- if (tryParseReferenceColumnHeader(c.Item(1).Value) == null) {
- return !(c.Item(1).Value.indexOf("Unit") === 0);
- }
- else {
- return false;
- }
- }, columns);
-}
-
-/**
- * Returns the annotation table of the worksheet if it exists, else returns None
- */
-export function tryAnnotationTable(sheet) {
- return tryFind((t) => (t.Name.indexOf("annotationTable") === 0), sheet.Tables);
-}
-
-/**
- * Groups and parses a collection of single columns into the according ISA composite columns
- */
-export function composeColumns(columns) {
- return toArray(map(fromFsColumns, groupColumnsByHeader(toList(columns))));
-}
-
-/**
- * Returns the protocol described by the headers and a function for parsing the values of the matrix to the processes of this protocol
- */
-export function tryFromFsWorksheet(sheet) {
- const matchValue = tryAnnotationTable(sheet);
- if (matchValue == null) {
- return void 0;
- }
- else {
- const t = matchValue;
- const compositeColumns = composeColumns(map_1(fixDeprecatedIOHeader, t.GetColumns(sheet.CellCollection)));
- return ArcTable.addColumns(compositeColumns)(ArcTable.init(sheet.Name));
- }
-}
-
-export function toFsWorksheet(table) {
- const stringCount = new Map([]);
- const ws = new FsWorksheet(table.Name);
- const columns = collect(toFsColumns, sortBy(classifyColumnOrder, table.Columns, {
- Compare: comparePrimitives,
- }));
- const maxRow = length(head(columns)) | 0;
- const maxCol = length(columns) | 0;
- const fsTable = ws.Table("annotationTable", FsRangeAddress_$ctor_7E77A4A0(FsAddress_$ctor_Z37302880(1, 1), FsAddress_$ctor_Z37302880(maxRow, maxCol)));
- iterateIndexed((colI, col) => {
- iterateIndexed((rowI, cell) => {
- let value;
- if (rowI === 0) {
- const matchValue = Dictionary_tryGet(cell.Value, stringCount);
- if (matchValue == null) {
- addToDict(stringCount, cell.Value, "");
- value = cell.Value;
- }
- else {
- const spaces = matchValue;
- stringCount.set(cell.Value, spaces + " ");
- value = ((cell.Value + " ") + spaces);
- }
- }
- else {
- value = cell.Value;
- }
- const address = FsAddress_$ctor_Z37302880(rowI + 1, colI + 1);
- FsRangeBase__Cell_Z3407A44B(fsTable, address, ws.CellCollection).SetValueAs(value);
- }, col);
- }, columns);
- return ws;
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/CollectionAux.js b/js/ISA/ISA.Spreadsheet/CollectionAux.js
deleted file mode 100644
index f40c9e5d..00000000
--- a/js/ISA/ISA.Spreadsheet/CollectionAux.js
+++ /dev/null
@@ -1,160 +0,0 @@
-import { tryFind, maxBy, skip } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { defaultOf, comparePrimitives, disposeSafe, getEnumerator } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { reverse, tryPick, empty, ofArrayWithTail, cons, head, tail, singleton, isEmpty } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { tryItem, skip as skip_1, initialize } from "../../fable_modules/fable-library.4.1.4/Array.js";
-import { some, value } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { tryGetValue } from "../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { FSharpRef } from "../../fable_modules/fable-library.4.1.4/Types.js";
-
-/**
- * If at least i values exist in seq a, builds a new array that contains the elements of the given seq, exluding the first i elements
- */
-export function Seq_trySkip(i, s) {
- try {
- return skip(i, s);
- }
- catch (matchValue) {
- return void 0;
- }
-}
-
-function Seq_groupWhen(withOverlap, predicate, input) {
- let matchValue, t_4, h_4;
- const en = getEnumerator(input);
- try {
- const loop = (cont_mut) => {
- loop:
- while (true) {
- const cont = cont_mut;
- if (en["System.Collections.IEnumerator.MoveNext"]()) {
- const temp = en["System.Collections.Generic.IEnumerator`1.get_Current"]();
- if (predicate(temp)) {
- cont_mut = ((y) => cont(isEmpty(y) ? singleton(singleton(temp)) : (withOverlap ? ofArrayWithTail([singleton(temp), cons(temp, head(y))], tail(y)) : ofArrayWithTail([empty(), cons(temp, head(y))], tail(y)))));
- continue loop;
- }
- else {
- cont_mut = ((y_1) => cont(isEmpty(y_1) ? singleton(singleton(temp)) : cons(cons(temp, head(y_1)), tail(y_1))));
- continue loop;
- }
- }
- else {
- return cont(empty());
- }
- break;
- }
- };
- return (matchValue = loop((x) => x), isEmpty(matchValue) ? empty() : ((t_4 = tail(matchValue), (h_4 = head(matchValue), isEmpty(h_4) ? t_4 : (isEmpty(tail(h_4)) ? ((predicate(head(h_4)) && withOverlap) ? t_4 : cons(h_4, t_4)) : cons(h_4, t_4))))));
- }
- finally {
- disposeSafe(en);
- }
-}
-
-export function Array_ofIndexedSeq(s) {
- return initialize(1 + maxBy((tuple) => tuple[0], s, {
- Compare: comparePrimitives,
- })[0], (i) => {
- const matchValue = tryFind((arg) => (i === arg[0]), s);
- if (matchValue == null) {
- return "";
- }
- else {
- const i_1 = matchValue[0] | 0;
- return matchValue[1];
- }
- });
-}
-
-/**
- * If at least i values exist in array a, builds a new array that contains the elements of the given array, exluding the first i elements
- */
-export function Array_trySkip(i, a) {
- try {
- return skip_1(i, a);
- }
- catch (matchValue) {
- return void 0;
- }
-}
-
-/**
- * Returns Item of array at index i if existing, else returns default value
- */
-export function Array_tryItemDefault(i, d, a) {
- const matchValue = tryItem(i, a);
- if (matchValue == null) {
- return d;
- }
- else {
- return value(matchValue);
- }
-}
-
-export function Array_map4(f, aa, ba, ca, da) {
- if (!(((aa.length === ba.length) && (ba.length === ca.length)) && (ca.length === da.length))) {
- throw new Error("");
- }
- return initialize(aa.length, (i) => f(aa[i], ba[i], ca[i], da[i]));
-}
-
-export function List_tryPickDefault(chooser, d, list) {
- const matchValue = tryPick(chooser, list);
- if (matchValue == null) {
- return d;
- }
- else {
- return value(matchValue);
- }
-}
-
-export function List_unzip4(l) {
- const loop = (la_mut, lb_mut, lc_mut, ld_mut, l_1_mut) => {
- loop:
- while (true) {
- const la = la_mut, lb = lb_mut, lc = lc_mut, ld = ld_mut, l_1 = l_1_mut;
- if (isEmpty(l_1)) {
- return [reverse(la), reverse(lb), reverse(lc), reverse(ld)];
- }
- else {
- la_mut = cons(head(l_1)[0], la);
- lb_mut = cons(head(l_1)[1], lb);
- lc_mut = cons(head(l_1)[2], lc);
- ld_mut = cons(head(l_1)[3], ld);
- l_1_mut = tail(l_1);
- continue loop;
- }
- break;
- }
- };
- return loop(empty(), empty(), empty(), empty(), l);
-}
-
-export function Dictionary_tryGetValue(k, dict) {
- let patternInput;
- let outArg = defaultOf();
- patternInput = [tryGetValue(dict, k, new FSharpRef(() => outArg, (v) => {
- outArg = v;
- })), outArg];
- if (patternInput[0]) {
- return some(patternInput[1]);
- }
- else {
- return void 0;
- }
-}
-
-export function Dictionary_tryGetString(k, dict) {
- let patternInput;
- let outArg = defaultOf();
- patternInput = [tryGetValue(dict, k, new FSharpRef(() => outArg, (v) => {
- outArg = v;
- })), outArg];
- const v_1 = patternInput[1];
- if (patternInput[0] && (v_1.trim() !== "")) {
- return v_1.trim();
- }
- else {
- return void 0;
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/Comment.js b/js/ISA/ISA.Spreadsheet/Comment.js
deleted file mode 100644
index 06e87d07..00000000
--- a/js/ISA/ISA.Spreadsheet/Comment.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import { defaultArg, bind } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { match } from "../../fable_modules/fable-library.4.1.4/RegExp.js";
-import { printf, toText } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { Comment_make } from "../ISA/JsonTypes/Comment.js";
-import { Option_fromValueWithDefault } from "./Conversions.js";
-
-export const Comment_commentRegex = /(?<=Comment\[<).*(?=>\])/gu;
-
-export const Comment_commentRegexNoAngleBrackets = /(?<=Comment\[).*(?=\])/gu;
-
-export function Comment_$007CComment$007C_$007C(key) {
- return bind((k) => {
- const r = match(Comment_commentRegex, k);
- if (r != null) {
- return r[0];
- }
- else {
- const r_1 = match(Comment_commentRegexNoAngleBrackets, k);
- if (r_1 != null) {
- return r_1[0];
- }
- else {
- return void 0;
- }
- }
- }, key);
-}
-
-export function Comment_wrapCommentKey(k) {
- return toText(printf("Comment[%s]"))(k);
-}
-
-export function Comment_fromString(k, v) {
- return Comment_make(void 0, Option_fromValueWithDefault("", k), Option_fromValueWithDefault("", v));
-}
-
-export function Comment_toString(c) {
- return [defaultArg(c.Name, ""), defaultArg(c.Value, "")];
-}
-
-export const Remark_remarkRegex = /(?<=#).*/gu;
-
-export function Remark_$007CRemark$007C_$007C(key) {
- return bind((k) => {
- const r = match(Remark_remarkRegex, k);
- if (r != null) {
- return r[0];
- }
- else {
- return void 0;
- }
- }, key);
-}
-
-export function Remark_wrapRemark(r) {
- return toText(printf("#%s"))(r);
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/CompositeCell.js b/js/ISA/ISA.Spreadsheet/CompositeCell.js
deleted file mode 100644
index 6ab3ada4..00000000
--- a/js/ISA/ISA.Spreadsheet/CompositeCell.js
+++ /dev/null
@@ -1,79 +0,0 @@
-import { singleton, ofArray, head, tail, isEmpty, map } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { CompositeCell } from "../ISA/ArcTypes/CompositeCell.js";
-import { printf, toFail } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { FsCell } from "../../fable_modules/FsSpreadsheet.3.3.0/Cells/FsCell.fs.js";
-import { OntologyAnnotation__get_TermAccessionOntobeeUrl, OntologyAnnotation__get_TermSourceREFString, OntologyAnnotation__get_NameText } from "../ISA/JsonTypes/OntologyAnnotation.js";
-
-export function fromFsCells(cells) {
- const cellValues = map((c) => c.Value, cells);
- let matchResult, v, v1, v2, v3, v1_1, v2_1, v3_1, v4;
- if (!isEmpty(cellValues)) {
- if (!isEmpty(tail(cellValues))) {
- if (!isEmpty(tail(tail(cellValues)))) {
- if (!isEmpty(tail(tail(tail(cellValues))))) {
- if (isEmpty(tail(tail(tail(tail(cellValues)))))) {
- matchResult = 2;
- v1_1 = head(cellValues);
- v2_1 = head(tail(cellValues));
- v3_1 = head(tail(tail(cellValues)));
- v4 = head(tail(tail(tail(cellValues))));
- }
- else {
- matchResult = 3;
- }
- }
- else {
- matchResult = 1;
- v1 = head(cellValues);
- v2 = head(tail(cellValues));
- v3 = head(tail(tail(cellValues)));
- }
- }
- else {
- matchResult = 3;
- }
- }
- else {
- matchResult = 0;
- v = head(cellValues);
- }
- }
- else {
- matchResult = 3;
- }
- switch (matchResult) {
- case 0:
- return CompositeCell.createFreeText(v);
- case 1:
- return CompositeCell.createTermFromString(v1, v2, v3);
- case 2:
- return CompositeCell.createUnitizedFromString(v1_1, v2_1, v3_1, v4);
- default:
- return toFail(printf("Dafuq"));
- }
-}
-
-export function toFsCells(isTerm, hasUnit, cell) {
- switch (cell.tag) {
- case 0:
- if (hasUnit) {
- return ofArray([new FsCell(OntologyAnnotation__get_NameText(cell.fields[0])), new FsCell(""), new FsCell(OntologyAnnotation__get_TermSourceREFString(cell.fields[0])), new FsCell(OntologyAnnotation__get_TermAccessionOntobeeUrl(cell.fields[0]))]);
- }
- else {
- return ofArray([new FsCell(OntologyAnnotation__get_NameText(cell.fields[0])), new FsCell(OntologyAnnotation__get_TermSourceREFString(cell.fields[0])), new FsCell(OntologyAnnotation__get_TermAccessionOntobeeUrl(cell.fields[0]))]);
- }
- case 2:
- return ofArray([new FsCell(cell.fields[0]), new FsCell(OntologyAnnotation__get_NameText(cell.fields[1])), new FsCell(OntologyAnnotation__get_TermSourceREFString(cell.fields[1])), new FsCell(OntologyAnnotation__get_TermAccessionOntobeeUrl(cell.fields[1]))]);
- default:
- if (hasUnit) {
- return ofArray([new FsCell(cell.fields[0]), new FsCell(""), new FsCell(""), new FsCell("")]);
- }
- else if (isTerm) {
- return ofArray([new FsCell(cell.fields[0]), new FsCell(""), new FsCell("")]);
- }
- else {
- return singleton(new FsCell(cell.fields[0]));
- }
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/CompositeColumn.js b/js/ISA/ISA.Spreadsheet/CompositeColumn.js
deleted file mode 100644
index b952bc08..00000000
--- a/js/ISA/ISA.Spreadsheet/CompositeColumn.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import { CompositeHeader, IOType } from "../ISA/ArcTypes/CompositeHeader.js";
-import { toString } from "../../fable_modules/fable-library.4.1.4/Types.js";
-import { toFsCells, fromFsCells } from "./CompositeHeader.js";
-import { singleton as singleton_1, ofArray, item, map } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { FsAddress__get_RowNumber } from "../../fable_modules/FsSpreadsheet.3.3.0/FsAddress.fs.js";
-import { FsRangeAddress__get_LastAddress } from "../../fable_modules/FsSpreadsheet.3.3.0/Ranges/FsRangeAddress.fs.js";
-import { FsRangeBase__get_RangeAddress } from "../../fable_modules/FsSpreadsheet.3.3.0/Ranges/FsRangeBase.fs.js";
-import { singleton, append, toList, exists, map as map_1, delay, toArray } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { toFsCells as toFsCells_1, fromFsCells as fromFsCells_1 } from "./CompositeCell.js";
-import { rangeDouble } from "../../fable_modules/fable-library.4.1.4/Range.js";
-import { CompositeColumn } from "../ISA/ArcTypes/CompositeColumn.js";
-import { map as map_2 } from "../../fable_modules/fable-library.4.1.4/Array.js";
-
-/**
- * Checks if the column header is a deprecated IO Header. If so, fixes it.
- *
- * The old format of IO Headers was only the type of IO so, e.g. "Source Name" or "Raw Data File".
- *
- * A "Source Name" column will now be mapped to the propper "Input [Source Name]", and all other IO types will be mapped to "Output []".
- */
-export function fixDeprecatedIOHeader(col) {
- const matchValue = IOType.ofString(col.Item(1).Value);
- switch (matchValue.tag) {
- case 6:
- return col;
- case 0: {
- col.Item(1).SetValueAs(toString(new CompositeHeader(11, [new IOType(0, [])])));
- return col;
- }
- default: {
- col.Item(1).SetValueAs(toString(new CompositeHeader(12, [matchValue])));
- return col;
- }
- }
-}
-
-export function fromFsColumns(columns) {
- const header = fromFsCells(map((c) => c.Item(1), columns));
- const l = FsAddress__get_RowNumber(FsRangeAddress__get_LastAddress(FsRangeBase__get_RangeAddress(item(0, columns)))) | 0;
- const cells_2 = toArray(delay(() => map_1((i) => fromFsCells_1(map((c_1) => c_1.Item(i), columns)), rangeDouble(2, 1, l))));
- return CompositeColumn.create(header, cells_2);
-}
-
-export function toFsColumns(column) {
- const hasUnit = exists((c) => c.isUnitized, column.Cells);
- const isTerm = column.Header.IsTermColumn;
- const header = toFsCells(hasUnit, column.Header);
- const cells = map_2((cell) => toFsCells_1(isTerm, hasUnit, cell), column.Cells);
- if (hasUnit) {
- return ofArray([toList(delay(() => append(singleton(item(0, header)), delay(() => map_1((i) => item(0, cells[i]), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(1, header)), delay(() => map_1((i_1) => item(1, cells[i_1]), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(2, header)), delay(() => map_1((i_2) => item(2, cells[i_2]), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(3, header)), delay(() => map_1((i_3) => item(3, cells[i_3]), rangeDouble(0, 1, column.Cells.length - 1))))))]);
- }
- else if (isTerm) {
- return ofArray([toList(delay(() => append(singleton(item(0, header)), delay(() => map_1((i_4) => item(0, cells[i_4]), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(1, header)), delay(() => map_1((i_5) => item(1, cells[i_5]), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(2, header)), delay(() => map_1((i_6) => item(2, cells[i_6]), rangeDouble(0, 1, column.Cells.length - 1))))))]);
- }
- else {
- return singleton_1(toList(delay(() => append(singleton(item(0, header)), delay(() => map_1((i_7) => item(0, cells[i_7]), rangeDouble(0, 1, column.Cells.length - 1)))))));
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/CompositeHeader.js b/js/ISA/ISA.Spreadsheet/CompositeHeader.js
deleted file mode 100644
index 4adf598a..00000000
--- a/js/ISA/ISA.Spreadsheet/CompositeHeader.js
+++ /dev/null
@@ -1,478 +0,0 @@
-import { printf, toFail } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { singleton, tail, head, isEmpty, map } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologyAnnotation_fromString_2EB0E147 } from "../ISA/JsonTypes/OntologyAnnotation.js";
-import { ActivePatterns_$007COutputColumnHeader$007C_$007C, ActivePatterns_$007CInputColumnHeader$007C_$007C, tryParseComponentColumnHeader, tryParseCharacteristicColumnHeader, tryParseFactorColumnHeader, tryParseParameterColumnHeader, ActivePatterns_$007CUnitColumnHeader$007C_$007C, ActivePatterns_$007CTANColumnHeader$007C_$007C, ActivePatterns_$007CTSRColumnHeader$007C_$007C } from "../ISA/Regex.js";
-import { IOType, CompositeHeader } from "../ISA/ArcTypes/CompositeHeader.js";
-import { FsCell } from "../../fable_modules/FsSpreadsheet.3.3.0/Cells/FsCell.fs.js";
-import { toString } from "../../fable_modules/fable-library.4.1.4/Types.js";
-import { empty, singleton as singleton_1, append, delay, toList } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-
-export function ActivePattern_mergeTerms(tsr1, tan1, tsr2, tan2) {
- if (tsr1 !== tsr2) {
- toFail(printf("TermSourceRef %s and %s do not match"))(tsr1)(tsr2);
- }
- if (tan1 !== tan2) {
- toFail(printf("TermAccessionNumber %s and %s do not match"))(tan1)(tan2);
- }
- return {
- TermAccessionNumber: tan1,
- TermSourceRef: tsr1,
- };
-}
-
-export function ActivePattern_$007CTerm$007C_$007C(categoryParser, f, cells) {
- const $007CAC$007C_$007C = categoryParser;
- const cellValues = map((c) => c.Value, cells);
- let matchResult, name;
- if (!isEmpty(cellValues)) {
- const activePatternResult = $007CAC$007C_$007C(head(cellValues));
- if (activePatternResult != null) {
- if (isEmpty(tail(cellValues))) {
- matchResult = 0;
- name = activePatternResult;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return f(OntologyAnnotation_fromString_2EB0E147(name));
- default: {
- let matchResult_1, name_1, term1, term2;
- if (!isEmpty(cellValues)) {
- const activePatternResult_1 = $007CAC$007C_$007C(head(cellValues));
- if (activePatternResult_1 != null) {
- if (!isEmpty(tail(cellValues))) {
- const activePatternResult_2 = ActivePatterns_$007CTSRColumnHeader$007C_$007C(head(tail(cellValues)));
- if (activePatternResult_2 != null) {
- if (!isEmpty(tail(tail(cellValues)))) {
- const activePatternResult_3 = ActivePatterns_$007CTANColumnHeader$007C_$007C(head(tail(tail(cellValues))));
- if (activePatternResult_3 != null) {
- if (!isEmpty(tail(tail(tail(cellValues))))) {
- const activePatternResult_4 = ActivePatterns_$007CTANColumnHeader$007C_$007C(head(tail(tail(tail(cellValues)))));
- if (activePatternResult_4 != null) {
- if (isEmpty(tail(tail(tail(tail(cellValues)))))) {
- const activePatternResult_5 = ActivePatterns_$007CTSRColumnHeader$007C_$007C(head(tail(tail(cellValues))));
- if (activePatternResult_5 != null) {
- if (ActivePatterns_$007CUnitColumnHeader$007C_$007C(head(tail(cellValues))) != null) {
- matchResult_1 = 0;
- name_1 = activePatternResult_1;
- term1 = activePatternResult_5;
- term2 = activePatternResult_4;
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 0;
- name_1 = activePatternResult_1;
- term1 = activePatternResult_2;
- term2 = activePatternResult_3;
- }
- }
- else {
- const activePatternResult_7 = ActivePatterns_$007CTSRColumnHeader$007C_$007C(head(tail(tail(cellValues))));
- if (activePatternResult_7 != null) {
- if (!isEmpty(tail(tail(tail(cellValues))))) {
- const activePatternResult_8 = ActivePatterns_$007CTANColumnHeader$007C_$007C(head(tail(tail(tail(cellValues)))));
- if (activePatternResult_8 != null) {
- if (isEmpty(tail(tail(tail(tail(cellValues)))))) {
- if (ActivePatterns_$007CUnitColumnHeader$007C_$007C(head(tail(cellValues))) != null) {
- matchResult_1 = 0;
- name_1 = activePatternResult_1;
- term1 = activePatternResult_7;
- term2 = activePatternResult_8;
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else if (ActivePatterns_$007CUnitColumnHeader$007C_$007C(head(tail(cellValues))) != null) {
- if (!isEmpty(tail(tail(cellValues)))) {
- const activePatternResult_11 = ActivePatterns_$007CTSRColumnHeader$007C_$007C(head(tail(tail(cellValues))));
- if (activePatternResult_11 != null) {
- if (!isEmpty(tail(tail(tail(cellValues))))) {
- const activePatternResult_12 = ActivePatterns_$007CTANColumnHeader$007C_$007C(head(tail(tail(tail(cellValues)))));
- if (activePatternResult_12 != null) {
- if (isEmpty(tail(tail(tail(tail(cellValues)))))) {
- matchResult_1 = 0;
- name_1 = activePatternResult_1;
- term1 = activePatternResult_11;
- term2 = activePatternResult_12;
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- switch (matchResult_1) {
- case 0: {
- const term = ActivePattern_mergeTerms(term1.TermSourceREF, term1.TermAccessionNumber, term2.TermSourceREF, term2.TermAccessionNumber);
- return f(OntologyAnnotation_fromString_2EB0E147(name_1, term.TermSourceRef, term.TermAccessionNumber));
- }
- default:
- return void 0;
- }
- }
- }
-}
-
-export function ActivePattern_$007CParameter$007C_$007C(cells) {
- const activePatternResult = ActivePattern_$007CTerm$007C_$007C(tryParseParameterColumnHeader, (arg) => (new CompositeHeader(3, [arg])), cells);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-export function ActivePattern_$007CFactor$007C_$007C(cells) {
- const activePatternResult = ActivePattern_$007CTerm$007C_$007C(tryParseFactorColumnHeader, (arg) => (new CompositeHeader(2, [arg])), cells);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-export function ActivePattern_$007CCharacteristic$007C_$007C(cells) {
- const activePatternResult = ActivePattern_$007CTerm$007C_$007C(tryParseCharacteristicColumnHeader, (arg) => (new CompositeHeader(1, [arg])), cells);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-export function ActivePattern_$007CComponent$007C_$007C(cells) {
- const activePatternResult = ActivePattern_$007CTerm$007C_$007C(tryParseComponentColumnHeader, (arg) => (new CompositeHeader(0, [arg])), cells);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-export function ActivePattern_$007CInput$007C_$007C(cells) {
- const cellValues = map((c) => c.Value, cells);
- let matchResult, ioType;
- if (!isEmpty(cellValues)) {
- const activePatternResult = ActivePatterns_$007CInputColumnHeader$007C_$007C(head(cellValues));
- if (activePatternResult != null) {
- if (isEmpty(tail(cellValues))) {
- matchResult = 0;
- ioType = activePatternResult;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return new CompositeHeader(11, [IOType.ofString(ioType)]);
- default:
- return void 0;
- }
-}
-
-export function ActivePattern_$007COutput$007C_$007C(cells) {
- const cellValues = map((c) => c.Value, cells);
- let matchResult, ioType;
- if (!isEmpty(cellValues)) {
- const activePatternResult = ActivePatterns_$007COutputColumnHeader$007C_$007C(head(cellValues));
- if (activePatternResult != null) {
- if (isEmpty(tail(cellValues))) {
- matchResult = 0;
- ioType = activePatternResult;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return new CompositeHeader(12, [IOType.ofString(ioType)]);
- default:
- return void 0;
- }
-}
-
-export function ActivePattern_$007CProtocolHeader$007C_$007C(cells) {
- const cellValues = map((c) => c.Value, cells);
- let matchResult;
- if (!isEmpty(cellValues)) {
- switch (head(cellValues)) {
- case "Protocol Type": {
- matchResult = 0;
- break;
- }
- case "Protocol REF": {
- if (isEmpty(tail(cellValues))) {
- matchResult = 1;
- }
- else {
- matchResult = 7;
- }
- break;
- }
- case "Protocol Description": {
- if (isEmpty(tail(cellValues))) {
- matchResult = 2;
- }
- else {
- matchResult = 7;
- }
- break;
- }
- case "Protocol Uri": {
- if (isEmpty(tail(cellValues))) {
- matchResult = 3;
- }
- else {
- matchResult = 7;
- }
- break;
- }
- case "Protocol Version": {
- if (isEmpty(tail(cellValues))) {
- matchResult = 4;
- }
- else {
- matchResult = 7;
- }
- break;
- }
- case "Performer": {
- if (isEmpty(tail(cellValues))) {
- matchResult = 5;
- }
- else {
- matchResult = 7;
- }
- break;
- }
- case "Date": {
- if (isEmpty(tail(cellValues))) {
- matchResult = 6;
- }
- else {
- matchResult = 7;
- }
- break;
- }
- default:
- matchResult = 7;
- }
- }
- else {
- matchResult = 7;
- }
- switch (matchResult) {
- case 0:
- return new CompositeHeader(4, []);
- case 1:
- return new CompositeHeader(8, []);
- case 2:
- return new CompositeHeader(5, []);
- case 3:
- return new CompositeHeader(6, []);
- case 4:
- return new CompositeHeader(7, []);
- case 5:
- return new CompositeHeader(9, []);
- case 6:
- return new CompositeHeader(10, []);
- default:
- return void 0;
- }
-}
-
-export function ActivePattern_$007CFreeText$007C_$007C(cells) {
- const cellValues = map((c) => c.Value, cells);
- let matchResult, text;
- if (!isEmpty(cellValues)) {
- if (isEmpty(tail(cellValues))) {
- matchResult = 0;
- text = head(cellValues);
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return new CompositeHeader(13, [text]);
- default:
- return void 0;
- }
-}
-
-export function fromFsCells(cells) {
- const activePatternResult = ActivePattern_$007CParameter$007C_$007C(cells);
- if (activePatternResult != null) {
- const p = activePatternResult;
- return p;
- }
- else {
- const activePatternResult_1 = ActivePattern_$007CFactor$007C_$007C(cells);
- if (activePatternResult_1 != null) {
- const f = activePatternResult_1;
- return f;
- }
- else {
- const activePatternResult_2 = ActivePattern_$007CCharacteristic$007C_$007C(cells);
- if (activePatternResult_2 != null) {
- const c = activePatternResult_2;
- return c;
- }
- else {
- const activePatternResult_3 = ActivePattern_$007CComponent$007C_$007C(cells);
- if (activePatternResult_3 != null) {
- const c_1 = activePatternResult_3;
- return c_1;
- }
- else {
- const activePatternResult_4 = ActivePattern_$007CInput$007C_$007C(cells);
- if (activePatternResult_4 != null) {
- const i = activePatternResult_4;
- return i;
- }
- else {
- const activePatternResult_5 = ActivePattern_$007COutput$007C_$007C(cells);
- if (activePatternResult_5 != null) {
- const o = activePatternResult_5;
- return o;
- }
- else {
- const activePatternResult_6 = ActivePattern_$007CProtocolHeader$007C_$007C(cells);
- if (activePatternResult_6 != null) {
- const ph = activePatternResult_6;
- return ph;
- }
- else {
- const activePatternResult_7 = ActivePattern_$007CFreeText$007C_$007C(cells);
- if (activePatternResult_7 != null) {
- const ft = activePatternResult_7;
- return ft;
- }
- else {
- return toFail(printf("Could not parse header group %O"))(cells);
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-export function toFsCells(hasUnit, header) {
- if (header.IsSingleColumn) {
- return singleton(new FsCell(toString(header)));
- }
- else if (header.IsTermColumn) {
- return toList(delay(() => append(singleton_1(new FsCell(toString(header))), delay(() => append(hasUnit ? singleton_1(new FsCell("Unit")) : empty(), delay(() => append(singleton_1(new FsCell(`Term Source REF (${header.GetColumnAccessionShort})`)), delay(() => singleton_1(new FsCell(`Term Accession Number (${header.GetColumnAccessionShort})`))))))))));
- }
- else {
- return toFail(printf("header %O is neither single nor term column"))(header);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/Conversions.js b/js/ISA/ISA.Spreadsheet/Conversions.js
deleted file mode 100644
index 0f6d6f2f..00000000
--- a/js/ISA/ISA.Spreadsheet/Conversions.js
+++ /dev/null
@@ -1,180 +0,0 @@
-import { equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { value, some } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { map, equalsWith, fill, map3, fold } from "../../fable_modules/fable-library.4.1.4/Array.js";
-import { toText, printf, toFail } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_fromString_2EB0E147 } from "../ISA/JsonTypes/OntologyAnnotation.js";
-import { map as map_1, fold as fold_1, ofArray, empty } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { Array_map4 } from "./CollectionAux.js";
-import { Component_toString_Z609B8895, Component_fromString_Z61E08C1 } from "../ISA/JsonTypes/Component.js";
-import { ProtocolParameter_toString_Z3A4310A5, ProtocolParameter_make } from "../ISA/JsonTypes/ProtocolParameter.js";
-
-/**
- * If the value matches the default, a None is returned, else a Some is returned
- */
-export function Option_fromValueWithDefault(d, v) {
- if (equals(d, v)) {
- return void 0;
- }
- else {
- return some(v);
- }
-}
-
-/**
- * Applies the function f on the value of the option if it exists, else applies it on the default value. If the result value matches the default, a None is returned
- */
-export function Option_mapDefault(d, f, o) {
- return Option_fromValueWithDefault(d, (o == null) ? f(d) : f(value(o)));
-}
-
-/**
- * Returns the length of a subpropertylist from the aggregated strings
- *
- * In ISATab format, some subproperties which are stored as lists in ISAJson are stored as semicolon delimited tables
- *
- * These strings should either contain the same number of semicolon delimited elements or be empty.
- */
-export function OntologyAnnotation_getLengthOfAggregatedStrings(separator, strings) {
- return fold((l, s) => {
- if (s === "") {
- return l | 0;
- }
- else if (l === 0) {
- return s.split(separator).length | 0;
- }
- else if (l === s.split(separator).length) {
- return l | 0;
- }
- else {
- return toFail(printf("The length of the aggregated string %s does not match the length of the others"))(s) | 0;
- }
- }, 0, strings);
-}
-
-/**
- * Returns a list of ISAJson OntologyAnnotation objects from ISATab aggregated strings
- */
-export function OntologyAnnotation_fromAggregatedStrings(separator, terms, source, accessions) {
- const l = OntologyAnnotation_getLengthOfAggregatedStrings(separator, [terms, source, accessions]) | 0;
- if (l === 0) {
- return [];
- }
- else {
- return map3(OntologyAnnotation_fromString_2EB0E147, (terms === "") ? fill(new Array(l), 0, l, "") : terms.split(separator), (source === "") ? fill(new Array(l), 0, l, "") : source.split(separator), (accessions === "") ? fill(new Array(l), 0, l, "") : accessions.split(separator));
- }
-}
-
-/**
- * Returns the aggregated ISATab OntologyAnnotation Name, ontology source and Accession number from a list of ISAJson OntologyAnnotation objects
- */
-export function OntologyAnnotation_toAggregatedStrings(separator, oas) {
- let first = true;
- if (equalsWith(equals, oas, [])) {
- return {
- TermAccessionNumberAgg: "",
- TermNameAgg: "",
- TermSourceREFAgg: "",
- };
- }
- else {
- const tupledArg_1 = fold((tupledArg, term) => {
- if (first) {
- first = false;
- return [term.TermName, term.TermSourceREF, term.TermAccessionNumber];
- }
- else {
- return [toText(printf("%s%c%s"))(tupledArg[0])(separator)(term.TermName), toText(printf("%s%c%s"))(tupledArg[1])(separator)(term.TermSourceREF), toText(printf("%s%c%s"))(tupledArg[2])(separator)(term.TermAccessionNumber)];
- }
- }, ["", "", ""], map(OntologyAnnotation_toString_5E3DAF0D, oas));
- return {
- TermAccessionNumberAgg: tupledArg_1[2],
- TermNameAgg: tupledArg_1[0],
- TermSourceREFAgg: tupledArg_1[1],
- };
- }
-}
-
-/**
- * Returns a list of ISAJson Component objects from ISATab aggregated strings
- */
-export function Component_fromAggregatedStrings(separator, names, terms, source, accessions) {
- const l = OntologyAnnotation_getLengthOfAggregatedStrings(separator, [names, terms, source, accessions]) | 0;
- if (l === 0) {
- return empty();
- }
- else {
- return ofArray(Array_map4(Component_fromString_Z61E08C1, (names === "") ? fill(new Array(l), 0, l, "") : names.split(separator), (terms === "") ? fill(new Array(l), 0, l, "") : terms.split(separator), (source === "") ? fill(new Array(l), 0, l, "") : source.split(separator), (accessions === "") ? fill(new Array(l), 0, l, "") : accessions.split(separator)));
- }
-}
-
-/**
- * Returns the aggregated ISATAb Component Name, Ontology Annotation value, Accession number and ontology source from a list of ISAJson Component objects
- */
-export function Component_toAggregatedStrings(separator, cs) {
- let first = true;
- if (equals(cs, empty())) {
- return {
- NameAgg: "",
- TermAccessionNumberAgg: "",
- TermNameAgg: "",
- TermSourceREFAgg: "",
- };
- }
- else {
- const tupledArg_2 = fold_1((tupledArg, tupledArg_1) => {
- const name = tupledArg_1[0];
- const term = tupledArg_1[1];
- if (first) {
- first = false;
- return [name, term.TermName, term.TermSourceREF, term.TermAccessionNumber];
- }
- else {
- return [toText(printf("%s%c%s"))(tupledArg[0])(separator)(name), toText(printf("%s%c%s"))(tupledArg[1])(separator)(term.TermName), toText(printf("%s%c%s"))(tupledArg[2])(separator)(term.TermSourceREF), toText(printf("%s%c%s"))(tupledArg[3])(separator)(term.TermAccessionNumber)];
- }
- }, ["", "", "", ""], map_1(Component_toString_Z609B8895, cs));
- return {
- NameAgg: tupledArg_2[0],
- TermAccessionNumberAgg: tupledArg_2[3],
- TermNameAgg: tupledArg_2[1],
- TermSourceREFAgg: tupledArg_2[2],
- };
- }
-}
-
-/**
- * Returns a list of ISAJson ProtocolParameter objects from ISATab aggregated strings
- */
-export function ProtocolParameter_fromAggregatedStrings(separator, terms, source, accessions) {
- return map((arg_3) => ((arg_2) => ProtocolParameter_make(void 0, arg_2))(arg_3), OntologyAnnotation_fromAggregatedStrings(separator, terms, source, accessions));
-}
-
-/**
- * Returns the aggregated ISATAb Ontology Annotation value, Accession number and ontology source from a list of ISAJson ProtocolParameter objects
- */
-export function ProtocolParameter_toAggregatedStrings(separator, oas) {
- let first = true;
- if (equals(oas, empty())) {
- return {
- TermAccessionNumberAgg: "",
- TermNameAgg: "",
- TermSourceREFAgg: "",
- };
- }
- else {
- const tupledArg_1 = fold_1((tupledArg, term) => {
- if (first) {
- first = false;
- return [term.TermName, term.TermSourceREF, term.TermAccessionNumber];
- }
- else {
- return [toText(printf("%s%c%s"))(tupledArg[0])(separator)(term.TermName), toText(printf("%s%c%s"))(tupledArg[1])(separator)(term.TermSourceREF), toText(printf("%s%c%s"))(tupledArg[2])(separator)(term.TermAccessionNumber)];
- }
- }, ["", "", ""], map_1(ProtocolParameter_toString_Z3A4310A5, oas));
- return {
- TermAccessionNumberAgg: tupledArg_1[2],
- TermNameAgg: tupledArg_1[0],
- TermSourceREFAgg: tupledArg_1[1],
- };
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/Assays.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/Assays.js
deleted file mode 100644
index 378fefad..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/Assays.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import { reverse, cons, iterateIndexed, empty, map, toArray, initialize, singleton, length, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147 } from "../../ISA/JsonTypes/OntologyAnnotation.js";
-import { Option_fromValueWithDefault } from "../Conversions.js";
-import { ArcAssay } from "../../ISA/ArcTypes/ArcAssay.js";
-import { SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValue_11FD62A8, SparseTable__TryGetValueDefault_5BAE6133, SparseTable_GetEmptyComments_651559CC } from "../SparseTable.js";
-import { Assay_fileNameFromIdentifier, removeMissingIdentifier, Assay_identifierFromFileName, createMissingIdentifier } from "../../ISA/ArcTypes/Identifier.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { unwrap, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export const labels = ofArray(["Measurement Type", "Measurement Type Term Accession Number", "Measurement Type Term Source REF", "Technology Type", "Technology Type Term Accession Number", "Technology Type Term Source REF", "Technology Platform", "File Name"]);
-
-export function fromString(measurementType, measurementTypeTermSourceREF, measurementTypeTermAccessionNumber, technologyType, technologyTypeTermSourceREF, technologyTypeTermAccessionNumber, technologyPlatform, fileName, comments) {
- const measurementType_1 = OntologyAnnotation_fromString_2EB0E147(measurementType, measurementTypeTermSourceREF, measurementTypeTermAccessionNumber);
- const technologyType_1 = OntologyAnnotation_fromString_2EB0E147(technologyType, technologyTypeTermSourceREF, technologyTypeTermAccessionNumber);
- const arg_1 = Option_fromValueWithDefault(OntologyAnnotation_get_empty(), measurementType_1);
- const arg_2 = Option_fromValueWithDefault(OntologyAnnotation_get_empty(), technologyType_1);
- const arg_3 = Option_fromValueWithDefault("", technologyPlatform);
- return ArcAssay.make(fileName, arg_1, arg_2, arg_3, [], [], comments);
-}
-
-export function fromSparseTable(matrix) {
- if ((matrix.ColumnCount === 0) && (length(matrix.CommentKeys) !== 0)) {
- const comments = SparseTable_GetEmptyComments_651559CC(matrix);
- return singleton(ArcAssay.create(createMissingIdentifier(), void 0, void 0, void 0, void 0, void 0, comments));
- }
- else {
- return initialize(matrix.ColumnCount, (i) => {
- const comments_1 = toArray(map((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, i])), matrix.CommentKeys));
- return fromString(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Measurement Type", i]), SparseTable__TryGetValue_11FD62A8(matrix, ["Measurement Type Term Source REF", i]), SparseTable__TryGetValue_11FD62A8(matrix, ["Measurement Type Term Accession Number", i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Technology Type", i]), SparseTable__TryGetValue_11FD62A8(matrix, ["Technology Type Term Source REF", i]), SparseTable__TryGetValue_11FD62A8(matrix, ["Technology Type Term Accession Number", i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Technology Platform", i]), Assay_identifierFromFileName(SparseTable__TryGetValueDefault_5BAE6133(matrix, createMissingIdentifier(), ["File Name", i])), comments_1);
- });
- }
-}
-
-export function toSparseTable(assays) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, labels, void 0, length(assays) + 1);
- let commentKeys = empty();
- iterateIndexed((i, a) => {
- const processedFileName = (a.Identifier.indexOf("MISSING_IDENTIFIER_") === 0) ? removeMissingIdentifier(a.Identifier) : Assay_fileNameFromIdentifier(a.Identifier);
- const i_1 = (i + 1) | 0;
- const mt_1 = OntologyAnnotation_toString_5E3DAF0D(defaultArg(a.MeasurementType, OntologyAnnotation_get_empty()), true);
- const tt_1 = OntologyAnnotation_toString_5E3DAF0D(defaultArg(a.TechnologyType, OntologyAnnotation_get_empty()), true);
- addToDict(matrix.Matrix, ["Measurement Type", i_1], mt_1.TermName);
- addToDict(matrix.Matrix, ["Measurement Type Term Accession Number", i_1], mt_1.TermAccessionNumber);
- addToDict(matrix.Matrix, ["Measurement Type Term Source REF", i_1], mt_1.TermSourceREF);
- addToDict(matrix.Matrix, ["Technology Type", i_1], tt_1.TermName);
- addToDict(matrix.Matrix, ["Technology Type Term Accession Number", i_1], tt_1.TermAccessionNumber);
- addToDict(matrix.Matrix, ["Technology Type Term Source REF", i_1], tt_1.TermSourceREF);
- addToDict(matrix.Matrix, ["Technology Platform", i_1], defaultArg(a.TechnologyPlatform, ""));
- addToDict(matrix.Matrix, ["File Name", i_1], processedFileName);
- if (!(a.Comments.length === 0)) {
- const array = a.Comments;
- array.forEach((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, i_1], patternInput[1]);
- });
- }
- }, assays);
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function fromRows(prefix, lineNumber, rows) {
- const tupledArg = SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber, unwrap(prefix));
- return [tupledArg[0], tupledArg[1], tupledArg[2], fromSparseTable(tupledArg[3])];
-}
-
-export function toRows(prefix, assays) {
- return SparseTable_ToRows_6A3D4534(toSparseTable(assays), unwrap(prefix));
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/Contacts.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/Contacts.js
deleted file mode 100644
index 05c5ba45..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/Contacts.js
+++ /dev/null
@@ -1,100 +0,0 @@
-import { reverse, cons, iterateIndexed, empty, map, toArray, initialize, singleton, length, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologyAnnotation_toAggregatedStrings, Option_fromValueWithDefault, OntologyAnnotation_fromAggregatedStrings } from "../Conversions.js";
-import { Person_create_4538B98B, Person_make } from "../../ISA/JsonTypes/Person.js";
-import { SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValueDefault_5BAE6133, SparseTable_GetEmptyComments_651559CC } from "../SparseTable.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { unwrap, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export const lastNameLabel = "Last Name";
-
-export const firstNameLabel = "First Name";
-
-export const midInitialsLabel = "Mid Initials";
-
-export const emailLabel = "Email";
-
-export const phoneLabel = "Phone";
-
-export const faxLabel = "Fax";
-
-export const addressLabel = "Address";
-
-export const affiliationLabel = "Affiliation";
-
-export const rolesLabel = "Roles";
-
-export const rolesTermAccessionNumberLabel = "Roles Term Accession Number";
-
-export const rolesTermSourceREFLabel = "Roles Term Source REF";
-
-export const labels = ofArray([lastNameLabel, firstNameLabel, midInitialsLabel, emailLabel, phoneLabel, faxLabel, addressLabel, affiliationLabel, rolesLabel, rolesTermAccessionNumberLabel, rolesTermSourceREFLabel]);
-
-export function fromString(lastName, firstName, midInitials, email, phone, fax, address, affiliation, role, rolesTermAccessionNumber, rolesTermSourceREF, comments) {
- const roles = OntologyAnnotation_fromAggregatedStrings(";", role, rolesTermSourceREF, rolesTermAccessionNumber);
- return Person_make(void 0, Option_fromValueWithDefault("", lastName), Option_fromValueWithDefault("", firstName), Option_fromValueWithDefault("", midInitials), Option_fromValueWithDefault("", email), Option_fromValueWithDefault("", phone), Option_fromValueWithDefault("", fax), Option_fromValueWithDefault("", address), Option_fromValueWithDefault("", affiliation), Option_fromValueWithDefault([], roles), Option_fromValueWithDefault([], comments));
-}
-
-export function fromSparseTable(matrix) {
- if ((matrix.ColumnCount === 0) && (length(matrix.CommentKeys) !== 0)) {
- return singleton(Person_create_4538B98B(void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, SparseTable_GetEmptyComments_651559CC(matrix)));
- }
- else {
- return initialize(matrix.ColumnCount, (i) => {
- const comments_1 = toArray(map((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, i])), matrix.CommentKeys));
- return fromString(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [lastNameLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [firstNameLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [midInitialsLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [emailLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [phoneLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [faxLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [addressLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [affiliationLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [rolesLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [rolesTermAccessionNumberLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [rolesTermSourceREFLabel, i]), comments_1);
- });
- }
-}
-
-export function toSparseTable(persons) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, labels, void 0, length(persons) + 1);
- let commentKeys = empty();
- iterateIndexed((i, p) => {
- const i_1 = (i + 1) | 0;
- const rAgg = OntologyAnnotation_toAggregatedStrings(";", defaultArg(p.Roles, []));
- addToDict(matrix.Matrix, [lastNameLabel, i_1], defaultArg(p.LastName, ""));
- addToDict(matrix.Matrix, [firstNameLabel, i_1], defaultArg(p.FirstName, ""));
- addToDict(matrix.Matrix, [midInitialsLabel, i_1], defaultArg(p.MidInitials, ""));
- addToDict(matrix.Matrix, [emailLabel, i_1], defaultArg(p.EMail, ""));
- addToDict(matrix.Matrix, [phoneLabel, i_1], defaultArg(p.Phone, ""));
- addToDict(matrix.Matrix, [faxLabel, i_1], defaultArg(p.Fax, ""));
- addToDict(matrix.Matrix, [addressLabel, i_1], defaultArg(p.Address, ""));
- addToDict(matrix.Matrix, [affiliationLabel, i_1], defaultArg(p.Affiliation, ""));
- addToDict(matrix.Matrix, [rolesLabel, i_1], rAgg.TermNameAgg);
- addToDict(matrix.Matrix, [rolesTermAccessionNumberLabel, i_1], rAgg.TermAccessionNumberAgg);
- addToDict(matrix.Matrix, [rolesTermSourceREFLabel, i_1], rAgg.TermSourceREFAgg);
- const matchValue = p.Comments;
- if (matchValue != null) {
- const array = matchValue;
- array.forEach((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, i_1], patternInput[1]);
- });
- }
- }, persons);
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function fromRows(prefix, lineNumber, rows) {
- const tupledArg = SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber, unwrap(prefix));
- return [tupledArg[0], tupledArg[1], tupledArg[2], fromSparseTable(tupledArg[3])];
-}
-
-export function toRows(prefix, persons) {
- const m = toSparseTable(persons);
- if (prefix == null) {
- return SparseTable_ToRows_6A3D4534(m);
- }
- else {
- return SparseTable_ToRows_6A3D4534(m, prefix);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/DesignDescriptors.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/DesignDescriptors.js
deleted file mode 100644
index 644b7924..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/DesignDescriptors.js
+++ /dev/null
@@ -1,69 +0,0 @@
-import { reverse, cons, iterateIndexed, empty, map, toArray, initialize, singleton, length, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation_create_Z61CCDEEC } from "../../ISA/JsonTypes/OntologyAnnotation.js";
-import { SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValueDefault_5BAE6133, SparseTable_GetEmptyComments_651559CC } from "../SparseTable.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export const designTypeLabel = "Type";
-
-export const designTypeTermAccessionNumberLabel = "Type Term Accession Number";
-
-export const designTypeTermSourceREFLabel = "Type Term Source REF";
-
-export const labels = ofArray([designTypeLabel, designTypeTermAccessionNumberLabel, designTypeTermSourceREFLabel]);
-
-export function fromSparseTable(matrix) {
- if ((matrix.ColumnCount === 0) && (length(matrix.CommentKeys) !== 0)) {
- return singleton(OntologyAnnotation_create_Z61CCDEEC(void 0, void 0, void 0, void 0, void 0, SparseTable_GetEmptyComments_651559CC(matrix)));
- }
- else {
- return initialize(matrix.ColumnCount, (i) => {
- const comments_1 = toArray(map((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, i])), matrix.CommentKeys));
- return OntologyAnnotation_fromString_2EB0E147(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [designTypeLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [designTypeTermSourceREFLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [designTypeTermAccessionNumberLabel, i]), comments_1);
- });
- }
-}
-
-export function toSparseTable(designs) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, labels, void 0, length(designs) + 1);
- let commentKeys = empty();
- iterateIndexed((i, d) => {
- const i_1 = (i + 1) | 0;
- const oa = OntologyAnnotation_toString_5E3DAF0D(d, true);
- addToDict(matrix.Matrix, [designTypeLabel, i_1], oa.TermName);
- addToDict(matrix.Matrix, [designTypeTermAccessionNumberLabel, i_1], oa.TermAccessionNumber);
- addToDict(matrix.Matrix, [designTypeTermSourceREFLabel, i_1], oa.TermSourceREF);
- const matchValue = d.Comments;
- if (matchValue != null) {
- const array = matchValue;
- array.forEach((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, i_1], patternInput[1]);
- });
- }
- }, designs);
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function fromRows(prefix, lineNumber, rows) {
- const tupledArg = (prefix == null) ? SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber) : SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber, prefix);
- return [tupledArg[0], tupledArg[1], tupledArg[2], fromSparseTable(tupledArg[3])];
-}
-
-export function toRows(prefix, designs) {
- const m = toSparseTable(designs);
- if (prefix == null) {
- return SparseTable_ToRows_6A3D4534(m);
- }
- else {
- return SparseTable_ToRows_6A3D4534(m, prefix);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/Factors.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/Factors.js
deleted file mode 100644
index e1fef48f..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/Factors.js
+++ /dev/null
@@ -1,80 +0,0 @@
-import { reverse, cons, iterateIndexed, empty, map, toArray, initialize, singleton, length, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147 } from "../../ISA/JsonTypes/OntologyAnnotation.js";
-import { Factor_create_3A99E5B8, Factor_make } from "../../ISA/JsonTypes/Factor.js";
-import { Option_fromValueWithDefault } from "../Conversions.js";
-import { SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValue_11FD62A8, SparseTable__TryGetValueDefault_5BAE6133, SparseTable_GetEmptyComments_651559CC } from "../SparseTable.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export const nameLabel = "Name";
-
-export const factorTypeLabel = "Type";
-
-export const typeTermAccessionNumberLabel = "Type Term Accession Number";
-
-export const typeTermSourceREFLabel = "Type Term Source REF";
-
-export const labels = ofArray([nameLabel, factorTypeLabel, typeTermAccessionNumberLabel, typeTermSourceREFLabel]);
-
-export function fromString(name, designType, typeTermSourceREF, typeTermAccessionNumber, comments) {
- const factorType = OntologyAnnotation_fromString_2EB0E147(designType, typeTermSourceREF, typeTermAccessionNumber);
- return Factor_make(void 0, Option_fromValueWithDefault("", name), Option_fromValueWithDefault(OntologyAnnotation_get_empty(), factorType), Option_fromValueWithDefault([], comments));
-}
-
-export function fromSparseTable(matrix) {
- if ((matrix.ColumnCount === 0) && (length(matrix.CommentKeys) !== 0)) {
- return singleton(Factor_create_3A99E5B8(void 0, void 0, void 0, SparseTable_GetEmptyComments_651559CC(matrix)));
- }
- else {
- return initialize(matrix.ColumnCount, (i) => {
- const comments_1 = toArray(map((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, i])), matrix.CommentKeys));
- return fromString(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [nameLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [factorTypeLabel, i]), SparseTable__TryGetValue_11FD62A8(matrix, [typeTermSourceREFLabel, i]), SparseTable__TryGetValue_11FD62A8(matrix, [typeTermAccessionNumberLabel, i]), comments_1);
- });
- }
-}
-
-export function toSparseTable(factors) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, labels, void 0, length(factors) + 1);
- let commentKeys = empty();
- iterateIndexed((i, f) => {
- const i_1 = (i + 1) | 0;
- const ft = OntologyAnnotation_toString_5E3DAF0D(defaultArg(f.FactorType, OntologyAnnotation_get_empty()), true);
- addToDict(matrix.Matrix, [nameLabel, i_1], defaultArg(f.Name, ""));
- addToDict(matrix.Matrix, [factorTypeLabel, i_1], ft.TermName);
- addToDict(matrix.Matrix, [typeTermAccessionNumberLabel, i_1], ft.TermAccessionNumber);
- addToDict(matrix.Matrix, [typeTermSourceREFLabel, i_1], ft.TermSourceREF);
- const matchValue = f.Comments;
- if (matchValue != null) {
- const array = matchValue;
- array.forEach((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, i_1], patternInput[1]);
- });
- }
- }, factors);
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function fromRows(prefix, lineNumber, rows) {
- const tupledArg = (prefix == null) ? SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber) : SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber, prefix);
- return [tupledArg[0], tupledArg[1], tupledArg[2], fromSparseTable(tupledArg[3])];
-}
-
-export function toRows(prefix, factors) {
- const m = toSparseTable(factors);
- if (prefix == null) {
- return SparseTable_ToRows_6A3D4534(m);
- }
- else {
- return SparseTable_ToRows_6A3D4534(m, prefix);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/Investigation.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/Investigation.js
deleted file mode 100644
index 756f6e8f..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/Investigation.js
+++ /dev/null
@@ -1,302 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { record_type, list_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Remark_toTuple_Z26CAFFFA, Comment$_$reflection } from "../../ISA/JsonTypes/Comment.js";
-import { head, tail, isEmpty, ofSeq, append, toArray, reverse, cons, empty, map, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { Remark_wrapRemark, Comment_toString, Comment_fromString } from "../Comment.js";
-import { SparseRowModule_writeToSheet, SparseRowModule_fromFsRow, SparseRowModule_fromValues, SparseRowModule_tryGetValueAt, SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValueDefault_5BAE6133 } from "../SparseTable.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { value as value_1, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { comparePrimitives, getEnumerator, stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { Option_fromValueWithDefault } from "../Conversions.js";
-import { ArcInvestigation } from "../../ISA/ArcTypes/ArcInvestigation.js";
-import { toRows as toRows_1, fromRows as fromRows_1 } from "./OntologySourceReference.js";
-import { toRows as toRows_2, fromRows as fromRows_2 } from "./Publication.js";
-import { toRows as toRows_3, fromRows as fromRows_3 } from "./Contacts.js";
-import { toRows as toRows_4, fromRows as fromRows_4 } from "./Study.js";
-import { iterateIndexed, head as head_1, map as map_1, toList, collect, singleton, append as append_1, delay } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-import { tryFind, ofList } from "../../../fable_modules/fable-library.4.1.4/Map.js";
-import { printf, toFail } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { FsWorksheet } from "../../../fable_modules/FsSpreadsheet.3.3.0/FsWorksheet.fs.js";
-import { FsWorkbook } from "../../../fable_modules/FsSpreadsheet.3.3.0/FsWorkbook.fs.js";
-
-export class InvestigationInfo extends Record {
- constructor(Identifier, Title, Description, SubmissionDate, PublicReleaseDate, Comments) {
- super();
- this.Identifier = Identifier;
- this.Title = Title;
- this.Description = Description;
- this.SubmissionDate = SubmissionDate;
- this.PublicReleaseDate = PublicReleaseDate;
- this.Comments = Comments;
- }
-}
-
-export function InvestigationInfo_$reflection() {
- return record_type("ARCtrl.ISA.Spreadsheet.ArcInvestigation.InvestigationInfo", [], InvestigationInfo, () => [["Identifier", string_type], ["Title", string_type], ["Description", string_type], ["SubmissionDate", string_type], ["PublicReleaseDate", string_type], ["Comments", list_type(Comment$_$reflection())]]);
-}
-
-export function InvestigationInfo_create(identifier, title, description, submissionDate, publicReleaseDate, comments) {
- return new InvestigationInfo(identifier, title, description, submissionDate, publicReleaseDate, comments);
-}
-
-export function InvestigationInfo_get_Labels() {
- return ofArray(["Investigation Identifier", "Investigation Title", "Investigation Description", "Investigation Submission Date", "Investigation Public Release Date"]);
-}
-
-export function InvestigationInfo_FromSparseTable_651559CC(matrix) {
- const comments = map((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, 0])), matrix.CommentKeys);
- return InvestigationInfo_create(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Investigation Identifier", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Investigation Title", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Investigation Description", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Investigation Submission Date", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Investigation Public Release Date", 0]), comments);
-}
-
-export function InvestigationInfo_ToSparseTable_Z4D87C88C(investigation) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, InvestigationInfo_get_Labels(), void 0, 2);
- let commentKeys = empty();
- addToDict(matrix.Matrix, ["Investigation Identifier", 1], investigation.Identifier);
- addToDict(matrix.Matrix, ["Investigation Title", 1], defaultArg(investigation.Title, ""));
- addToDict(matrix.Matrix, ["Investigation Description", 1], defaultArg(investigation.Description, ""));
- addToDict(matrix.Matrix, ["Investigation Submission Date", 1], defaultArg(investigation.SubmissionDate, ""));
- addToDict(matrix.Matrix, ["Investigation Public Release Date", 1], defaultArg(investigation.PublicReleaseDate, ""));
- if (!(investigation.Comments.length === 0)) {
- const array = investigation.Comments;
- array.forEach((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, 1], patternInput[1]);
- });
- }
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function InvestigationInfo_fromRows(lineNumber, rows) {
- const tupledArg = SparseTable_FromRows_Z5579EC29(rows, InvestigationInfo_get_Labels(), lineNumber);
- return [tupledArg[0], tupledArg[1], tupledArg[2], InvestigationInfo_FromSparseTable_651559CC(tupledArg[3])];
-}
-
-export function InvestigationInfo_toRows_Z4D87C88C(investigation) {
- return SparseTable_ToRows_6A3D4534(InvestigationInfo_ToSparseTable_Z4D87C88C(investigation));
-}
-
-export function fromParts(investigationInfo, ontologySourceReference, publications, contacts, studies, remarks) {
- const arg_1 = Option_fromValueWithDefault("", investigationInfo.Title);
- const arg_2 = Option_fromValueWithDefault("", investigationInfo.Description);
- const arg_3 = Option_fromValueWithDefault("", investigationInfo.SubmissionDate);
- const arg_4 = Option_fromValueWithDefault("", investigationInfo.PublicReleaseDate);
- const arg_5 = toArray(ontologySourceReference);
- const arg_6 = toArray(publications);
- const arg_7 = toArray(contacts);
- const arg_8 = Array.from(studies);
- const arg_9 = toArray(investigationInfo.Comments);
- const arg_10 = toArray(remarks);
- return ArcInvestigation.make(investigationInfo.Identifier, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9, arg_10);
-}
-
-export function fromRows(rows) {
- const en = getEnumerator(rows);
- const emptyInvestigationInfo = InvestigationInfo_create("", "", "", "", "", empty());
- const loop = (lastLine_mut, ontologySourceReferences_mut, investigationInfo_mut, publications_mut, contacts_mut, studies_mut, remarks_mut, lineNumber_mut) => {
- loop:
- while (true) {
- const lastLine = lastLine_mut, ontologySourceReferences = ontologySourceReferences_mut, investigationInfo = investigationInfo_mut, publications = publications_mut, contacts = contacts_mut, studies = studies_mut, remarks = remarks_mut, lineNumber = lineNumber_mut;
- let matchResult, k_5, k_6, k_7, k_8, k_9, k_10;
- if (lastLine != null) {
- switch (lastLine) {
- case "ONTOLOGY SOURCE REFERENCE": {
- matchResult = 0;
- k_5 = lastLine;
- break;
- }
- case "INVESTIGATION": {
- matchResult = 1;
- k_6 = lastLine;
- break;
- }
- case "INVESTIGATION PUBLICATIONS": {
- matchResult = 2;
- k_7 = lastLine;
- break;
- }
- case "INVESTIGATION CONTACTS": {
- matchResult = 3;
- k_8 = lastLine;
- break;
- }
- case "STUDY": {
- matchResult = 4;
- k_9 = lastLine;
- break;
- }
- default: {
- matchResult = 5;
- k_10 = lastLine;
- }
- }
- }
- else {
- matchResult = 5;
- k_10 = lastLine;
- }
- switch (matchResult) {
- case 0: {
- const patternInput = fromRows_1(lineNumber + 1, en);
- lastLine_mut = patternInput[0];
- ontologySourceReferences_mut = patternInput[3];
- investigationInfo_mut = investigationInfo;
- publications_mut = publications;
- contacts_mut = contacts;
- studies_mut = studies;
- remarks_mut = append(remarks, patternInput[2]);
- lineNumber_mut = patternInput[1];
- continue loop;
- }
- case 1: {
- const patternInput_1 = InvestigationInfo_fromRows(lineNumber + 1, en);
- lastLine_mut = patternInput_1[0];
- ontologySourceReferences_mut = ontologySourceReferences;
- investigationInfo_mut = patternInput_1[3];
- publications_mut = publications;
- contacts_mut = contacts;
- studies_mut = studies;
- remarks_mut = append(remarks, patternInput_1[2]);
- lineNumber_mut = patternInput_1[1];
- continue loop;
- }
- case 2: {
- const patternInput_2 = fromRows_2("Investigation Publication", lineNumber + 1, en);
- lastLine_mut = patternInput_2[0];
- ontologySourceReferences_mut = ontologySourceReferences;
- investigationInfo_mut = investigationInfo;
- publications_mut = patternInput_2[3];
- contacts_mut = contacts;
- studies_mut = studies;
- remarks_mut = append(remarks, patternInput_2[2]);
- lineNumber_mut = patternInput_2[1];
- continue loop;
- }
- case 3: {
- const patternInput_3 = fromRows_3("Investigation Person", lineNumber + 1, en);
- lastLine_mut = patternInput_3[0];
- ontologySourceReferences_mut = ontologySourceReferences;
- investigationInfo_mut = investigationInfo;
- publications_mut = publications;
- contacts_mut = patternInput_3[3];
- studies_mut = studies;
- remarks_mut = append(remarks, patternInput_3[2]);
- lineNumber_mut = patternInput_3[1];
- continue loop;
- }
- case 4: {
- const patternInput_4 = fromRows_4(lineNumber + 1, en);
- const study = patternInput_4[3];
- const newRemarks_4 = patternInput_4[2];
- const lineNumber_5 = patternInput_4[1] | 0;
- const currentLine_4 = patternInput_4[0];
- if (study != null) {
- lastLine_mut = currentLine_4;
- ontologySourceReferences_mut = ontologySourceReferences;
- investigationInfo_mut = investigationInfo;
- publications_mut = publications;
- contacts_mut = contacts;
- studies_mut = cons(value_1(study), studies);
- remarks_mut = append(remarks, newRemarks_4);
- lineNumber_mut = lineNumber_5;
- continue loop;
- }
- else {
- lastLine_mut = currentLine_4;
- ontologySourceReferences_mut = ontologySourceReferences;
- investigationInfo_mut = investigationInfo;
- publications_mut = publications;
- contacts_mut = contacts;
- studies_mut = studies;
- remarks_mut = append(remarks, newRemarks_4);
- lineNumber_mut = lineNumber_5;
- continue loop;
- }
- }
- default:
- return fromParts(investigationInfo, ontologySourceReferences, publications, contacts, reverse(studies), remarks);
- }
- break;
- }
- };
- if (en["System.Collections.IEnumerator.MoveNext"]()) {
- return loop(SparseRowModule_tryGetValueAt(0, en["System.Collections.Generic.IEnumerator`1.get_Current"]()), empty(), emptyInvestigationInfo, empty(), empty(), empty(), empty(), 1);
- }
- else {
- throw new Error("emptyInvestigationFile");
- }
-}
-
-export function toRows(investigation) {
- let remarks, rows;
- 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))), ofSeq(investigation.Studies))))))))))))))))))), (() => {
- try {
- const rm = ofList(map(Remark_toTuple_Z26CAFFFA, remarks), {
- Compare: comparePrimitives,
- });
- const loop = (i_mut, l_mut, nl_mut) => {
- loop:
- while (true) {
- const i = i_mut, l = l_mut, nl = nl_mut;
- const matchValue = tryFind(i, rm);
- if (matchValue == null) {
- if (!isEmpty(l)) {
- i_mut = (i + 1);
- l_mut = tail(l);
- nl_mut = cons(head(l), nl);
- continue loop;
- }
- else {
- return nl;
- }
- }
- else {
- const remark = matchValue;
- i_mut = (i + 1);
- l_mut = l;
- nl_mut = cons(SparseRowModule_fromValues([Remark_wrapRemark(remark)]), nl);
- continue loop;
- }
- break;
- }
- };
- return reverse(loop(1, ofSeq(rows), empty()));
- }
- catch (matchValue_1) {
- return toList(rows);
- }
- })()));
-}
-
-export function fromFsWorkbook(doc) {
- let arg;
- try {
- return fromRows(map_1(SparseRowModule_fromFsRow, (arg = head_1(doc.GetWorksheets()), FsWorksheet.getRows(arg))));
- }
- catch (err) {
- const arg_1 = err.message;
- return toFail(printf("Could not read investigation from spreadsheet: %s"))(arg_1);
- }
-}
-
-export function toFsWorkbook(investigation) {
- try {
- const wb = new FsWorkbook();
- const sheet = new FsWorksheet("Investigation");
- iterateIndexed((rowI, r) => {
- SparseRowModule_writeToSheet(rowI + 1, r, sheet);
- }, toRows(investigation));
- wb.AddWorksheet(sheet);
- return wb;
- }
- catch (err) {
- const arg = err.message;
- return toFail(printf("Could not write investigation to spreadsheet: %s"))(arg);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/OntologySourceReference.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/OntologySourceReference.js
deleted file mode 100644
index 044dc812..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/OntologySourceReference.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import { reverse, cons, iterate, iterateIndexed, map, initialize, singleton, length, empty, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologySourceReference_create_5CD5B036, OntologySourceReference_make } from "../../ISA/JsonTypes/OntologySourceReference.js";
-import { Option_fromValueWithDefault } from "../Conversions.js";
-import { SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValueDefault_5BAE6133, SparseTable_GetEmptyComments_651559CC } from "../SparseTable.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export const nameLabel = "Term Source Name";
-
-export const fileLabel = "Term Source File";
-
-export const versionLabel = "Term Source Version";
-
-export const descriptionLabel = "Term Source Description";
-
-export const labels = ofArray([nameLabel, fileLabel, versionLabel, descriptionLabel]);
-
-export function fromString(description, file, name, version, comments) {
- return OntologySourceReference_make(Option_fromValueWithDefault("", description), Option_fromValueWithDefault("", file), Option_fromValueWithDefault("", name), Option_fromValueWithDefault("", version), Option_fromValueWithDefault(empty(), comments));
-}
-
-export function fromSparseTable(matrix) {
- if ((matrix.ColumnCount === 0) && (length(matrix.CommentKeys) !== 0)) {
- return singleton(OntologySourceReference_create_5CD5B036(void 0, void 0, void 0, void 0, ofArray(SparseTable_GetEmptyComments_651559CC(matrix))));
- }
- else {
- return initialize(matrix.ColumnCount, (i) => {
- const comments_1 = map((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, i])), matrix.CommentKeys);
- return fromString(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [descriptionLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [fileLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [nameLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [versionLabel, i]), comments_1);
- });
- }
-}
-
-export function toSparseTable(ontologySources) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, labels, void 0, length(ontologySources) + 1);
- let commentKeys = empty();
- iterateIndexed((i, o) => {
- const i_1 = (i + 1) | 0;
- addToDict(matrix.Matrix, [nameLabel, i_1], defaultArg(o.Name, ""));
- addToDict(matrix.Matrix, [fileLabel, i_1], defaultArg(o.File, ""));
- addToDict(matrix.Matrix, [versionLabel, i_1], defaultArg(o.Version, ""));
- addToDict(matrix.Matrix, [descriptionLabel, i_1], defaultArg(o.Description, ""));
- const matchValue = o.Comments;
- if (matchValue != null) {
- iterate((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, i_1], patternInput[1]);
- }, matchValue);
- }
- }, ontologySources);
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function fromRows(lineNumber, rows) {
- const tupledArg = SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber);
- return [tupledArg[0], tupledArg[1], tupledArg[2], fromSparseTable(tupledArg[3])];
-}
-
-export function toRows(termSources) {
- return SparseTable_ToRows_6A3D4534(toSparseTable(termSources));
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/Protocols.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/Protocols.js
deleted file mode 100644
index 481fa65b..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/Protocols.js
+++ /dev/null
@@ -1,114 +0,0 @@
-import { reverse, cons, iterate, iterateIndexed, map as map_1, initialize, singleton, length, empty, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147 } from "../../ISA/JsonTypes/OntologyAnnotation.js";
-import { Component_toAggregatedStrings, ProtocolParameter_toAggregatedStrings, Option_fromValueWithDefault, Component_fromAggregatedStrings, ProtocolParameter_fromAggregatedStrings } from "../Conversions.js";
-import { Protocol_create_Z7DFD6E67, Protocol_make } from "../../ISA/JsonTypes/Protocol.js";
-import { defaultArg, map } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { URIModule_fromString } from "../../ISA/JsonTypes/URI.js";
-import { SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValue_11FD62A8, SparseTable__TryGetValueDefault_5BAE6133, SparseTable_GetEmptyComments_651559CC } from "../SparseTable.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export const nameLabel = "Name";
-
-export const protocolTypeLabel = "Type";
-
-export const typeTermAccessionNumberLabel = "Type Term Accession Number";
-
-export const typeTermSourceREFLabel = "Type Term Source REF";
-
-export const descriptionLabel = "Description";
-
-export const uriLabel = "URI";
-
-export const versionLabel = "Version";
-
-export const parametersNameLabel = "Parameters Name";
-
-export const parametersTermAccessionNumberLabel = "Parameters Term Accession Number";
-
-export const parametersTermSourceREFLabel = "Parameters Term Source REF";
-
-export const componentsNameLabel = "Components Name";
-
-export const componentsTypeLabel = "Components Type";
-
-export const componentsTypeTermAccessionNumberLabel = "Components Type Term Accession Number";
-
-export const componentsTypeTermSourceREFLabel = "Components Type Term Source REF";
-
-export const labels = ofArray([nameLabel, protocolTypeLabel, typeTermAccessionNumberLabel, typeTermSourceREFLabel, descriptionLabel, uriLabel, versionLabel, parametersNameLabel, parametersTermAccessionNumberLabel, parametersTermSourceREFLabel, componentsNameLabel, componentsTypeLabel, componentsTypeTermAccessionNumberLabel, componentsTypeTermSourceREFLabel]);
-
-export function fromString(name, protocolType, typeTermAccessionNumber, typeTermSourceREF, description, uri, version, parametersName, parametersTermAccessionNumber, parametersTermSourceREF, componentsName, componentsType, componentsTypeTermAccessionNumber, componentsTypeTermSourceREF, comments) {
- const protocolType_1 = OntologyAnnotation_fromString_2EB0E147(protocolType, typeTermSourceREF, typeTermAccessionNumber);
- const parameters = ofArray(ProtocolParameter_fromAggregatedStrings(";", parametersName, parametersTermSourceREF, parametersTermAccessionNumber));
- const components = Component_fromAggregatedStrings(";", componentsName, componentsType, componentsTypeTermSourceREF, componentsTypeTermAccessionNumber);
- return Protocol_make(void 0, map(URIModule_fromString, Option_fromValueWithDefault("", name)), Option_fromValueWithDefault(OntologyAnnotation_get_empty(), protocolType_1), Option_fromValueWithDefault("", description), map(URIModule_fromString, Option_fromValueWithDefault("", uri)), Option_fromValueWithDefault("", version), Option_fromValueWithDefault(empty(), parameters), Option_fromValueWithDefault(empty(), components), Option_fromValueWithDefault(empty(), comments));
-}
-
-export function fromSparseTable(matrix) {
- if ((matrix.ColumnCount === 0) && (length(matrix.CommentKeys) !== 0)) {
- return singleton(Protocol_create_Z7DFD6E67(void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, ofArray(SparseTable_GetEmptyComments_651559CC(matrix))));
- }
- else {
- return initialize(matrix.ColumnCount, (i) => {
- const comments_1 = map_1((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, i])), matrix.CommentKeys);
- return fromString(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [nameLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [protocolTypeLabel, i]), SparseTable__TryGetValue_11FD62A8(matrix, [typeTermAccessionNumberLabel, i]), SparseTable__TryGetValue_11FD62A8(matrix, [typeTermSourceREFLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [descriptionLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [uriLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [versionLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [parametersNameLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [parametersTermAccessionNumberLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [parametersTermSourceREFLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [componentsNameLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [componentsTypeLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [componentsTypeTermAccessionNumberLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [componentsTypeTermSourceREFLabel, i]), comments_1);
- });
- }
-}
-
-export function toSparseTable(protocols) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, labels, void 0, length(protocols) + 1);
- let commentKeys = empty();
- iterateIndexed((i, p) => {
- const i_1 = (i + 1) | 0;
- const pt_1 = OntologyAnnotation_toString_5E3DAF0D(defaultArg(p.ProtocolType, OntologyAnnotation_get_empty()), true);
- const pAgg = ProtocolParameter_toAggregatedStrings(";", defaultArg(p.Parameters, empty()));
- const cAgg = Component_toAggregatedStrings(";", defaultArg(p.Components, empty()));
- addToDict(matrix.Matrix, [nameLabel, i_1], defaultArg(p.Name, ""));
- addToDict(matrix.Matrix, [protocolTypeLabel, i_1], pt_1.TermName);
- addToDict(matrix.Matrix, [typeTermAccessionNumberLabel, i_1], pt_1.TermAccessionNumber);
- addToDict(matrix.Matrix, [typeTermSourceREFLabel, i_1], pt_1.TermSourceREF);
- addToDict(matrix.Matrix, [descriptionLabel, i_1], defaultArg(p.Description, ""));
- addToDict(matrix.Matrix, [uriLabel, i_1], defaultArg(p.Uri, ""));
- addToDict(matrix.Matrix, [versionLabel, i_1], defaultArg(p.Version, ""));
- addToDict(matrix.Matrix, [parametersNameLabel, i_1], pAgg.TermNameAgg);
- addToDict(matrix.Matrix, [parametersTermAccessionNumberLabel, i_1], pAgg.TermAccessionNumberAgg);
- addToDict(matrix.Matrix, [parametersTermSourceREFLabel, i_1], pAgg.TermSourceREFAgg);
- addToDict(matrix.Matrix, [componentsNameLabel, i_1], cAgg.NameAgg);
- addToDict(matrix.Matrix, [componentsTypeLabel, i_1], cAgg.TermNameAgg);
- addToDict(matrix.Matrix, [componentsTypeTermAccessionNumberLabel, i_1], cAgg.TermAccessionNumberAgg);
- addToDict(matrix.Matrix, [componentsTypeTermSourceREFLabel, i_1], cAgg.TermSourceREFAgg);
- const matchValue = p.Comments;
- if (matchValue != null) {
- iterate((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, i_1], patternInput[1]);
- }, matchValue);
- }
- }, protocols);
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function fromRows(prefix, lineNumber, rows) {
- const tupledArg = (prefix == null) ? SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber) : SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber, prefix);
- return [tupledArg[0], tupledArg[1], tupledArg[2], fromSparseTable(tupledArg[3])];
-}
-
-export function toRows(prefix, protocols) {
- const m = toSparseTable(protocols);
- if (prefix == null) {
- return SparseTable_ToRows_6A3D4534(m);
- }
- else {
- return SparseTable_ToRows_6A3D4534(m, prefix);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/Publication.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/Publication.js
deleted file mode 100644
index 7e7cf897..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/Publication.js
+++ /dev/null
@@ -1,90 +0,0 @@
-import { reverse, cons, iterateIndexed, empty, map as map_1, toArray, initialize, singleton, length, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147 } from "../../ISA/JsonTypes/OntologyAnnotation.js";
-import { Publication_create_496BCAB8, Publication_make } from "../../ISA/JsonTypes/Publication.js";
-import { defaultArg, map } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { URIModule_fromString } from "../../ISA/JsonTypes/URI.js";
-import { Option_fromValueWithDefault } from "../Conversions.js";
-import { SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValue_11FD62A8, SparseTable__TryGetValueDefault_5BAE6133, SparseTable_GetEmptyComments_651559CC } from "../SparseTable.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export const pubMedIDLabel = "PubMed ID";
-
-export const doiLabel = "DOI";
-
-export const authorListLabel = "Author List";
-
-export const titleLabel = "Title";
-
-export const statusLabel = "Status";
-
-export const statusTermAccessionNumberLabel = "Status Term Accession Number";
-
-export const statusTermSourceREFLabel = "Status Term Source REF";
-
-export const labels = ofArray([pubMedIDLabel, doiLabel, authorListLabel, titleLabel, statusLabel, statusTermAccessionNumberLabel, statusTermSourceREFLabel]);
-
-export function fromString(pubMedID, doi, author, title, status, statusTermSourceREF, statusTermAccessionNumber, comments) {
- const status_1 = OntologyAnnotation_fromString_2EB0E147(status, statusTermSourceREF, statusTermAccessionNumber);
- return Publication_make(map(URIModule_fromString, Option_fromValueWithDefault("", pubMedID)), Option_fromValueWithDefault("", doi), Option_fromValueWithDefault("", author), Option_fromValueWithDefault("", title), Option_fromValueWithDefault(OntologyAnnotation_get_empty(), status_1), Option_fromValueWithDefault([], comments));
-}
-
-export function fromSparseTable(matrix) {
- if ((matrix.ColumnCount === 0) && (length(matrix.CommentKeys) !== 0)) {
- return singleton(Publication_create_496BCAB8(void 0, void 0, void 0, void 0, void 0, SparseTable_GetEmptyComments_651559CC(matrix)));
- }
- else {
- return initialize(matrix.ColumnCount, (i) => {
- const comments_1 = toArray(map_1((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, i])), matrix.CommentKeys));
- return fromString(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [pubMedIDLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [doiLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [authorListLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [titleLabel, i]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [statusLabel, i]), SparseTable__TryGetValue_11FD62A8(matrix, [statusTermSourceREFLabel, i]), SparseTable__TryGetValue_11FD62A8(matrix, [statusTermAccessionNumberLabel, i]), comments_1);
- });
- }
-}
-
-export function toSparseTable(publications) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, labels, void 0, length(publications) + 1);
- let commentKeys = empty();
- iterateIndexed((i, p) => {
- const i_1 = (i + 1) | 0;
- const s_1 = OntologyAnnotation_toString_5E3DAF0D(defaultArg(p.Status, OntologyAnnotation_get_empty()), true);
- addToDict(matrix.Matrix, [pubMedIDLabel, i_1], defaultArg(p.PubMedID, ""));
- addToDict(matrix.Matrix, [doiLabel, i_1], defaultArg(p.DOI, ""));
- addToDict(matrix.Matrix, [authorListLabel, i_1], defaultArg(p.Authors, ""));
- addToDict(matrix.Matrix, [titleLabel, i_1], defaultArg(p.Title, ""));
- addToDict(matrix.Matrix, [statusLabel, i_1], s_1.TermName);
- addToDict(matrix.Matrix, [statusTermAccessionNumberLabel, i_1], s_1.TermAccessionNumber);
- addToDict(matrix.Matrix, [statusTermSourceREFLabel, i_1], s_1.TermSourceREF);
- const matchValue = p.Comments;
- if (matchValue != null) {
- const array = matchValue;
- array.forEach((comment) => {
- const patternInput = Comment_toString(comment);
- const n = patternInput[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, i_1], patternInput[1]);
- });
- }
- }, publications);
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function fromRows(prefix, lineNumber, rows) {
- const tupledArg = (prefix == null) ? SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber) : SparseTable_FromRows_Z5579EC29(rows, labels, lineNumber, prefix);
- return [tupledArg[0], tupledArg[1], tupledArg[2], fromSparseTable(tupledArg[3])];
-}
-
-export function toRows(prefix, publications) {
- const m = toSparseTable(publications);
- if (prefix == null) {
- return SparseTable_ToRows_6A3D4534(m);
- }
- else {
- return SparseTable_ToRows_6A3D4534(m, prefix);
- }
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/InvestigationFile/Study.js b/js/ISA/ISA.Spreadsheet/InvestigationFile/Study.js
deleted file mode 100644
index 4ce74f93..00000000
--- a/js/ISA/ISA.Spreadsheet/InvestigationFile/Study.js
+++ /dev/null
@@ -1,258 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { record_type, list_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Comment$_$reflection } from "../../ISA/JsonTypes/Comment.js";
-import { ofSeq, append, toArray, reverse, cons, empty, map, ofArray } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { Comment_toString, Comment_fromString } from "../Comment.js";
-import { SparseRowModule_fromValues, SparseTable_ToRows_6A3D4534, SparseTable_FromRows_Z5579EC29, SparseTable, SparseTable_Create_Z2192E64B, SparseTable__TryGetValueDefault_5BAE6133 } from "../SparseTable.js";
-import { Study_fileNameFromIdentifier } from "../../ISA/ArcTypes/Identifier.js";
-import { addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { Option_fromValueWithDefault } from "../Conversions.js";
-import { ArcTable } from "../../ISA/ArcTypes/ArcTable.js";
-import { ArcStudy } from "../../ISA/ArcTypes/ArcStudy.js";
-import { toRows as toRows_1, fromRows as fromRows_1 } from "./DesignDescriptors.js";
-import { toRows as toRows_2, fromRows as fromRows_2 } from "./Publication.js";
-import { toRows as toRows_3, fromRows as fromRows_3 } from "./Factors.js";
-import { toRows as toRows_4, fromRows as fromRows_4 } from "./Assays.js";
-import { toRows as toRows_5, fromRows as fromRows_5 } from "./Protocols.js";
-import { toRows as toRows_6, fromRows as fromRows_6 } from "./Contacts.js";
-import { singleton, append as append_1, delay, collect } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-
-export class StudyInfo extends Record {
- constructor(Identifier, Title, Description, SubmissionDate, PublicReleaseDate, FileName, Comments) {
- super();
- this.Identifier = Identifier;
- this.Title = Title;
- this.Description = Description;
- this.SubmissionDate = SubmissionDate;
- this.PublicReleaseDate = PublicReleaseDate;
- this.FileName = FileName;
- this.Comments = Comments;
- }
-}
-
-export function StudyInfo_$reflection() {
- return record_type("ARCtrl.ISA.Spreadsheet.Studies.StudyInfo", [], StudyInfo, () => [["Identifier", string_type], ["Title", string_type], ["Description", string_type], ["SubmissionDate", string_type], ["PublicReleaseDate", string_type], ["FileName", string_type], ["Comments", list_type(Comment$_$reflection())]]);
-}
-
-export function StudyInfo_create(identifier, title, description, submissionDate, publicReleaseDate, fileName, comments) {
- return new StudyInfo(identifier, title, description, submissionDate, publicReleaseDate, fileName, comments);
-}
-
-export function StudyInfo_get_Labels() {
- return ofArray(["Study Identifier", "Study Title", "Study Description", "Study Submission Date", "Study Public Release Date", "Study File Name"]);
-}
-
-export function StudyInfo_FromSparseTable_651559CC(matrix) {
- const comments = map((k) => Comment_fromString(k, SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [k, 0])), matrix.CommentKeys);
- return StudyInfo_create(SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Study Identifier", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Study Title", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Study Description", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Study Submission Date", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Study Public Release Date", 0]), SparseTable__TryGetValueDefault_5BAE6133(matrix, "", ["Study File Name", 0]), comments);
-}
-
-export function StudyInfo_ToSparseTable_1B3D5E9B(study) {
- const matrix = SparseTable_Create_Z2192E64B(void 0, StudyInfo_get_Labels(), void 0, 2);
- let commentKeys = empty();
- const patternInput = (study.Identifier.indexOf("MISSING_IDENTIFIER_") === 0) ? ["", ""] : [study.Identifier, Study_fileNameFromIdentifier(study.Identifier)];
- addToDict(matrix.Matrix, ["Study Identifier", 1], patternInput[0]);
- addToDict(matrix.Matrix, ["Study Title", 1], defaultArg(study.Title, ""));
- addToDict(matrix.Matrix, ["Study Description", 1], defaultArg(study.Description, ""));
- addToDict(matrix.Matrix, ["Study Submission Date", 1], defaultArg(study.SubmissionDate, ""));
- addToDict(matrix.Matrix, ["Study Public Release Date", 1], defaultArg(study.PublicReleaseDate, ""));
- addToDict(matrix.Matrix, ["Study File Name", 1], patternInput[1]);
- if (!(study.Comments.length === 0)) {
- const array = study.Comments;
- array.forEach((comment) => {
- const patternInput_1 = Comment_toString(comment);
- const n = patternInput_1[0];
- commentKeys = cons(n, commentKeys);
- addToDict(matrix.Matrix, [n, 1], patternInput_1[1]);
- });
- }
- return new SparseTable(matrix.Matrix, matrix.Keys, reverse(List_distinct(commentKeys, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })), matrix.ColumnCount);
-}
-
-export function StudyInfo_fromRows(lineNumber, rows) {
- const tupledArg = SparseTable_FromRows_Z5579EC29(rows, StudyInfo_get_Labels(), lineNumber);
- return [tupledArg[0], tupledArg[1], tupledArg[2], StudyInfo_FromSparseTable_651559CC(tupledArg[3])];
-}
-
-export function StudyInfo_toRows_1B3D5E9B(study) {
- return SparseTable_ToRows_6A3D4534(StudyInfo_ToSparseTable_1B3D5E9B(study));
-}
-
-export function fromParts(studyInfo, designDescriptors, publications, factors, assays, protocols, contacts) {
- let arcstudy;
- const arg_1 = Option_fromValueWithDefault("", studyInfo.Title);
- const arg_2 = Option_fromValueWithDefault("", studyInfo.Description);
- const arg_3 = Option_fromValueWithDefault("", studyInfo.SubmissionDate);
- const arg_4 = Option_fromValueWithDefault("", studyInfo.PublicReleaseDate);
- const arg_5 = toArray(publications);
- const arg_6 = toArray(contacts);
- const arg_7 = toArray(designDescriptors);
- let arg_8;
- const arg_13 = map((arg_12) => ArcTable.fromProtocol(arg_12), protocols);
- arg_8 = Array.from(arg_13);
- const arg_9 = Array.from(assays);
- const arg_10 = toArray(factors);
- const arg_11 = toArray(studyInfo.Comments);
- arcstudy = ArcStudy.make(studyInfo.Identifier, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9, arg_10, arg_11);
- if (arcstudy.isEmpty && (arcstudy.Identifier === "")) {
- return void 0;
- }
- else {
- return arcstudy;
- }
-}
-
-export function fromRows(lineNumber, en) {
- const loop = (lastLine_mut, studyInfo_mut, designDescriptors_mut, publications_mut, factors_mut, assays_mut, protocols_mut, contacts_mut, remarks_mut, lineNumber_1_mut) => {
- loop:
- while (true) {
- const lastLine = lastLine_mut, studyInfo = studyInfo_mut, designDescriptors = designDescriptors_mut, publications = publications_mut, factors = factors_mut, assays = assays_mut, protocols = protocols_mut, contacts = contacts_mut, remarks = remarks_mut, lineNumber_1 = lineNumber_1_mut;
- let matchResult, k_6, k_7, k_8, k_9, k_10, k_11, k_12;
- if (lastLine != null) {
- switch (lastLine) {
- case "STUDY DESIGN DESCRIPTORS": {
- matchResult = 0;
- k_6 = lastLine;
- break;
- }
- case "STUDY PUBLICATIONS": {
- matchResult = 1;
- k_7 = lastLine;
- break;
- }
- case "STUDY FACTORS": {
- matchResult = 2;
- k_8 = lastLine;
- break;
- }
- case "STUDY ASSAYS": {
- matchResult = 3;
- k_9 = lastLine;
- break;
- }
- case "STUDY PROTOCOLS": {
- matchResult = 4;
- k_10 = lastLine;
- break;
- }
- case "STUDY CONTACTS": {
- matchResult = 5;
- k_11 = lastLine;
- break;
- }
- default: {
- matchResult = 6;
- k_12 = lastLine;
- }
- }
- }
- else {
- matchResult = 6;
- k_12 = lastLine;
- }
- switch (matchResult) {
- case 0: {
- const patternInput = fromRows_1("Study Design", lineNumber_1 + 1, en);
- lastLine_mut = patternInput[0];
- studyInfo_mut = studyInfo;
- designDescriptors_mut = patternInput[3];
- publications_mut = publications;
- factors_mut = factors;
- assays_mut = assays;
- protocols_mut = protocols;
- contacts_mut = contacts;
- remarks_mut = append(remarks, patternInput[2]);
- lineNumber_1_mut = patternInput[1];
- continue loop;
- }
- case 1: {
- const patternInput_1 = fromRows_2("Study Publication", lineNumber_1 + 1, en);
- lastLine_mut = patternInput_1[0];
- studyInfo_mut = studyInfo;
- designDescriptors_mut = designDescriptors;
- publications_mut = patternInput_1[3];
- factors_mut = factors;
- assays_mut = assays;
- protocols_mut = protocols;
- contacts_mut = contacts;
- remarks_mut = append(remarks, patternInput_1[2]);
- lineNumber_1_mut = patternInput_1[1];
- continue loop;
- }
- case 2: {
- const patternInput_2 = fromRows_3("Study Factor", lineNumber_1 + 1, en);
- lastLine_mut = patternInput_2[0];
- studyInfo_mut = studyInfo;
- designDescriptors_mut = designDescriptors;
- publications_mut = publications;
- factors_mut = patternInput_2[3];
- assays_mut = assays;
- protocols_mut = protocols;
- contacts_mut = contacts;
- remarks_mut = append(remarks, patternInput_2[2]);
- lineNumber_1_mut = patternInput_2[1];
- continue loop;
- }
- case 3: {
- const patternInput_3 = fromRows_4("Study Assay", lineNumber_1 + 1, en);
- lastLine_mut = patternInput_3[0];
- studyInfo_mut = studyInfo;
- designDescriptors_mut = designDescriptors;
- publications_mut = publications;
- factors_mut = factors;
- assays_mut = patternInput_3[3];
- protocols_mut = protocols;
- contacts_mut = contacts;
- remarks_mut = append(remarks, patternInput_3[2]);
- lineNumber_1_mut = patternInput_3[1];
- continue loop;
- }
- case 4: {
- const patternInput_4 = fromRows_5("Study Protocol", lineNumber_1 + 1, en);
- lastLine_mut = patternInput_4[0];
- studyInfo_mut = studyInfo;
- designDescriptors_mut = designDescriptors;
- publications_mut = publications;
- factors_mut = factors;
- assays_mut = assays;
- protocols_mut = patternInput_4[3];
- contacts_mut = contacts;
- remarks_mut = append(remarks, patternInput_4[2]);
- lineNumber_1_mut = patternInput_4[1];
- continue loop;
- }
- case 5: {
- const patternInput_5 = fromRows_6("Study Person", lineNumber_1 + 1, en);
- lastLine_mut = patternInput_5[0];
- studyInfo_mut = studyInfo;
- designDescriptors_mut = designDescriptors;
- publications_mut = publications;
- factors_mut = factors;
- assays_mut = assays;
- protocols_mut = protocols;
- contacts_mut = patternInput_5[3];
- remarks_mut = append(remarks, patternInput_5[2]);
- lineNumber_1_mut = patternInput_5[1];
- continue loop;
- }
- default:
- return [k_12, lineNumber_1, remarks, fromParts(studyInfo, designDescriptors, publications, factors, assays, protocols, contacts)];
- }
- break;
- }
- };
- const patternInput_6 = StudyInfo_fromRows(lineNumber, en);
- return loop(patternInput_6[0], patternInput_6[3], empty(), empty(), empty(), empty(), empty(), empty(), patternInput_6[2], patternInput_6[1]);
-}
-
-export function toRows(study) {
- const protocols = ofSeq(collect((p) => p.GetProtocols(), study.Tables));
- return delay(() => append_1(StudyInfo_toRows_1B3D5E9B(study), delay(() => append_1(singleton(SparseRowModule_fromValues(["STUDY DESIGN DESCRIPTORS"])), delay(() => append_1(toRows_1("Study Design", ofArray(study.StudyDesignDescriptors)), delay(() => append_1(singleton(SparseRowModule_fromValues(["STUDY PUBLICATIONS"])), delay(() => append_1(toRows_2("Study Publication", ofArray(study.Publications)), delay(() => append_1(singleton(SparseRowModule_fromValues(["STUDY FACTORS"])), delay(() => append_1(toRows_3("Study Factor", ofArray(study.Factors)), delay(() => append_1(singleton(SparseRowModule_fromValues(["STUDY ASSAYS"])), delay(() => append_1(toRows_4("Study Assay", ofSeq(study.Assays)), delay(() => append_1(singleton(SparseRowModule_fromValues(["STUDY PROTOCOLS"])), delay(() => append_1(toRows_5("Study Protocol", protocols), delay(() => append_1(singleton(SparseRowModule_fromValues(["STUDY CONTACTS"])), delay(() => toRows_6("Study Person", ofArray(study.Contacts)))))))))))))))))))))))))));
-}
-
diff --git a/js/ISA/ISA.Spreadsheet/SparseTable.js b/js/ISA/ISA.Spreadsheet/SparseTable.js
deleted file mode 100644
index 5b0e8610..00000000
--- a/js/ISA/ISA.Spreadsheet/SparseTable.js
+++ /dev/null
@@ -1,441 +0,0 @@
-import { append as append_1, delay, tryItem, length as length_1, isEmpty, iterate, fold, tryPick, maxBy, initialize, choose, map, indexed } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { defaultArg, map as map_1 } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { tryFind, ofSeq } from "../../fable_modules/fable-library.4.1.4/Map.js";
-import { arrayHash, equalArrays, equals, comparePrimitives } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { RowBuilder_get_Empty, RowBuilder__Combine_19F30600, RowBuilder_$ctor } from "../../fable_modules/FsSpreadsheet.3.3.0/DSL/RowBuilder.fs.js";
-import { CellBuilder_$ctor, CellBuilder__AsCellElement_825BA8D } from "../../fable_modules/FsSpreadsheet.3.3.0/DSL/CellBuilder.fs.js";
-import { Messages_format, SheetEntity$1_some_2B595 } from "../../fable_modules/FsSpreadsheet.3.3.0/DSL/Types.fs.js";
-import { DataType } from "../../fable_modules/FsSpreadsheet.3.3.0/Cells/FsCell.fs.js";
-import { map as map_2, toArray, initialize as initialize_1, exists, find, cons, append, empty, singleton } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { ColumnIndex, RowElement } from "../../fable_modules/FsSpreadsheet.3.3.0/DSL/Types.fs.js";
-import { Record } from "../../fable_modules/fable-library.4.1.4/Types.js";
-import { record_type, list_type, class_type, tuple_type, int32_type, string_type } from "../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Seq_trySkip, Dictionary_tryGetValue } from "./CollectionAux.js";
-import { addToDict, getItemFromDict } from "../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { Dictionary } from "../../fable_modules/fable-library.4.1.4/MutableMap.js";
-import { printf, toFail } from "../../fable_modules/fable-library.4.1.4/String.js";
-import { Comment_create_250E0578, Remark_make } from "../ISA/JsonTypes/Comment.js";
-import { Comment_wrapCommentKey, Comment_$007CComment$007C_$007C, Remark_$007CRemark$007C_$007C } from "./Comment.js";
-
-export function SparseRowModule_fromValues(v) {
- return indexed(v);
-}
-
-export function SparseRowModule_getValues(i) {
- return map((tuple) => tuple[1], i);
-}
-
-export function SparseRowModule_fromAllValues(v) {
- return choose((tupledArg) => map_1((v_1) => [tupledArg[0], v_1], tupledArg[1]), indexed(v));
-}
-
-export function SparseRowModule_getAllValues(i) {
- const m = ofSeq(i, {
- Compare: comparePrimitives,
- });
- return initialize(maxBy((tuple) => tuple[0], i, {
- Compare: comparePrimitives,
- })[0] + 1, (i_1) => tryFind(i_1, m));
-}
-
-export function SparseRowModule_fromFsRow(r) {
- return map((c) => [c.ColumnNumber - 1, c.Value], r.Cells);
-}
-
-export function SparseRowModule_tryGetValueAt(i, vs) {
- return tryPick((tupledArg) => {
- if (tupledArg[0] === i) {
- return tupledArg[1];
- }
- else {
- return void 0;
- }
- }, vs);
-}
-
-export function SparseRowModule_toDSLRow(vs) {
- const builder$0040 = RowBuilder_$ctor();
- let this$_9;
- const arg = map((_arg) => {
- const v = _arg;
- if (v == null) {
- let c_1;
- const this$_5 = CellBuilder__AsCellElement_825BA8D(CellBuilder_$ctor(), SheetEntity$1_some_2B595(singleton([new DataType(0, []), ""])));
- let matchResult, errs_1, f_1, ms_2_1;
- switch (this$_5.tag) {
- case 1: {
- if (equals(this$_5.fields[0], empty())) {
- matchResult = 1;
- ms_2_1 = this$_5.fields[0];
- }
- else {
- matchResult = 2;
- }
- break;
- }
- case 2: {
- if (equals(this$_5.fields[0], empty())) {
- matchResult = 1;
- ms_2_1 = this$_5.fields[0];
- }
- else {
- matchResult = 2;
- }
- break;
- }
- default: {
- matchResult = 0;
- errs_1 = this$_5.fields[1];
- f_1 = this$_5.fields[0];
- }
- }
- switch (matchResult) {
- case 0: {
- c_1 = f_1;
- break;
- }
- case 1: {
- throw new Error("SheetEntity does not contain Value.");
- break;
- }
- default: {
- let matchResult_1, ms_3_1;
- switch (this$_5.tag) {
- case 1: {
- matchResult_1 = 0;
- ms_3_1 = this$_5.fields[0];
- break;
- }
- case 2: {
- matchResult_1 = 0;
- ms_3_1 = this$_5.fields[0];
- break;
- }
- default:
- matchResult_1 = 1;
- }
- switch (matchResult_1) {
- case 0: {
- throw new Error(`SheetEntity does not contain Value:
- ${Messages_format(ms_3_1)}`);
- break;
- }
- default:
- throw new Error("Match failure: FsSpreadsheet.DSL.SheetEntity`1");
- }
- }
- }
- return SheetEntity$1_some_2B595(singleton((c_1[1] == null) ? (new RowElement(1, [c_1[0]])) : (new RowElement(0, [new ColumnIndex(c_1[1]), c_1[0]]))));
- }
- else {
- const v_1 = v;
- let c;
- const this$_2 = CellBuilder__AsCellElement_825BA8D(CellBuilder_$ctor(), SheetEntity$1_some_2B595(singleton([new DataType(0, []), v_1])));
- let matchResult_2, errs, f, ms_2;
- switch (this$_2.tag) {
- case 1: {
- if (equals(this$_2.fields[0], empty())) {
- matchResult_2 = 1;
- ms_2 = this$_2.fields[0];
- }
- else {
- matchResult_2 = 2;
- }
- break;
- }
- case 2: {
- if (equals(this$_2.fields[0], empty())) {
- matchResult_2 = 1;
- ms_2 = this$_2.fields[0];
- }
- else {
- matchResult_2 = 2;
- }
- break;
- }
- default: {
- matchResult_2 = 0;
- errs = this$_2.fields[1];
- f = this$_2.fields[0];
- }
- }
- switch (matchResult_2) {
- case 0: {
- c = f;
- break;
- }
- case 1: {
- throw new Error("SheetEntity does not contain Value.");
- break;
- }
- default: {
- let matchResult_3, ms_3;
- switch (this$_2.tag) {
- case 1: {
- matchResult_3 = 0;
- ms_3 = this$_2.fields[0];
- break;
- }
- case 2: {
- matchResult_3 = 0;
- ms_3 = this$_2.fields[0];
- break;
- }
- default:
- matchResult_3 = 1;
- }
- switch (matchResult_3) {
- case 0: {
- throw new Error(`SheetEntity does not contain Value:
- ${Messages_format(ms_3)}`);
- break;
- }
- default:
- throw new Error("Match failure: FsSpreadsheet.DSL.SheetEntity`1");
- }
- }
- }
- return SheetEntity$1_some_2B595(singleton((c[1] == null) ? (new RowElement(1, [c[0]])) : (new RowElement(0, [new ColumnIndex(c[1]), c[0]]))));
- }
- }, SparseRowModule_getAllValues(vs));
- this$_9 = fold((state, we) => RowBuilder__Combine_19F30600(builder$0040, state, we), RowBuilder_get_Empty(), arg);
- let matchResult_4, errs_2, f_3, ms_2_2;
- switch (this$_9.tag) {
- case 1: {
- if (equals(this$_9.fields[0], empty())) {
- matchResult_4 = 1;
- ms_2_2 = this$_9.fields[0];
- }
- else {
- matchResult_4 = 2;
- }
- break;
- }
- case 2: {
- if (equals(this$_9.fields[0], empty())) {
- matchResult_4 = 1;
- ms_2_2 = this$_9.fields[0];
- }
- else {
- matchResult_4 = 2;
- }
- break;
- }
- default: {
- matchResult_4 = 0;
- errs_2 = this$_9.fields[1];
- f_3 = this$_9.fields[0];
- }
- }
- switch (matchResult_4) {
- case 0:
- return f_3;
- case 1:
- throw new Error("SheetEntity does not contain Value.");
- default: {
- let matchResult_5, ms_3_2;
- switch (this$_9.tag) {
- case 1: {
- matchResult_5 = 0;
- ms_3_2 = this$_9.fields[0];
- break;
- }
- case 2: {
- matchResult_5 = 0;
- ms_3_2 = this$_9.fields[0];
- break;
- }
- default:
- matchResult_5 = 1;
- }
- switch (matchResult_5) {
- case 0:
- throw new Error(`SheetEntity does not contain Value:
- ${Messages_format(ms_3_2)}`);
- default:
- throw new Error("Match failure: FsSpreadsheet.DSL.SheetEntity`1");
- }
- }
- }
-}
-
-export function SparseRowModule_readFromSheet(sheet) {
- return map(SparseRowModule_fromFsRow, sheet.Rows);
-}
-
-export function SparseRowModule_writeToSheet(rowI, row, sheet) {
- const fsRow = sheet.Row(rowI);
- iterate((tupledArg) => {
- fsRow.Item(tupledArg[0] + 1).SetValueAs(tupledArg[1]);
- }, row);
-}
-
-export class SparseTable extends Record {
- constructor(Matrix, Keys, CommentKeys, ColumnCount) {
- super();
- this.Matrix = Matrix;
- this.Keys = Keys;
- this.CommentKeys = CommentKeys;
- this.ColumnCount = (ColumnCount | 0);
- }
-}
-
-export function SparseTable_$reflection() {
- return record_type("ARCtrl.ISA.Spreadsheet.SparseTable", [], SparseTable, () => [["Matrix", class_type("System.Collections.Generic.Dictionary`2", [tuple_type(string_type, int32_type), string_type])], ["Keys", list_type(string_type)], ["CommentKeys", list_type(string_type)], ["ColumnCount", int32_type]]);
-}
-
-export function SparseTable__TryGetValue_11FD62A8(this$, key) {
- return Dictionary_tryGetValue(key, this$.Matrix);
-}
-
-export function SparseTable__TryGetValueDefault_5BAE6133(this$, defaultValue, key) {
- if (this$.Matrix.has(key)) {
- return getItemFromDict(this$.Matrix, key);
- }
- else {
- return defaultValue;
- }
-}
-
-export function SparseTable_Create_Z2192E64B(matrix, keys, commentKeys, length) {
- return new SparseTable(defaultArg(matrix, new Dictionary([], {
- Equals: equalArrays,
- GetHashCode: arrayHash,
- })), defaultArg(keys, empty()), defaultArg(commentKeys, empty()), defaultArg(length, 0));
-}
-
-export function SparseTable_AddRow(key, values, matrix) {
- iterate((tupledArg) => {
- addToDict(matrix.Matrix, [key, tupledArg[0]], tupledArg[1]);
- }, values);
- const length = (isEmpty(values) ? 0 : (1 + maxBy((tuple) => tuple[0], values, {
- Compare: comparePrimitives,
- })[0])) | 0;
- return new SparseTable(matrix.Matrix, append(matrix.Keys, singleton(key)), matrix.CommentKeys, (length > matrix.ColumnCount) ? length : matrix.ColumnCount);
-}
-
-export function SparseTable_AddEmptyComment(key, matrix) {
- return new SparseTable(matrix.Matrix, matrix.Keys, append(matrix.CommentKeys, singleton(key)), matrix.ColumnCount);
-}
-
-export function SparseTable_AddComment(key, values, matrix) {
- if (length_1(values) === 0) {
- return SparseTable_AddEmptyComment(key, matrix);
- }
- else {
- iterate((tupledArg) => {
- addToDict(matrix.Matrix, [key, tupledArg[0]], tupledArg[1]);
- }, values);
- const length = (isEmpty(values) ? 0 : (1 + maxBy((tuple) => tuple[0], values, {
- Compare: comparePrimitives,
- })[0])) | 0;
- return new SparseTable(matrix.Matrix, matrix.Keys, append(matrix.CommentKeys, singleton(key)), (length > matrix.ColumnCount) ? length : matrix.ColumnCount);
- }
-}
-
-export function SparseTable_FromRows_Z5579EC29(en, labels, lineNumber, prefix) {
- try {
- const prefix_1 = (prefix == null) ? "" : (prefix + " ");
- const loop = (matrix_mut, remarks_mut, lineNumber_1_mut) => {
- let v_2, k_1;
- loop:
- while (true) {
- const matrix = matrix_mut, remarks = remarks_mut, lineNumber_1 = lineNumber_1_mut;
- if (en["System.Collections.IEnumerator.MoveNext"]()) {
- const row = map((tupledArg) => [tupledArg[0] - 1, tupledArg[1]], en["System.Collections.Generic.IEnumerator`1.get_Current"]());
- const matchValue = map_1((tuple) => tuple[1], tryItem(0, row));
- const vals = Seq_trySkip(1, row);
- const key = matchValue;
- let matchResult, k, v_1;
- const activePatternResult = Comment_$007CComment$007C_$007C(key);
- if (activePatternResult != null) {
- if (vals != null) {
- matchResult = 0;
- k = activePatternResult;
- v_1 = vals;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0: {
- matrix_mut = SparseTable_AddComment(k, v_1, matrix);
- remarks_mut = remarks;
- lineNumber_1_mut = (lineNumber_1 + 1);
- continue loop;
- }
- default: {
- let matchResult_1, k_2, k_3, v_3, k_4;
- const activePatternResult_1 = Remark_$007CRemark$007C_$007C(key);
- if (activePatternResult_1 != null) {
- matchResult_1 = 0;
- k_2 = activePatternResult_1;
- }
- else if (key != null) {
- if (vals != null) {
- if ((v_2 = vals, (k_1 = key, exists((label) => (k_1 === (prefix_1 + label)), labels)))) {
- matchResult_1 = 1;
- k_3 = key;
- v_3 = vals;
- }
- else {
- matchResult_1 = 2;
- k_4 = key;
- }
- }
- else {
- matchResult_1 = 2;
- k_4 = key;
- }
- }
- else {
- matchResult_1 = 3;
- }
- switch (matchResult_1) {
- case 0: {
- matrix_mut = matrix;
- remarks_mut = cons(Remark_make(lineNumber_1, k_2), remarks);
- lineNumber_1_mut = (lineNumber_1 + 1);
- continue loop;
- }
- case 1: {
- matrix_mut = SparseTable_AddRow(find((label_1) => (k_3 === (prefix_1 + label_1)), labels), v_3, matrix);
- remarks_mut = remarks;
- lineNumber_1_mut = (lineNumber_1 + 1);
- continue loop;
- }
- case 2:
- return [k_4, lineNumber_1, remarks, matrix];
- default:
- return [void 0, lineNumber_1, remarks, matrix];
- }
- }
- }
- }
- else {
- return [void 0, lineNumber_1, remarks, matrix];
- }
- break;
- }
- };
- return loop(SparseTable_Create_Z2192E64B(), empty(), lineNumber);
- }
- catch (err) {
- const arg_9 = err.message;
- return toFail(printf("Error parsing block in investigation file starting from line number %i: %s"))(lineNumber)(arg_9);
- }
-}
-
-export function SparseTable_ToRows_6A3D4534(matrix, prefix) {
- const prefix_1 = (prefix == null) ? "" : (prefix + " ");
- return delay(() => append_1(map((key) => SparseRowModule_fromValues(cons(prefix_1 + key, initialize_1(matrix.ColumnCount - 1, (i) => SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [key, i + 1])))), matrix.Keys), delay(() => map((key_1) => SparseRowModule_fromValues(cons(Comment_wrapCommentKey(key_1), initialize_1(matrix.ColumnCount - 1, (i_1) => SparseTable__TryGetValueDefault_5BAE6133(matrix, "", [key_1, i_1 + 1])))), matrix.CommentKeys))));
-}
-
-export function SparseTable_GetEmptyComments_651559CC(matrix) {
- return toArray(map_2((key) => Comment_create_250E0578(void 0, key), matrix.CommentKeys));
-}
-
diff --git a/js/ISA/ISA/ArcTypes/ArcAssay.js b/js/ISA/ISA/ArcTypes/ArcAssay.js
deleted file mode 100644
index 57b408c0..00000000
--- a/js/ISA/ISA/ArcTypes/ArcAssay.js
+++ /dev/null
@@ -1,468 +0,0 @@
-import { defaultArg, map, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { ArcTables_fromProcesses_134EBDED, ArcTables__get_Tables, ArcTables__GetProcesses, ArcTables__GetRow_Z18115A39, ArcTables__GetRowAt_Z37302880, ArcTables__UpdateRow_1BFE2CFB, ArcTables__UpdateRowAt_1CF7B5DC, ArcTables__RemoveRow_Z18115A39, ArcTables__RemoveRowAt_Z37302880, ArcTables__AddRow_Z16315DE5, ArcTables__AddRowAt_Z12CDB784, ArcTables__GetColumn_Z18115A39, ArcTables__GetColumnAt_Z37302880, ArcTables__UpdateColumn_Z6083042A, ArcTables__UpdateColumnAt_21300791, ArcTables__RemoveColumn_Z18115A39, ArcTables__RemoveColumnAt_Z37302880, ArcTables__AddColumn_1FF50D3C, ArcTables__AddColumnAt_6A9784DB, ArcTables__RenameTable_Z384F8060, ArcTables__RenameTableAt_Z176EF219, ArcTables__MapTable_27DD7B1B, ArcTables__MapTableAt_8FC095C, ArcTables__RemoveTable_Z721C83C5, ArcTables__RemoveTableAt_Z524259A4, ArcTables__UpdateTable_51766571, ArcTables__UpdateTableAt_7E571736, ArcTables__GetTable_Z721C83C5, ArcTables__GetTableAt_Z524259A4, ArcTables__InitTables_7B28792B, ArcTables__InitTable_3B406CA4, ArcTables__AddTables_Z2D453886, ArcTables__AddTable_EC12B15, ArcTables__get_TableNames, ArcTables_$ctor_Z18C2F36D, ArcTables__get_Count } from "./ArcTables.js";
-import { disposeSafe, getEnumerator } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { AssayMaterials_get_empty, AssayMaterials_create_Z253F0553 } from "../JsonTypes/AssayMaterials.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-import { toArray, ofArray, empty } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { getUnits, getCharacteristics, getData, getMaterials, getSamples } from "../JsonTypes/ProcessSequence.js";
-import { Assay_create_3D372A24 } from "../JsonTypes/Assay.js";
-import { Assay_identifierFromFileName, createMissingIdentifier, Assay_fileNameFromIdentifier, isMissingIdentifier } from "./Identifier.js";
-import { class_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class ArcAssay {
- constructor(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments) {
- const tables_1 = defaultArg(tables, []);
- const performers_1 = defaultArg(performers, []);
- const comments_1 = defaultArg(comments, []);
- this["identifier@13"] = identifier;
- this["MeasurementType@"] = measurementType;
- this["TechnologyType@"] = technologyType;
- this["TechnologyPlatform@"] = technologyPlatform;
- this["Tables@"] = tables_1;
- this["Performers@"] = performers_1;
- this["Comments@"] = comments_1;
- }
- get Identifier() {
- const this$ = this;
- return this$["identifier@13"];
- }
- set Identifier(i) {
- const this$ = this;
- this$["identifier@13"] = i;
- }
- static get FileName() {
- return "isa.assay.xlsx";
- }
- get MeasurementType() {
- const __ = this;
- return unwrap(__["MeasurementType@"]);
- }
- set MeasurementType(v) {
- const __ = this;
- __["MeasurementType@"] = v;
- }
- get TechnologyType() {
- const __ = this;
- return unwrap(__["TechnologyType@"]);
- }
- set TechnologyType(v) {
- const __ = this;
- __["TechnologyType@"] = v;
- }
- get TechnologyPlatform() {
- const __ = this;
- return unwrap(__["TechnologyPlatform@"]);
- }
- set TechnologyPlatform(v) {
- const __ = this;
- __["TechnologyPlatform@"] = v;
- }
- get Tables() {
- const __ = this;
- return __["Tables@"];
- }
- set Tables(v) {
- const __ = this;
- __["Tables@"] = v;
- }
- get Performers() {
- const __ = this;
- return __["Performers@"];
- }
- set Performers(v) {
- const __ = this;
- __["Performers@"] = v;
- }
- get Comments() {
- const __ = this;
- return __["Comments@"];
- }
- set Comments(v) {
- const __ = this;
- __["Comments@"] = v;
- }
- static init(identifier) {
- return new ArcAssay(identifier);
- }
- static create(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments) {
- return new ArcAssay(identifier, unwrap(measurementType), unwrap(technologyType), unwrap(technologyPlatform), unwrap(tables), unwrap(performers), unwrap(comments));
- }
- static make(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments) {
- return new ArcAssay(identifier, unwrap(measurementType), unwrap(technologyType), unwrap(technologyPlatform), tables, performers, comments);
- }
- get TableCount() {
- const this$ = this;
- return ArcTables__get_Count(ArcTables_$ctor_Z18C2F36D(this$.Tables)) | 0;
- }
- get TableNames() {
- const this$ = this;
- return ArcTables__get_TableNames(ArcTables_$ctor_Z18C2F36D(this$.Tables));
- }
- AddTable(table, index) {
- const this$ = this;
- ArcTables__AddTable_EC12B15(ArcTables_$ctor_Z18C2F36D(this$.Tables), table, unwrap(index));
- }
- static addTable(table, index) {
- return (assay) => {
- const c = assay.Copy();
- c.AddTable(table, unwrap(index));
- return c;
- };
- }
- AddTables(tables, index) {
- const this$ = this;
- ArcTables__AddTables_Z2D453886(ArcTables_$ctor_Z18C2F36D(this$.Tables), tables, unwrap(index));
- }
- static addTables(tables, index) {
- return (assay) => {
- const c = assay.Copy();
- c.AddTables(tables, unwrap(index));
- return c;
- };
- }
- InitTable(tableName, index) {
- const this$ = this;
- return ArcTables__InitTable_3B406CA4(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, unwrap(index));
- }
- static initTable(tableName, index) {
- return (assay) => {
- const c = assay.Copy();
- return c.InitTable(tableName, unwrap(index));
- };
- }
- InitTables(tableNames, index) {
- const this$ = this;
- ArcTables__InitTables_7B28792B(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableNames, unwrap(index));
- }
- static initTables(tableNames, index) {
- return (assay) => {
- const c = assay.Copy();
- c.InitTables(tableNames, unwrap(index));
- return c;
- };
- }
- GetTableAt(index) {
- const this$ = this;
- return ArcTables__GetTableAt_Z524259A4(ArcTables_$ctor_Z18C2F36D(this$.Tables), index);
- }
- static getTableAt(index) {
- return (assay) => {
- const newAssay = assay.Copy();
- return newAssay.GetTableAt(index);
- };
- }
- GetTable(name) {
- const this$ = this;
- return ArcTables__GetTable_Z721C83C5(ArcTables_$ctor_Z18C2F36D(this$.Tables), name);
- }
- static getTable(name) {
- return (assay) => {
- const newAssay = assay.Copy();
- return newAssay.GetTable(name);
- };
- }
- UpdateTableAt(index, table) {
- const this$ = this;
- ArcTables__UpdateTableAt_7E571736(ArcTables_$ctor_Z18C2F36D(this$.Tables), index, table);
- }
- static updateTableAt(index, table) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.UpdateTableAt(index, table);
- return newAssay;
- };
- }
- UpdateTable(name, table) {
- const this$ = this;
- ArcTables__UpdateTable_51766571(ArcTables_$ctor_Z18C2F36D(this$.Tables), name, table);
- }
- static updateTable(name, table) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.UpdateTable(name, table);
- return newAssay;
- };
- }
- RemoveTableAt(index) {
- const this$ = this;
- ArcTables__RemoveTableAt_Z524259A4(ArcTables_$ctor_Z18C2F36D(this$.Tables), index);
- }
- static removeTableAt(index) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RemoveTableAt(index);
- return newAssay;
- };
- }
- RemoveTable(name) {
- const this$ = this;
- ArcTables__RemoveTable_Z721C83C5(ArcTables_$ctor_Z18C2F36D(this$.Tables), name);
- }
- static removeTable(name) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RemoveTable(name);
- return newAssay;
- };
- }
- MapTableAt(index, updateFun) {
- const this$ = this;
- ArcTables__MapTableAt_8FC095C(ArcTables_$ctor_Z18C2F36D(this$.Tables), index, updateFun);
- }
- static mapTableAt(index, updateFun) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.MapTableAt(index, updateFun);
- return newAssay;
- };
- }
- MapTable(name, updateFun) {
- const this$ = this;
- ArcTables__MapTable_27DD7B1B(ArcTables_$ctor_Z18C2F36D(this$.Tables), name, updateFun);
- }
- static updateTable(name, updateFun) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.MapTable(name, updateFun);
- return newAssay;
- };
- }
- RenameTableAt(index, newName) {
- const this$ = this;
- ArcTables__RenameTableAt_Z176EF219(ArcTables_$ctor_Z18C2F36D(this$.Tables), index, newName);
- }
- static renameTableAt(index, newName) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RenameTableAt(index, newName);
- return newAssay;
- };
- }
- RenameTable(name, newName) {
- const this$ = this;
- ArcTables__RenameTable_Z384F8060(ArcTables_$ctor_Z18C2F36D(this$.Tables), name, newName);
- }
- static renameTable(name, newName) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RenameTable(name, newName);
- return newAssay;
- };
- }
- AddColumnAt(tableIndex, header, cells, columnIndex, forceReplace) {
- const this$ = this;
- ArcTables__AddColumnAt_6A9784DB(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- }
- static addColumnAt(tableIndex, header, cells, columnIndex, forceReplace) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.AddColumnAt(tableIndex, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- return newAssay;
- };
- }
- AddColumn(tableName, header, cells, columnIndex, forceReplace) {
- const this$ = this;
- ArcTables__AddColumn_1FF50D3C(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- }
- static addColumn(tableName, header, cells, columnIndex, forceReplace) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.AddColumn(tableName, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- return newAssay;
- };
- }
- RemoveColumnAt(tableIndex, columnIndex) {
- const this$ = this;
- ArcTables__RemoveColumnAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, columnIndex);
- }
- static removeColumnAt(tableIndex, columnIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RemoveColumnAt(tableIndex, columnIndex);
- return newAssay;
- };
- }
- RemoveColumn(tableName, columnIndex) {
- const this$ = this;
- ArcTables__RemoveColumn_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, columnIndex);
- }
- static removeColumn(tableName, columnIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RemoveColumn(tableName, columnIndex);
- return newAssay;
- };
- }
- UpdateColumnAt(tableIndex, columnIndex, header, cells) {
- const this$ = this;
- ArcTables__UpdateColumnAt_21300791(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, columnIndex, header, unwrap(cells));
- }
- static updateColumnAt(tableIndex, columnIndex, header, cells) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.UpdateColumnAt(tableIndex, columnIndex, header, unwrap(cells));
- return newAssay;
- };
- }
- UpdateColumn(tableName, columnIndex, header, cells) {
- const this$ = this;
- ArcTables__UpdateColumn_Z6083042A(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, columnIndex, header, unwrap(cells));
- }
- static updateColumn(tableName, columnIndex, header, cells) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.UpdateColumn(tableName, columnIndex, header, unwrap(cells));
- return newAssay;
- };
- }
- GetColumnAt(tableIndex, columnIndex) {
- const this$ = this;
- return ArcTables__GetColumnAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, columnIndex);
- }
- static getColumnAt(tableIndex, columnIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- return newAssay.GetColumnAt(tableIndex, columnIndex);
- };
- }
- GetColumn(tableName, columnIndex) {
- const this$ = this;
- return ArcTables__GetColumn_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, columnIndex);
- }
- static getColumn(tableName, columnIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- return newAssay.GetColumn(tableName, columnIndex);
- };
- }
- AddRowAt(tableIndex, cells, rowIndex) {
- const this$ = this;
- ArcTables__AddRowAt_Z12CDB784(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, unwrap(cells), unwrap(rowIndex));
- }
- static addRowAt(tableIndex, cells, rowIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.AddRowAt(tableIndex, unwrap(cells), unwrap(rowIndex));
- return newAssay;
- };
- }
- AddRow(tableName, cells, rowIndex) {
- const this$ = this;
- ArcTables__AddRow_Z16315DE5(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, unwrap(cells), unwrap(rowIndex));
- }
- static addRow(tableName, cells, rowIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.AddRow(tableName, unwrap(cells), unwrap(rowIndex));
- return newAssay;
- };
- }
- RemoveRowAt(tableIndex, rowIndex) {
- const this$ = this;
- ArcTables__RemoveRowAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, rowIndex);
- }
- static removeRowAt(tableIndex, rowIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RemoveColumnAt(tableIndex, rowIndex);
- return newAssay;
- };
- }
- RemoveRow(tableName, rowIndex) {
- const this$ = this;
- ArcTables__RemoveRow_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, rowIndex);
- }
- static removeRow(tableName, rowIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.RemoveRow(tableName, rowIndex);
- return newAssay;
- };
- }
- UpdateRowAt(tableIndex, rowIndex, cells) {
- const this$ = this;
- ArcTables__UpdateRowAt_1CF7B5DC(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, rowIndex, cells);
- }
- static updateRowAt(tableIndex, rowIndex, cells) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.UpdateRowAt(tableIndex, rowIndex, cells);
- return newAssay;
- };
- }
- UpdateRow(tableName, rowIndex, cells) {
- const this$ = this;
- ArcTables__UpdateRow_1BFE2CFB(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, rowIndex, cells);
- }
- static updateRow(tableName, rowIndex, cells) {
- return (assay) => {
- const newAssay = assay.Copy();
- newAssay.UpdateRow(tableName, rowIndex, cells);
- return newAssay;
- };
- }
- GetRowAt(tableIndex, rowIndex) {
- const this$ = this;
- return ArcTables__GetRowAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, rowIndex);
- }
- static getRowAt(tableIndex, rowIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- return newAssay.GetRowAt(tableIndex, rowIndex);
- };
- }
- GetRow(tableName, rowIndex) {
- const this$ = this;
- return ArcTables__GetRow_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, rowIndex);
- }
- static getRow(tableName, rowIndex) {
- return (assay) => {
- const newAssay = assay.Copy();
- return newAssay.GetRow(tableName, rowIndex);
- };
- }
- static setPerformers(performers, assay) {
- assay.Performers = performers;
- return assay;
- }
- Copy() {
- const this$ = this;
- const newTables = [];
- let enumerator = getEnumerator(this$.Tables);
- try {
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
- const table = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
- const copy = table.Copy();
- void (newTables.push(copy));
- }
- }
- finally {
- disposeSafe(enumerator);
- }
- return new ArcAssay(this$.Identifier, unwrap(this$.MeasurementType), unwrap(this$.TechnologyType), unwrap(this$.TechnologyPlatform), newTables, this$.Performers, this$.Comments);
- }
- ToAssay() {
- const this$ = this;
- const processSeq = ArcTables__GetProcesses(ArcTables_$ctor_Z18C2F36D(this$.Tables));
- let assayMaterials;
- const v_2 = AssayMaterials_create_Z253F0553(unwrap(fromValueWithDefault(empty(), getSamples(processSeq))), unwrap(fromValueWithDefault(empty(), getMaterials(processSeq))));
- assayMaterials = fromValueWithDefault(AssayMaterials_get_empty(), v_2);
- return Assay_create_3D372A24(void 0, unwrap(isMissingIdentifier(this$.Identifier) ? void 0 : Assay_fileNameFromIdentifier(this$.Identifier)), unwrap(this$.MeasurementType), unwrap(this$.TechnologyType), unwrap(this$.TechnologyPlatform), unwrap(fromValueWithDefault(empty(), getData(processSeq))), unwrap(assayMaterials), unwrap(fromValueWithDefault(empty(), getCharacteristics(processSeq))), unwrap(fromValueWithDefault(empty(), getUnits(processSeq))), unwrap(fromValueWithDefault(empty(), processSeq)), unwrap(fromValueWithDefault(empty(), ofArray(this$.Comments))));
- }
- static fromAssay(a) {
- const tables = map((arg_1) => ArcTables__get_Tables(ArcTables_fromProcesses_134EBDED(arg_1)), a.ProcessSequence);
- let identifer;
- const matchValue = a.FileName;
- identifer = ((matchValue == null) ? createMissingIdentifier() : Assay_identifierFromFileName(matchValue));
- return ArcAssay.create(identifer, unwrap(a.MeasurementType), unwrap(a.TechnologyType), unwrap(a.TechnologyPlatform), unwrap(tables), void 0, unwrap(map(toArray, a.Comments)));
- }
-}
-
-export function ArcAssay_$reflection() {
- return class_type("ARCtrl.ISA.ArcAssay", void 0, ArcAssay);
-}
-
-export function ArcAssay_$ctor_Z2A43082B(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments) {
- return new ArcAssay(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/ArcInvestigation.js b/js/ISA/ISA/ArcTypes/ArcInvestigation.js
deleted file mode 100644
index f442a15d..00000000
--- a/js/ISA/ISA/ArcTypes/ArcInvestigation.js
+++ /dev/null
@@ -1,414 +0,0 @@
-import { map as map_2, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { toList, removeAt, tryFindIndex, map } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ArcStudy } from "./ArcStudy.js";
-import { tryFind, removeInPlace } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { disposeSafe, getEnumerator, defaultOf, safeHash, equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { ArcAssay } from "./ArcAssay.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-import { toArray, ofArray, map as map_1, empty } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { Investigation_create_4AD66BBE } from "../JsonTypes/Investigation.js";
-import { createMissingIdentifier, isMissingIdentifier } from "./Identifier.js";
-import { class_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class ArcInvestigation {
- constructor(identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications, contacts, studies, comments, remarks) {
- const ontologySourceReferences_1 = defaultArg(ontologySourceReferences, []);
- const publications_1 = defaultArg(publications, []);
- const contacts_1 = defaultArg(contacts, []);
- const studies_1 = defaultArg(studies, []);
- const comments_1 = defaultArg(comments, []);
- const remarks_1 = defaultArg(remarks, []);
- this["identifier@25"] = identifier;
- this["Title@"] = title;
- this["Description@"] = description;
- this["SubmissionDate@"] = submissionDate;
- this["PublicReleaseDate@"] = publicReleaseDate;
- this["OntologySourceReferences@"] = ontologySourceReferences_1;
- this["Publications@"] = publications_1;
- this["Contacts@"] = contacts_1;
- this["Studies@"] = studies_1;
- this["Comments@"] = comments_1;
- this["Remarks@"] = remarks_1;
- }
- get Identifier() {
- const this$ = this;
- return this$["identifier@25"];
- }
- set Identifier(i) {
- const this$ = this;
- this$["identifier@25"] = i;
- }
- get Title() {
- const __ = this;
- return unwrap(__["Title@"]);
- }
- set Title(v) {
- const __ = this;
- __["Title@"] = v;
- }
- get Description() {
- const __ = this;
- return unwrap(__["Description@"]);
- }
- set Description(v) {
- const __ = this;
- __["Description@"] = v;
- }
- get SubmissionDate() {
- const __ = this;
- return unwrap(__["SubmissionDate@"]);
- }
- set SubmissionDate(v) {
- const __ = this;
- __["SubmissionDate@"] = v;
- }
- get PublicReleaseDate() {
- const __ = this;
- return unwrap(__["PublicReleaseDate@"]);
- }
- set PublicReleaseDate(v) {
- const __ = this;
- __["PublicReleaseDate@"] = v;
- }
- get OntologySourceReferences() {
- const __ = this;
- return __["OntologySourceReferences@"];
- }
- set OntologySourceReferences(v) {
- const __ = this;
- __["OntologySourceReferences@"] = v;
- }
- get Publications() {
- const __ = this;
- return __["Publications@"];
- }
- set Publications(v) {
- const __ = this;
- __["Publications@"] = v;
- }
- get Contacts() {
- const __ = this;
- return __["Contacts@"];
- }
- set Contacts(v) {
- const __ = this;
- __["Contacts@"] = v;
- }
- get Studies() {
- const __ = this;
- return __["Studies@"];
- }
- set Studies(v) {
- const __ = this;
- __["Studies@"] = v;
- }
- get Comments() {
- const __ = this;
- return __["Comments@"];
- }
- set Comments(v) {
- const __ = this;
- __["Comments@"] = v;
- }
- get Remarks() {
- const __ = this;
- return __["Remarks@"];
- }
- set Remarks(v) {
- const __ = this;
- __["Remarks@"] = v;
- }
- static get FileName() {
- return "isa.investigation.xlsx";
- }
- static init(identifier) {
- return new ArcInvestigation(identifier);
- }
- static create(identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications, contacts, studies, comments, remarks) {
- return new ArcInvestigation(identifier, unwrap(title), unwrap(description), unwrap(submissionDate), unwrap(publicReleaseDate), unwrap(ontologySourceReferences), unwrap(publications), unwrap(contacts), unwrap(studies), unwrap(comments), unwrap(remarks));
- }
- static make(identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications, contacts, studies, comments, remarks) {
- return new ArcInvestigation(identifier, unwrap(title), unwrap(description), unwrap(submissionDate), unwrap(publicReleaseDate), ontologySourceReferences, publications, contacts, studies, comments, remarks);
- }
- get StudyCount() {
- const this$ = this;
- return this$.Studies.length | 0;
- }
- get StudyIdentifiers() {
- const this$ = this;
- return map((x) => x.Identifier, this$.Studies);
- }
- AddStudy(study) {
- const this$ = this;
- const study_1 = study;
- const matchValue = tryFindIndex((x) => (x.Identifier === study_1.Identifier), this$.Studies);
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create study with name ${study_1.Identifier}, as study names must be unique and study at index ${matchValue} has the same name.`);
- }
- void (this$.Studies.push(study));
- }
- static addStudy(study) {
- return (inv) => {
- const copy = inv.Copy();
- copy.AddStudy(study);
- return copy;
- };
- }
- InitStudy(studyName) {
- const this$ = this;
- const study = ArcStudy.init(studyName);
- this$.AddStudy(study);
- return study;
- }
- static initStudy(studyName) {
- return (inv) => {
- const copy = inv.Copy();
- return copy.InitStudy(studyName);
- };
- }
- RemoveStudyAt(index) {
- const this$ = this;
- this$.Studies.splice(index, 1);
- }
- static removeStudyAt(index) {
- return (inv) => {
- const newInv = inv.Copy();
- newInv.RemoveStudyAt(index);
- return newInv;
- };
- }
- RemoveStudy(studyIdentifier) {
- const this$ = this;
- removeInPlace(this$.GetStudy(studyIdentifier), this$.Studies, {
- Equals: equals,
- GetHashCode: safeHash,
- });
- }
- static removeStudy(studyIdentifier) {
- return (inv) => {
- const copy = inv.Copy();
- copy.RemoveStudy(studyIdentifier);
- return copy;
- };
- }
- SetStudyAt(index, study) {
- const this$ = this;
- const study_1 = study;
- const matchValue = tryFindIndex((x) => (x.Identifier === study_1.Identifier), removeAt(index, this$.Studies));
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create study with name ${study_1.Identifier}, as study names must be unique and study at index ${matchValue} has the same name.`);
- }
- this$.Studies[index] = study;
- }
- static setStudyAt(index, study) {
- return (inv) => {
- const newInv = inv.Copy();
- newInv.SetStudyAt(index, study);
- return newInv;
- };
- }
- SetStudy(studyIdentifier, study) {
- const this$ = this;
- const index = this$.GetStudyIndex(studyIdentifier) | 0;
- const study_1 = study;
- const matchValue = tryFindIndex((x) => (x.Identifier === study_1.Identifier), removeAt(index, this$.Studies));
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create study with name ${study_1.Identifier}, as study names must be unique and study at index ${matchValue} has the same name.`);
- }
- this$.Studies[index] = study;
- }
- static setStudy(studyIdentifier, study) {
- return (inv) => {
- const newInv = inv.Copy();
- newInv.SetStudy(studyIdentifier, study);
- return newInv;
- };
- }
- GetStudyIndex(studyIdentifier) {
- const this$ = this;
- const index = this$.Studies.findIndex((s) => (s.Identifier === studyIdentifier)) | 0;
- if (index === -1) {
- throw new Error(`Unable to find study with specified identifier '${studyIdentifier}'!`);
- }
- return index | 0;
- }
- static getStudyIndex(studyIdentifier) {
- return (inv) => inv.GetStudyIndex(studyIdentifier);
- }
- GetStudyAt(index) {
- const this$ = this;
- return this$.Studies[index];
- }
- static getStudyAt(index) {
- return (inv) => {
- const newInv = inv.Copy();
- return newInv.GetStudyAt(index);
- };
- }
- GetStudy(studyIdentifier) {
- const this$ = this;
- return defaultArg(tryFind((s) => (s.Identifier === studyIdentifier), this$.Studies), defaultOf());
- }
- static getStudy(studyIdentifier) {
- return (inv) => {
- const newInv = inv.Copy();
- return newInv.GetStudy(studyIdentifier);
- };
- }
- AddAssay(studyIdentifier, assay) {
- const this$ = this;
- const study = this$.GetStudy(studyIdentifier);
- const assay_1 = assay;
- const matchValue = tryFindIndex((x) => (x.Identifier === assay_1.Identifier), study.Assays);
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create assay with name ${assay_1.Identifier}, as assay names must be unique and assay at index ${matchValue} has the same name.`);
- }
- study.AddAssay(assay);
- }
- static addAssay(studyIdentifier, assay) {
- return (inv) => {
- const copy = inv.Copy();
- copy.AddAssay(studyIdentifier, assay);
- return copy;
- };
- }
- AddAssayAt(studyIndex, assay) {
- const this$ = this;
- const study = this$.GetStudyAt(studyIndex);
- const assay_1 = assay;
- const matchValue = tryFindIndex((x) => (x.Identifier === assay_1.Identifier), study.Assays);
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create assay with name ${assay_1.Identifier}, as assay names must be unique and assay at index ${matchValue} has the same name.`);
- }
- study.AddAssay(assay);
- }
- static addAssayAt(studyIndex, assay) {
- return (inv) => {
- const copy = inv.Copy();
- copy.AddAssayAt(studyIndex, assay);
- return copy;
- };
- }
- InitAssay(studyIdentifier, assayName) {
- const this$ = this;
- const assay = ArcAssay.init(assayName);
- this$.AddAssay(studyIdentifier, assay);
- return assay;
- }
- static initAssay(studyIdentifier, assayName) {
- return (inv) => {
- const copy = inv.Copy();
- return copy.InitAssay(studyIdentifier, assayName);
- };
- }
- RemoveAssayAt(studyIdentifier, index) {
- const this$ = this;
- const study = this$.GetStudy(studyIdentifier);
- study.Assays.splice(index, 1);
- }
- static removeAssayAt(studyIdentifier, index) {
- return (inv) => {
- const newInv = inv.Copy();
- newInv.RemoveAssayAt(studyIdentifier, index);
- return newInv;
- };
- }
- SetAssayAt(studyIdentifier, index, assay) {
- const this$ = this;
- const study = this$.GetStudy(studyIdentifier);
- study.SetAssayAt(index, assay);
- this$.Studies[index] = study;
- }
- static setAssayAt(studyIdentifier, index, assay) {
- return (inv) => {
- const newInv = inv.Copy();
- newInv.SetAssayAt(studyIdentifier, index, assay);
- return newInv;
- };
- }
- SetAssay(studyIdentifier, assayIdentifier, assay) {
- const this$ = this;
- const study = this$.GetStudy(studyIdentifier);
- const index = study.GetAssayIndex(assayIdentifier) | 0;
- study.SetAssayAt(index, assay);
- }
- static setAssay(studyIdentifier, assayIdentifier, assay) {
- return (inv) => {
- const newInv = inv.Copy();
- newInv.SetAssay(studyIdentifier, assayIdentifier, assay);
- };
- }
- GetAssayAt(studyIdentifier, index) {
- const this$ = this;
- const study = this$.GetStudy(studyIdentifier);
- return study.GetAssayAt(index);
- }
- static getAssayAt(studyIdentifier, index) {
- return (inv) => {
- const newInv = inv.Copy();
- return newInv.GetAssayAt(studyIdentifier, index);
- };
- }
- GetAssay(studyIdentifier, assayIdentifier) {
- const this$ = this;
- const study = this$.GetStudy(studyIdentifier);
- const index = study.GetAssayIndex(assayIdentifier) | 0;
- return study.GetAssayAt(index);
- }
- static getAssay(studyIdentifier, assayIdentifier) {
- return (inv) => {
- const newInv = inv.Copy();
- return newInv.GetAssay(studyIdentifier, assayIdentifier);
- };
- }
- Copy() {
- const this$ = this;
- const newStudies = [];
- let enumerator = getEnumerator(this$.Studies);
- try {
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
- const study = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
- const copy = study.Copy();
- void (newStudies.push(copy));
- }
- }
- finally {
- disposeSafe(enumerator);
- }
- return new ArcInvestigation(this$.Identifier, unwrap(this$.Title), unwrap(this$.Description), unwrap(this$.SubmissionDate), unwrap(this$.PublicReleaseDate), this$.OntologySourceReferences, this$.Publications, this$.Contacts, newStudies, this$.Comments, this$.Remarks);
- }
- ToInvestigation() {
- const this$ = this;
- const studies = fromValueWithDefault(empty(), map_1((a) => a.ToStudy(), toList(this$.Studies)));
- return Investigation_create_4AD66BBE(void 0, "isa.investigation.xlsx", isMissingIdentifier(this$.Identifier) ? void 0 : this$.Identifier, this$.Title, this$.Description, this$.SubmissionDate, this$.PublicReleaseDate, void 0, fromValueWithDefault(empty(), ofArray(this$.Publications)), fromValueWithDefault(empty(), ofArray(this$.Contacts)), studies, fromValueWithDefault(empty(), ofArray(this$.Comments)));
- }
- static fromInvestigation(i) {
- let identifer;
- const matchValue = i.Identifier;
- identifer = ((matchValue == null) ? createMissingIdentifier() : matchValue);
- const studies = map_2((arg_2) => {
- const arg_1 = map_1((arg) => ArcStudy.fromStudy(arg), arg_2);
- return Array.from(arg_1);
- }, i.Studies);
- return ArcInvestigation.create(identifer, i.Title, i.Description, i.SubmissionDate, i.PublicReleaseDate, void 0, map_2(toArray, i.Publications), map_2(toArray, i.Contacts), studies, map_2(toArray, i.Comments));
- }
-}
-
-export function ArcInvestigation_$reflection() {
- return class_type("ARCtrl.ISA.ArcInvestigation", void 0, ArcInvestigation);
-}
-
-export function ArcInvestigation_$ctor_12187E3F(identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications, contacts, studies, comments, remarks) {
- return new ArcInvestigation(identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications, contacts, studies, comments, remarks);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/ArcStudy.js b/js/ISA/ISA/ArcTypes/ArcStudy.js
deleted file mode 100644
index eec2027d..00000000
--- a/js/ISA/ISA/ArcTypes/ArcStudy.js
+++ /dev/null
@@ -1,651 +0,0 @@
-import { defaultArg, map as map_2, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { disposeSafe, getEnumerator, equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { equalsWith } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { toList, removeAt, tryFindIndex, map } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-import { ArcAssay } from "./ArcAssay.js";
-import { ArcTables_fromProcesses_134EBDED, ArcTables__get_Tables, ArcTables__GetProcesses, ArcTables__GetRow_Z18115A39, ArcTables__GetRowAt_Z37302880, ArcTables__UpdateRow_1BFE2CFB, ArcTables__UpdateRowAt_1CF7B5DC, ArcTables__RemoveRow_Z18115A39, ArcTables__RemoveRowAt_Z37302880, ArcTables__AddRow_Z16315DE5, ArcTables__AddRowAt_Z12CDB784, ArcTables__GetColumn_Z18115A39, ArcTables__GetColumnAt_Z37302880, ArcTables__UpdateColumn_Z6083042A, ArcTables__UpdateColumnAt_21300791, ArcTables__RemoveColumn_Z18115A39, ArcTables__RemoveColumnAt_Z37302880, ArcTables__AddColumn_1FF50D3C, ArcTables__AddColumnAt_6A9784DB, ArcTables__RenameTable_Z384F8060, ArcTables__RenameTableAt_Z176EF219, ArcTables__MapTable_27DD7B1B, ArcTables__MapTableAt_8FC095C, ArcTables__RemoveTable_Z721C83C5, ArcTables__RemoveTableAt_Z524259A4, ArcTables__UpdateTable_51766571, ArcTables__UpdateTableAt_7E571736, ArcTables__GetTable_Z721C83C5, ArcTables__GetTableAt_Z524259A4, ArcTables__InitTables_7B28792B, ArcTables__InitTable_3B406CA4, ArcTables__AddTables_Z2D453886, ArcTables__AddTable_EC12B15, ArcTables__get_TableNames, ArcTables_$ctor_Z18C2F36D, ArcTables__get_Count } from "./ArcTables.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-import { toArray, ofArray, map as map_1, empty } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { getUnits, getCharacteristics, getMaterials, getSamples, getSources, getProtocols } from "../JsonTypes/ProcessSequence.js";
-import { StudyMaterials_get_empty, StudyMaterials_create_1BE9FA55 } from "../JsonTypes/StudyMaterials.js";
-import { Study_identifierFromFileName, createMissingIdentifier, Study_fileNameFromIdentifier, isMissingIdentifier } from "./Identifier.js";
-import { Study_create_Z2D28E954 } from "../JsonTypes/Study.js";
-import { class_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class ArcStudy {
- constructor(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, assays, factors, comments) {
- this.submissionDate = submissionDate;
- const publications_1 = defaultArg(publications, []);
- const contacts_1 = defaultArg(contacts, []);
- const studyDesignDescriptors_1 = defaultArg(studyDesignDescriptors, []);
- const tables_1 = defaultArg(tables, []);
- const assays_1 = defaultArg(assays, []);
- const factors_1 = defaultArg(factors, []);
- const comments_1 = defaultArg(comments, []);
- this["identifier@25"] = identifier;
- this["Title@"] = title;
- this["Description@"] = description;
- this["SubmissionDate@"] = this.submissionDate;
- this["PublicReleaseDate@"] = publicReleaseDate;
- this["Publications@"] = publications_1;
- this["Contacts@"] = contacts_1;
- this["StudyDesignDescriptors@"] = studyDesignDescriptors_1;
- this["Tables@"] = tables_1;
- this["Assays@"] = assays_1;
- this["Factors@"] = factors_1;
- this["Comments@"] = comments_1;
- }
- get Identifier() {
- const this$ = this;
- return this$["identifier@25"];
- }
- set Identifier(i) {
- const this$ = this;
- this$["identifier@25"] = i;
- }
- get Title() {
- const __ = this;
- return unwrap(__["Title@"]);
- }
- set Title(v) {
- const __ = this;
- __["Title@"] = v;
- }
- get Description() {
- const __ = this;
- return unwrap(__["Description@"]);
- }
- set Description(v) {
- const __ = this;
- __["Description@"] = v;
- }
- get SubmissionDate() {
- const __ = this;
- return unwrap(__["SubmissionDate@"]);
- }
- set SubmissionDate(v) {
- const __ = this;
- __["SubmissionDate@"] = v;
- }
- get PublicReleaseDate() {
- const __ = this;
- return unwrap(__["PublicReleaseDate@"]);
- }
- set PublicReleaseDate(v) {
- const __ = this;
- __["PublicReleaseDate@"] = v;
- }
- get Publications() {
- const __ = this;
- return __["Publications@"];
- }
- set Publications(v) {
- const __ = this;
- __["Publications@"] = v;
- }
- get Contacts() {
- const __ = this;
- return __["Contacts@"];
- }
- set Contacts(v) {
- const __ = this;
- __["Contacts@"] = v;
- }
- get StudyDesignDescriptors() {
- const __ = this;
- return __["StudyDesignDescriptors@"];
- }
- set StudyDesignDescriptors(v) {
- const __ = this;
- __["StudyDesignDescriptors@"] = v;
- }
- get Tables() {
- const __ = this;
- return __["Tables@"];
- }
- set Tables(v) {
- const __ = this;
- __["Tables@"] = v;
- }
- get Assays() {
- const __ = this;
- return __["Assays@"];
- }
- set Assays(v) {
- const __ = this;
- __["Assays@"] = v;
- }
- get Factors() {
- const __ = this;
- return __["Factors@"];
- }
- set Factors(v) {
- const __ = this;
- __["Factors@"] = v;
- }
- get Comments() {
- const __ = this;
- return __["Comments@"];
- }
- set Comments(v) {
- const __ = this;
- __["Comments@"] = v;
- }
- static init(identifier) {
- return new ArcStudy(identifier);
- }
- static create(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, assays, factors, comments) {
- return new ArcStudy(identifier, unwrap(title), unwrap(description), unwrap(submissionDate), unwrap(publicReleaseDate), unwrap(publications), unwrap(contacts), unwrap(studyDesignDescriptors), unwrap(tables), unwrap(assays), unwrap(factors), unwrap(comments));
- }
- static make(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, assays, factors, comments) {
- return new ArcStudy(identifier, unwrap(title), unwrap(description), unwrap(submissionDate), unwrap(publicReleaseDate), publications, contacts, studyDesignDescriptors, tables, assays, factors, comments);
- }
- get isEmpty() {
- const this$ = this;
- return (((((((((equals(this$.Title, void 0) && equals(this$.Description, void 0)) && equals(this$.SubmissionDate, void 0)) && equals(this$.PublicReleaseDate, void 0)) && equalsWith(equals, this$.Publications, [])) && equalsWith(equals, this$.Contacts, [])) && equalsWith(equals, this$.StudyDesignDescriptors, [])) && (this$.Tables.length === 0)) && (this$.Assays.length === 0)) && equalsWith(equals, this$.Factors, [])) && equalsWith(equals, this$.Comments, []);
- }
- static get FileName() {
- return "isa.study.xlsx";
- }
- get AssayCount() {
- const this$ = this;
- return this$.Assays.length | 0;
- }
- get AssayIdentifiers() {
- const this$ = this;
- return map((x) => x.Identifier, this$.Assays);
- }
- AddAssay(assay) {
- const this$ = this;
- const assay_1 = assay;
- const matchValue = tryFindIndex((x) => (x.Identifier === assay_1.Identifier), this$.Assays);
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create assay with name ${assay_1.Identifier}, as assay names must be unique and assay at index ${matchValue} has the same name.`);
- }
- void (this$.Assays.push(assay));
- }
- static addAssay(assay) {
- return (study) => {
- const newStudy = study.Copy();
- newStudy.AddAssay(assay);
- return newStudy;
- };
- }
- InitAssay(assayName) {
- const this$ = this;
- const assay = new ArcAssay(assayName);
- this$.AddAssay(assay);
- return assay;
- }
- static initAssay(assayName) {
- return (study) => {
- const newStudy = study.Copy();
- return newStudy.InitAssay(assayName);
- };
- }
- RemoveAssayAt(index) {
- const this$ = this;
- this$.Assays.splice(index, 1);
- }
- static removeAssayAt(index) {
- return (study) => {
- const newStudy = study.Copy();
- newStudy.RemoveAssayAt(index);
- return newStudy;
- };
- }
- SetAssayAt(index, assay) {
- const this$ = this;
- const assay_1 = assay;
- const matchValue = tryFindIndex((x) => (x.Identifier === assay_1.Identifier), removeAt(index, this$.Assays));
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create assay with name ${assay_1.Identifier}, as assay names must be unique and assay at index ${matchValue} has the same name.`);
- }
- this$.Assays[index] = assay;
- }
- static setAssayAt(index, assay) {
- return (study) => {
- const newStudy = study.Copy();
- newStudy.SetAssayAt(index, assay);
- return newStudy;
- };
- }
- SetAssay(assayIdentifier, assay) {
- const this$ = this;
- const index = this$.GetAssayIndex(assayIdentifier) | 0;
- this$.Assays[index] = assay;
- }
- static setAssay(assayIdentifier, assay) {
- return (study) => {
- const newStudy = study.Copy();
- newStudy.SetAssay(assayIdentifier, assay);
- return newStudy;
- };
- }
- GetAssayIndex(assayIdentifier) {
- const this$ = this;
- const index = this$.Assays.findIndex((a) => (a.Identifier === assayIdentifier)) | 0;
- if (index === -1) {
- throw new Error(`Unable to find assay with specified identifier '${assayIdentifier}'!`);
- }
- return index | 0;
- }
- static GetAssayIndex(assayIdentifier) {
- return (study) => study.GetAssayIndex(assayIdentifier);
- }
- GetAssayAt(index) {
- const this$ = this;
- return this$.Assays[index];
- }
- static getAssayAt(index) {
- return (study) => {
- const newStudy = study.Copy();
- return newStudy.GetAssayAt(index);
- };
- }
- GetAssay(assayIdentifier) {
- const this$ = this;
- const index = this$.GetAssayIndex(assayIdentifier) | 0;
- return this$.GetAssayAt(index);
- }
- static getAssay(assayIdentifier) {
- return (study) => {
- const newStudy = study.Copy();
- return newStudy.GetAssay(assayIdentifier);
- };
- }
- get TableCount() {
- const this$ = this;
- return ArcTables__get_Count(ArcTables_$ctor_Z18C2F36D(this$.Tables)) | 0;
- }
- get TableNames() {
- const this$ = this;
- return ArcTables__get_TableNames(ArcTables_$ctor_Z18C2F36D(this$.Tables));
- }
- AddTable(table, index) {
- const this$ = this;
- ArcTables__AddTable_EC12B15(ArcTables_$ctor_Z18C2F36D(this$.Tables), table, unwrap(index));
- }
- static addTable(table, index) {
- return (study) => {
- const c = study.Copy();
- c.AddTable(table, unwrap(index));
- return c;
- };
- }
- AddTables(tables, index) {
- const this$ = this;
- ArcTables__AddTables_Z2D453886(ArcTables_$ctor_Z18C2F36D(this$.Tables), tables, unwrap(index));
- }
- static addTables(tables, index) {
- return (study) => {
- const c = study.Copy();
- c.AddTables(tables, unwrap(index));
- return c;
- };
- }
- InitTable(tableName, index) {
- const this$ = this;
- return ArcTables__InitTable_3B406CA4(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, unwrap(index));
- }
- static initTable(tableName, index) {
- return (study) => {
- const c = study.Copy();
- return c.InitTable(tableName, unwrap(index));
- };
- }
- InitTables(tableNames, index) {
- const this$ = this;
- ArcTables__InitTables_7B28792B(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableNames, unwrap(index));
- }
- static initTables(tableNames, index) {
- return (study) => {
- const c = study.Copy();
- c.InitTables(tableNames, unwrap(index));
- return c;
- };
- }
- GetTableAt(index) {
- const this$ = this;
- return ArcTables__GetTableAt_Z524259A4(ArcTables_$ctor_Z18C2F36D(this$.Tables), index);
- }
- static getTableAt(index) {
- return (study) => {
- const newAssay = study.Copy();
- return newAssay.GetTableAt(index);
- };
- }
- GetTable(name) {
- const this$ = this;
- return ArcTables__GetTable_Z721C83C5(ArcTables_$ctor_Z18C2F36D(this$.Tables), name);
- }
- static getTable(name) {
- return (study) => {
- const newAssay = study.Copy();
- return newAssay.GetTable(name);
- };
- }
- UpdateTableAt(index, table) {
- const this$ = this;
- ArcTables__UpdateTableAt_7E571736(ArcTables_$ctor_Z18C2F36D(this$.Tables), index, table);
- }
- static updateTableAt(index, table) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.UpdateTableAt(index, table);
- return newAssay;
- };
- }
- UpdateTable(name, table) {
- const this$ = this;
- ArcTables__UpdateTable_51766571(ArcTables_$ctor_Z18C2F36D(this$.Tables), name, table);
- }
- static updateTable(name, table) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.UpdateTable(name, table);
- return newAssay;
- };
- }
- RemoveTableAt(index) {
- const this$ = this;
- ArcTables__RemoveTableAt_Z524259A4(ArcTables_$ctor_Z18C2F36D(this$.Tables), index);
- }
- static removeTableAt(index) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RemoveTableAt(index);
- return newAssay;
- };
- }
- RemoveTable(name) {
- const this$ = this;
- ArcTables__RemoveTable_Z721C83C5(ArcTables_$ctor_Z18C2F36D(this$.Tables), name);
- }
- static removeTable(name) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RemoveTable(name);
- return newAssay;
- };
- }
- MapTableAt(index, updateFun) {
- const this$ = this;
- ArcTables__MapTableAt_8FC095C(ArcTables_$ctor_Z18C2F36D(this$.Tables), index, updateFun);
- }
- static mapTableAt(index, updateFun) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.MapTableAt(index, updateFun);
- return newAssay;
- };
- }
- MapTable(name, updateFun) {
- const this$ = this;
- ArcTables__MapTable_27DD7B1B(ArcTables_$ctor_Z18C2F36D(this$.Tables), name, updateFun);
- }
- static mapTable(name, updateFun) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.MapTable(name, updateFun);
- return newAssay;
- };
- }
- RenameTableAt(index, newName) {
- const this$ = this;
- ArcTables__RenameTableAt_Z176EF219(ArcTables_$ctor_Z18C2F36D(this$.Tables), index, newName);
- }
- static renameTableAt(index, newName) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RenameTableAt(index, newName);
- return newAssay;
- };
- }
- RenameTable(name, newName) {
- const this$ = this;
- ArcTables__RenameTable_Z384F8060(ArcTables_$ctor_Z18C2F36D(this$.Tables), name, newName);
- }
- static renameTable(name, newName) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RenameTable(name, newName);
- return newAssay;
- };
- }
- AddColumnAt(tableIndex, header, cells, columnIndex, forceReplace) {
- const this$ = this;
- ArcTables__AddColumnAt_6A9784DB(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- }
- static addColumnAt(tableIndex, header, cells, columnIndex, forceReplace) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.AddColumnAt(tableIndex, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- return newAssay;
- };
- }
- AddColumn(tableName, header, cells, columnIndex, forceReplace) {
- const this$ = this;
- ArcTables__AddColumn_1FF50D3C(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- }
- static addColumn(tableName, header, cells, columnIndex, forceReplace) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.AddColumn(tableName, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- return newAssay;
- };
- }
- RemoveColumnAt(tableIndex, columnIndex) {
- const this$ = this;
- ArcTables__RemoveColumnAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, columnIndex);
- }
- static removeColumnAt(tableIndex, columnIndex) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RemoveColumnAt(tableIndex, columnIndex);
- return newAssay;
- };
- }
- RemoveColumn(tableName, columnIndex) {
- const this$ = this;
- ArcTables__RemoveColumn_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, columnIndex);
- }
- static removeColumn(tableName, columnIndex) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RemoveColumn(tableName, columnIndex);
- return newAssay;
- };
- }
- UpdateColumnAt(tableIndex, columnIndex, header, cells) {
- const this$ = this;
- ArcTables__UpdateColumnAt_21300791(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, columnIndex, header, unwrap(cells));
- }
- static updateColumnAt(tableIndex, columnIndex, header, cells) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.UpdateColumnAt(tableIndex, columnIndex, header, unwrap(cells));
- return newAssay;
- };
- }
- UpdateColumn(tableName, columnIndex, header, cells) {
- const this$ = this;
- ArcTables__UpdateColumn_Z6083042A(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, columnIndex, header, unwrap(cells));
- }
- static updateColumn(tableName, columnIndex, header, cells) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.UpdateColumn(tableName, columnIndex, header, unwrap(cells));
- return newAssay;
- };
- }
- GetColumnAt(tableIndex, columnIndex) {
- const this$ = this;
- return ArcTables__GetColumnAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, columnIndex);
- }
- static getColumnAt(tableIndex, columnIndex) {
- return (study) => {
- const newAssay = study.Copy();
- return newAssay.GetColumnAt(tableIndex, columnIndex);
- };
- }
- GetColumn(tableName, columnIndex) {
- const this$ = this;
- return ArcTables__GetColumn_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, columnIndex);
- }
- static getColumn(tableName, columnIndex) {
- return (study) => {
- const newAssay = study.Copy();
- return newAssay.GetColumn(tableName, columnIndex);
- };
- }
- AddRowAt(tableIndex, cells, rowIndex) {
- const this$ = this;
- ArcTables__AddRowAt_Z12CDB784(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, unwrap(cells), unwrap(rowIndex));
- }
- static addRowAt(tableIndex, cells, rowIndex) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.AddRowAt(tableIndex, unwrap(cells), unwrap(rowIndex));
- return newAssay;
- };
- }
- AddRow(tableName, cells, rowIndex) {
- const this$ = this;
- ArcTables__AddRow_Z16315DE5(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, unwrap(cells), unwrap(rowIndex));
- }
- static addRow(tableName, cells, rowIndex) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.AddRow(tableName, unwrap(cells), unwrap(rowIndex));
- return newAssay;
- };
- }
- RemoveRowAt(tableIndex, rowIndex) {
- const this$ = this;
- ArcTables__RemoveRowAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, rowIndex);
- }
- static removeRowAt(tableIndex, rowIndex) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RemoveColumnAt(tableIndex, rowIndex);
- return newAssay;
- };
- }
- RemoveRow(tableName, rowIndex) {
- const this$ = this;
- ArcTables__RemoveRow_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, rowIndex);
- }
- static removeRow(tableName, rowIndex) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.RemoveRow(tableName, rowIndex);
- return newAssay;
- };
- }
- UpdateRowAt(tableIndex, rowIndex, cells) {
- const this$ = this;
- ArcTables__UpdateRowAt_1CF7B5DC(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, rowIndex, cells);
- }
- static updateRowAt(tableIndex, rowIndex, cells) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.UpdateRowAt(tableIndex, rowIndex, cells);
- return newAssay;
- };
- }
- UpdateRow(tableName, rowIndex, cells) {
- const this$ = this;
- ArcTables__UpdateRow_1BFE2CFB(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, rowIndex, cells);
- }
- static updateRow(tableName, rowIndex, cells) {
- return (study) => {
- const newAssay = study.Copy();
- newAssay.UpdateRow(tableName, rowIndex, cells);
- return newAssay;
- };
- }
- GetRowAt(tableIndex, rowIndex) {
- const this$ = this;
- return ArcTables__GetRowAt_Z37302880(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableIndex, rowIndex);
- }
- static getRowAt(tableIndex, rowIndex) {
- return (study) => {
- const newAssay = study.Copy();
- return newAssay.GetRowAt(tableIndex, rowIndex);
- };
- }
- GetRow(tableName, rowIndex) {
- const this$ = this;
- return ArcTables__GetRow_Z18115A39(ArcTables_$ctor_Z18C2F36D(this$.Tables), tableName, rowIndex);
- }
- static getRow(tableName, rowIndex) {
- return (study) => {
- const newAssay = study.Copy();
- return newAssay.GetRow(tableName, rowIndex);
- };
- }
- Copy() {
- const this$ = this;
- const newTables = [];
- const newAssays = [];
- let enumerator = getEnumerator(this$.Tables);
- try {
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
- const table = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
- const copy = table.Copy();
- void (newTables.push(copy));
- }
- }
- finally {
- disposeSafe(enumerator);
- }
- let enumerator_1 = getEnumerator(this$.Assays);
- try {
- while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
- const study = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
- const copy_1 = study.Copy();
- void (newAssays.push(copy_1));
- }
- }
- finally {
- disposeSafe(enumerator_1);
- }
- return new ArcStudy(this$.Identifier, unwrap(this$.Title), unwrap(this$.Description), unwrap(this$.submissionDate), unwrap(this$.PublicReleaseDate), this$.Publications, this$.Contacts, this$.StudyDesignDescriptors, newTables, newAssays, this$.Factors, this$.Comments);
- }
- ToStudy() {
- const this$ = this;
- const processSeq = ArcTables__GetProcesses(ArcTables_$ctor_Z18C2F36D(this$.Tables));
- const protocols = fromValueWithDefault(empty(), getProtocols(processSeq));
- const assays = fromValueWithDefault(empty(), map_1((a) => a.ToAssay(), toList(this$.Assays)));
- let studyMaterials;
- const v_5 = StudyMaterials_create_1BE9FA55(unwrap(fromValueWithDefault(empty(), getSources(processSeq))), unwrap(fromValueWithDefault(empty(), getSamples(processSeq))), unwrap(fromValueWithDefault(empty(), getMaterials(processSeq))));
- studyMaterials = fromValueWithDefault(StudyMaterials_get_empty(), v_5);
- const patternInput = isMissingIdentifier(this$.Identifier) ? [void 0, void 0] : [this$.Identifier, Study_fileNameFromIdentifier(this$.Identifier)];
- return Study_create_Z2D28E954(void 0, unwrap(patternInput[1]), unwrap(patternInput[0]), unwrap(this$.Title), unwrap(this$.Description), unwrap(this$.SubmissionDate), unwrap(this$.PublicReleaseDate), unwrap(fromValueWithDefault(empty(), ofArray(this$.Publications))), unwrap(fromValueWithDefault(empty(), ofArray(this$.Contacts))), unwrap(fromValueWithDefault(empty(), ofArray(this$.StudyDesignDescriptors))), unwrap(protocols), unwrap(studyMaterials), unwrap(fromValueWithDefault(empty(), processSeq)), unwrap(assays), unwrap(fromValueWithDefault(empty(), ofArray(this$.Factors))), unwrap(fromValueWithDefault(empty(), getCharacteristics(processSeq))), unwrap(fromValueWithDefault(empty(), getUnits(processSeq))), unwrap(fromValueWithDefault(empty(), ofArray(this$.Comments))));
- }
- static fromStudy(s) {
- const tables = map_2((arg_1) => ArcTables__get_Tables(ArcTables_fromProcesses_134EBDED(arg_1)), s.ProcessSequence);
- let identifer;
- const matchValue = s.FileName;
- identifer = ((matchValue == null) ? createMissingIdentifier() : Study_identifierFromFileName(matchValue));
- const assays = map_2((arg_4) => {
- const arg_3 = map_1((arg_2) => ArcAssay.fromAssay(arg_2), arg_4);
- return Array.from(arg_3);
- }, s.Assays);
- return ArcStudy.create(identifer, unwrap(s.Title), unwrap(s.Description), unwrap(s.SubmissionDate), unwrap(s.PublicReleaseDate), unwrap(map_2(toArray, s.Publications)), unwrap(map_2(toArray, s.Contacts)), unwrap(map_2(toArray, s.StudyDesignDescriptors)), unwrap(tables), unwrap(assays), unwrap(map_2(toArray, s.Factors)), unwrap(map_2(toArray, s.Comments)));
- }
-}
-
-export function ArcStudy_$reflection() {
- return class_type("ARCtrl.ISA.ArcStudy", void 0, ArcStudy);
-}
-
-export function ArcStudy_$ctor_1627F9A7(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, assays, factors, comments) {
- return new ArcStudy(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, assays, factors, comments);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/ArcTable.js b/js/ISA/ISA/ArcTypes/ArcTable.js
deleted file mode 100644
index 9169b6bc..00000000
--- a/js/ISA/ISA/ArcTypes/ArcTable.js
+++ /dev/null
@@ -1,594 +0,0 @@
-import { Dictionary } from "../../../fable_modules/fable-library.4.1.4/MutableMap.js";
-import { stringHash, compareArrays, safeHash, disposeSafe, getEnumerator, equals, comparePrimitives, arrayHash, equalArrays } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { map as map_2, value as value_9, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { ProcessParsing_processToRows, ProcessParsing_alignByHeaders, ProcessParsing_getProcessGetter, Unchecked_removeRowCells_withIndexChange, Unchecked_addRow, Unchecked_getEmptyCellForHeader, Unchecked_removeColumnCells_withIndexChange, tryFindDuplicateUniqueInArray, Unchecked_removeColumnCells, Unchecked_removeHeader, Unchecked_fillMissingCells, Unchecked_addColumn, tryFindDuplicateUnique, Unchecked_setCellAt, SanityChecks_validateColumn, SanityChecks_validateRowIndex, SanityChecks_validateColumnIndex, Unchecked_tryGetCellAt, getRowCount, getColumnCount } from "./ArcTableAux.js";
-import { sortBy, forAll2, append, zip, fold, filter, length, singleton, collect, findIndex, toArray, removeAt, map, delay, toList } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-import { rangeDouble } from "../../../fable_modules/fable-library.4.1.4/Range.js";
-import { CompositeColumn } from "./CompositeColumn.js";
-import { singleton as singleton_1, initialize, sortDescending, iterateIndexed, map as map_1 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { collect as collect_1, initialize as initialize_1, singleton as singleton_2, empty, iterate, isEmpty } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { StringBuilder__AppendLine_Z721C83C5, StringBuilder_$ctor } from "../../../fable_modules/fable-library.4.1.4/System.Text.js";
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { CompositeCell_$reflection, CompositeCell } from "./CompositeCell.js";
-import { CompositeHeader_$reflection, CompositeHeader } from "./CompositeHeader.js";
-import { ARCtrl_ISA_Component__Component_TryGetColumnIndex, ARCtrl_ISA_ProtocolParameter__ProtocolParameter_TryGetColumnIndex } from "../JsonTypes/ColumnIndex.js";
-import { Protocol_get_empty, Protocol_addComponent, Protocol_addParameter, Protocol_setName, Protocol_setDescription, Protocol_setUri, Protocol_setVersion, Protocol_setProtocolType } from "../JsonTypes/Protocol.js";
-import { OntologyAnnotation_get_empty } from "../JsonTypes/OntologyAnnotation.js";
-import { ProtocolParameter_create_Z6C54B221 } from "../JsonTypes/ProtocolParameter.js";
-import { Component_create_61502994 } from "../JsonTypes/Component.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { toProtocol } from "./CompositeRow.js";
-import { join } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { record_type, class_type, tuple_type, int32_type, array_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class ArcTable extends Record {
- constructor(Name, Headers, Values) {
- super();
- this.Name = Name;
- this.Headers = Headers;
- this.Values = Values;
- }
- static create(name, headers, values) {
- return new ArcTable(name, headers, values);
- }
- static init(name) {
- return new ArcTable(name, [], new Dictionary([], {
- Equals: equalArrays,
- GetHashCode: arrayHash,
- }));
- }
- Validate(raiseException) {
- const this$ = this;
- let isValid = true;
- for (let columnIndex = 0; columnIndex <= (this$.ColumnCount - 1); columnIndex++) {
- const column = this$.GetColumn(columnIndex);
- isValid = column.validate(unwrap(raiseException));
- }
- return isValid;
- }
- static validate(raiseException) {
- return (table) => table.Validate(unwrap(raiseException));
- }
- get ColumnCount() {
- const this$ = this;
- return getColumnCount(this$.Headers) | 0;
- }
- get RowCount() {
- const this$ = this;
- return getRowCount(this$.Values) | 0;
- }
- get Columns() {
- const this$ = this;
- return toList(delay(() => map((i) => this$.GetColumn(i), rangeDouble(0, 1, this$.ColumnCount - 1))));
- }
- Copy() {
- const this$ = this;
- return ArcTable.create(this$.Name, Array.from(this$.Headers), new Dictionary(this$.Values, {
- Equals: equalArrays,
- GetHashCode: arrayHash,
- }));
- }
- TryGetCellAt(column, row) {
- const this$ = this;
- return Unchecked_tryGetCellAt(column, row, this$.Values);
- }
- static tryGetCellAt(column, row) {
- return (table) => table.TryGetCellAt(column, row);
- }
- UpdateCellAt(columnIndex, rowIndex, c) {
- const this$ = this;
- SanityChecks_validateColumnIndex(columnIndex, this$.ColumnCount, false);
- SanityChecks_validateRowIndex(rowIndex, this$.RowCount, false);
- SanityChecks_validateColumn(CompositeColumn.create(this$.Headers[columnIndex], [c]));
- Unchecked_setCellAt(columnIndex, rowIndex, c, this$.Values);
- }
- static updateCellAt(columnIndex, rowIndex, cell) {
- return (table) => {
- const newTable = table.Copy();
- newTable.UpdateCellAt(columnIndex, rowIndex, cell);
- return newTable;
- };
- }
- UpdateHeader(index, newHeader, forceConvertCells) {
- const this$ = this;
- const forceConvertCells_1 = defaultArg(forceConvertCells, false);
- SanityChecks_validateColumnIndex(index, this$.ColumnCount, false);
- const header = newHeader;
- const matchValue = tryFindDuplicateUnique(header, removeAt(index, this$.Headers));
- if (matchValue != null) {
- throw new Error(`Invalid input. Tried setting unique header \`${header}\`, but header of same type already exists at index ${matchValue}.`);
- }
- const c = new CompositeColumn(newHeader, this$.GetColumn(index).Cells);
- if (c.validate()) {
- let setHeader;
- setHeader = (this$.Headers[index] = newHeader);
- }
- else if (forceConvertCells_1) {
- const convertedCells = newHeader.IsTermColumn ? map_1((c_1) => c_1.ToTermCell(), c.Cells) : map_1((c_2) => c_2.ToFreeTextCell(), c.Cells);
- this$.UpdateColumn(index, newHeader, convertedCells);
- }
- else {
- throw new Error("Tried setting header for column with invalid type of cells. Set `forceConvertCells` flag to automatically convert cells into valid CompositeCell type.");
- }
- }
- static updateHeader(index, header) {
- return (table) => {
- const newTable = table.Copy();
- newTable.UpdateHeader(index, header);
- return newTable;
- };
- }
- AddColumn(header, cells, index, forceReplace) {
- const this$ = this;
- const index_1 = defaultArg(index, this$.ColumnCount) | 0;
- const cells_1 = defaultArg(cells, []);
- const forceReplace_1 = defaultArg(forceReplace, false);
- SanityChecks_validateColumnIndex(index_1, this$.ColumnCount, true);
- SanityChecks_validateColumn(CompositeColumn.create(header, cells_1));
- Unchecked_addColumn(header, cells_1, index_1, forceReplace_1, this$.Headers, this$.Values);
- Unchecked_fillMissingCells(this$.Headers, this$.Values);
- }
- static addColumn(header, cells, index, forceReplace) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AddColumn(header, unwrap(cells), unwrap(index), unwrap(forceReplace));
- return newTable;
- };
- }
- UpdateColumn(columnIndex, header, cells) {
- const this$ = this;
- SanityChecks_validateColumnIndex(columnIndex, this$.ColumnCount, false);
- const column = CompositeColumn.create(header, unwrap(cells));
- SanityChecks_validateColumn(column);
- const header_1 = column.Header;
- const matchValue = tryFindDuplicateUnique(header_1, removeAt(columnIndex, this$.Headers));
- if (matchValue != null) {
- throw new Error(`Invalid input. Tried setting unique header \`${header_1}\`, but header of same type already exists at index ${matchValue}.`);
- }
- Unchecked_removeHeader(columnIndex, this$.Headers);
- Unchecked_removeColumnCells(columnIndex, this$.Values);
- this$.Headers.splice(columnIndex, 0, column.Header);
- iterateIndexed((rowIndex, v) => {
- Unchecked_setCellAt(columnIndex, rowIndex, v, this$.Values);
- }, column.Cells);
- Unchecked_fillMissingCells(this$.Headers, this$.Values);
- }
- static updatetColumn(columnIndex, header, cells) {
- return (table) => {
- const newTable = table.Copy();
- newTable.UpdateColumn(columnIndex, header, unwrap(cells));
- return newTable;
- };
- }
- InsertColumn(header, index, cells) {
- const this$ = this;
- this$.AddColumn(header, unwrap(cells), index, false);
- }
- static insertColumn(header, index, cells) {
- return (table) => {
- const newTable = table.Copy();
- newTable.InsertColumn(header, index, unwrap(cells));
- return newTable;
- };
- }
- AppendColumn(header, cells) {
- const this$ = this;
- this$.AddColumn(header, unwrap(cells), this$.ColumnCount, false);
- }
- static appendColumn(header, cells) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AppendColumn(header, unwrap(cells));
- return newTable;
- };
- }
- AddColumns(columns, index, forceReplace) {
- const this$ = this;
- let index_1 = defaultArg(index, this$.ColumnCount);
- const forceReplace_1 = defaultArg(forceReplace, false);
- SanityChecks_validateColumnIndex(index_1, this$.ColumnCount, true);
- const duplicates = tryFindDuplicateUniqueInArray(map((x) => x.Header, columns));
- if (!isEmpty(duplicates)) {
- const sb = StringBuilder_$ctor();
- StringBuilder__AppendLine_Z721C83C5(sb, "Found duplicate unique columns in `columns`.");
- iterate((x_1) => {
- StringBuilder__AppendLine_Z721C83C5(sb, `Duplicate \`${x_1.HeaderType}\` at index ${x_1.Index1} and ${x_1.Index2}.`);
- }, duplicates);
- throw new Error(toString(sb));
- }
- columns.forEach((x_2) => {
- SanityChecks_validateColumn(x_2);
- });
- columns.forEach((col) => {
- const prevHeadersCount = this$.Headers.length | 0;
- Unchecked_addColumn(col.Header, col.Cells, index_1, forceReplace_1, this$.Headers, this$.Values);
- if (this$.Headers.length > prevHeadersCount) {
- index_1 = ((index_1 + 1) | 0);
- }
- });
- Unchecked_fillMissingCells(this$.Headers, this$.Values);
- }
- static addColumns(columns, index) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AddColumns(columns, index);
- return newTable;
- };
- }
- RemoveColumn(index) {
- const this$ = this;
- SanityChecks_validateColumnIndex(index, this$.ColumnCount, false);
- const columnCount = this$.ColumnCount | 0;
- Unchecked_removeHeader(index, this$.Headers);
- Unchecked_removeColumnCells_withIndexChange(index, columnCount, this$.RowCount, this$.Values);
- }
- static removeColumn(index) {
- return (table) => {
- const newTable = table.Copy();
- newTable.RemoveColumn(index);
- return newTable;
- };
- }
- RemoveColumns(indexArr) {
- const this$ = this;
- indexArr.forEach((index) => {
- SanityChecks_validateColumnIndex(index, this$.ColumnCount, false);
- });
- const indexArr_1 = sortDescending(indexArr, {
- Compare: comparePrimitives,
- });
- indexArr_1.forEach((index_1) => {
- this$.RemoveColumn(index_1);
- });
- }
- static removeColumns(indexArr) {
- return (table) => {
- const newTable = table.Copy();
- newTable.RemoveColumns(indexArr);
- return newTable;
- };
- }
- GetColumn(columnIndex) {
- const this$ = this;
- SanityChecks_validateColumnIndex(columnIndex, this$.ColumnCount, false);
- const h = this$.Headers[columnIndex];
- const cells = toArray(delay(() => map((i) => value_9(this$.TryGetCellAt(columnIndex, i)), rangeDouble(0, 1, this$.RowCount - 1))));
- return CompositeColumn.create(h, cells);
- }
- static getColumn(index) {
- return (table) => table.GetColumn(index);
- }
- GetColumnByHeader(header) {
- const this$ = this;
- const index = findIndex((x) => equals(x, header), this$.Headers) | 0;
- return this$.GetColumn(index);
- }
- AddRow(cells, index) {
- const this$ = this;
- const index_1 = defaultArg(index, this$.RowCount) | 0;
- const cells_1 = (cells == null) ? toArray(delay(() => collect((columnIndex) => singleton(Unchecked_getEmptyCellForHeader(this$.Headers[columnIndex], Unchecked_tryGetCellAt(columnIndex, 0, this$.Values))), rangeDouble(0, 1, this$.ColumnCount - 1)))) : value_9(cells);
- SanityChecks_validateRowIndex(index_1, this$.RowCount, true);
- const columnCount = this$.ColumnCount | 0;
- const newCellsCount = length(cells_1) | 0;
- if (columnCount === 0) {
- throw new Error("Table contains no columns! Cannot add row to empty table!");
- }
- else if (newCellsCount !== columnCount) {
- throw new Error(`Cannot add a new row with ${newCellsCount} cells, as the table has ${columnCount} columns.`);
- }
- for (let columnIndex_1 = 0; columnIndex_1 <= (this$.ColumnCount - 1); columnIndex_1++) {
- const h_1 = this$.Headers[columnIndex_1];
- SanityChecks_validateColumn(CompositeColumn.create(h_1, [cells_1[columnIndex_1]]));
- }
- Unchecked_addRow(index_1, cells_1, this$.Headers, this$.Values);
- }
- static addRow(cells, index) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AddRow(unwrap(cells), unwrap(index));
- return newTable;
- };
- }
- UpdateRow(rowIndex, cells) {
- const this$ = this;
- SanityChecks_validateRowIndex(rowIndex, this$.RowCount, false);
- const columnCount = this$.RowCount | 0;
- const newCellsCount = length(cells) | 0;
- if (columnCount === 0) {
- throw new Error("Table contains no columns! Cannot add row to empty table!");
- }
- else if (newCellsCount !== columnCount) {
- throw new Error(`Cannot add a new row with ${newCellsCount} cells, as the table has ${columnCount} columns.`);
- }
- iterateIndexed((i, cell) => {
- const h = this$.Headers[i];
- SanityChecks_validateColumn(CompositeColumn.create(h, [cell]));
- }, cells);
- iterateIndexed((columnIndex, cell_1) => {
- Unchecked_setCellAt(columnIndex, rowIndex, cell_1, this$.Values);
- }, cells);
- }
- static updateRow(rowIndex, cells) {
- return (table) => {
- const newTable = table.Copy();
- newTable.UpdateRow(rowIndex, cells);
- return newTable;
- };
- }
- AppendRow(cells) {
- const this$ = this;
- this$.AddRow(unwrap(cells), this$.RowCount);
- }
- static appendRow(cells) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AppendRow(unwrap(cells));
- return newTable;
- };
- }
- InsertRow(index, cells) {
- const this$ = this;
- this$.AddRow(unwrap(cells), index);
- }
- static insertRow(index, cells) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AddRow(unwrap(cells), index);
- return newTable;
- };
- }
- AddRows(rows, index) {
- const this$ = this;
- let index_1 = defaultArg(index, this$.RowCount);
- SanityChecks_validateRowIndex(index_1, this$.RowCount, true);
- rows.forEach((row) => {
- const columnCount = this$.ColumnCount | 0;
- const newCellsCount = length(row) | 0;
- if (columnCount === 0) {
- throw new Error("Table contains no columns! Cannot add row to empty table!");
- }
- else if (newCellsCount !== columnCount) {
- throw new Error(`Cannot add a new row with ${newCellsCount} cells, as the table has ${columnCount} columns.`);
- }
- });
- for (let idx = 0; idx <= (rows.length - 1); idx++) {
- const row_1 = rows[idx];
- for (let columnIndex = 0; columnIndex <= (this$.ColumnCount - 1); columnIndex++) {
- const h = this$.Headers[columnIndex];
- SanityChecks_validateColumn(CompositeColumn.create(h, [row_1[columnIndex]]));
- }
- }
- rows.forEach((row_2) => {
- Unchecked_addRow(index_1, row_2, this$.Headers, this$.Values);
- index_1 = ((index_1 + 1) | 0);
- });
- }
- static addRows(rows, index) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AddRows(rows, unwrap(index));
- return newTable;
- };
- }
- AddRowsEmpty(rowCount, index) {
- const this$ = this;
- const row = toArray(delay(() => collect((columnIndex) => singleton(Unchecked_getEmptyCellForHeader(this$.Headers[columnIndex], Unchecked_tryGetCellAt(columnIndex, 0, this$.Values))), rangeDouble(0, 1, this$.ColumnCount - 1))));
- const rows = initialize(rowCount, (_arg) => row);
- this$.AddRows(rows, unwrap(index));
- }
- static addRowsEmpty(rowCount, index) {
- return (table) => {
- const newTable = table.Copy();
- newTable.AddRowsEmpty(rowCount, unwrap(index));
- return newTable;
- };
- }
- RemoveRow(index) {
- const this$ = this;
- SanityChecks_validateRowIndex(index, this$.RowCount, false);
- const removeCells = Unchecked_removeRowCells_withIndexChange(index, this$.ColumnCount, this$.RowCount, this$.Values);
- }
- static removeRow(index) {
- return (table) => {
- const newTable = table.Copy();
- newTable.RemoveRow(index);
- return newTable;
- };
- }
- RemoveRows(indexArr) {
- const this$ = this;
- indexArr.forEach((index) => {
- SanityChecks_validateRowIndex(index, this$.RowCount, false);
- });
- const indexArr_1 = sortDescending(indexArr, {
- Compare: comparePrimitives,
- });
- indexArr_1.forEach((index_1) => {
- this$.RemoveRow(index_1);
- });
- }
- static removeRows(indexArr) {
- return (table) => {
- const newTable = table.Copy();
- newTable.RemoveColumns(indexArr);
- return newTable;
- };
- }
- GetRow(rowIndex) {
- const this$ = this;
- SanityChecks_validateRowIndex(rowIndex, this$.RowCount, false);
- return toArray(delay(() => map((columnIndex) => value_9(this$.TryGetCellAt(columnIndex, rowIndex)), rangeDouble(0, 1, this$.ColumnCount - 1))));
- }
- static getRow(index) {
- return (table) => table.GetRow(index);
- }
- static insertParameterValue(t, p) {
- throw new Error();
- }
- static getParameterValues(t) {
- throw new Error();
- }
- AddProtocolTypeColumn(types, index) {
- const this$ = this;
- const cells = map_2((array) => map_1((arg) => (new CompositeCell(0, [arg])), array), types);
- this$.AddColumn(new CompositeHeader(4, []), cells, index);
- }
- AddProtocolVersionColumn(versions, index) {
- const this$ = this;
- const cells = map_2((array) => map_1((arg) => (new CompositeCell(1, [arg])), array), versions);
- this$.AddColumn(new CompositeHeader(7, []), cells, index);
- }
- AddProtocolUriColumn(uris, index) {
- const this$ = this;
- const cells = map_2((array) => map_1((arg) => (new CompositeCell(1, [arg])), array), uris);
- this$.AddColumn(new CompositeHeader(6, []), cells, index);
- }
- AddProtocolDescriptionColumn(descriptions, index) {
- const this$ = this;
- const cells = map_2((array) => map_1((arg) => (new CompositeCell(1, [arg])), array), descriptions);
- this$.AddColumn(new CompositeHeader(5, []), cells, index);
- }
- AddProtocolNameColumn(names, index) {
- const this$ = this;
- const cells = map_2((array) => map_1((arg) => (new CompositeCell(1, [arg])), array), names);
- this$.AddColumn(new CompositeHeader(8, []), cells, index);
- }
- GetProtocolTypeColumn() {
- const this$ = this;
- return this$.GetColumnByHeader(new CompositeHeader(4, []));
- }
- GetProtocolVersionColumn() {
- const this$ = this;
- return this$.GetColumnByHeader(new CompositeHeader(7, []));
- }
- GetProtocolUriColumn() {
- const this$ = this;
- return this$.GetColumnByHeader(new CompositeHeader(6, []));
- }
- GetProtocolDescriptionColumn() {
- const this$ = this;
- return this$.GetColumnByHeader(new CompositeHeader(5, []));
- }
- GetProtocolNameColumn() {
- const this$ = this;
- return this$.GetColumnByHeader(new CompositeHeader(8, []));
- }
- GetComponentColumns() {
- const this$ = this;
- return map_1((h_1) => this$.GetColumnByHeader(h_1), toArray(filter((h) => h.isComponent, this$.Headers)));
- }
- static fromProtocol(p) {
- const t = ArcTable.init(defaultArg(p.Name, ""));
- const enumerator = getEnumerator(defaultArg(p.Parameters, empty()));
- try {
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
- const pp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
- t.AddColumn(new CompositeHeader(3, [value_9(pp.ParameterName)]), void 0, ARCtrl_ISA_ProtocolParameter__ProtocolParameter_TryGetColumnIndex(pp));
- }
- }
- finally {
- disposeSafe(enumerator);
- }
- const enumerator_1 = getEnumerator(defaultArg(p.Components, empty()));
- try {
- while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
- const c = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
- const v_1 = map_2((arg) => singleton_1(CompositeCell.fromValue(arg, unwrap(c.ComponentUnit))), c.ComponentValue);
- t.AddColumn(new CompositeHeader(3, [value_9(c.ComponentType)]), v_1, ARCtrl_ISA_Component__Component_TryGetColumnIndex(c));
- }
- }
- finally {
- disposeSafe(enumerator_1);
- }
- map_2((d) => {
- t.AddProtocolDescriptionColumn([d]);
- }, p.Description);
- map_2((d_1) => {
- t.AddProtocolVersionColumn([d_1]);
- }, p.Version);
- map_2((d_2) => {
- t.AddProtocolTypeColumn([d_2]);
- }, p.ProtocolType);
- map_2((d_3) => {
- t.AddProtocolUriColumn([d_3]);
- }, p.Uri);
- map_2((d_4) => {
- t.AddProtocolNameColumn([d_4]);
- }, p.Name);
- return t;
- }
- GetProtocols() {
- const this$ = this;
- return (this$.RowCount === 0) ? singleton_2(fold((p, h) => {
- switch (h.tag) {
- case 4:
- return Protocol_setProtocolType(p, OntologyAnnotation_get_empty());
- case 7:
- return Protocol_setVersion(p, "");
- case 6:
- return Protocol_setUri(p, "");
- case 5:
- return Protocol_setDescription(p, "");
- case 8:
- return Protocol_setName(p, "");
- case 3:
- return Protocol_addParameter(ProtocolParameter_create_Z6C54B221(void 0, h.fields[0]), p);
- case 0:
- return Protocol_addComponent(Component_create_61502994(void 0, void 0, void 0, h.fields[0]), p);
- default:
- return p;
- }
- }, Protocol_get_empty(), this$.Headers)) : List_distinct(initialize_1(this$.RowCount, (i) => toProtocol(zip(this$.Headers, this$.GetRow(i)))), {
- Equals: equals,
- GetHashCode: safeHash,
- });
- }
- GetProcesses() {
- const this$ = this;
- let getter;
- const clo = ProcessParsing_getProcessGetter(this$.Name, this$.Headers);
- getter = ((arg) => {
- const clo_1 = clo(arg);
- return clo_1;
- });
- return toList(delay(() => map((i) => getter(this$.Values)(i), rangeDouble(0, 1, this$.RowCount - 1))));
- }
- static fromProcesses(name, ps) {
- const tupledArg = ProcessParsing_alignByHeaders(collect_1(ProcessParsing_processToRows, ps));
- return ArcTable.create(name, tupledArg[0], tupledArg[1]);
- }
- toString() {
- const this$ = this;
- return join("\n", toList(delay(() => append(singleton(`Table: ${this$.Name}`), delay(() => append(singleton("-------------"), delay(() => append(singleton(join("\t|\t", map(toString, this$.Headers))), delay(() => map((rowI) => join("\t|\t", map(toString, this$.GetRow(rowI))), rangeDouble(0, 1, this$.RowCount - 1)))))))))));
- }
- Equals(other) {
- const this$ = this;
- if (other instanceof ArcTable) {
- const table = other;
- const sameName = this$.Name === table.Name;
- const h1 = this$.Headers;
- const h2 = table.Headers;
- const sameHeaderLength = h1.length === h2.length;
- const sameHeaders = forAll2(equals, h1, h2);
- const b1 = sortBy((kv) => kv[0], this$.Values, {
- Compare: compareArrays,
- });
- const b2 = sortBy((kv_1) => kv_1[0], table.Values, {
- Compare: compareArrays,
- });
- return (((sameName && sameHeaderLength) && sameHeaders) && (length(b1) === length(b2))) && forAll2(equals, b1, b2);
- }
- else {
- return false;
- }
- }
- GetHashCode() {
- const this$ = this;
- return ((stringHash(this$.Name) + fold((state, ele) => (state + safeHash(ele)), 0, this$.Headers)) + fold((state_2, ele_1) => (state_2 + safeHash(ele_1)), 0, this$.Values)) | 0;
- }
-}
-
-export function ArcTable_$reflection() {
- return record_type("ARCtrl.ISA.ArcTable", [], ArcTable, () => [["Name", string_type], ["Headers", array_type(CompositeHeader_$reflection())], ["Values", class_type("System.Collections.Generic.Dictionary`2", [tuple_type(int32_type, int32_type), CompositeCell_$reflection()])]]);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/ArcTableAux.js b/js/ISA/ISA/ArcTypes/ArcTableAux.js
deleted file mode 100644
index 79276823..00000000
--- a/js/ISA/ISA/ArcTypes/ArcTableAux.js
+++ /dev/null
@@ -1,1033 +0,0 @@
-import { getItemFromDict, addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { map as map_2, defaultArg, unwrap, value as value_8, some } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { empty as empty_2, singleton as singleton_1, append, delay, map, tryPick, toList, indexed, initialize, filter, tryFindIndex, maxBy } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-import { arrayHash, equalArrays, stringHash, int32ToString, compareArrays, disposeSafe, getEnumerator, compare, equals, comparePrimitives } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { mapIndexed, pick, exists, zip, append as append_1, sortBy, tryPick as tryPick_1, item, length, map as map_1, ofArray, singleton, choose, ofSeq, empty as empty_1, head, tail as tail_1, isEmpty, cons } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { CompositeCell } from "./CompositeCell.js";
-import { max } from "../../../fable_modules/fable-library.4.1.4/Double.js";
-import { iterateIndexed } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { FSharpSet__get_MinimumElement, FSharpSet__get_IsEmpty, difference, ofSeq as ofSeq_1 } from "../../../fable_modules/fable-library.4.1.4/Set.js";
-import { Value_fromString_Z721C83C5, Value } from "../JsonTypes/Value.js";
-import { Component_fromOptions } from "../JsonTypes/Component.js";
-import { ProcessParameterValue_create_569825F3 } from "../JsonTypes/ProcessParameterValue.js";
-import { ProtocolParameter_create_Z6C54B221 } from "../JsonTypes/ProtocolParameter.js";
-import { FactorValue_create_18335379 } from "../JsonTypes/FactorValue.js";
-import { Factor_create_3A99E5B8 } from "../JsonTypes/Factor.js";
-import { toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { MaterialAttributeValue_create_7F714043 } from "../JsonTypes/MaterialAttributeValue.js";
-import { MaterialAttribute_create_Z6C54B221 } from "../JsonTypes/MaterialAttribute.js";
-import { ProcessInput_getCharacteristicValues_102B6859, ProcessInput__isMaterial, ProcessInput__isData, ProcessInput_setCharacteristicValues, ProcessInput__get_Name, ProcessInput__isSource, ProcessInput__isSample, ProcessInput, ProcessInput_createDerivedData_Z721C83C5, ProcessInput_createRawData_Z721C83C5, ProcessInput_createImageFile_Z721C83C5, ProcessInput_createMaterial_2363974C, ProcessInput_createSample_Z6DF16D07, ProcessInput_createSource_7888CE42 } from "../JsonTypes/ProcessInput.js";
-import { remove, printf, toFail } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { ProcessOutput_getFactorValues_11830B70, ProcessOutput__isMaterial, ProcessOutput__isData, ProcessOutput_setFactorValues, ProcessOutput__get_Name, ProcessOutput__isSample, ProcessOutput, ProcessOutput_createDerivedData_Z721C83C5, ProcessOutput_createRawData_Z721C83C5, ProcessOutput_createImageFile_Z721C83C5, ProcessOutput_createMaterial_2363974C, ProcessOutput_createSample_Z6DF16D07 } from "../JsonTypes/ProcessOutput.js";
-import { IOType, CompositeHeader } from "./CompositeHeader.js";
-import { tryGetFactorColumnIndex, tryGetCharacteristicColumnIndex, tryGetComponentIndex, tryGetParameterColumnIndex, ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_SetColumnIndex_Z524259A4 } from "../JsonTypes/ColumnIndex.js";
-import { Source_create_7A281ED9 } from "../JsonTypes/Source.js";
-import { Sample_create_E50ED22 } from "../JsonTypes/Sample.js";
-import { mapOrDefault, fromValueWithDefault } from "../OptionExtensions.js";
-import { Protocol_make } from "../JsonTypes/Protocol.js";
-import { Process_decomposeName_Z721C83C5, Process_make } from "../JsonTypes/Process.js";
-import { List_groupBy } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { createMissingIdentifier } from "./Identifier.js";
-import { Dictionary } from "../../../fable_modules/fable-library.4.1.4/MutableMap.js";
-
-/**
- * Returns the dictionary with the binding added to the given dictionary.
- * If a binding with the given key already exists in the input dictionary, the existing binding is replaced by the new binding in the result dictionary.
- */
-export function Dictionary_addOrUpdateInPlace(key, value, table) {
- if (table.has(key)) {
- table.set(key, value);
- }
- else {
- addToDict(table, key, value);
- }
- return table;
-}
-
-/**
- * Lookup an element in the dictionary, returning a Some value if the element is in the domain
- * of the dictionary and None if not.
- */
-export function Dictionary_tryFind(key, table) {
- if (table.has(key)) {
- return some(getItemFromDict(table, key));
- }
- else {
- return void 0;
- }
-}
-
-export function getColumnCount(headers) {
- return headers.length;
-}
-
-export function getRowCount(values) {
- if (values.size === 0) {
- return 0;
- }
- else {
- return (1 + maxBy((tuple) => tuple[1], values.keys(), {
- Compare: comparePrimitives,
- })[1]) | 0;
- }
-}
-
-export function $007CIsUniqueExistingHeader$007C_$007C(existingHeaders, input) {
- switch (input.tag) {
- case 3:
- case 2:
- case 1:
- case 0:
- case 13:
- return void 0;
- case 12:
- return tryFindIndex((h) => (h.tag === 12), existingHeaders);
- case 11:
- return tryFindIndex((h_1) => (h_1.tag === 11), existingHeaders);
- default:
- return tryFindIndex((h_2) => equals(h_2, input), existingHeaders);
- }
-}
-
-/**
- * Returns the column index of the duplicate unique column in `existingHeaders`.
- */
-export function tryFindDuplicateUnique(newHeader, existingHeaders) {
- const activePatternResult = $007CIsUniqueExistingHeader$007C_$007C(existingHeaders, newHeader);
- if (activePatternResult != null) {
- const index = activePatternResult | 0;
- return index;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Returns the column index of the duplicate unique column in `existingHeaders`.
- */
-export function tryFindDuplicateUniqueInArray(existingHeaders) {
- const loop = (i_mut, duplicateList_mut, headerList_mut) => {
- loop:
- while (true) {
- const i = i_mut, duplicateList = duplicateList_mut, headerList = headerList_mut;
- let matchResult, header, tail;
- if (isEmpty(headerList)) {
- matchResult = 0;
- }
- else if (isEmpty(tail_1(headerList))) {
- matchResult = 0;
- }
- else {
- matchResult = 1;
- header = head(headerList);
- tail = tail_1(headerList);
- }
- switch (matchResult) {
- case 0:
- return duplicateList;
- default: {
- const hasDuplicate = tryFindDuplicateUnique(header, tail);
- i_mut = (i + 1);
- duplicateList_mut = ((hasDuplicate != null) ? cons({
- HeaderType: header,
- Index1: i,
- Index2: value_8(hasDuplicate),
- }, duplicateList) : duplicateList);
- headerList_mut = tail;
- continue loop;
- }
- }
- break;
- }
- };
- return loop(0, empty_1(), ofSeq(filter((x) => !x.IsTermColumn, existingHeaders)));
-}
-
-/**
- * Checks if given column index is valid for given number of columns.
- *
- * if `allowAppend` = true => `0 < index <= columnCount`
- *
- * if `allowAppend` = false => `0 < index < columnCount`
- */
-export function SanityChecks_validateColumnIndex(index, columnCount, allowAppend) {
- let x, y;
- if (index < 0) {
- throw new Error("Cannot insert CompositeColumn at index < 0.");
- }
- if ((x = (index | 0), (y = (columnCount | 0), allowAppend ? (compare(x, y) > 0) : (compare(x, y) >= 0)))) {
- throw new Error(`Specified index is out of table range! Table contains only ${columnCount} columns.`);
- }
-}
-
-/**
- * Checks if given index is valid for given number of rows.
- *
- * if `allowAppend` = true => `0 < index <= rowCount`
- *
- * if `allowAppend` = false => `0 < index < rowCount`
- */
-export function SanityChecks_validateRowIndex(index, rowCount, allowAppend) {
- let x, y;
- if (index < 0) {
- throw new Error("Cannot insert CompositeColumn at index < 0.");
- }
- if ((x = (index | 0), (y = (rowCount | 0), allowAppend ? (compare(x, y) > 0) : (compare(x, y) >= 0)))) {
- throw new Error(`Specified index is out of table range! Table contains only ${rowCount} rows.`);
- }
-}
-
-export function SanityChecks_validateColumn(column) {
- column.validate(true);
-}
-
-export function Unchecked_tryGetCellAt(column, row, cells) {
- return Dictionary_tryFind([column, row], cells);
-}
-
-export function Unchecked_setCellAt(columnIndex, rowIndex, c, cells) {
- Dictionary_addOrUpdateInPlace([columnIndex, rowIndex], c, cells);
-}
-
-export function Unchecked_moveCellTo(fromCol, fromRow, toCol, toRow, cells) {
- const matchValue = Dictionary_tryFind([fromCol, fromRow], cells);
- if (matchValue == null) {
- }
- else {
- const c = matchValue;
- cells.delete([fromCol, fromRow]);
- const value_1 = Unchecked_setCellAt(toCol, toRow, c, cells);
- }
-}
-
-export function Unchecked_removeHeader(index, headers) {
- headers.splice(index, 1);
-}
-
-/**
- * Remove cells of one Column, change index of cells with higher index to index - 1
- */
-export function Unchecked_removeColumnCells(index, cells) {
- let enumerator = getEnumerator(cells);
- try {
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
- const activePatternResult = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
- const c = activePatternResult[0][0] | 0;
- if (c === index) {
- cells.delete([c, activePatternResult[0][1]]);
- }
- }
- }
- finally {
- disposeSafe(enumerator);
- }
-}
-
-/**
- * Remove cells of one Column, change index of cells with higher index to index - 1
- */
-export function Unchecked_removeColumnCells_withIndexChange(index, columnCount, rowCount, cells) {
- for (let col = index; col <= (columnCount - 1); col++) {
- for (let row = 0; row <= (rowCount - 1); row++) {
- if (col === index) {
- cells.delete([col, row]);
- }
- else if (col > index) {
- Unchecked_moveCellTo(col, row, col - 1, row, cells);
- }
- }
- }
-}
-
-export function Unchecked_removeRowCells(rowIndex, cells) {
- let enumerator = getEnumerator(cells);
- try {
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
- const activePatternResult = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
- const r = activePatternResult[0][1] | 0;
- if (r === rowIndex) {
- cells.delete([activePatternResult[0][0], r]);
- }
- }
- }
- finally {
- disposeSafe(enumerator);
- }
-}
-
-/**
- * Remove cells of one Row, change index of cells with higher index to index - 1
- */
-export function Unchecked_removeRowCells_withIndexChange(rowIndex, columnCount, rowCount, cells) {
- for (let row = rowIndex; row <= (rowCount - 1); row++) {
- for (let col = 0; col <= (columnCount - 1); col++) {
- if (row === rowIndex) {
- cells.delete([col, row]);
- }
- else if (row > rowIndex) {
- Unchecked_moveCellTo(col, row, col, row - 1, cells);
- }
- }
- }
-}
-
-/**
- * Get an empty cell fitting for related column header.
- *
- * `columCellOption` is used to decide between `CompositeCell.Term` or `CompositeCell.Unitized`. `columCellOption` can be any other cell in the same column, preferably the first one.
- */
-export function Unchecked_getEmptyCellForHeader(header, columCellOption) {
- const matchValue = header.IsTermColumn;
- if (matchValue) {
- let matchResult;
- if (columCellOption == null) {
- matchResult = 0;
- }
- else {
- switch (columCellOption.tag) {
- case 0: {
- matchResult = 0;
- break;
- }
- case 2: {
- matchResult = 1;
- break;
- }
- default:
- matchResult = 2;
- }
- }
- switch (matchResult) {
- case 0:
- return CompositeCell.emptyTerm;
- case 1:
- return CompositeCell.emptyUnitized;
- default:
- throw new Error("[extendBodyCells] This should never happen, IsTermColumn header must be paired with either term or unitized cell.");
- }
- }
- else {
- return CompositeCell.emptyFreeText;
- }
-}
-
-export function Unchecked_addColumn(newHeader, newCells, index, forceReplace, headers, values) {
- let numberOfNewColumns = 1;
- let index_1 = index;
- const hasDuplicateUnique = tryFindDuplicateUnique(newHeader, headers);
- if (!forceReplace && (hasDuplicateUnique != null)) {
- throw new Error(`Invalid new column \`${newHeader}\`. Table already contains header of the same type on index \`${value_8(hasDuplicateUnique)}\``);
- }
- if (hasDuplicateUnique != null) {
- numberOfNewColumns = 0;
- index_1 = (value_8(hasDuplicateUnique) | 0);
- }
- const matchValue = getColumnCount(headers) | 0;
- const matchValue_1 = getRowCount(values) | 0;
- const startColCount = matchValue | 0;
- let setNewHeader;
- if (hasDuplicateUnique != null) {
- Unchecked_removeHeader(index_1, headers);
- }
- setNewHeader = headers.splice(index_1, 0, newHeader);
- let increaseColumnIndices;
- if ((index_1 < startColCount) && (hasDuplicateUnique == null)) {
- const lastColumnIndex = max(startColCount - 1, 0) | 0;
- for (let columnIndex = lastColumnIndex; columnIndex >= index_1; columnIndex--) {
- for (let rowIndex = 0; rowIndex <= matchValue_1; rowIndex++) {
- Unchecked_moveCellTo(columnIndex, rowIndex, columnIndex + numberOfNewColumns, rowIndex, values);
- }
- }
- }
- else {
- increaseColumnIndices = void 0;
- }
- let setNewCells;
- if (hasDuplicateUnique != null) {
- Unchecked_removeColumnCells(index_1, values);
- }
- setNewCells = iterateIndexed((rowIndex_1, cell) => {
- Unchecked_setCellAt(index_1, rowIndex_1, cell, values);
- }, newCells);
-}
-
-export function Unchecked_fillMissingCells(headers, values) {
- const rowCount = getRowCount(values) | 0;
- const lastColumnIndex = (getColumnCount(headers) - 1) | 0;
- const keys = values.keys();
- for (let columnIndex = 0; columnIndex <= lastColumnIndex; columnIndex++) {
- const colKeys = ofSeq_1(filter((tupledArg) => (tupledArg[0] === columnIndex), keys), {
- Compare: compareArrays,
- });
- const missingKeys = difference(ofSeq_1(initialize(rowCount, (i) => [columnIndex, i]), {
- Compare: compareArrays,
- }), colKeys);
- if (!FSharpSet__get_IsEmpty(missingKeys)) {
- const empty = Unchecked_getEmptyCellForHeader(headers[columnIndex], FSharpSet__get_IsEmpty(colKeys) ? void 0 : getItemFromDict(values, FSharpSet__get_MinimumElement(colKeys)));
- const enumerator = getEnumerator(missingKeys);
- try {
- while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
- const forLoopVar = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
- Unchecked_setCellAt(forLoopVar[0], forLoopVar[1], empty, values);
- }
- }
- finally {
- disposeSafe(enumerator);
- }
- }
- }
-}
-
-export function Unchecked_addRow(index, newCells, headers, values) {
- const rowCount = getRowCount(values) | 0;
- const columnCount = getColumnCount(headers) | 0;
- let increaseRowIndices;
- if (index < rowCount) {
- const lastRowIndex = max(rowCount - 1, 0) | 0;
- for (let rowIndex = lastRowIndex; rowIndex >= index; rowIndex--) {
- for (let columnIndex = 0; columnIndex <= (columnCount - 1); columnIndex++) {
- Unchecked_moveCellTo(columnIndex, rowIndex, columnIndex, rowIndex + 1, values);
- }
- }
- }
- else {
- increaseRowIndices = void 0;
- }
- const setNewCells = iterateIndexed((columnIndex_1, cell) => {
- Unchecked_setCellAt(columnIndex_1, index, cell, values);
- }, newCells);
-}
-
-/**
- * Convert a CompositeCell to a ISA Value and Unit tuple.
- */
-export function JsonTypes_valueOfCell(value) {
- switch (value.tag) {
- case 0:
- return [new Value(0, [value.fields[0]]), void 0];
- case 2:
- return [Value_fromString_Z721C83C5(value.fields[0]), value.fields[1]];
- default:
- return [Value_fromString_Z721C83C5(value.fields[0]), void 0];
- }
-}
-
-/**
- * Convert a CompositeHeader and Cell tuple to a ISA Component
- */
-export function JsonTypes_composeComponent(header, value) {
- const patternInput = JsonTypes_valueOfCell(value);
- return Component_fromOptions(patternInput[0], patternInput[1], header.ToTerm());
-}
-
-/**
- * Convert a CompositeHeader and Cell tuple to a ISA ProcessParameterValue
- */
-export function JsonTypes_composeParameterValue(header, value) {
- const patternInput = JsonTypes_valueOfCell(value);
- return ProcessParameterValue_create_569825F3(ProtocolParameter_create_Z6C54B221(void 0, header.ToTerm()), patternInput[0], unwrap(patternInput[1]));
-}
-
-/**
- * Convert a CompositeHeader and Cell tuple to a ISA FactorValue
- */
-export function JsonTypes_composeFactorValue(header, value) {
- const patternInput = JsonTypes_valueOfCell(value);
- return FactorValue_create_18335379(void 0, Factor_create_3A99E5B8(void 0, toString(header), header.ToTerm()), patternInput[0], unwrap(patternInput[1]));
-}
-
-/**
- * Convert a CompositeHeader and Cell tuple to a ISA MaterialAttributeValue
- */
-export function JsonTypes_composeCharacteristicValue(header, value) {
- const patternInput = JsonTypes_valueOfCell(value);
- return MaterialAttributeValue_create_7F714043(void 0, MaterialAttribute_create_Z6C54B221(void 0, header.ToTerm()), patternInput[0], unwrap(patternInput[1]));
-}
-
-/**
- * Convert a CompositeHeader and Cell tuple to a ISA ProcessInput
- */
-export function JsonTypes_composeProcessInput(header, value) {
- let matchResult;
- if (header.tag === 11) {
- switch (header.fields[0].tag) {
- case 0: {
- matchResult = 0;
- break;
- }
- case 1: {
- matchResult = 1;
- break;
- }
- case 5: {
- matchResult = 2;
- break;
- }
- case 4: {
- matchResult = 3;
- break;
- }
- case 2: {
- matchResult = 4;
- break;
- }
- case 3: {
- matchResult = 5;
- break;
- }
- default:
- matchResult = 6;
- }
- }
- else {
- matchResult = 6;
- }
- switch (matchResult) {
- case 0:
- return ProcessInput_createSource_7888CE42(toString(value));
- case 1:
- return ProcessInput_createSample_Z6DF16D07(toString(value));
- case 2:
- return ProcessInput_createMaterial_2363974C(toString(value));
- case 3:
- return ProcessInput_createImageFile_Z721C83C5(toString(value));
- case 4:
- return ProcessInput_createRawData_Z721C83C5(toString(value));
- case 5:
- return ProcessInput_createDerivedData_Z721C83C5(toString(value));
- default:
- return toFail(printf("Could not parse input header %O"))(header);
- }
-}
-
-/**
- * Convert a CompositeHeader and Cell tuple to a ISA ProcessOutput
- */
-export function JsonTypes_composeProcessOutput(header, value) {
- let matchResult;
- if (header.tag === 12) {
- switch (header.fields[0].tag) {
- case 1: {
- matchResult = 0;
- break;
- }
- case 5: {
- matchResult = 1;
- break;
- }
- case 4: {
- matchResult = 2;
- break;
- }
- case 2: {
- matchResult = 3;
- break;
- }
- case 3: {
- matchResult = 4;
- break;
- }
- default:
- matchResult = 5;
- }
- }
- else {
- matchResult = 5;
- }
- switch (matchResult) {
- case 0:
- return ProcessOutput_createSample_Z6DF16D07(toString(value));
- case 1:
- return ProcessOutput_createMaterial_2363974C(toString(value));
- case 2:
- return ProcessOutput_createImageFile_Z721C83C5(toString(value));
- case 3:
- return ProcessOutput_createRawData_Z721C83C5(toString(value));
- case 4:
- return ProcessOutput_createDerivedData_Z721C83C5(toString(value));
- default:
- return toFail(printf("Could not parse output header %O"))(header);
- }
-}
-
-/**
- * Convert an ISA Value and Unit tuple to a CompositeCell
- */
-export function JsonTypes_cellOfValue(value, unit) {
- const value_2 = defaultArg(value, new Value(3, [""]));
- let matchResult, oa, text, u, f, u_1, f_1, i, u_2, i_1;
- switch (value_2.tag) {
- case 3: {
- if (unit != null) {
- if (value_2.fields[0] === "") {
- matchResult = 2;
- u = unit;
- }
- else {
- matchResult = 7;
- }
- }
- else {
- matchResult = 1;
- text = value_2.fields[0];
- }
- break;
- }
- case 2: {
- if (unit == null) {
- matchResult = 4;
- f_1 = value_2.fields[0];
- }
- else {
- matchResult = 3;
- f = value_2.fields[0];
- u_1 = unit;
- }
- break;
- }
- case 1: {
- if (unit == null) {
- matchResult = 6;
- i_1 = value_2.fields[0];
- }
- else {
- matchResult = 5;
- i = value_2.fields[0];
- u_2 = unit;
- }
- break;
- }
- default:
- if (unit == null) {
- matchResult = 0;
- oa = value_2.fields[0];
- }
- else {
- matchResult = 7;
- }
- }
- switch (matchResult) {
- case 0:
- return new CompositeCell(0, [oa]);
- case 1:
- return new CompositeCell(1, [text]);
- case 2:
- return new CompositeCell(2, ["", u]);
- case 3:
- return new CompositeCell(2, [f.toString(), u_1]);
- case 4:
- return new CompositeCell(1, [f_1.toString()]);
- case 5:
- return new CompositeCell(2, [int32ToString(i), u_2]);
- case 6:
- return new CompositeCell(1, [int32ToString(i_1)]);
- default:
- return toFail(printf("Could not parse value %O with unit %O"))(value_2)(unit);
- }
-}
-
-/**
- * Convert an ISA Component to a CompositeHeader and Cell tuple
- */
-export function JsonTypes_decomposeComponent(c) {
- return [new CompositeHeader(0, [value_8(c.ComponentType)]), JsonTypes_cellOfValue(c.ComponentValue, c.ComponentUnit)];
-}
-
-/**
- * Convert an ISA ProcessParameterValue to a CompositeHeader and Cell tuple
- */
-export function JsonTypes_decomposeParameterValue(ppv) {
- return [new CompositeHeader(3, [value_8(value_8(ppv.Category).ParameterName)]), JsonTypes_cellOfValue(ppv.Value, ppv.Unit)];
-}
-
-/**
- * Convert an ISA FactorValue to a CompositeHeader and Cell tuple
- */
-export function JsonTypes_decomposeFactorValue(fv) {
- return [new CompositeHeader(2, [value_8(value_8(fv.Category).FactorType)]), JsonTypes_cellOfValue(fv.Value, fv.Unit)];
-}
-
-/**
- * Convert an ISA MaterialAttributeValue to a CompositeHeader and Cell tuple
- */
-export function JsonTypes_decomposeCharacteristicValue(cv) {
- return [new CompositeHeader(1, [value_8(value_8(cv.Category).CharacteristicType)]), JsonTypes_cellOfValue(cv.Value, cv.Unit)];
-}
-
-/**
- * Convert an ISA ProcessOutput to a CompositeHeader and Cell tuple
- */
-export function JsonTypes_decomposeProcessInput(pi) {
- switch (pi.tag) {
- case 1:
- return [new CompositeHeader(11, [new IOType(1, [])]), new CompositeCell(1, [defaultArg(pi.fields[0].Name, "")])];
- case 3:
- return [new CompositeHeader(11, [new IOType(5, [])]), new CompositeCell(1, [defaultArg(pi.fields[0].Name, "")])];
- case 2: {
- const d = pi.fields[0];
- const dataType = value_8(d.DataType);
- switch (dataType.tag) {
- case 0:
- return [new CompositeHeader(11, [new IOType(2, [])]), new CompositeCell(1, [defaultArg(d.Name, "")])];
- case 1:
- return [new CompositeHeader(11, [new IOType(3, [])]), new CompositeCell(1, [defaultArg(d.Name, "")])];
- default:
- return [new CompositeHeader(11, [new IOType(4, [])]), new CompositeCell(1, [defaultArg(d.Name, "")])];
- }
- }
- default:
- return [new CompositeHeader(11, [new IOType(0, [])]), new CompositeCell(1, [defaultArg(pi.fields[0].Name, "")])];
- }
-}
-
-/**
- * Convert an ISA ProcessOutput to a CompositeHeader and Cell tuple
- */
-export function JsonTypes_decomposeProcessOutput(po) {
- switch (po.tag) {
- case 2:
- return [new CompositeHeader(12, [new IOType(5, [])]), new CompositeCell(1, [defaultArg(po.fields[0].Name, "")])];
- case 1: {
- const d = po.fields[0];
- const dataType = value_8(d.DataType);
- switch (dataType.tag) {
- case 0:
- return [new CompositeHeader(12, [new IOType(2, [])]), new CompositeCell(1, [defaultArg(d.Name, "")])];
- case 1:
- return [new CompositeHeader(12, [new IOType(3, [])]), new CompositeCell(1, [defaultArg(d.Name, "")])];
- default:
- return [new CompositeHeader(12, [new IOType(4, [])]), new CompositeCell(1, [defaultArg(d.Name, "")])];
- }
- }
- default:
- return [new CompositeHeader(12, [new IOType(1, [])]), new CompositeCell(1, [defaultArg(po.fields[0].Name, "")])];
- }
-}
-
-/**
- * If the headers of a node depict a component, returns a function for parsing the values of the matrix to the values of this component
- */
-export function ProcessParsing_tryComponentGetter(generalI, valueI, valueHeader) {
- if (valueHeader.tag === 0) {
- const cat = new CompositeHeader(0, [ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_SetColumnIndex_Z524259A4(valueHeader.fields[0], valueI)]);
- return (matrix) => ((i) => JsonTypes_composeComponent(cat, getItemFromDict(matrix, [generalI, i])));
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If the headers of a node depict a protocolType, returns a function for parsing the values of the matrix to the values of this type
- */
-export function ProcessParsing_tryParameterGetter(generalI, valueI, valueHeader) {
- if (valueHeader.tag === 3) {
- const cat = new CompositeHeader(3, [ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_SetColumnIndex_Z524259A4(valueHeader.fields[0], valueI)]);
- return (matrix) => ((i) => JsonTypes_composeParameterValue(cat, getItemFromDict(matrix, [generalI, i])));
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryFactorGetter(generalI, valueI, valueHeader) {
- if (valueHeader.tag === 2) {
- const cat = new CompositeHeader(2, [ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_SetColumnIndex_Z524259A4(valueHeader.fields[0], valueI)]);
- return (matrix) => ((i) => JsonTypes_composeFactorValue(cat, getItemFromDict(matrix, [generalI, i])));
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryCharacteristicGetter(generalI, valueI, valueHeader) {
- if (valueHeader.tag === 1) {
- const cat = new CompositeHeader(1, [ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_SetColumnIndex_Z524259A4(valueHeader.fields[0], valueI)]);
- return (matrix) => ((i) => JsonTypes_composeCharacteristicValue(cat, getItemFromDict(matrix, [generalI, i])));
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If the headers of a node depict a protocolType, returns a function for parsing the values of the matrix to the values of this type
- */
-export function ProcessParsing_tryGetProtocolTypeGetter(generalI, header) {
- if (header.tag === 4) {
- return (matrix) => ((i) => getItemFromDict(matrix, [generalI, i]).AsTerm);
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryGetProtocolREFGetter(generalI, header) {
- if (header.tag === 8) {
- return (matrix) => ((i) => getItemFromDict(matrix, [generalI, i]).AsFreeText);
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryGetProtocolDescriptionGetter(generalI, header) {
- if (header.tag === 5) {
- return (matrix) => ((i) => getItemFromDict(matrix, [generalI, i]).AsFreeText);
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryGetProtocolURIGetter(generalI, header) {
- if (header.tag === 6) {
- return (matrix) => ((i) => getItemFromDict(matrix, [generalI, i]).AsFreeText);
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryGetProtocolVersionGetter(generalI, header) {
- if (header.tag === 7) {
- return (matrix) => ((i) => getItemFromDict(matrix, [generalI, i]).AsFreeText);
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryGetInputGetter(generalI, header) {
- if (header.tag === 11) {
- return (matrix) => ((i) => JsonTypes_composeProcessInput(header, getItemFromDict(matrix, [generalI, i])));
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessParsing_tryGetOutputGetter(generalI, header) {
- if (header.tag === 12) {
- return (matrix) => ((i) => JsonTypes_composeProcessOutput(header, getItemFromDict(matrix, [generalI, i])));
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Given the header sequence of an ArcTable, returns a function for parsing each row of the table to a process
- */
-export function ProcessParsing_getProcessGetter(processNameRoot, headers) {
- const headers_1 = indexed(headers);
- const valueHeaders = toList(indexed(filter((arg) => arg[1].IsCvParamColumn, headers_1)));
- const charGetters = choose((tupledArg) => {
- const _arg = tupledArg[1];
- return ProcessParsing_tryCharacteristicGetter(_arg[0], tupledArg[0], _arg[1]);
- }, valueHeaders);
- const factorValueGetters = choose((tupledArg_1) => {
- const _arg_1 = tupledArg_1[1];
- return ProcessParsing_tryFactorGetter(_arg_1[0], tupledArg_1[0], _arg_1[1]);
- }, valueHeaders);
- const parameterValueGetters = choose((tupledArg_2) => {
- const _arg_2 = tupledArg_2[1];
- return ProcessParsing_tryParameterGetter(_arg_2[0], tupledArg_2[0], _arg_2[1]);
- }, valueHeaders);
- const componentGetters = choose((tupledArg_3) => {
- const _arg_3 = tupledArg_3[1];
- return ProcessParsing_tryComponentGetter(_arg_3[0], tupledArg_3[0], _arg_3[1]);
- }, valueHeaders);
- const protocolTypeGetter = tryPick((tupledArg_4) => ProcessParsing_tryGetProtocolTypeGetter(tupledArg_4[0], tupledArg_4[1]), headers_1);
- const protocolREFGetter = tryPick((tupledArg_5) => ProcessParsing_tryGetProtocolREFGetter(tupledArg_5[0], tupledArg_5[1]), headers_1);
- const protocolDescriptionGetter = tryPick((tupledArg_6) => ProcessParsing_tryGetProtocolDescriptionGetter(tupledArg_6[0], tupledArg_6[1]), headers_1);
- const protocolURIGetter = tryPick((tupledArg_7) => ProcessParsing_tryGetProtocolURIGetter(tupledArg_7[0], tupledArg_7[1]), headers_1);
- const protocolVersionGetter = tryPick((tupledArg_8) => ProcessParsing_tryGetProtocolVersionGetter(tupledArg_8[0], tupledArg_8[1]), headers_1);
- let inputGetter_1;
- const matchValue = tryPick((tupledArg_9) => ProcessParsing_tryGetInputGetter(tupledArg_9[0], tupledArg_9[1]), headers_1);
- if (matchValue == null) {
- inputGetter_1 = ((matrix_1) => ((i_1) => singleton(new ProcessInput(0, [Source_create_7A281ED9(void 0, `${processNameRoot}_Input_${i_1}`, toList(map((f_1) => f_1(matrix_1)(i_1), charGetters)))]))));
- }
- else {
- const inputGetter = matchValue;
- inputGetter_1 = ((matrix) => ((i) => {
- const chars = toList(map((f) => f(matrix)(i), charGetters));
- const input = inputGetter(matrix)(i);
- return (!(ProcessInput__isSample(input) ? true : ProcessInput__isSource(input)) && !isEmpty(chars)) ? ofArray([input, ProcessInput_createSample_Z6DF16D07(ProcessInput__get_Name(input), chars)]) : singleton(ProcessInput_setCharacteristicValues(chars, input));
- }));
- }
- let outputGetter_1;
- const matchValue_1 = tryPick((tupledArg_10) => ProcessParsing_tryGetOutputGetter(tupledArg_10[0], tupledArg_10[1]), headers_1);
- if (matchValue_1 == null) {
- outputGetter_1 = ((matrix_3) => ((i_3) => singleton(new ProcessOutput(0, [Sample_create_E50ED22(void 0, `${processNameRoot}_Output_${i_3}`, void 0, toList(map((f_3) => f_3(matrix_3)(i_3), factorValueGetters)))]))));
- }
- else {
- const outputGetter = matchValue_1;
- outputGetter_1 = ((matrix_2) => ((i_2) => {
- const factors = toList(map((f_2) => f_2(matrix_2)(i_2), factorValueGetters));
- const output = outputGetter(matrix_2)(i_2);
- return (!ProcessOutput__isSample(output) && !isEmpty(factors)) ? ofArray([output, ProcessOutput_createSample_Z6DF16D07(ProcessOutput__get_Name(output), void 0, factors)]) : singleton(ProcessOutput_setFactorValues(factors, output));
- }));
- }
- return (matrix_4) => ((i_4) => {
- const pn = fromValueWithDefault("", processNameRoot);
- const paramvalues = fromValueWithDefault(empty_1(), map_1((f_4) => f_4(matrix_4)(i_4), parameterValueGetters));
- const parameters = map_2((list_5) => map_1((pv) => value_8(pv.Category), list_5), paramvalues);
- const protocol = Protocol_make(void 0, mapOrDefault(pn, (f_5) => f_5(matrix_4)(i_4), protocolREFGetter), map_2((f_7) => f_7(matrix_4)(i_4), protocolTypeGetter), map_2((f_8) => f_8(matrix_4)(i_4), protocolDescriptionGetter), map_2((f_9) => f_9(matrix_4)(i_4), protocolURIGetter), map_2((f_10) => f_10(matrix_4)(i_4), protocolVersionGetter), parameters, fromValueWithDefault(empty_1(), map_1((f_11) => f_11(matrix_4)(i_4), componentGetters)), void 0);
- let patternInput;
- const inputs = inputGetter_1(matrix_4)(i_4);
- const outputs = outputGetter_1(matrix_4)(i_4);
- patternInput = (((length(inputs) === 1) && (length(outputs) === 2)) ? [ofArray([item(0, inputs), item(0, inputs)]), outputs] : (((length(inputs) === 2) && (length(outputs) === 1)) ? [inputs, ofArray([item(0, outputs), item(0, outputs)])] : [inputs, outputs]));
- return Process_make(void 0, pn, protocol, paramvalues, void 0, void 0, void 0, void 0, patternInput[0], patternInput[1], void 0);
- });
-}
-
-/**
- * Groups processes by their name, or by the name of the protocol they execute
- *
- * Process names are taken from the Worksheet name and numbered: SheetName_1, SheetName_2, etc.
- *
- * This function decomposes this name into a root name and a number, and groups processes by root name.
- */
-export function ProcessParsing_groupProcesses(ps) {
- return List_groupBy((x) => {
- if ((x.Name != null) && (Process_decomposeName_Z721C83C5(value_8(x.Name))[1] != null)) {
- return Process_decomposeName_Z721C83C5(value_8(x.Name))[0];
- }
- else if ((x.ExecutesProtocol != null) && (value_8(x.ExecutesProtocol).Name != null)) {
- return value_8(value_8(x.ExecutesProtocol).Name);
- }
- else if ((x.Name != null) && (value_8(x.Name).indexOf("_") >= 0)) {
- const lastUnderScoreIndex = value_8(x.Name).lastIndexOf("_") | 0;
- return remove(value_8(x.Name), lastUnderScoreIndex);
- }
- else if ((x.ExecutesProtocol != null) && (value_8(x.ExecutesProtocol).ID != null)) {
- return value_8(value_8(x.ExecutesProtocol).ID);
- }
- else {
- return createMissingIdentifier();
- }
- }, ps, {
- Equals: (x_1, y) => (x_1 === y),
- GetHashCode: stringHash,
- });
-}
-
-export function ProcessParsing_processToRows(p) {
- let list_3;
- const pvs = map_1((ppv) => [JsonTypes_decomposeParameterValue(ppv), tryGetParameterColumnIndex(ppv)], defaultArg(p.ParameterValues, empty_1()));
- let components;
- const matchValue = p.ExecutesProtocol;
- components = ((matchValue == null) ? empty_1() : map_1((ppv_1) => [JsonTypes_decomposeComponent(ppv_1), tryGetComponentIndex(ppv_1)], defaultArg(matchValue.Components, empty_1())));
- let protVals;
- const matchValue_1 = p.ExecutesProtocol;
- if (matchValue_1 == null) {
- protVals = empty_1();
- }
- else {
- const prot_1 = matchValue_1;
- protVals = toList(delay(() => append((prot_1.Name != null) ? singleton_1([new CompositeHeader(8, []), new CompositeCell(1, [value_8(prot_1.Name)])]) : empty_2(), delay(() => append((prot_1.ProtocolType != null) ? singleton_1([new CompositeHeader(4, []), new CompositeCell(0, [value_8(prot_1.ProtocolType)])]) : empty_2(), delay(() => append((prot_1.Description != null) ? singleton_1([new CompositeHeader(5, []), new CompositeCell(1, [value_8(prot_1.Description)])]) : empty_2(), delay(() => append((prot_1.Uri != null) ? singleton_1([new CompositeHeader(6, []), new CompositeCell(1, [value_8(prot_1.Uri)])]) : empty_2(), delay(() => ((prot_1.Version != null) ? singleton_1([new CompositeHeader(7, []), new CompositeCell(1, [value_8(prot_1.Version)])]) : empty_2())))))))))));
- }
- return map_1((tupledArg_1) => {
- const ios = tupledArg_1[1];
- const inputForCharas = defaultArg(tryPick_1((tupledArg_2) => {
- const i_2 = tupledArg_2[0];
- if (ProcessInput__isSource(i_2) ? true : ProcessInput__isSample(i_2)) {
- return i_2;
- }
- else {
- return void 0;
- }
- }, ios), head(ios)[0]);
- const inputForType = defaultArg(tryPick_1((tupledArg_3) => {
- const i_3 = tupledArg_3[0];
- if (ProcessInput__isData(i_3) ? true : ProcessInput__isMaterial(i_3)) {
- return i_3;
- }
- else {
- return void 0;
- }
- }, ios), head(ios)[0]);
- const chars = map_1((cv) => [JsonTypes_decomposeCharacteristicValue(cv), tryGetCharacteristicColumnIndex(cv)], ProcessInput_getCharacteristicValues_102B6859(inputForCharas));
- const outputForFactors = defaultArg(tryPick_1((tupledArg_4) => {
- const o_4 = tupledArg_4[1];
- if (ProcessOutput__isSample(o_4)) {
- return o_4;
- }
- else {
- return void 0;
- }
- }, ios), head(ios)[1]);
- const outputForType = defaultArg(tryPick_1((tupledArg_5) => {
- const o_5 = tupledArg_5[1];
- if (ProcessOutput__isData(o_5) ? true : ProcessOutput__isMaterial(o_5)) {
- return o_5;
- }
- else {
- return void 0;
- }
- }, ios), head(ios)[1]);
- const vals = map_1((tuple_5) => tuple_5[0], sortBy((arg_2) => defaultArg(arg_2[1], 10000), append_1(chars, append_1(components, append_1(pvs, map_1((fv) => [JsonTypes_decomposeFactorValue(fv), tryGetFactorColumnIndex(fv)], ProcessOutput_getFactorValues_11830B70(outputForFactors))))), {
- Compare: comparePrimitives,
- }));
- return toList(delay(() => append(singleton_1(JsonTypes_decomposeProcessInput(inputForType)), delay(() => append(protVals, delay(() => append(vals, delay(() => singleton_1(JsonTypes_decomposeProcessOutput(outputForType))))))))));
- }, List_groupBy((tupledArg) => [ProcessInput__get_Name(tupledArg[0]), ProcessOutput__get_Name(tupledArg[1])], (list_3 = value_8(p.Outputs), zip(value_8(p.Inputs), list_3)), {
- Equals: equalArrays,
- GetHashCode: arrayHash,
- }));
-}
-
-/**
- * Returns true, if two composite headers share the same main header string
- */
-export function ProcessParsing_compositeHeaderEqual(ch1, ch2) {
- return toString(ch1) === toString(ch2);
-}
-
-/**
- * From a list of rows consisting of headers and values, creates a list of combined headers and the values as a sparse matrix
- *
- * The values cant be directly taken as they are, as there is no guarantee that the headers are aligned
- *
- * This function aligns the headers and values by the main header string
- */
-export function ProcessParsing_alignByHeaders(rows) {
- const headers = [];
- const values = new Dictionary([], {
- Equals: equalArrays,
- GetHashCode: arrayHash,
- });
- const loop = (colI_mut, rows_2_mut) => {
- loop:
- while (true) {
- const colI = colI_mut, rows_2 = rows_2_mut;
- if (!exists((arg_1) => !isEmpty(arg_1), rows_2)) {
- return [headers, values];
- }
- else {
- const firstElem = pick((l) => (isEmpty(l) ? void 0 : head(l)), rows_2)[0];
- void (headers.push(firstElem));
- colI_mut = (colI + 1);
- rows_2_mut = mapIndexed((rowI, l_1) => {
- if (!isEmpty(l_1)) {
- if (ProcessParsing_compositeHeaderEqual(head(l_1)[0], firstElem)) {
- addToDict(values, [colI, rowI], head(l_1)[1]);
- return tail_1(l_1);
- }
- else {
- return l_1;
- }
- }
- else {
- return empty_1();
- }
- }, rows_2);
- continue loop;
- }
- break;
- }
- };
- return loop(0, rows);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/ArcTables.js b/js/ISA/ISA/ArcTypes/ArcTables.js
deleted file mode 100644
index 85d65baf..00000000
--- a/js/ISA/ISA/ArcTypes/ArcTables.js
+++ /dev/null
@@ -1,278 +0,0 @@
-import { map, delay, toList, length, tryFindIndex } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-import { comparePrimitives, stringHash, compare } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { FSharpSet__get_IsEmpty, ofSeq, intersect } from "../../../fable_modules/fable-library.4.1.4/Set.js";
-import { class_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { unwrap, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { insertRangeInPlace } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { ArcTable } from "./ArcTable.js";
-import { map as map_1, collect } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { ProcessParsing_groupProcesses, ProcessParsing_processToRows, ProcessParsing_alignByHeaders } from "./ArcTableAux.js";
-
-export function ArcTablesAux_indexByTableName(name, tables) {
- const matchValue = tryFindIndex((t) => (t.Name === name), tables);
- if (matchValue == null) {
- throw new Error(`Unable to find table with name '${name}'!`);
- }
- else {
- return matchValue | 0;
- }
-}
-
-export function ArcTablesAux_SanityChecks_validateSheetIndex(index, allowAppend, sheets) {
- let x, y;
- if (index < 0) {
- throw new Error("Cannot insert ArcTable at index < 0.");
- }
- if ((x = (index | 0), (y = (sheets.length | 0), allowAppend ? (compare(x, y) > 0) : (compare(x, y) >= 0)))) {
- throw new Error(`Specified index is out of range! Assay contains only ${sheets.length} tables.`);
- }
-}
-
-export function ArcTablesAux_SanityChecks_validateNamesUnique(names) {
- if (!(length(names) === length(distinct(names, {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- })))) {
- throw new Error("Cannot add multiple tables with the same name! Table names inside one assay must be unqiue");
- }
-}
-
-export function ArcTablesAux_SanityChecks_validateNewNameUnique(newName, existingNames) {
- const matchValue = tryFindIndex((x) => (x === newName), existingNames);
- if (matchValue == null) {
- }
- else {
- throw new Error(`Cannot create table with name ${newName}, as table names must be unique and table at index ${matchValue} has the same name.`);
- }
-}
-
-export function ArcTablesAux_SanityChecks_validateNewNamesUnique(newNames, existingNames) {
- ArcTablesAux_SanityChecks_validateNamesUnique(newNames);
- const same = intersect(ofSeq(newNames, {
- Compare: comparePrimitives,
- }), ofSeq(existingNames, {
- Compare: comparePrimitives,
- }));
- if (!FSharpSet__get_IsEmpty(same)) {
- throw new Error(`Cannot create tables with the names ${same}, as table names must be unique.`);
- }
-}
-
-export class ArcTables {
- constructor(thisTables) {
- this.thisTables = thisTables;
- }
-}
-
-export function ArcTables_$reflection() {
- return class_type("ARCtrl.ISA.ArcTables", void 0, ArcTables);
-}
-
-export function ArcTables_$ctor_Z18C2F36D(thisTables) {
- return new ArcTables(thisTables);
-}
-
-export function ArcTables__get_Count(this$) {
- return this$.thisTables.length;
-}
-
-export function ArcTables__get_TableNames(this$) {
- return toList(delay(() => map((s) => s.Name, this$.thisTables)));
-}
-
-export function ArcTables__get_Tables(this$) {
- return this$.thisTables;
-}
-
-export function ArcTables__get_Item_Z524259A4(this$, index) {
- return this$.thisTables[index];
-}
-
-export function ArcTables__AddTable_EC12B15(this$, table, index) {
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
- ArcTablesAux_SanityChecks_validateNewNameUnique(table.Name, ArcTables__get_TableNames(this$));
- this$.thisTables.splice(index_1, 0, table);
-}
-
-export function ArcTables__AddTables_Z2D453886(this$, tables, index) {
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
- ArcTablesAux_SanityChecks_validateNewNamesUnique(map((x) => x.Name, tables), ArcTables__get_TableNames(this$));
- insertRangeInPlace(index_1, tables, this$.thisTables);
-}
-
-export function ArcTables__InitTable_3B406CA4(this$, tableName, index) {
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
- const table = ArcTable.init(tableName);
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
- ArcTablesAux_SanityChecks_validateNewNameUnique(table.Name, ArcTables__get_TableNames(this$));
- this$.thisTables.splice(index_1, 0, table);
- return table;
-}
-
-export function ArcTables__InitTables_7B28792B(this$, tableNames, index) {
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
- const tables = map((x) => ArcTable.init(x), tableNames);
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
- ArcTablesAux_SanityChecks_validateNewNamesUnique(map((x_1) => x_1.Name, tables), ArcTables__get_TableNames(this$));
- insertRangeInPlace(index_1, tables, this$.thisTables);
-}
-
-export function ArcTables__GetTableAt_Z524259A4(this$, index) {
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
- return this$.thisTables[index];
-}
-
-export function ArcTables__GetTable_Z721C83C5(this$, name) {
- return ArcTables__GetTableAt_Z524259A4(this$, ArcTablesAux_indexByTableName(name, this$.thisTables));
-}
-
-export function ArcTables__UpdateTableAt_7E571736(this$, index, table) {
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
- ArcTablesAux_SanityChecks_validateNewNameUnique(table.Name, ArcTables__get_TableNames(this$));
- this$.thisTables[index] = table;
-}
-
-export function ArcTables__UpdateTable_51766571(this$, name, table) {
- const tupledArg = [ArcTablesAux_indexByTableName(name, this$.thisTables), table];
- ArcTables__UpdateTableAt_7E571736(this$, tupledArg[0], tupledArg[1]);
-}
-
-export function ArcTables__RemoveTableAt_Z524259A4(this$, index) {
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
- this$.thisTables.splice(index, 1);
-}
-
-export function ArcTables__RemoveTable_Z721C83C5(this$, name) {
- ArcTables__RemoveTableAt_Z524259A4(this$, ArcTablesAux_indexByTableName(name, this$.thisTables));
-}
-
-export function ArcTables__MapTableAt_8FC095C(this$, index, updateFun) {
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
- updateFun(this$.thisTables[index]);
-}
-
-export function ArcTables__MapTable_27DD7B1B(this$, name, updateFun) {
- const tupledArg = [ArcTablesAux_indexByTableName(name, this$.thisTables), updateFun];
- ArcTables__MapTableAt_8FC095C(this$, tupledArg[0], tupledArg[1]);
-}
-
-export function ArcTables__RenameTableAt_Z176EF219(this$, index, newName) {
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
- ArcTablesAux_SanityChecks_validateNewNameUnique(newName, ArcTables__get_TableNames(this$));
- const table = ArcTables__GetTableAt_Z524259A4(this$, index);
- ArcTables__UpdateTableAt_7E571736(this$, index, new ArcTable(newName, table.Headers, table.Values));
-}
-
-export function ArcTables__RenameTable_Z384F8060(this$, name, newName) {
- const tupledArg = [ArcTablesAux_indexByTableName(name, this$.thisTables), newName];
- ArcTables__RenameTableAt_Z176EF219(this$, tupledArg[0], tupledArg[1]);
-}
-
-export function ArcTables__AddColumnAt_6A9784DB(this$, tableIndex, header, cells, columnIndex, forceReplace) {
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
- table.AddColumn(header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
- });
-}
-
-export function ArcTables__AddColumn_1FF50D3C(this$, tableName, header, cells, columnIndex, forceReplace) {
- ArcTables__AddColumnAt_6A9784DB(this$, ArcTablesAux_indexByTableName(tableName, this$.thisTables), header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
-}
-
-export function ArcTables__RemoveColumnAt_Z37302880(this$, tableIndex, columnIndex) {
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
- table.RemoveColumn(columnIndex);
- });
-}
-
-export function ArcTables__RemoveColumn_Z18115A39(this$, tableName, columnIndex) {
- const tupledArg = [ArcTablesAux_indexByTableName(tableName, this$.thisTables), columnIndex];
- ArcTables__RemoveColumnAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
-}
-
-export function ArcTables__UpdateColumnAt_21300791(this$, tableIndex, columnIndex, header, cells) {
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
- table.UpdateColumn(columnIndex, header, unwrap(cells));
- });
-}
-
-export function ArcTables__UpdateColumn_Z6083042A(this$, tableName, columnIndex, header, cells) {
- ArcTables__UpdateColumnAt_21300791(this$, ArcTablesAux_indexByTableName(tableName, this$.thisTables), columnIndex, header, unwrap(cells));
-}
-
-export function ArcTables__GetColumnAt_Z37302880(this$, tableIndex, columnIndex) {
- const table = ArcTables__GetTableAt_Z524259A4(this$, tableIndex);
- return table.GetColumn(columnIndex);
-}
-
-export function ArcTables__GetColumn_Z18115A39(this$, tableName, columnIndex) {
- const tupledArg = [ArcTablesAux_indexByTableName(tableName, this$.thisTables), columnIndex];
- return ArcTables__GetColumnAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
-}
-
-export function ArcTables__AddRowAt_Z12CDB784(this$, tableIndex, cells, rowIndex) {
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
- table.AddRow(unwrap(cells), unwrap(rowIndex));
- });
-}
-
-export function ArcTables__AddRow_Z16315DE5(this$, tableName, cells, rowIndex) {
- ArcTables__AddRowAt_Z12CDB784(this$, ArcTablesAux_indexByTableName(tableName, this$.thisTables), unwrap(cells), unwrap(rowIndex));
-}
-
-export function ArcTables__RemoveRowAt_Z37302880(this$, tableIndex, rowIndex) {
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
- table.RemoveRow(rowIndex);
- });
-}
-
-export function ArcTables__RemoveRow_Z18115A39(this$, tableName, rowIndex) {
- const tupledArg = [ArcTablesAux_indexByTableName(tableName, this$.thisTables), rowIndex];
- ArcTables__RemoveRowAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
-}
-
-export function ArcTables__UpdateRowAt_1CF7B5DC(this$, tableIndex, rowIndex, cells) {
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
- table.UpdateRow(rowIndex, cells);
- });
-}
-
-export function ArcTables__UpdateRow_1BFE2CFB(this$, tableName, rowIndex, cells) {
- const tupledArg = [ArcTablesAux_indexByTableName(tableName, this$.thisTables), rowIndex, cells];
- ArcTables__UpdateRowAt_1CF7B5DC(this$, tupledArg[0], tupledArg[1], tupledArg[2]);
-}
-
-export function ArcTables__GetRowAt_Z37302880(this$, tableIndex, rowIndex) {
- const table = ArcTables__GetTableAt_Z524259A4(this$, tableIndex);
- return table.GetRow(rowIndex);
-}
-
-export function ArcTables__GetRow_Z18115A39(this$, tableName, rowIndex) {
- const tupledArg = [ArcTablesAux_indexByTableName(tableName, this$.thisTables), rowIndex];
- return ArcTables__GetRowAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
-}
-
-/**
- * Return a list of all the processes in all the tables.
- */
-export function ArcTables__GetProcesses(this$) {
- return collect((t) => t.GetProcesses(), toList(ArcTables__get_Tables(this$)));
-}
-
-/**
- * Create a collection of tables from a list of processes.
- *
- * For this, the processes are grouped by nameroot ("nameroot_1", "nameroot_2" ...) or exectued protocol if no name exists
- *
- * Then each group is converted to a table with this nameroot as sheetname
- */
-export function ArcTables_fromProcesses_134EBDED(ps) {
- let arg;
- return ArcTables_$ctor_Z18C2F36D((arg = map_1((tupledArg) => {
- const tupledArg_1 = ProcessParsing_alignByHeaders(collect(ProcessParsing_processToRows, tupledArg[1]));
- return ArcTable.create(tupledArg[0], tupledArg_1[0], tupledArg_1[1]);
- }, ProcessParsing_groupProcesses(ps)), Array.from(arg)));
-}
-
diff --git a/js/ISA/ISA/ArcTypes/CompositeCell.js b/js/ISA/ISA/ArcTypes/CompositeCell.js
deleted file mode 100644
index e14291fc..00000000
--- a/js/ISA/ISA/ArcTypes/CompositeCell.js
+++ /dev/null
@@ -1,165 +0,0 @@
-import { int32ToString } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { OntologyAnnotation_$reflection, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation__get_NameText, OntologyAnnotation_create_Z61CCDEEC } from "../JsonTypes/OntologyAnnotation.js";
-import { AnnotationValue } from "../JsonTypes/AnnotationValue.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { Union } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { union_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class CompositeCell extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Term", "FreeText", "Unitized"];
- }
- static fromValue(value, unit) {
- let matchResult, t, i, i_1, u, f, f_1, u_1, s;
- switch (value.tag) {
- case 1: {
- if (unit != null) {
- matchResult = 2;
- i_1 = value.fields[0];
- u = unit;
- }
- else {
- matchResult = 1;
- i = value.fields[0];
- }
- break;
- }
- case 2: {
- if (unit != null) {
- matchResult = 4;
- f_1 = value.fields[0];
- u_1 = unit;
- }
- else {
- matchResult = 3;
- f = value.fields[0];
- }
- break;
- }
- case 3: {
- if (unit == null) {
- matchResult = 5;
- s = value.fields[0];
- }
- else {
- matchResult = 6;
- }
- break;
- }
- default:
- if (unit == null) {
- matchResult = 0;
- t = value.fields[0];
- }
- else {
- matchResult = 6;
- }
- }
- switch (matchResult) {
- case 0:
- return new CompositeCell(0, [t]);
- case 1:
- return new CompositeCell(1, [int32ToString(i)]);
- case 2:
- return new CompositeCell(2, [int32ToString(i_1), u]);
- case 3:
- return new CompositeCell(1, [f.toString()]);
- case 4:
- return new CompositeCell(2, [f_1.toString(), u_1]);
- case 5:
- return new CompositeCell(1, [s]);
- default:
- throw new Error("could not convert value to cell, invalid combination of value and unit");
- }
- }
- get isUnitized() {
- const this$ = this;
- return this$.tag === 2;
- }
- get isTerm() {
- const this$ = this;
- return this$.tag === 0;
- }
- get isFreeText() {
- const this$ = this;
- return this$.tag === 1;
- }
- ToUnitizedCell() {
- const this$ = this;
- return (this$.tag === 1) ? (new CompositeCell(2, ["", OntologyAnnotation_create_Z61CCDEEC(void 0, new AnnotationValue(0, [this$.fields[0]]))])) : ((this$.tag === 0) ? (new CompositeCell(2, ["", this$.fields[0]])) : this$);
- }
- ToTermCell() {
- const this$ = this;
- return (this$.tag === 2) ? (new CompositeCell(0, [this$.fields[1]])) : ((this$.tag === 1) ? (new CompositeCell(0, [OntologyAnnotation_create_Z61CCDEEC(void 0, new AnnotationValue(0, [this$.fields[0]]))])) : this$);
- }
- ToFreeTextCell() {
- const this$ = this;
- return (this$.tag === 0) ? (new CompositeCell(1, [OntologyAnnotation__get_NameText(this$.fields[0])])) : ((this$.tag === 2) ? (new CompositeCell(1, [OntologyAnnotation__get_NameText(this$.fields[1])])) : this$);
- }
- get AsUnitized() {
- const this$ = this;
- if (this$.tag === 2) {
- return [this$.fields[0], this$.fields[1]];
- }
- else {
- throw new Error("Not a Unitized cell.");
- }
- }
- get AsTerm() {
- const this$ = this;
- if (this$.tag === 0) {
- return this$.fields[0];
- }
- else {
- throw new Error("Not a Swate TermCell.");
- }
- }
- get AsFreeText() {
- const this$ = this;
- if (this$.tag === 1) {
- return this$.fields[0];
- }
- else {
- throw new Error("Not a Swate TermCell.");
- }
- }
- static createTerm(oa) {
- return new CompositeCell(0, [oa]);
- }
- static createTermFromString(name, tsr, tan) {
- return new CompositeCell(0, [OntologyAnnotation_fromString_2EB0E147(name, tsr, tan)]);
- }
- static createUnitized(value, oa) {
- return new CompositeCell(2, [value, defaultArg(oa, OntologyAnnotation_get_empty())]);
- }
- static createUnitizedFromString(value, name, tsr, tan) {
- const tupledArg = [value, OntologyAnnotation_fromString_2EB0E147(name, tsr, tan)];
- return new CompositeCell(2, [tupledArg[0], tupledArg[1]]);
- }
- static createFreeText(value) {
- return new CompositeCell(1, [value]);
- }
- static get emptyTerm() {
- return new CompositeCell(0, [OntologyAnnotation_get_empty()]);
- }
- static get emptyFreeText() {
- return new CompositeCell(1, [""]);
- }
- static get emptyUnitized() {
- return new CompositeCell(2, ["", OntologyAnnotation_get_empty()]);
- }
- toString() {
- const this$ = this;
- return (this$.tag === 1) ? this$.fields[0] : ((this$.tag === 2) ? (`${this$.fields[0]} ${OntologyAnnotation__get_NameText(this$.fields[1])}`) : (`Term${OntologyAnnotation__get_NameText(this$.fields[0])}`));
- }
-}
-
-export function CompositeCell_$reflection() {
- return union_type("ARCtrl.ISA.CompositeCell", [], CompositeCell, () => [[["Item", OntologyAnnotation_$reflection()]], [["Item", string_type]], [["Item1", string_type], ["Item2", OntologyAnnotation_$reflection()]]]);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/CompositeColumn.js b/js/ISA/ISA/ArcTypes/CompositeColumn.js
deleted file mode 100644
index 2b0e5862..00000000
--- a/js/ISA/ISA/ArcTypes/CompositeColumn.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { CompositeHeader_$reflection } from "./CompositeHeader.js";
-import { CompositeCell_$reflection } from "./CompositeCell.js";
-import { record_type, array_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class CompositeColumn extends Record {
- constructor(Header, Cells) {
- super();
- this.Header = Header;
- this.Cells = Cells;
- }
- static create(header, cells) {
- return new CompositeColumn(header, defaultArg(cells, []));
- }
- validate(raiseException) {
- const this$ = this;
- const raiseExeption = defaultArg(raiseException, false);
- const header = this$.Header;
- const cells = this$.Cells;
- if (cells.length === 0) {
- return true;
- }
- else if (header.IsTermColumn && (cells[0].isTerm ? true : cells[0].isUnitized)) {
- return true;
- }
- else if (!header.IsTermColumn && cells[0].isFreeText) {
- return true;
- }
- else {
- if (raiseExeption) {
- throw new Error(`Invalid combination of header \`${header}\` and cells \`${cells[0]}\``);
- }
- return false;
- }
- }
-}
-
-export function CompositeColumn_$reflection() {
- return record_type("ARCtrl.ISA.CompositeColumn", [], CompositeColumn, () => [["Header", CompositeHeader_$reflection()], ["Cells", array_type(CompositeCell_$reflection())]]);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/CompositeHeader.js b/js/ISA/ISA/ArcTypes/CompositeHeader.js
deleted file mode 100644
index e4fd1d46..00000000
--- a/js/ISA/ISA/ArcTypes/CompositeHeader.js
+++ /dev/null
@@ -1,334 +0,0 @@
-import { Union, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { ActivePatterns_$007CTermColumn$007C_$007C, ActivePatterns_$007CRegex$007C_$007C, tryParseIOTypeHeader } from "../Regex.js";
-import { union_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation_$reflection, OntologyAnnotation__get_TermAccessionShort, OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation__get_NameText } from "../JsonTypes/OntologyAnnotation.js";
-import { ProtocolParameter_create_Z6C54B221 } from "../JsonTypes/ProtocolParameter.js";
-import { Factor_create_3A99E5B8 } from "../JsonTypes/Factor.js";
-import { MaterialAttribute_create_Z6C54B221 } from "../JsonTypes/MaterialAttribute.js";
-import { Component_create_61502994 } from "../JsonTypes/Component.js";
-
-export class IOType extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Source", "Sample", "RawDataFile", "DerivedDataFile", "ImageFile", "Material", "FreeText"];
- }
- static get All() {
- return [new IOType(0, []), new IOType(1, []), new IOType(2, []), new IOType(3, []), new IOType(4, []), new IOType(5, [])];
- }
- get asInput() {
- const this$ = this;
- const stringCreate = (x) => {
- let copyOfStruct;
- return `Input [${(copyOfStruct = x, toString(copyOfStruct))}]`;
- };
- return (this$.tag === 6) ? stringCreate(this$.fields[0]) : stringCreate(this$);
- }
- get asOutput() {
- const this$ = this;
- const stringCreate = (x) => {
- let copyOfStruct;
- return `Output [${(copyOfStruct = x, toString(copyOfStruct))}]`;
- };
- return (this$.tag === 6) ? stringCreate(this$.fields[0]) : stringCreate(this$);
- }
- toString() {
- const this$ = this;
- return (this$.tag === 1) ? "Sample Name" : ((this$.tag === 2) ? "Raw Data File" : ((this$.tag === 3) ? "Derived Data File" : ((this$.tag === 4) ? "Image File" : ((this$.tag === 5) ? "Material" : ((this$.tag === 6) ? this$.fields[0] : "Source Name")))));
- }
- static ofString(str) {
- return (str === "Source") ? (new IOType(0, [])) : ((str === "Source Name") ? (new IOType(0, [])) : ((str === "Sample") ? (new IOType(1, [])) : ((str === "Sample Name") ? (new IOType(1, [])) : ((str === "RawDataFile") ? (new IOType(2, [])) : ((str === "Raw Data File") ? (new IOType(2, [])) : ((str === "DerivedDataFile") ? (new IOType(3, [])) : ((str === "Derived Data File") ? (new IOType(3, [])) : ((str === "ImageFile") ? (new IOType(4, [])) : ((str === "Image File") ? (new IOType(4, [])) : ((str === "Material") ? (new IOType(5, [])) : (new IOType(6, [str]))))))))))));
- }
- static tryOfHeaderString(str) {
- const matchValue = tryParseIOTypeHeader(str);
- if (matchValue == null) {
- return void 0;
- }
- else {
- const s = matchValue;
- return IOType.ofString(s);
- }
- }
-}
-
-export function IOType_$reflection() {
- return union_type("ARCtrl.ISA.IOType", [], IOType, () => [[], [], [], [], [], [], [["Item", string_type]]]);
-}
-
-export class CompositeHeader extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Component", "Characteristic", "Factor", "Parameter", "ProtocolType", "ProtocolDescription", "ProtocolUri", "ProtocolVersion", "ProtocolREF", "Performer", "Date", "Input", "Output", "FreeText"];
- }
- toString() {
- const this$ = this;
- return (this$.tag === 2) ? (`Factor [${OntologyAnnotation__get_NameText(this$.fields[0])}]`) : ((this$.tag === 1) ? (`Characteristic [${OntologyAnnotation__get_NameText(this$.fields[0])}]`) : ((this$.tag === 0) ? (`Component [${OntologyAnnotation__get_NameText(this$.fields[0])}]`) : ((this$.tag === 4) ? "Protocol Type" : ((this$.tag === 8) ? "Protocol REF" : ((this$.tag === 5) ? "Protocol Description" : ((this$.tag === 6) ? "Protocol Uri" : ((this$.tag === 7) ? "Protocol Version" : ((this$.tag === 9) ? "Performer" : ((this$.tag === 10) ? "Date" : ((this$.tag === 11) ? this$.fields[0].asInput : ((this$.tag === 12) ? this$.fields[0].asOutput : ((this$.tag === 13) ? this$.fields[0] : (`Parameter [${OntologyAnnotation__get_NameText(this$.fields[0])}]`)))))))))))));
- }
- ToTerm() {
- const this$ = this;
- return (this$.tag === 2) ? this$.fields[0] : ((this$.tag === 1) ? this$.fields[0] : ((this$.tag === 0) ? this$.fields[0] : ((this$.tag === 4) ? OntologyAnnotation_fromString_2EB0E147("Protocol Type") : ((this$.tag === 8) ? OntologyAnnotation_fromString_2EB0E147("Protocol REF") : ((this$.tag === 5) ? OntologyAnnotation_fromString_2EB0E147("Protocol Description") : ((this$.tag === 6) ? OntologyAnnotation_fromString_2EB0E147("Protocol Uri") : ((this$.tag === 7) ? OntologyAnnotation_fromString_2EB0E147("Protocol Version") : ((this$.tag === 9) ? OntologyAnnotation_fromString_2EB0E147("Performer") : ((this$.tag === 10) ? OntologyAnnotation_fromString_2EB0E147("Date") : ((this$.tag === 11) ? OntologyAnnotation_fromString_2EB0E147(this$.fields[0].asInput) : ((this$.tag === 12) ? OntologyAnnotation_fromString_2EB0E147(this$.fields[0].asOutput) : ((this$.tag === 13) ? OntologyAnnotation_fromString_2EB0E147(this$.fields[0]) : this$.fields[0]))))))))))));
- }
- static OfHeaderString(str) {
- const matchValue = str.trim();
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("Input\\s\\[(?.+)\\]", matchValue);
- if (activePatternResult != null) {
- const r = activePatternResult;
- const iotype = (r.groups && r.groups.iotype) || "";
- return new CompositeHeader(11, [IOType.ofString(iotype)]);
- }
- else {
- const activePatternResult_1 = ActivePatterns_$007CRegex$007C_$007C("Output\\s\\[(?.+)\\]", matchValue);
- if (activePatternResult_1 != null) {
- const r_1 = activePatternResult_1;
- const iotype_1 = (r_1.groups && r_1.groups.iotype) || "";
- return new CompositeHeader(12, [IOType.ofString(iotype_1)]);
- }
- else {
- const activePatternResult_2 = ActivePatterns_$007CTermColumn$007C_$007C(matchValue);
- if (activePatternResult_2 != null) {
- const r_2 = activePatternResult_2;
- const matchValue_1 = r_2.TermColumnType;
- switch (matchValue_1) {
- case "Parameter":
- case "Parameter Value":
- return new CompositeHeader(3, [OntologyAnnotation_fromString_2EB0E147(r_2.TermName)]);
- case "Factor":
- case "Factor Value":
- return new CompositeHeader(2, [OntologyAnnotation_fromString_2EB0E147(r_2.TermName)]);
- case "Characteristic":
- case "Characteristics":
- case "Characteristics Value":
- return new CompositeHeader(1, [OntologyAnnotation_fromString_2EB0E147(r_2.TermName)]);
- case "Component":
- return new CompositeHeader(0, [OntologyAnnotation_fromString_2EB0E147(r_2.TermName)]);
- default:
- return new CompositeHeader(13, [str]);
- }
- }
- else {
- return (matchValue === "Date") ? (new CompositeHeader(10, [])) : ((matchValue === "Performer") ? (new CompositeHeader(9, [])) : ((matchValue === "Protocol Description") ? (new CompositeHeader(5, [])) : ((matchValue === "Protocol Uri") ? (new CompositeHeader(6, [])) : ((matchValue === "Protocol Version") ? (new CompositeHeader(7, [])) : ((matchValue === "Protocol Type") ? (new CompositeHeader(4, [])) : ((matchValue === "Protocol REF") ? (new CompositeHeader(8, [])) : (new CompositeHeader(13, [matchValue]))))))));
- }
- }
- }
- }
- get IsDeprecated() {
- const this$ = this;
- let matchResult, s_4, s_5, s_6, s_7;
- if (this$.tag === 13) {
- if (this$.fields[0].toLocaleLowerCase() === "sample name") {
- matchResult = 0;
- s_4 = this$.fields[0];
- }
- else if (this$.fields[0].toLocaleLowerCase() === "source name") {
- matchResult = 1;
- s_5 = this$.fields[0];
- }
- else if (this$.fields[0].toLocaleLowerCase() === "data file name") {
- matchResult = 2;
- s_6 = this$.fields[0];
- }
- else if (this$.fields[0].toLocaleLowerCase() === "derived data file") {
- matchResult = 3;
- s_7 = this$.fields[0];
- }
- else {
- matchResult = 4;
- }
- }
- else {
- matchResult = 4;
- }
- switch (matchResult) {
- case 0:
- return true;
- case 1:
- return true;
- case 2:
- return true;
- case 3:
- return true;
- default:
- return false;
- }
- }
- get IsCvParamColumn() {
- const this$ = this;
- switch (this$.tag) {
- case 3:
- case 2:
- case 1:
- case 0:
- return true;
- default:
- return false;
- }
- }
- get IsTermColumn() {
- const this$ = this;
- switch (this$.tag) {
- case 3:
- case 2:
- case 1:
- case 0:
- case 4:
- return true;
- default:
- return false;
- }
- }
- get IsFeaturedColumn() {
- const this$ = this;
- return this$.tag === 4;
- }
- get GetFeaturedColumnAccession() {
- const this$ = this;
- if (this$.tag === 4) {
- return "DPBO:1000161";
- }
- else {
- throw new Error(`Tried matching ${this$} in getFeaturedColumnAccession, but is not a featured column.`);
- }
- }
- get GetColumnAccessionShort() {
- const this$ = this;
- switch (this$.tag) {
- case 4:
- return this$.GetFeaturedColumnAccession;
- case 3:
- return OntologyAnnotation__get_TermAccessionShort(this$.fields[0]);
- case 2:
- return OntologyAnnotation__get_TermAccessionShort(this$.fields[0]);
- case 1:
- return OntologyAnnotation__get_TermAccessionShort(this$.fields[0]);
- case 0:
- return OntologyAnnotation__get_TermAccessionShort(this$.fields[0]);
- default:
- throw new Error(`Tried matching ${this$}, but is not a column with an accession.`);
- }
- }
- get IsSingleColumn() {
- const this$ = this;
- switch (this$.tag) {
- case 13:
- case 11:
- case 12:
- case 8:
- case 5:
- case 6:
- case 7:
- case 9:
- case 10:
- return true;
- default:
- return false;
- }
- }
- get IsIOType() {
- const this$ = this;
- let matchResult, io;
- switch (this$.tag) {
- case 11: {
- matchResult = 0;
- io = this$.fields[0];
- break;
- }
- case 12: {
- matchResult = 0;
- io = this$.fields[0];
- break;
- }
- default:
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return true;
- default:
- return false;
- }
- }
- get isInput() {
- const this$ = this;
- return this$.tag === 11;
- }
- get isOutput() {
- const this$ = this;
- return this$.tag === 11;
- }
- get isParameter() {
- const this$ = this;
- return this$.tag === 3;
- }
- get isFactor() {
- const this$ = this;
- return this$.tag === 2;
- }
- get isCharacteristic() {
- const this$ = this;
- return this$.tag === 1;
- }
- get isComponent() {
- const this$ = this;
- return this$.tag === 0;
- }
- get isProtocolType() {
- const this$ = this;
- return this$.tag === 4;
- }
- get isProtocolREF() {
- const this$ = this;
- return this$.tag === 8;
- }
- get isProtocolDescription() {
- const this$ = this;
- return this$.tag === 5;
- }
- get isProtocolUri() {
- const this$ = this;
- return this$.tag === 6;
- }
- get isProtocolVersion() {
- const this$ = this;
- return this$.tag === 7;
- }
- get isPerformer() {
- const this$ = this;
- return this$.tag === 9;
- }
- get isDate() {
- const this$ = this;
- return this$.tag === 10;
- }
- get isFreeText() {
- const this$ = this;
- return this$.tag === 13;
- }
- TryParameter() {
- const this$ = this;
- return (this$.tag === 3) ? ProtocolParameter_create_Z6C54B221(void 0, this$.fields[0]) : void 0;
- }
- TryFactor() {
- const this$ = this;
- return (this$.tag === 2) ? Factor_create_3A99E5B8(void 0, void 0, this$.fields[0]) : void 0;
- }
- TryCharacteristic() {
- const this$ = this;
- return (this$.tag === 1) ? MaterialAttribute_create_Z6C54B221(void 0, this$.fields[0]) : void 0;
- }
- TryComponent() {
- const this$ = this;
- return (this$.tag === 0) ? Component_create_61502994(void 0, void 0, void 0, this$.fields[0]) : void 0;
- }
-}
-
-export function CompositeHeader_$reflection() {
- return union_type("ARCtrl.ISA.CompositeHeader", [], CompositeHeader, () => [[["Item", OntologyAnnotation_$reflection()]], [["Item", OntologyAnnotation_$reflection()]], [["Item", OntologyAnnotation_$reflection()]], [["Item", OntologyAnnotation_$reflection()]], [], [], [], [], [], [], [], [["Item", IOType_$reflection()]], [["Item", IOType_$reflection()]], [["Item", string_type]]]);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/CompositeRow.js b/js/ISA/ISA/ArcTypes/CompositeRow.js
deleted file mode 100644
index b0836243..00000000
--- a/js/ISA/ISA/ArcTypes/CompositeRow.js
+++ /dev/null
@@ -1,111 +0,0 @@
-import { fold } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
-import { Protocol_get_empty, Protocol_addComponent, Protocol_addParameter, Protocol_setName, Protocol_setDescription, Protocol_setUri, Protocol_setVersion, Protocol_setProtocolType } from "../JsonTypes/Protocol.js";
-import { ProtocolParameter_create_Z6C54B221 } from "../JsonTypes/ProtocolParameter.js";
-import { Component_create_61502994 } from "../JsonTypes/Component.js";
-import { Value, Value_fromString_Z721C83C5 } from "../JsonTypes/Value.js";
-
-export function toProtocol(row) {
- return fold((p, hc) => {
- let matchResult, oa, v, v_1, v_2, v_3, oa_1, oa_2, unit, v_4, oa_3, t;
- switch (hc[0].tag) {
- case 4: {
- if (hc[1].tag === 0) {
- matchResult = 0;
- oa = hc[1].fields[0];
- }
- else {
- matchResult = 8;
- }
- break;
- }
- case 7: {
- if (hc[1].tag === 1) {
- matchResult = 1;
- v = hc[1].fields[0];
- }
- else {
- matchResult = 8;
- }
- break;
- }
- case 6: {
- if (hc[1].tag === 1) {
- matchResult = 2;
- v_1 = hc[1].fields[0];
- }
- else {
- matchResult = 8;
- }
- break;
- }
- case 5: {
- if (hc[1].tag === 1) {
- matchResult = 3;
- v_2 = hc[1].fields[0];
- }
- else {
- matchResult = 8;
- }
- break;
- }
- case 8: {
- if (hc[1].tag === 1) {
- matchResult = 4;
- v_3 = hc[1].fields[0];
- }
- else {
- matchResult = 8;
- }
- break;
- }
- case 3: {
- matchResult = 5;
- oa_1 = hc[0].fields[0];
- break;
- }
- case 0: {
- switch (hc[1].tag) {
- case 2: {
- matchResult = 6;
- oa_2 = hc[0].fields[0];
- unit = hc[1].fields[1];
- v_4 = hc[1].fields[0];
- break;
- }
- case 0: {
- matchResult = 7;
- oa_3 = hc[0].fields[0];
- t = hc[1].fields[0];
- break;
- }
- default:
- matchResult = 8;
- }
- break;
- }
- default:
- matchResult = 8;
- }
- switch (matchResult) {
- case 0:
- return Protocol_setProtocolType(p, oa);
- case 1:
- return Protocol_setVersion(p, v);
- case 2:
- return Protocol_setUri(p, v_1);
- case 3:
- return Protocol_setDescription(p, v_2);
- case 4:
- return Protocol_setName(p, v_3);
- case 5:
- return Protocol_addParameter(ProtocolParameter_create_Z6C54B221(void 0, oa_1), p);
- case 6:
- return Protocol_addComponent(Component_create_61502994(void 0, Value_fromString_Z721C83C5(v_4), unit, oa_2), p);
- case 7:
- return Protocol_addComponent(Component_create_61502994(void 0, new Value(0, [t]), void 0, oa_3), p);
- default:
- return p;
- }
- }, Protocol_get_empty(), row);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/Identifier.js b/js/ISA/ISA/ArcTypes/Identifier.js
deleted file mode 100644
index 24b09786..00000000
--- a/js/ISA/ISA/ArcTypes/Identifier.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import { match, isMatch } from "../../../fable_modules/fable-library.4.1.4/RegExp.js";
-import { newGuid } from "../../../fable_modules/fable-library.4.1.4/Guid.js";
-import { combineMany } from "../../../FileSystem/Path.js";
-
-export function checkValidCharacters(identifier) {
- if (!isMatch(/^[a-zA-Z0-9_\- ]+$/gu, identifier)) {
- throw new Error("New identifier contains forbidden characters! Allowed characters are: letters, digits, underscore (_), dash (-) and whitespace ( ).");
- }
-}
-
-export function createMissingIdentifier() {
- let copyOfStruct;
- return "MISSING_IDENTIFIER_" + ((copyOfStruct = newGuid(), copyOfStruct));
-}
-
-export function isMissingIdentifier(str) {
- return str.indexOf("MISSING_IDENTIFIER_") === 0;
-}
-
-export function removeMissingIdentifier(str) {
- if (str.indexOf("MISSING_IDENTIFIER_") === 0) {
- return "";
- }
- else {
- return str;
- }
-}
-
-/**
- * On read-in the FileName can be any combination of "assays" (assay folder name), assayIdentifier and "isa.assay.xlsx" (the actual file name).
- *
- * This functions extracts assayIdentifier from any of these combinations and returns it.
- */
-export function Assay_identifierFromFileName(fileName) {
- const m = match(/^(assays(\/|\\))?(?[a-zA-Z0-9_\- ]+)((\/|\\)isa.assay.xlsx)?$/gu, fileName);
- const matchValue = m != null;
- if (matchValue) {
- return (m.groups && m.groups.identifier) || "";
- }
- else {
- throw new Error(`Cannot parse identifier from FileName \`${fileName}\``);
- }
-}
-
-/**
- * On writing a xlsx file we unify our output to a relative path to ARC root. So: `assays/assayIdentifier/isa.assay.xlsx`.
- */
-export function Assay_fileNameFromIdentifier(identifier) {
- checkValidCharacters(identifier);
- return combineMany(["assays", identifier, "isa.assay.xlsx"]);
-}
-
-/**
- * On read-in the FileName can be any combination of "studies" (study folder name), studyIdentifier and "isa.study.xlsx" (the actual file name).
- *
- * This functions extracts studyIdentifier from any of these combinations and returns it.
- */
-export function Study_identifierFromFileName(fileName) {
- const m = match(/^(studies(\/|\\))?(?[a-zA-Z0-9_\- ]+)((\/|\\)isa.study.xlsx)?$/gu, fileName);
- const matchValue = m != null;
- if (matchValue) {
- return (m.groups && m.groups.identifier) || "";
- }
- else {
- throw new Error(`Cannot parse identifier from FileName \`${fileName}\``);
- }
-}
-
-/**
- * On writing a xlsx file we unify our output to a relative path to ARC root. So: `studies/studyIdentifier/isa.study.xlsx`.
- */
-export function Study_fileNameFromIdentifier(identifier) {
- checkValidCharacters(identifier);
- return combineMany(["studies", identifier, "isa.study.xlsx"]);
-}
-
diff --git a/js/ISA/ISA/ArcTypes/IdentifierSetters.js b/js/ISA/ISA/ArcTypes/IdentifierSetters.js
deleted file mode 100644
index fa90dfdc..00000000
--- a/js/ISA/ISA/ArcTypes/IdentifierSetters.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import { checkValidCharacters } from "./Identifier.js";
-
-export function setAssayIdentifier(newIdentifier, assay) {
- checkValidCharacters(newIdentifier);
- assay.Identifier = newIdentifier;
- return assay;
-}
-
-export function setStudyIdentifier(newIdentifier, study) {
- checkValidCharacters(newIdentifier);
- study.Identifier = newIdentifier;
- return study;
-}
-
-export function setInvestigationIdentifier(newIdentifier, investigation) {
- checkValidCharacters(newIdentifier);
- investigation.Identifier = newIdentifier;
- return investigation;
-}
-
diff --git a/js/ISA/ISA/Builder/Types.js b/js/ISA/ISA/Builder/Types.js
deleted file mode 100644
index 9baa7c60..00000000
--- a/js/ISA/ISA/Builder/Types.js
+++ /dev/null
@@ -1,243 +0,0 @@
-import { Union } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { list_type, union_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation_$reflection } from "../JsonTypes/OntologyAnnotation.js";
-import { Protocol_get_empty, Protocol } from "../JsonTypes/Protocol.js";
-import { ProcessParameterValue_$reflection } from "../JsonTypes/ProcessParameterValue.js";
-import { MaterialAttributeValue_$reflection } from "../JsonTypes/MaterialAttributeValue.js";
-import { FactorValue_$reflection } from "../JsonTypes/FactorValue.js";
-import { map as map_1, exists, fold, singleton, empty, append } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { map, value as value_4, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { Process_get_empty, Process } from "../JsonTypes/Process.js";
-import { Assay_get_empty, Assay } from "../JsonTypes/Assay.js";
-import { printf, toFail } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { Study } from "../JsonTypes/Study.js";
-
-export class ProtocolTransformation extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["AddName", "AddProtocolType", "AddDescription"];
- }
-}
-
-export function ProtocolTransformation_$reflection() {
- return union_type("ARCtrl.ISA.Builder.ProtocolTransformation", [], ProtocolTransformation, () => [[["Item", string_type]], [["Item", OntologyAnnotation_$reflection()]], [["Item", string_type]]]);
-}
-
-export function ProtocolTransformation__Transform_Z5F51792E(this$, p) {
- switch (this$.tag) {
- case 1:
- return new Protocol(p.ID, p.Name, this$.fields[0], p.Description, p.Uri, p.Version, p.Parameters, p.Components, p.Comments);
- case 2:
- return new Protocol(p.ID, p.Name, p.ProtocolType, this$.fields[0], p.Uri, p.Version, p.Parameters, p.Components, p.Comments);
- default:
- return new Protocol(p.ID, this$.fields[0], p.ProtocolType, p.Description, p.Uri, p.Version, p.Parameters, p.Components, p.Comments);
- }
-}
-
-export function ProtocolTransformation__Equals_Z5F51792E(this$, p) {
- const matchValue = p.Name;
- let matchResult, n_1, n$0027_1;
- if (this$.tag === 0) {
- if (matchValue != null) {
- if (this$.fields[0] === matchValue) {
- matchResult = 0;
- n_1 = this$.fields[0];
- n$0027_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return true;
- default:
- return false;
- }
-}
-
-export class ProcessTransformation extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["AddName", "AddParameter", "AddCharacteristic", "AddFactor", "AddProtocol"];
- }
-}
-
-export function ProcessTransformation_$reflection() {
- return union_type("ARCtrl.ISA.Builder.ProcessTransformation", [], ProcessTransformation, () => [[["Item", string_type]], [["Item", ProcessParameterValue_$reflection()]], [["Item", MaterialAttributeValue_$reflection()]], [["Item", FactorValue_$reflection()]], [["Item", list_type(ProtocolTransformation_$reflection())]]]);
-}
-
-export function ProcessTransformation__Transform_716E708F(this$, p) {
- let pro;
- switch (this$.tag) {
- case 1: {
- const pv = this$.fields[0];
- const parameterValues = append(defaultArg(p.ParameterValues, empty()), singleton(pv));
- return new Process(p.ID, p.Name, (pro = defaultArg(p.ExecutesProtocol, Protocol_get_empty()), new Protocol(pro.ID, pro.Name, pro.ProtocolType, pro.Description, pro.Uri, pro.Version, append(defaultArg(pro.Parameters, empty()), singleton(value_4(pv.Category))), pro.Components, pro.Comments)), parameterValues, p.Performer, p.Date, p.PreviousProcess, p.NextProcess, p.Inputs, p.Outputs, p.Comments);
- }
- case 2:
- return new Process(p.ID, p.Name, p.ExecutesProtocol, p.ParameterValues, p.Performer, p.Date, p.PreviousProcess, p.NextProcess, map((i) => i, p.Inputs), p.Outputs, p.Comments);
- case 3:
- return new Process(p.ID, p.Name, p.ExecutesProtocol, p.ParameterValues, p.Performer, p.Date, p.PreviousProcess, p.NextProcess, p.Inputs, map((i_1) => i_1, p.Outputs), p.Comments);
- case 4:
- return new Process(p.ID, p.Name, fold((pro_2, trans) => ProtocolTransformation__Transform_Z5F51792E(trans, pro_2), defaultArg(p.ExecutesProtocol, Protocol_get_empty()), this$.fields[0]), p.ParameterValues, p.Performer, p.Date, p.PreviousProcess, p.NextProcess, p.Inputs, p.Outputs, p.Comments);
- default:
- return new Process(p.ID, this$.fields[0], p.ExecutesProtocol, p.ParameterValues, p.Performer, p.Date, p.PreviousProcess, p.NextProcess, p.Inputs, p.Outputs, p.Comments);
- }
-}
-
-export function ProcessTransformation__Equals_716E708F(this$, p) {
- const matchValue = p.Name;
- let matchResult, n_1, n$0027_1;
- if (this$.tag === 0) {
- if (matchValue != null) {
- if (this$.fields[0] === matchValue) {
- matchResult = 0;
- n_1 = this$.fields[0];
- n$0027_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return true;
- default:
- return false;
- }
-}
-
-export class AssayTransformation extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["AddFileName", "AddParameter", "AddCharacteristic", "AddFactor", "AddProcess"];
- }
-}
-
-export function AssayTransformation_$reflection() {
- return union_type("ARCtrl.ISA.Builder.AssayTransformation", [], AssayTransformation, () => [[["Item", string_type]], [["Item", ProcessParameterValue_$reflection()]], [["Item", MaterialAttributeValue_$reflection()]], [["Item", FactorValue_$reflection()]], [["Item", list_type(ProcessTransformation_$reflection())]]]);
-}
-
-export function AssayTransformation__Transform_722A269D(this$, a) {
- switch (this$.tag) {
- case 4: {
- const pts = this$.fields[0];
- const processes = defaultArg(a.ProcessSequence, empty());
- return new Assay(a.ID, a.FileName, a.MeasurementType, a.TechnologyType, a.TechnologyPlatform, a.DataFiles, a.Materials, a.CharacteristicCategories, a.UnitCategories, exists((p) => exists((trans) => ProcessTransformation__Equals_716E708F(trans, p), pts), processes) ? map_1((p_1) => {
- if (exists((trans_1) => ProcessTransformation__Equals_716E708F(trans_1, p_1), pts)) {
- return fold((p_2, trans_2) => ProcessTransformation__Transform_716E708F(trans_2, p_2), p_1, pts);
- }
- else {
- return p_1;
- }
- }, processes) : append(processes, singleton(fold((p_3, trans_3) => ProcessTransformation__Transform_716E708F(trans_3, p_3), Process_get_empty(), pts))), a.Comments);
- }
- case 0:
- return new Assay(a.ID, this$.fields[0], a.MeasurementType, a.TechnologyType, a.TechnologyPlatform, a.DataFiles, a.Materials, a.CharacteristicCategories, a.UnitCategories, a.ProcessSequence, a.Comments);
- default:
- return toFail(printf("Builder failed: Case %O Not implemented"))(this$);
- }
-}
-
-export function AssayTransformation__Equals_722A269D(this$, a) {
- const matchValue = a.FileName;
- let matchResult, n_1, n$0027_1;
- if (this$.tag === 0) {
- if (matchValue != null) {
- if (this$.fields[0] === matchValue) {
- matchResult = 0;
- n_1 = this$.fields[0];
- n$0027_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return true;
- default:
- return false;
- }
-}
-
-export class StudyTransformation extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["AddParameter", "AddCharacteristic", "AddFactor", "AddProcess", "AddAssay"];
- }
-}
-
-export function StudyTransformation_$reflection() {
- return union_type("ARCtrl.ISA.Builder.StudyTransformation", [], StudyTransformation, () => [[["Item", ProcessParameterValue_$reflection()]], [["Item", MaterialAttributeValue_$reflection()]], [["Item", FactorValue_$reflection()]], [["Item", list_type(ProcessTransformation_$reflection())]], [["Item", list_type(AssayTransformation_$reflection())]]]);
-}
-
-export function StudyTransformation__Transform_7312BC8B(this$, s) {
- switch (this$.tag) {
- case 3: {
- const pts = this$.fields[0];
- const processes = defaultArg(s.ProcessSequence, empty());
- return new Study(s.ID, s.FileName, s.Identifier, s.Title, s.Description, s.SubmissionDate, s.PublicReleaseDate, s.Publications, s.Contacts, s.StudyDesignDescriptors, s.Protocols, s.Materials, exists((p) => exists((trans) => ProcessTransformation__Equals_716E708F(trans, p), pts), processes) ? map_1((p_1) => {
- if (exists((trans_1) => ProcessTransformation__Equals_716E708F(trans_1, p_1), pts)) {
- return fold((p_2, trans_2) => ProcessTransformation__Transform_716E708F(trans_2, p_2), p_1, pts);
- }
- else {
- return p_1;
- }
- }, processes) : append(processes, singleton(fold((p_3, trans_3) => ProcessTransformation__Transform_716E708F(trans_3, p_3), Process_get_empty(), pts))), s.Assays, s.Factors, s.CharacteristicCategories, s.UnitCategories, s.Comments);
- }
- case 4: {
- const ats = this$.fields[0];
- const assays = defaultArg(s.Assays, empty());
- return new Study(s.ID, s.FileName, s.Identifier, s.Title, s.Description, s.SubmissionDate, s.PublicReleaseDate, s.Publications, s.Contacts, s.StudyDesignDescriptors, s.Protocols, s.Materials, s.ProcessSequence, exists((a) => exists((trans_4) => AssayTransformation__Equals_722A269D(trans_4, a), ats), assays) ? map_1((a_1) => {
- if (exists((trans_5) => AssayTransformation__Equals_722A269D(trans_5, a_1), ats)) {
- return fold((a_2, trans_6) => AssayTransformation__Transform_722A269D(trans_6, a_2), a_1, ats);
- }
- else {
- return a_1;
- }
- }, assays) : append(assays, singleton(fold((a_3, trans_7) => AssayTransformation__Transform_722A269D(trans_7, a_3), Assay_get_empty(), ats))), s.Factors, s.CharacteristicCategories, s.UnitCategories, s.Comments);
- }
- default:
- return toFail(printf("Builder failed: Case %O Not implemented"))(this$);
- }
-}
-
diff --git a/js/ISA/ISA/Fable.js b/js/ISA/ISA/Fable.js
deleted file mode 100644
index 634fe13a..00000000
--- a/js/ISA/ISA/Fable.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import { toString } from "../../fable_modules/fable-library.4.1.4/Types.js";
-import { append } from "../../fable_modules/fable-library.4.1.4/List.js";
-import { append as append_1 } from "../../fable_modules/fable-library.4.1.4/Array.js";
-import { Array_distinct, List_distinct } from "../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { structuralHash, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-
-export function isMap_generic(l1) {
- let copyOfStruct;
- return ((copyOfStruct = l1, toString(copyOfStruct))).indexOf("map [") === 0;
-}
-
-export function isList_generic(l1) {
- let s;
- let copyOfStruct = l1;
- s = toString(copyOfStruct);
- if (s.indexOf("[") === 0) {
- return !(s.indexOf("seq [") === 0);
- }
- else {
- return false;
- }
-}
-
-export function append_generic(l1, l2) {
- if (l2 == null) {
- return l1;
- }
- else if (isList_generic(l1)) {
- return append(l1, l2);
- }
- else {
- return append_1(l1, l2);
- }
-}
-
-export function distinct_generic(l1) {
- if (isList_generic(l1)) {
- return List_distinct(l1, {
- Equals: equals,
- GetHashCode: structuralHash,
- });
- }
- else {
- return Array_distinct(l1, {
- Equals: equals,
- GetHashCode: structuralHash,
- });
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/AnnotationValue.js b/js/ISA/ISA/JsonTypes/AnnotationValue.js
deleted file mode 100644
index db5a1c68..00000000
--- a/js/ISA/ISA/JsonTypes/AnnotationValue.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import { Union } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { union_type, int32_type, float64_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { parse } from "../../../fable_modules/fable-library.4.1.4/Double.js";
-import { parse as parse_1 } from "../../../fable_modules/fable-library.4.1.4/Int32.js";
-import { int32ToString } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-export class AnnotationValue extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Text", "Float", "Int"];
- }
-}
-
-export function AnnotationValue_$reflection() {
- return union_type("ARCtrl.ISA.AnnotationValue", [], AnnotationValue, () => [[["Item", string_type]], [["Item", float64_type]], [["Item", int32_type]]]);
-}
-
-export function AnnotationValue_get_empty() {
- return new AnnotationValue(0, [""]);
-}
-
-/**
- * Create a ISAJson Annotation value from a ISATab string entry
- */
-export function AnnotationValue_fromString_Z721C83C5(s) {
- try {
- return new AnnotationValue(2, [parse_1(s, 511, false, 32)]);
- }
- catch (matchValue) {
- try {
- return new AnnotationValue(1, [parse(s)]);
- }
- catch (matchValue_1) {
- return new AnnotationValue(0, [s]);
- }
- }
-}
-
-/**
- * Get a ISATab string Annotation Name from a ISAJson object
- */
-export function AnnotationValue_toString_Z6FAD7738(v) {
- switch (v.tag) {
- case 2:
- return int32ToString(v.fields[0]);
- case 1:
- return v.fields[0].toString();
- default:
- return v.fields[0];
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Assay.js b/js/ISA/ISA/JsonTypes/Assay.js
deleted file mode 100644
index 109b3790..00000000
--- a/js/ISA/ISA/JsonTypes/Assay.js
+++ /dev/null
@@ -1,621 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { Data_$reflection } from "./Data.js";
-import { AssayMaterials_get_empty, AssayMaterials_make, AssayMaterials_$reflection } from "./AssayMaterials.js";
-import { MaterialAttribute_$reflection } from "./MaterialAttribute.js";
-import { Process_$reflection } from "./Process.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { empty, filter, map, singleton, append, exists, tryFind } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { safeHash, structuralHash, equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { map2 as map2_2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Dict_tryFind, Dict_ofSeqWithMerge, Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { fromValueWithDefault, mapDefault } from "../OptionExtensions.js";
-import { updateProtocols, getProtocols, getFactors, getOutputsWithFactorBy, getOutputsWithCharacteristicBy, getInputsWithCharacteristicBy, getParameters, getOutputsWithParameterBy, getInputsWithParameterBy, getMaterials, getSamples, getSources, getCharacteristics, getUnits, getData } from "./ProcessSequence.js";
-import { map as map_1, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { Update_UpdateOptions } from "../Update.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { Sample_$reflection } from "./Sample.js";
-import { Material_$reflection } from "./Material.js";
-import { toFail } from "../../../fable_modules/fable-library.4.1.4/String.js";
-
-export class Assay extends Record {
- constructor(ID, FileName, MeasurementType, TechnologyType, TechnologyPlatform, DataFiles, Materials, CharacteristicCategories, UnitCategories, ProcessSequence, Comments) {
- super();
- this.ID = ID;
- this.FileName = FileName;
- this.MeasurementType = MeasurementType;
- this.TechnologyType = TechnologyType;
- this.TechnologyPlatform = TechnologyPlatform;
- this.DataFiles = DataFiles;
- this.Materials = Materials;
- this.CharacteristicCategories = CharacteristicCategories;
- this.UnitCategories = UnitCategories;
- this.ProcessSequence = ProcessSequence;
- this.Comments = Comments;
- }
-}
-
-export function Assay_$reflection() {
- return record_type("ARCtrl.ISA.Assay", [], Assay, () => [["ID", option_type(string_type)], ["FileName", option_type(string_type)], ["MeasurementType", option_type(OntologyAnnotation_$reflection())], ["TechnologyType", option_type(OntologyAnnotation_$reflection())], ["TechnologyPlatform", option_type(string_type)], ["DataFiles", option_type(list_type(Data_$reflection()))], ["Materials", option_type(AssayMaterials_$reflection())], ["CharacteristicCategories", option_type(list_type(MaterialAttribute_$reflection()))], ["UnitCategories", option_type(list_type(OntologyAnnotation_$reflection()))], ["ProcessSequence", option_type(list_type(Process_$reflection()))], ["Comments", option_type(list_type(Comment$_$reflection()))]]);
-}
-
-export function Assay_make(id, fileName, measurementType, technologyType, technologyPlatform, dataFiles, materials, characteristicCategories, unitCategories, processSequence, comments) {
- return new Assay(id, fileName, measurementType, technologyType, technologyPlatform, dataFiles, materials, characteristicCategories, unitCategories, processSequence, comments);
-}
-
-export function Assay_create_3D372A24(Id, FileName, MeasurementType, TechnologyType, TechnologyPlatform, DataFiles, Materials, CharacteristicCategories, UnitCategories, ProcessSequence, Comments) {
- return Assay_make(Id, FileName, MeasurementType, TechnologyType, TechnologyPlatform, DataFiles, Materials, CharacteristicCategories, UnitCategories, ProcessSequence, Comments);
-}
-
-export function Assay_get_empty() {
- return Assay_create_3D372A24();
-}
-
-/**
- * If an assay with the given identfier exists in the list, returns it
- */
-export function Assay_tryGetByFileName(fileName, assays) {
- return tryFind((a) => equals(a.FileName, fileName), assays);
-}
-
-/**
- * If an assay with the given identfier exists in the list, returns true
- */
-export function Assay_existsByFileName(fileName, assays) {
- return exists((a) => equals(a.FileName, fileName), assays);
-}
-
-/**
- * Adds the given assay to the assays
- */
-export function Assay_add(assays, assay) {
- return append(assays, singleton(assay));
-}
-
-/**
- * Updates all assays for which the predicate returns true with the given assays values
- */
-export function Assay_updateBy(predicate, updateOption, assay, assays) {
- if (exists(predicate, assays)) {
- return map((a) => {
- if (predicate(a)) {
- const this$ = updateOption;
- const recordType_1 = a;
- const recordType_2 = assay;
- switch (this$.tag) {
- case 2:
- return makeRecord(Assay_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Assay_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Assay_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }
- else {
- return a;
- }
- }, assays);
- }
- else {
- return assays;
- }
-}
-
-/**
- * If an assay with the same fileName as the given assay exists in the study exists, updates it with the given assay values
- */
-export function Assay_updateByFileName(updateOption, assay, assays) {
- return Assay_updateBy((a) => equals(a.FileName, assay.FileName), updateOption, assay, assays);
-}
-
-/**
- * Updates all assays with the same name as the given assay with its values
- */
-export function Assay_removeByFileName(fileName, assays) {
- return filter((a) => !equals(a.FileName, fileName), assays);
-}
-
-/**
- * Returns comments of an assay
- */
-export function Assay_getComments_722A269D(assay) {
- return assay.Comments;
-}
-
-/**
- * Applies function f on comments of an assay
- */
-export function Assay_mapComments(f, assay) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, mapDefault(empty(), f, assay.Comments));
-}
-
-/**
- * Replaces comments of an assay by given comment list
- */
-export function Assay_setComments(assay, comments) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, comments);
-}
-
-/**
- * Returns data files of an assay
- */
-export function Assay_getData_722A269D(assay) {
- const processSequenceData = getData(defaultArg(assay.ProcessSequence, empty()));
- const updateOptions = new Update_UpdateOptions(3, []);
- const mapping = (d) => d.Name;
- const list1 = defaultArg(assay.DataFiles, empty());
- const list2 = processSequenceData;
- try {
- const map1 = Dict_ofSeqWithMerge((arg, arg_1) => {
- const this$ = updateOptions;
- const recordType_1 = arg;
- const recordType_2 = arg_1;
- switch (this$.tag) {
- case 2:
- return makeRecord(Data_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Data_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Data_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }, map((v) => [mapping(v), v], list1));
- const map2 = Dict_ofSeqWithMerge((arg_2, arg_3) => {
- const this$_1 = updateOptions;
- const recordType_1_1 = arg_2;
- const recordType_2_1 = arg_3;
- switch (this$_1.tag) {
- case 2:
- return makeRecord(Data_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 1:
- return makeRecord(Data_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 3:
- return makeRecord(Data_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- default:
- return recordType_2_1;
- }
- }, map((v_1) => [mapping(v_1), v_1], list2));
- return map((k) => {
- const matchValue = Dict_tryFind(k, map1);
- const matchValue_1 = Dict_tryFind(k, map2);
- if (matchValue == null) {
- if (matchValue_1 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1 = matchValue_1;
- return v2_1;
- }
- }
- else if (matchValue_1 == null) {
- const v1_1 = matchValue;
- return v1_1;
- }
- else {
- const v1 = matchValue;
- const v2 = matchValue_1;
- const this$_2 = updateOptions;
- const recordType_1_2 = v1;
- const recordType_2_2 = v2;
- switch (this$_2.tag) {
- case 2:
- return makeRecord(Data_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 1:
- return makeRecord(Data_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 3:
- return makeRecord(Data_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- default:
- return recordType_2_2;
- }
- }
- }, List_distinct(append(map(mapping, list1), map(mapping, list2)), {
- Equals: equals,
- GetHashCode: structuralHash,
- }));
- }
- catch (err) {
- throw new Error(`Could not mergeUpdate ${"Data"} list:
-${err.message}`);
- }
-}
-
-/**
- * Applies function f on data files of an assay
- */
-export function Assay_mapData(f, assay) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, mapDefault(empty(), f, assay.DataFiles), assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Replaces data files of an assay by given data file list
- */
-export function Assay_setData(assay, dataFiles) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, dataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Returns unit categories of an assay
- */
-export function Assay_getUnitCategories_722A269D(assay) {
- return List_distinct(append(getUnits(defaultArg(assay.ProcessSequence, empty())), defaultArg(assay.UnitCategories, empty())), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Applies function f on unit categories of an assay
- */
-export function Assay_mapUnitCategories(f, assay) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, mapDefault(empty(), f, assay.UnitCategories), assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Replaces unit categories of an assay by given unit categorie list
- */
-export function Assay_setUnitCategories(assay, unitCategories) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, unitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Returns characteristic categories of an assay
- */
-export function Assay_getCharacteristics_722A269D(assay) {
- return List_distinct(append(getCharacteristics(defaultArg(assay.ProcessSequence, empty())), defaultArg(assay.CharacteristicCategories, empty())), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Applies function f on characteristic categories of an assay
- */
-export function Assay_mapCharacteristics(f, assay) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, mapDefault(empty(), f, assay.CharacteristicCategories), assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Replaces characteristic categories of an assay by given characteristic categorie list
- */
-export function Assay_setCharacteristics(assay, characteristics) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, characteristics, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Returns measurement type of an assay
- */
-export function Assay_getMeasurementType_722A269D(assay) {
- return assay.MeasurementType;
-}
-
-/**
- * Applies function f on measurement type of an assay
- */
-export function Assay_mapMeasurementType(f, assay) {
- return new Assay(assay.ID, assay.FileName, map_1(f, assay.MeasurementType), assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Replaces measurement type of an assay by given measurement type
- */
-export function Assay_setMeasurementType(assay, measurementType) {
- return new Assay(assay.ID, assay.FileName, measurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Returns technology type of an assay
- */
-export function Assay_getTechnologyType_722A269D(assay) {
- return assay.TechnologyType;
-}
-
-/**
- * Applies function f on technology type of an assay
- */
-export function Assay_mapTechnologyType(f, assay) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, map_1(f, assay.TechnologyType), assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Replaces technology type of an assay by given technology type
- */
-export function Assay_setTechnologyType(assay, technologyType) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, technologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Returns processes of an assay
- */
-export function Assay_getProcesses_722A269D(assay) {
- return defaultArg(assay.ProcessSequence, empty());
-}
-
-/**
- * Applies function f on processes of an assay
- */
-export function Assay_mapProcesses(f, assay) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, mapDefault(empty(), f, assay.ProcessSequence), assay.Comments);
-}
-
-/**
- * Replaces processes of an assay by given processe list
- */
-export function Assay_setProcesses(assay, processes) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, assay.Materials, assay.CharacteristicCategories, assay.UnitCategories, processes, assay.Comments);
-}
-
-export function Assay_getSources_722A269D(assay) {
- return getSources(Assay_getProcesses_722A269D(assay));
-}
-
-export function Assay_getSamples_722A269D(assay) {
- return getSamples(Assay_getProcesses_722A269D(assay));
-}
-
-/**
- * Returns materials of an assay
- */
-export function Assay_getMaterials_722A269D(assay) {
- const processSequenceMaterials = getMaterials(defaultArg(assay.ProcessSequence, empty()));
- const processSequenceSamples = getSamples(defaultArg(assay.ProcessSequence, empty()));
- const matchValue = assay.Materials;
- if (matchValue == null) {
- return AssayMaterials_make(fromValueWithDefault(empty(), processSequenceSamples), fromValueWithDefault(empty(), processSequenceMaterials));
- }
- else {
- const mat = matchValue;
- let samples;
- const updateOptions = new Update_UpdateOptions(3, []);
- const mapping = (s) => s.Name;
- const list1 = defaultArg(mat.Samples, empty());
- const list2 = processSequenceSamples;
- try {
- const map1 = Dict_ofSeqWithMerge((arg, arg_1) => {
- const this$ = updateOptions;
- const recordType_1 = arg;
- const recordType_2 = arg_1;
- switch (this$.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }, map((v) => [mapping(v), v], list1));
- const map2 = Dict_ofSeqWithMerge((arg_2, arg_3) => {
- const this$_1 = updateOptions;
- const recordType_1_1 = arg_2;
- const recordType_2_1 = arg_3;
- switch (this$_1.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- default:
- return recordType_2_1;
- }
- }, map((v_1) => [mapping(v_1), v_1], list2));
- samples = map((k) => {
- const matchValue_1 = Dict_tryFind(k, map1);
- const matchValue_1_1 = Dict_tryFind(k, map2);
- if (matchValue_1 == null) {
- if (matchValue_1_1 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1 = matchValue_1_1;
- return v2_1;
- }
- }
- else if (matchValue_1_1 == null) {
- const v1_1 = matchValue_1;
- return v1_1;
- }
- else {
- const v1 = matchValue_1;
- const v2 = matchValue_1_1;
- const this$_2 = updateOptions;
- const recordType_1_2 = v1;
- const recordType_2_2 = v2;
- switch (this$_2.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- default:
- return recordType_2_2;
- }
- }
- }, List_distinct(append(map(mapping, list1), map(mapping, list2)), {
- Equals: equals,
- GetHashCode: structuralHash,
- }));
- }
- catch (err) {
- throw new Error(`Could not mergeUpdate ${"Sample"} list:
-${err.message}`);
- }
- let materials;
- const updateOptions_1 = new Update_UpdateOptions(3, []);
- const mapping_5 = (m) => m.Name;
- const list1_1 = defaultArg(mat.OtherMaterials, empty());
- const list2_1 = processSequenceMaterials;
- try {
- const map1_1 = Dict_ofSeqWithMerge((arg_6, arg_1_1) => {
- const this$_3 = updateOptions_1;
- const recordType_1_3 = arg_6;
- const recordType_2_3 = arg_1_1;
- switch (this$_3.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- default:
- return recordType_2_3;
- }
- }, map((v_2) => [mapping_5(v_2), v_2], list1_1));
- const map2_1 = Dict_ofSeqWithMerge((arg_2_1, arg_3_1) => {
- const this$_4 = updateOptions_1;
- const recordType_1_4 = arg_2_1;
- const recordType_2_4 = arg_3_1;
- switch (this$_4.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- default:
- return recordType_2_4;
- }
- }, map((v_1_1) => [mapping_5(v_1_1), v_1_1], list2_1));
- materials = map((k_1) => {
- const matchValue_3 = Dict_tryFind(k_1, map1_1);
- const matchValue_1_2 = Dict_tryFind(k_1, map2_1);
- if (matchValue_3 == null) {
- if (matchValue_1_2 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1_1 = matchValue_1_2;
- return v2_1_1;
- }
- }
- else if (matchValue_1_2 == null) {
- const v1_1_1 = matchValue_3;
- return v1_1_1;
- }
- else {
- const v1_2 = matchValue_3;
- const v2_2 = matchValue_1_2;
- const this$_5 = updateOptions_1;
- const recordType_1_5 = v1_2;
- const recordType_2_5 = v2_2;
- switch (this$_5.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- default:
- return recordType_2_5;
- }
- }
- }, List_distinct(append(map(mapping_5, list1_1), map(mapping_5, list2_1)), {
- Equals: equals,
- GetHashCode: structuralHash,
- }));
- }
- catch (err_1) {
- throw new Error(`Could not mergeUpdate ${"Material"} list:
-${err_1.message}`);
- }
- return AssayMaterials_make(fromValueWithDefault(empty(), samples), fromValueWithDefault(empty(), materials));
- }
-}
-
-/**
- * Applies function f on materials of an assay
- */
-export function Assay_mapMaterials(f, assay) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, map_1(f, assay.Materials), assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * Replaces materials of an assay by given assay materials
- */
-export function Assay_setMaterials(assay, materials) {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, assay.DataFiles, materials, assay.CharacteristicCategories, assay.UnitCategories, assay.ProcessSequence, assay.Comments);
-}
-
-/**
- * If the assay contains a process implementing the given parameter, return the list of input files together with their according parameter values of this parameter
- */
-export function Assay_getInputsWithParameterBy(predicate, assay) {
- return map_1((processSequence) => getInputsWithParameterBy(predicate, processSequence), assay.ProcessSequence);
-}
-
-/**
- * If the assay contains a process implementing the given parameter, return the list of output files together with their according parameter values of this parameter
- */
-export function Assay_getOutputsWithParameterBy(predicate, assay) {
- return map_1((processSequence) => getOutputsWithParameterBy(predicate, processSequence), assay.ProcessSequence);
-}
-
-/**
- * Returns the parameters implemented by the processes contained in this assay
- */
-export function Assay_getParameters_722A269D(assay) {
- return map_1(getParameters, assay.ProcessSequence);
-}
-
-/**
- * If the assay contains a process implementing the given parameter, return the list of input files together with their according parameter values of this parameter
- */
-export function Assay_getInputsWithCharacteristicBy(predicate, assay) {
- return map_1((processSequence) => getInputsWithCharacteristicBy(predicate, processSequence), assay.ProcessSequence);
-}
-
-/**
- * If the assay contains a process implementing the given parameter, return the list of output files together with their according parameter values of this parameter
- */
-export function Assay_getOutputsWithCharacteristicBy(predicate, assay) {
- return map_1((processSequence) => getOutputsWithCharacteristicBy(predicate, processSequence), assay.ProcessSequence);
-}
-
-/**
- * If the assay contains a process implementing the given factor, return the list of output files together with their according factor values of this factor
- */
-export function Assay_getOutputsWithFactorBy(predicate, assay) {
- return map_1((processSequence) => getOutputsWithFactorBy(predicate, processSequence), assay.ProcessSequence);
-}
-
-/**
- * Returns the factors implemented by the processes contained in this assay
- */
-export function Assay_getFactors_722A269D(assay) {
- return getFactors(defaultArg(assay.ProcessSequence, empty()));
-}
-
-/**
- * Returns the protocols implemented by the processes contained in this assay
- */
-export function Assay_getProtocols_722A269D(assay) {
- return getProtocols(defaultArg(assay.ProcessSequence, empty()));
-}
-
-export function Assay_update_722A269D(assay) {
- let v_1;
- try {
- return new Assay(assay.ID, assay.FileName, assay.MeasurementType, assay.TechnologyType, assay.TechnologyPlatform, fromValueWithDefault(empty(), Assay_getData_722A269D(assay)), (v_1 = Assay_getMaterials_722A269D(assay), fromValueWithDefault(AssayMaterials_get_empty(), v_1)), fromValueWithDefault(empty(), Assay_getCharacteristics_722A269D(assay)), fromValueWithDefault(empty(), Assay_getUnitCategories_722A269D(assay)), assay.ProcessSequence, assay.Comments);
- }
- catch (err) {
- return toFail(`Could not update assay ${assay.FileName}:
-${err.message}`);
- }
-}
-
-export function Assay_updateProtocols(protocols, assay) {
- try {
- return Assay_mapProcesses((processSequence) => updateProtocols(protocols, processSequence), assay);
- }
- catch (err) {
- return toFail(`Could not update assay protocols ${assay.FileName}:
-${err.message}`);
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/AssayMaterials.js b/js/ISA/ISA/JsonTypes/AssayMaterials.js
deleted file mode 100644
index 8a2acd0b..00000000
--- a/js/ISA/ISA/JsonTypes/AssayMaterials.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { Sample_$reflection } from "./Sample.js";
-import { record_type, option_type, list_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Material_$reflection } from "./Material.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { empty } from "../../../fable_modules/fable-library.4.1.4/List.js";
-
-export class AssayMaterials extends Record {
- constructor(Samples, OtherMaterials) {
- super();
- this.Samples = Samples;
- this.OtherMaterials = OtherMaterials;
- }
-}
-
-export function AssayMaterials_$reflection() {
- return record_type("ARCtrl.ISA.AssayMaterials", [], AssayMaterials, () => [["Samples", option_type(list_type(Sample_$reflection()))], ["OtherMaterials", option_type(list_type(Material_$reflection()))]]);
-}
-
-export function AssayMaterials_make(samples, otherMaterials) {
- return new AssayMaterials(samples, otherMaterials);
-}
-
-export function AssayMaterials_create_Z253F0553(Samples, OtherMaterials) {
- return AssayMaterials_make(Samples, OtherMaterials);
-}
-
-export function AssayMaterials_get_empty() {
- return AssayMaterials_create_Z253F0553();
-}
-
-export function AssayMaterials_getMaterials_35E61745(am) {
- return defaultArg(am.OtherMaterials, empty());
-}
-
-export function AssayMaterials_getSamples_35E61745(am) {
- return defaultArg(am.Samples, empty());
-}
-
diff --git a/js/ISA/ISA/JsonTypes/ColumnIndex.js b/js/ISA/ISA/JsonTypes/ColumnIndex.js
deleted file mode 100644
index 518ded55..00000000
--- a/js/ISA/ISA/JsonTypes/ColumnIndex.js
+++ /dev/null
@@ -1,245 +0,0 @@
-import { tryParse } from "../../../fable_modules/fable-library.4.1.4/Int32.js";
-import { FSharpRef } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { Comment_fromString } from "./Comment.js";
-import { int32ToString } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { value, bind } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { tryItem } from "./CommentList.js";
-import { append } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { OntologyAnnotation } from "./OntologyAnnotation.js";
-import { Factor_fromString_E4803FF } from "./Factor.js";
-import { MaterialAttribute_fromString_Z2304A83C } from "./MaterialAttribute.js";
-import { ProtocolParameter_fromString_Z2304A83C } from "./ProtocolParameter.js";
-import { Component_fromString_Z61E08C1 } from "./Component.js";
-
-function tryInt(str) {
- let matchValue;
- let outArg = 0;
- matchValue = [tryParse(str, 511, false, 32, new FSharpRef(() => outArg, (v) => {
- outArg = (v | 0);
- })), outArg];
- if (matchValue[0]) {
- return matchValue[1];
- }
- else {
- return void 0;
- }
-}
-
-export const orderName = "ColumnIndex";
-
-export function createOrderComment(index) {
- return Comment_fromString(orderName, int32ToString(index));
-}
-
-export function tryGetIndex(comments) {
- return bind(tryInt, tryItem(orderName, comments));
-}
-
-export function setOntologyAnnotationIndex(i, oa) {
- let matchValue, cs;
- return new OntologyAnnotation(oa.ID, oa.Name, oa.TermSourceREF, oa.LocalID, oa.TermAccessionNumber, (matchValue = oa.Comments, (matchValue == null) ? [createOrderComment(i)] : ((cs = matchValue, append([createOrderComment(i)], cs)))));
-}
-
-export function tryGetOntologyAnnotationIndex(oa) {
- return bind(tryGetIndex, oa.Comments);
-}
-
-export function tryGetParameterIndex(param) {
- return bind((oa) => bind(tryGetIndex, oa.Comments), param.ParameterName);
-}
-
-export function tryGetParameterColumnIndex(paramValue) {
- return bind(tryGetParameterIndex, paramValue.Category);
-}
-
-export function tryGetFactorIndex(factor) {
- return bind((oa) => bind(tryGetIndex, oa.Comments), factor.FactorType);
-}
-
-export function tryGetFactorColumnIndex(factorValue) {
- return bind(tryGetFactorIndex, factorValue.Category);
-}
-
-export function tryGetCharacteristicIndex(characteristic) {
- return bind((oa) => bind(tryGetIndex, oa.Comments), characteristic.CharacteristicType);
-}
-
-export function tryGetCharacteristicColumnIndex(characteristicValue) {
- return bind(tryGetCharacteristicIndex, characteristicValue.Category);
-}
-
-export function tryGetComponentIndex(comp) {
- return bind((oa) => bind(tryGetIndex, oa.Comments), comp.ComponentType);
-}
-
-/**
- * Create a ISAJson Factor from ISATab string entries
- */
-export function ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_fromStringWithColumnIndex_Static(name, term, source, accession, valueIndex) {
- return Factor_fromString_E4803FF(name, term, source, accession, [createOrderComment(valueIndex)]);
-}
-
-export function ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_getColumnIndex_Static_Z4C0FE73C(f) {
- return value(tryGetOntologyAnnotationIndex(f));
-}
-
-export function ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_GetColumnIndex(this$) {
- return value(tryGetOntologyAnnotationIndex(this$));
-}
-
-export function ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_tryGetColumnIndex_Static_Z4C0FE73C(f) {
- return tryGetOntologyAnnotationIndex(f);
-}
-
-export function ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_TryGetColumnIndex(this$) {
- return tryGetOntologyAnnotationIndex(this$);
-}
-
-export function ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_setColumnIndex_Static(i, oa) {
- return setOntologyAnnotationIndex(i, oa);
-}
-
-export function ARCtrl_ISA_OntologyAnnotation__OntologyAnnotation_SetColumnIndex_Z524259A4(this$, i) {
- return setOntologyAnnotationIndex(i, this$);
-}
-
-/**
- * Create a ISAJson Factor from ISATab string entries
- */
-export function ARCtrl_ISA_Factor__Factor_fromStringWithColumnIndex_Static(name, term, source, accession, valueIndex) {
- return Factor_fromString_E4803FF(name, term, source, accession, [createOrderComment(valueIndex)]);
-}
-
-export function ARCtrl_ISA_Factor__Factor_getColumnIndex_Static_Z55333BD7(f) {
- return value(tryGetFactorIndex(f));
-}
-
-export function ARCtrl_ISA_Factor__Factor_GetColumnIndex(this$) {
- return value(tryGetFactorIndex(this$));
-}
-
-export function ARCtrl_ISA_Factor__Factor_tryGetColumnIndex_Static_Z55333BD7(f) {
- return tryGetFactorIndex(f);
-}
-
-export function ARCtrl_ISA_Factor__Factor_TryGetColumnIndex(this$) {
- return tryGetFactorIndex(this$);
-}
-
-export function ARCtrl_ISA_FactorValue__FactorValue_getColumnIndex_Static_Z2623397E(f) {
- return value(tryGetFactorColumnIndex(f));
-}
-
-export function ARCtrl_ISA_FactorValue__FactorValue_GetColumnIndex(this$) {
- return value(tryGetFactorColumnIndex(this$));
-}
-
-export function ARCtrl_ISA_FactorValue__FactorValue_tryGetColumnIndex_Static_Z2623397E(f) {
- return tryGetFactorColumnIndex(f);
-}
-
-export function ARCtrl_ISA_FactorValue__FactorValue_TryGetColumnIndex(this$) {
- return tryGetFactorColumnIndex(this$);
-}
-
-/**
- * Create a ISAJson characteristic from ISATab string entries
- */
-export function ARCtrl_ISA_MaterialAttribute__MaterialAttribute_fromStringWithColumnIndex_Static(term, source, accession, valueIndex) {
- return MaterialAttribute_fromString_Z2304A83C(term, source, accession, [createOrderComment(valueIndex)]);
-}
-
-export function ARCtrl_ISA_MaterialAttribute__MaterialAttribute_getColumnIndex_Static_Z5F39696D(m) {
- return value(tryGetCharacteristicIndex(m));
-}
-
-export function ARCtrl_ISA_MaterialAttribute__MaterialAttribute_GetColumnIndex(this$) {
- return value(tryGetCharacteristicIndex(this$));
-}
-
-export function ARCtrl_ISA_MaterialAttribute__MaterialAttribute_tryGetColumnIndex_Static_Z5F39696D(m) {
- return tryGetCharacteristicIndex(m);
-}
-
-export function ARCtrl_ISA_MaterialAttribute__MaterialAttribute_TryGetColumnIndex(this$) {
- return tryGetCharacteristicIndex(this$);
-}
-
-export function ARCtrl_ISA_MaterialAttributeValue__MaterialAttributeValue_getColumnIndex_Static_43A5B238(m) {
- return value(tryGetCharacteristicColumnIndex(m));
-}
-
-export function ARCtrl_ISA_MaterialAttributeValue__MaterialAttributeValue_GetColumnIndex(this$) {
- return value(tryGetCharacteristicColumnIndex(this$));
-}
-
-export function ARCtrl_ISA_MaterialAttributeValue__MaterialAttributeValue_tryGetColumnIndex_Static_43A5B238(m) {
- return tryGetCharacteristicColumnIndex(m);
-}
-
-export function ARCtrl_ISA_MaterialAttributeValue__MaterialAttributeValue_TryGetColumnIndex(this$) {
- return tryGetCharacteristicColumnIndex(this$);
-}
-
-/**
- * Create a ISAJson parameter from ISATab string entries
- */
-export function ARCtrl_ISA_ProtocolParameter__ProtocolParameter_fromStringWithColumnIndex_Static(term, source, accession, valueIndex) {
- return ProtocolParameter_fromString_Z2304A83C(term, source, accession, [createOrderComment(valueIndex)]);
-}
-
-export function ARCtrl_ISA_ProtocolParameter__ProtocolParameter_getColumnIndex_Static_Z3A4310A5(p) {
- return value(tryGetParameterIndex(p));
-}
-
-export function ARCtrl_ISA_ProtocolParameter__ProtocolParameter_GetColumnIndex(this$) {
- return value(tryGetParameterIndex(this$));
-}
-
-export function ARCtrl_ISA_ProtocolParameter__ProtocolParameter_tryGetColumnIndex_Static_Z3A4310A5(p) {
- return tryGetParameterIndex(p);
-}
-
-export function ARCtrl_ISA_ProtocolParameter__ProtocolParameter_TryGetColumnIndex(this$) {
- return tryGetParameterIndex(this$);
-}
-
-export function ARCtrl_ISA_ProcessParameterValue__ProcessParameterValue_getColumnIndex_Static_5FD7232D(p) {
- return value(tryGetParameterColumnIndex(p));
-}
-
-export function ARCtrl_ISA_ProcessParameterValue__ProcessParameterValue_GetColumnIndex(this$) {
- return value(tryGetParameterColumnIndex(this$));
-}
-
-export function ARCtrl_ISA_ProcessParameterValue__ProcessParameterValue_tryGetColumnIndex_Static_5FD7232D(p) {
- return tryGetParameterColumnIndex(p);
-}
-
-export function ARCtrl_ISA_ProcessParameterValue__ProcessParameterValue_TryGetColumnIndex(this$) {
- return tryGetParameterColumnIndex(this$);
-}
-
-/**
- * Create a ISAJson Factor from ISATab string entries
- */
-export function ARCtrl_ISA_Component__Component_fromStringWithColumnIndex_Static(name, term, source, accession, valueIndex) {
- return Component_fromString_Z61E08C1(name, term, source, accession, [createOrderComment(valueIndex)]);
-}
-
-export function ARCtrl_ISA_Component__Component_getColumnIndex_Static_Z609B8895(f) {
- return value(tryGetComponentIndex(f));
-}
-
-export function ARCtrl_ISA_Component__Component_GetColumnIndex(this$) {
- return value(tryGetComponentIndex(this$));
-}
-
-export function ARCtrl_ISA_Component__Component_tryGetColumnIndex_Static_Z609B8895(f) {
- return tryGetComponentIndex(f);
-}
-
-export function ARCtrl_ISA_Component__Component_TryGetColumnIndex(this$) {
- return tryGetComponentIndex(this$);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Comment.js b/js/ISA/ISA/JsonTypes/Comment.js
deleted file mode 100644
index daae00b4..00000000
--- a/js/ISA/ISA/JsonTypes/Comment.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { int32_type, record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-
-export class Comment$ extends Record {
- constructor(ID, Name, Value) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.Value = Value;
- }
-}
-
-export function Comment$_$reflection() {
- return record_type("ARCtrl.ISA.Comment", [], Comment$, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["Value", option_type(string_type)]]);
-}
-
-export function Comment_make(id, name, value) {
- return new Comment$(id, name, value);
-}
-
-export function Comment_create_250E0578(Id, Name, Value) {
- return Comment_make(Id, Name, Value);
-}
-
-export function Comment_fromString(name, value) {
- return Comment_create_250E0578(void 0, name, value);
-}
-
-export function Comment_toString_ZFA4E8A9(comment) {
- return [defaultArg(comment.Name, ""), defaultArg(comment.Value, "")];
-}
-
-export class Remark extends Record {
- constructor(Line, Value) {
- super();
- this.Line = (Line | 0);
- this.Value = Value;
- }
-}
-
-export function Remark_$reflection() {
- return record_type("ARCtrl.ISA.Remark", [], Remark, () => [["Line", int32_type], ["Value", string_type]]);
-}
-
-export function Remark_make(line, value) {
- return new Remark(line, value);
-}
-
-export function Remark_create_Z176EF219(line, value) {
- return Remark_make(line, value);
-}
-
-export function Remark_toTuple_Z26CAFFFA(remark) {
- return [remark.Line, remark.Value];
-}
-
diff --git a/js/ISA/ISA/JsonTypes/CommentList.js b/js/ISA/ISA/JsonTypes/CommentList.js
deleted file mode 100644
index 580d4cca..00000000
--- a/js/ISA/ISA/JsonTypes/CommentList.js
+++ /dev/null
@@ -1,139 +0,0 @@
-import { map, append, choose, tryPick } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { value } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { ofArray } from "../../../fable_modules/fable-library.4.1.4/Map.js";
-import { equals, comparePrimitives } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-
-/**
- * If a comment with the given key exists in the [], return its value, else return None
- */
-export function tryItem(key, comments) {
- return tryPick((c) => {
- const matchValue = c.Name;
- let matchResult, n_1;
- if (matchValue != null) {
- if (matchValue === key) {
- matchResult = 0;
- n_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return c.Value;
- default:
- return void 0;
- }
- }, comments);
-}
-
-/**
- * Returns true, if the key exists in the []
- */
-export function containsKey(key, comments) {
- return comments.some((c) => {
- const matchValue = c.Name;
- let matchResult, n_1;
- if (matchValue != null) {
- if (matchValue === key) {
- matchResult = 0;
- n_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return true;
- default:
- return false;
- }
- });
-}
-
-/**
- * If a comment with the given key exists in the [], return its value
- */
-export function item(key, comments) {
- return value(tryItem(key, comments));
-}
-
-/**
- * Create a map of comment keys to comment values
- */
-export function toMap(comments) {
- return ofArray(choose((c) => {
- const matchValue = c.Name;
- if (matchValue != null) {
- return [matchValue, c.Value];
- }
- else {
- return void 0;
- }
- }, comments), {
- Compare: comparePrimitives,
- });
-}
-
-/**
- * Adds the given comment to the comment []
- */
-export function add(comment, comments) {
- return append(comments, [comment]);
-}
-
-/**
- * Add the given comment to the comment [] if it doesnt exist, else replace it
- */
-export function set$(comment, comments) {
- if (containsKey(value(comment.Name), comments)) {
- return map((c) => {
- if (equals(c.Name, comment.Name)) {
- return comment;
- }
- else {
- return c;
- }
- }, comments);
- }
- else {
- return append(comments, [comment]);
- }
-}
-
-/**
- * Returns a new comment [] where comments with the given key are filtered out
- */
-export function dropByKey(key, comments) {
- return comments.filter((c) => {
- const matchValue = c.Name;
- let matchResult, n_1;
- if (matchValue != null) {
- if (matchValue === key) {
- matchResult = 0;
- n_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return false;
- default:
- return true;
- }
- });
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Component.js b/js/ISA/ISA/JsonTypes/Component.js
deleted file mode 100644
index 57d714a1..00000000
--- a/js/ISA/ISA/JsonTypes/Component.js
+++ /dev/null
@@ -1,154 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Value as Value_1, Value_fromString_Z721C83C5, Value__get_Text, Value_$reflection } from "./Value.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation, OntologyAnnotation_fromTermAnnotation_Z721C83C5, OntologyAnnotation__get_TermAccessionShort, OntologyAnnotation__get_NameText, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { create, match } from "../../../fable_modules/fable-library.4.1.4/RegExp.js";
-import { AnnotationValue } from "./AnnotationValue.js";
-import { map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-
-export class Component extends Record {
- constructor(ComponentName, ComponentValue, ComponentUnit, ComponentType) {
- super();
- this.ComponentName = ComponentName;
- this.ComponentValue = ComponentValue;
- this.ComponentUnit = ComponentUnit;
- this.ComponentType = ComponentType;
- }
-}
-
-export function Component_$reflection() {
- return record_type("ARCtrl.ISA.Component", [], Component, () => [["ComponentName", option_type(string_type)], ["ComponentValue", option_type(Value_$reflection())], ["ComponentUnit", option_type(OntologyAnnotation_$reflection())], ["ComponentType", option_type(OntologyAnnotation_$reflection())]]);
-}
-
-export function Component_make(name, value, unit, componentType) {
- return new Component(name, value, unit, componentType);
-}
-
-export function Component_create_61502994(Name, Value, Unit, ComponentType) {
- return Component_make(Name, Value, Unit, ComponentType);
-}
-
-export function Component_get_empty() {
- return Component_create_61502994();
-}
-
-/**
- * This function creates a string containing full isa term triplet information about the component
- *
- * Components do not have enough fields in ISA-JSON to include all existing ontology term information.
- * This function allows us, to add the same information as `Parameter`, `Characteristics`.., to `Component`.
- * Without this string composition we loose the ontology information for the header value.
- */
-export function Component_composeName(value, unit) {
- if (value == null) {
- return "";
- }
- else if (value.tag === 0) {
- const oa = value.fields[0];
- return `${OntologyAnnotation__get_NameText(oa)} (${OntologyAnnotation__get_TermAccessionShort(oa)})`;
- }
- else if (unit != null) {
- const u = unit;
- const v_1 = value;
- return `${Value__get_Text(v_1)} ${OntologyAnnotation__get_NameText(u)} (${OntologyAnnotation__get_TermAccessionShort(u)})`;
- }
- else {
- const v = value;
- return `${Value__get_Text(v)}`;
- }
-}
-
-/**
- * This function parses the given Component header string format into the ISA-JSON Component type
- *
- * Components do not have enough fields in ISA-JSON to include all existing ontology term information.
- * This function allows us, to add the same information as `Parameter`, `Characteristics`.., to `Component`.
- * Without this string composition we loose the ontology information for the header value.
- */
-export function Component_decomposeName_Z721C83C5(name) {
- const r = match(create("(?[^\\(]+) \\((?[^(]*:[^)]*)\\)"), name);
- const unitr = match(create("(?[\\d\\.]+) (?.+) \\((?[^(]*:[^)]*)\\)"), name);
- if (unitr != null) {
- const oa = OntologyAnnotation_fromTermAnnotation_Z721C83C5((unitr.groups && unitr.groups.ontology) || "");
- return [Value_fromString_Z721C83C5((unitr.groups && unitr.groups.value) || ""), new OntologyAnnotation(oa.ID, new AnnotationValue(0, [(unitr.groups && unitr.groups.unit) || ""]), oa.TermSourceREF, oa.LocalID, oa.TermAccessionNumber, oa.Comments)];
- }
- else if (r != null) {
- const oa_1 = OntologyAnnotation_fromTermAnnotation_Z721C83C5((r.groups && r.groups.ontology) || "");
- return [new Value_1(0, [new OntologyAnnotation(oa_1.ID, new AnnotationValue(0, [Value__get_Text(Value_fromString_Z721C83C5((r.groups && r.groups.value) || ""))]), oa_1.TermSourceREF, oa_1.LocalID, oa_1.TermAccessionNumber, oa_1.Comments)]), void 0];
- }
- else {
- return [new Value_1(3, [name]), void 0];
- }
-}
-
-/**
- * Create a ISAJson Component from ISATab string entries
- */
-export function Component_fromString_Z61E08C1(name, term, source, accession, comments) {
- let cType;
- const v = OntologyAnnotation_fromString_2EB0E147(unwrap(term), unwrap(source), unwrap(accession), unwrap(comments));
- cType = fromValueWithDefault(OntologyAnnotation_get_empty(), v);
- if (name == null) {
- return Component_make(void 0, void 0, void 0, cType);
- }
- else {
- const patternInput = Component_decomposeName_Z721C83C5(name);
- return Component_make(name, fromValueWithDefault(new Value_1(3, [""]), patternInput[0]), patternInput[1], cType);
- }
-}
-
-export function Component_fromOptions(value, unit, header) {
- return Component_make(fromValueWithDefault("", Component_composeName(value, unit)), value, unit, header);
-}
-
-/**
- * Get ISATab string entries from an ISAJson Component object
- */
-export function Component_toString_Z609B8895(c) {
- let oa;
- const value = {
- TermAccessionNumber: "",
- TermName: "",
- TermSourceREF: "",
- };
- oa = defaultArg(map(OntologyAnnotation_toString_5E3DAF0D, c.ComponentType), value);
- return [defaultArg(c.ComponentName, ""), oa];
-}
-
-export function Component__get_NameText(this$) {
- return defaultArg(map(OntologyAnnotation__get_NameText, this$.ComponentType), "");
-}
-
-/**
- * Returns the ontology of the category of the Value as string
- */
-export function Component__get_UnitText(this$) {
- return defaultArg(map(OntologyAnnotation__get_NameText, this$.ComponentUnit), "");
-}
-
-export function Component__get_ValueText(this$) {
- return defaultArg(map(Value__get_Text, this$.ComponentValue), "");
-}
-
-export function Component__get_ValueWithUnitText(this$) {
- const unit = map(OntologyAnnotation__get_NameText, this$.ComponentUnit);
- const v = Component__get_ValueText(this$);
- if (unit == null) {
- return v;
- }
- else {
- const u = unit;
- return toText(printf("%s %s"))(v)(u);
- }
-}
-
-export function Component__MapCategory_Z69DD836A(this$, f) {
- return new Component(this$.ComponentName, this$.ComponentValue, this$.ComponentUnit, map(f, this$.ComponentType));
-}
-
-export function Component__SetCategory_Z4C0FE73C(this$, c) {
- return new Component(this$.ComponentName, this$.ComponentValue, this$.ComponentUnit, c);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Data.js b/js/ISA/ISA/JsonTypes/Data.js
deleted file mode 100644
index d419243b..00000000
--- a/js/ISA/ISA/JsonTypes/Data.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { DataFile_$reflection, DataFile__get_AsString } from "./DataFile.js";
-import { record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-
-export class Data extends Record {
- constructor(ID, Name, DataType, Comments) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.DataType = DataType;
- this.Comments = Comments;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- const matchValue = this$.DataType;
- if (matchValue == null) {
- const arg_2 = Data__get_NameAsString(this$);
- return toText(printf("%s"))(arg_2);
- }
- else {
- const t = matchValue;
- const arg = Data__get_NameAsString(this$);
- const arg_1 = DataFile__get_AsString(t);
- return toText(printf("%s [%s]"))(arg)(arg_1);
- }
- }
-}
-
-export function Data_$reflection() {
- return record_type("ARCtrl.ISA.Data", [], Data, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["DataType", option_type(DataFile_$reflection())], ["Comments", option_type(list_type(Comment$_$reflection()))]]);
-}
-
-export function Data_make(id, name, dataType, comments) {
- return new Data(id, name, dataType, comments);
-}
-
-export function Data_create_Z326CF519(Id, Name, DataType, Comments) {
- return Data_make(Id, Name, DataType, Comments);
-}
-
-export function Data_get_empty() {
- return Data_create_Z326CF519();
-}
-
-export function Data__get_NameAsString(this$) {
- return defaultArg(this$.Name, "");
-}
-
diff --git a/js/ISA/ISA/JsonTypes/DataFile.js b/js/ISA/ISA/JsonTypes/DataFile.js
deleted file mode 100644
index 7f26d359..00000000
--- a/js/ISA/ISA/JsonTypes/DataFile.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import { Union } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { union_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class DataFile extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["RawDataFile", "DerivedDataFile", "ImageFile"];
- }
-}
-
-export function DataFile_$reflection() {
- return union_type("ARCtrl.ISA.DataFile", [], DataFile, () => [[], [], []]);
-}
-
-export function DataFile_get_RawDataFileJson() {
- return "Raw Data File";
-}
-
-export function DataFile_get_DerivedDataFileJson() {
- return "Derived Data File";
-}
-
-export function DataFile_get_ImageFileJson() {
- return "Image File";
-}
-
-export function DataFile__get_AsString(this$) {
- switch (this$.tag) {
- case 1:
- return "DerivedDataFileJson";
- case 2:
- return "ImageFileJson";
- default:
- return "RawDataFileJson";
- }
-}
-
-export function DataFile__get_IsDerivedData(this$) {
- if (this$.tag === 1) {
- return true;
- }
- else {
- return false;
- }
-}
-
-export function DataFile__get_IsRawData(this$) {
- if (this$.tag === 0) {
- return true;
- }
- else {
- return false;
- }
-}
-
-export function DataFile__get_IsImage(this$) {
- if (this$.tag === 2) {
- return true;
- }
- else {
- return false;
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Factor.js b/js/ISA/ISA/JsonTypes/Factor.js
deleted file mode 100644
index 802de882..00000000
--- a/js/ISA/ISA/JsonTypes/Factor.js
+++ /dev/null
@@ -1,197 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, array_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-import { filter, map as map_1, singleton, append, exists, tryFind } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { map2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-
-export class Factor extends Record {
- constructor(ID, Name, FactorType, Comments) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.FactorType = FactorType;
- this.Comments = Comments;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- return "OA " + Factor__get_NameText(this$);
- }
-}
-
-export function Factor_$reflection() {
- return record_type("ARCtrl.ISA.Factor", [], Factor, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["FactorType", option_type(OntologyAnnotation_$reflection())], ["Comments", option_type(array_type(Comment$_$reflection()))]]);
-}
-
-export function Factor_make(id, name, factorType, comments) {
- return new Factor(id, name, factorType, comments);
-}
-
-export function Factor_create_3A99E5B8(Id, Name, FactorType, Comments) {
- return Factor_make(Id, Name, FactorType, Comments);
-}
-
-export function Factor_get_empty() {
- return Factor_create_3A99E5B8();
-}
-
-/**
- * Create a ISAJson Factor from ISATab string entries
- */
-export function Factor_fromString_E4803FF(name, term, source, accession, comments) {
- const oa = OntologyAnnotation_fromString_2EB0E147(term, source, accession, unwrap(comments));
- return Factor_make(void 0, fromValueWithDefault("", name), fromValueWithDefault(OntologyAnnotation_get_empty(), oa), void 0);
-}
-
-/**
- * Get ISATab string entries from an ISAJson Factor object
- */
-export function Factor_toString_Z55333BD7(factor) {
- const value = {
- TermAccessionNumber: "",
- TermName: "",
- TermSourceREF: "",
- };
- return defaultArg(map(OntologyAnnotation_toString_5E3DAF0D, factor.FactorType), value);
-}
-
-export function Factor__get_NameText(this$) {
- return defaultArg(this$.Name, "");
-}
-
-export function Factor__MapCategory_Z69DD836A(this$, f) {
- return new Factor(this$.ID, this$.Name, map(f, this$.FactorType), this$.Comments);
-}
-
-export function Factor__SetCategory_Z4C0FE73C(this$, c) {
- return new Factor(this$.ID, this$.Name, c, this$.Comments);
-}
-
-/**
- * If a factor with the given name exists in the list, returns it
- */
-export function Factor_tryGetByName(name, factors) {
- return tryFind((f) => equals(f.Name, name), factors);
-}
-
-/**
- * If a factor with the given name exists in the list exists, returns true
- */
-export function Factor_existsByName(name, factors) {
- return exists((f) => equals(f.Name, name), factors);
-}
-
-/**
- * adds the given factor to the factors
- */
-export function Factor_add(factors, factor) {
- return append(factors, singleton(factor));
-}
-
-/**
- * Updates all factors for which the predicate returns true with the given factor values
- */
-export function Factor_updateBy(predicate, updateOption, factor, factors) {
- if (exists(predicate, factors)) {
- return map_1((f) => {
- if (predicate(f)) {
- const this$ = updateOption;
- const recordType_1 = f;
- const recordType_2 = factor;
- return (this$.tag === 2) ? makeRecord(Factor_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 1) ? makeRecord(Factor_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 3) ? makeRecord(Factor_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : recordType_2));
- }
- else {
- return f;
- }
- }, factors);
- }
- else {
- return factors;
- }
-}
-
-/**
- * Updates all factors with the same name as the given factor with its values
- */
-export function Factor_updateByName(updateOption, factor, factors) {
- return Factor_updateBy((f) => equals(f.Name, factor.Name), updateOption, factor, factors);
-}
-
-/**
- * If a factor with the given name exists in the list, removes it
- */
-export function Factor_removeByName(name, factors) {
- return filter((f) => !equals(f.Name, name), factors);
-}
-
-/**
- * Returns comments of a factor
- */
-export function Factor_getComments_Z55333BD7(factor) {
- return factor.Comments;
-}
-
-/**
- * Applies function f on comments of a factor
- */
-export function Factor_mapComments(f, factor) {
- return new Factor(factor.ID, factor.Name, factor.FactorType, map(f, factor.Comments));
-}
-
-/**
- * Replaces comments of a factor by given comment list
- */
-export function Factor_setComments(factor, comments) {
- return new Factor(factor.ID, factor.Name, factor.FactorType, comments);
-}
-
-/**
- * Returns factor type of a factor
- */
-export function Factor_getFactorType_Z55333BD7(factor) {
- return factor.FactorType;
-}
-
-/**
- * Applies function f on factor type of a factor
- */
-export function Factor_mapFactorType(f, factor) {
- return new Factor(factor.ID, factor.Name, map(f, factor.FactorType), factor.Comments);
-}
-
-/**
- * Replaces factor type of a factor by given factor type
- */
-export function Factor_setFactorType(factor, factorType) {
- return new Factor(factor.ID, factor.Name, factorType, factor.Comments);
-}
-
-/**
- * Returns the name of the factor as string if it exists
- */
-export function Factor_tryGetName_Z55333BD7(f) {
- return f.Name;
-}
-
-/**
- * Returns the name of the factor as string
- */
-export function Factor_getNameAsString_Z55333BD7(f) {
- return Factor__get_NameText(f);
-}
-
-/**
- * Returns true if the given name matches the name of the factor
- */
-export function Factor_nameEqualsString(name, f) {
- return Factor__get_NameText(f) === name;
-}
-
diff --git a/js/ISA/ISA/JsonTypes/FactorValue.js b/js/ISA/ISA/JsonTypes/FactorValue.js
deleted file mode 100644
index 03a2feba..00000000
--- a/js/ISA/ISA/JsonTypes/FactorValue.js
+++ /dev/null
@@ -1,109 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { defaultArg, map } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { Factor__SetCategory_Z4C0FE73C, Factor_create_3A99E5B8, Factor__MapCategory_Z69DD836A, Factor_$reflection, Factor__get_NameText } from "./Factor.js";
-import { OntologyAnnotation_$reflection, OntologyAnnotation__get_NameText } from "./OntologyAnnotation.js";
-import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Value_$reflection } from "./Value.js";
-import { int32ToString } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-
-export class FactorValue extends Record {
- constructor(ID, Category, Value, Unit) {
- super();
- this.ID = ID;
- this.Category = Category;
- this.Value = Value;
- this.Unit = Unit;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- let value_2, category_2, category_1, value_1;
- const this$ = this;
- const category = map(Factor__get_NameText, this$.Category);
- const unit = map(OntologyAnnotation__get_NameText, this$.Unit);
- const value = map((v) => {
- const s = v.PrintCompact();
- if (unit == null) {
- return s;
- }
- else {
- return (s + " ") + unit;
- }
- }, this$.Value);
- return (category == null) ? ((value == null) ? "" : ((value_2 = value, value_2))) : ((value == null) ? ((category_2 = category, (category_2 + ":") + "No Value")) : ((category_1 = category, (value_1 = value, (category_1 + ":") + value_1))));
- }
-}
-
-export function FactorValue_$reflection() {
- return record_type("ARCtrl.ISA.FactorValue", [], FactorValue, () => [["ID", option_type(string_type)], ["Category", option_type(Factor_$reflection())], ["Value", option_type(Value_$reflection())], ["Unit", option_type(OntologyAnnotation_$reflection())]]);
-}
-
-export function FactorValue_make(id, category, value, unit) {
- return new FactorValue(id, category, value, unit);
-}
-
-export function FactorValue_create_18335379(Id, Category, Value, Unit) {
- return FactorValue_make(Id, Category, Value, Unit);
-}
-
-export function FactorValue_get_empty() {
- return FactorValue_create_18335379();
-}
-
-export function FactorValue__get_ValueText(this$) {
- return defaultArg(map((oa) => {
- switch (oa.tag) {
- case 2:
- return oa.fields[0].toString();
- case 1:
- return int32ToString(oa.fields[0]);
- case 3:
- return oa.fields[0];
- default:
- return OntologyAnnotation__get_NameText(oa.fields[0]);
- }
- }, this$.Value), "");
-}
-
-export function FactorValue__get_ValueWithUnitText(this$) {
- const unit = map(OntologyAnnotation__get_NameText, this$.Unit);
- const v = FactorValue__get_ValueText(this$);
- if (unit == null) {
- return v;
- }
- else {
- const u = unit;
- return toText(printf("%s %s"))(v)(u);
- }
-}
-
-export function FactorValue__get_NameText(this$) {
- return defaultArg(map(Factor__get_NameText, this$.Category), "");
-}
-
-export function FactorValue__MapCategory_Z69DD836A(this$, f) {
- return new FactorValue(this$.ID, map((p) => Factor__MapCategory_Z69DD836A(p, f), this$.Category), this$.Value, this$.Unit);
-}
-
-export function FactorValue__SetCategory_Z4C0FE73C(this$, c) {
- let matchValue;
- return new FactorValue(this$.ID, (matchValue = this$.Category, (matchValue == null) ? Factor_create_3A99E5B8(void 0, void 0, c) : Factor__SetCategory_Z4C0FE73C(matchValue, c)), this$.Value, this$.Unit);
-}
-
-/**
- * Returns the name of the factor value as string
- */
-export function FactorValue_getNameAsString_Z2623397E(fv) {
- return FactorValue__get_NameText(fv);
-}
-
-/**
- * Returns true if the given name matches the name of the factor value
- */
-export function FactorValue_nameEqualsString(name, fv) {
- return FactorValue__get_NameText(fv) === name;
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Investigation.js b/js/ISA/ISA/JsonTypes/Investigation.js
deleted file mode 100644
index 9eff6ea9..00000000
--- a/js/ISA/ISA/JsonTypes/Investigation.js
+++ /dev/null
@@ -1,204 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologySourceReference_$reflection } from "./OntologySourceReference.js";
-import { Publication_$reflection } from "./Publication.js";
-import { Person_$reflection } from "./Person.js";
-import { Study_update_7312BC8B, Study_$reflection } from "./Study.js";
-import { Remark_$reflection, Comment$_$reflection } from "./Comment.js";
-import { map, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { map as map_1, empty } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { mapDefault } from "../OptionExtensions.js";
-import { map2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { toFail } from "../../../fable_modules/fable-library.4.1.4/String.js";
-
-export class Investigation extends Record {
- constructor(ID, FileName, Identifier, Title, Description, SubmissionDate, PublicReleaseDate, OntologySourceReferences, Publications, Contacts, Studies, Comments, Remarks) {
- super();
- this.ID = ID;
- this.FileName = FileName;
- this.Identifier = Identifier;
- this.Title = Title;
- this.Description = Description;
- this.SubmissionDate = SubmissionDate;
- this.PublicReleaseDate = PublicReleaseDate;
- this.OntologySourceReferences = OntologySourceReferences;
- this.Publications = Publications;
- this.Contacts = Contacts;
- this.Studies = Studies;
- this.Comments = Comments;
- this.Remarks = Remarks;
- }
-}
-
-export function Investigation_$reflection() {
- return record_type("ARCtrl.ISA.Investigation", [], Investigation, () => [["ID", option_type(string_type)], ["FileName", option_type(string_type)], ["Identifier", option_type(string_type)], ["Title", option_type(string_type)], ["Description", option_type(string_type)], ["SubmissionDate", option_type(string_type)], ["PublicReleaseDate", option_type(string_type)], ["OntologySourceReferences", option_type(list_type(OntologySourceReference_$reflection()))], ["Publications", option_type(list_type(Publication_$reflection()))], ["Contacts", option_type(list_type(Person_$reflection()))], ["Studies", option_type(list_type(Study_$reflection()))], ["Comments", option_type(list_type(Comment$_$reflection()))], ["Remarks", list_type(Remark_$reflection())]]);
-}
-
-export function Investigation_make(id, filename, identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReference, publications, contacts, studies, comments, remarks) {
- return new Investigation(id, filename, identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReference, publications, contacts, studies, comments, remarks);
-}
-
-export function Investigation_create_4AD66BBE(Id, FileName, Identifier, Title, Description, SubmissionDate, PublicReleaseDate, OntologySourceReferences, Publications, Contacts, Studies, Comments, Remarks) {
- return Investigation_make(Id, FileName, Identifier, Title, Description, SubmissionDate, PublicReleaseDate, OntologySourceReferences, Publications, Contacts, Studies, Comments, defaultArg(Remarks, empty()));
-}
-
-export function Investigation_get_empty() {
- return Investigation_create_4AD66BBE();
-}
-
-/**
- * Returns contacts of an investigation
- */
-export function Investigation_getContacts_33B81164(investigation) {
- return investigation.Contacts;
-}
-
-/**
- * Applies function f on person of an investigation
- */
-export function Investigation_mapContacts(f, investigation) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, mapDefault(empty(), f, investigation.Contacts), investigation.Studies, investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Replaces persons of an investigation with the given person list
- */
-export function Investigation_setContacts(investigation, persons) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, persons, investigation.Studies, investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Returns publications of an investigation
- */
-export function Investigation_getPublications_33B81164(investigation) {
- return investigation.Publications;
-}
-
-/**
- * Applies function f on publications of an investigation
- */
-export function Investigation_mapPublications(f, investigation) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, mapDefault(empty(), f, investigation.Publications), investigation.Contacts, investigation.Studies, investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Replaces publications of an investigation with the given publication list
- */
-export function Investigation_setPublications(investigation, publications) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, publications, investigation.Contacts, investigation.Studies, investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Returns ontology source ref of an investigation
- */
-export function Investigation_getOntologies_33B81164(investigation) {
- return investigation.OntologySourceReferences;
-}
-
-/**
- * Applies function f on ontology source ref of an investigation
- */
-export function Investigation_mapOntologies(f, investigation) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, mapDefault(empty(), f, investigation.OntologySourceReferences), investigation.Publications, investigation.Contacts, investigation.Studies, investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Replaces ontology source ref of an investigation with the given ontology source ref list
- */
-export function Investigation_setOntologies(investigation, ontologies) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, ontologies, investigation.Publications, investigation.Contacts, investigation.Studies, investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Returns studies of an investigation
- */
-export function Investigation_getStudies_33B81164(investigation) {
- return defaultArg(investigation.Studies, empty());
-}
-
-/**
- * Applies function f on studies of an investigation
- */
-export function Investigation_mapStudies(f, investigation) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, investigation.Contacts, mapDefault(empty(), f, investigation.Studies), investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Replaces studies of an investigation with the given study list
- */
-export function Investigation_setStudies(investigation, studies) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, investigation.Contacts, studies, investigation.Comments, investigation.Remarks);
-}
-
-/**
- * Returns comments of an investigation
- */
-export function Investigation_getComments_33B81164(investigation) {
- return investigation.Comments;
-}
-
-/**
- * Applies function f on comments of an investigation
- */
-export function Investigation_mapComments(f, investigation) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, investigation.Contacts, investigation.Studies, mapDefault(empty(), f, investigation.Comments), investigation.Remarks);
-}
-
-/**
- * Replaces comments of an investigation with the given comment list
- */
-export function Investigation_setComments(investigation, comments) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, investigation.Contacts, investigation.Studies, comments, investigation.Remarks);
-}
-
-/**
- * Returns remarks of an investigation
- */
-export function Investigation_getRemarks_33B81164(investigation) {
- return investigation.Remarks;
-}
-
-/**
- * Applies function f on remarks of an investigation
- */
-export function Investigation_mapRemarks(f, investigation) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, investigation.Contacts, investigation.Studies, investigation.Comments, f(investigation.Remarks));
-}
-
-/**
- * Replaces remarks of an investigation with the given remark list
- */
-export function Investigation_setRemarks(investigation, remarks) {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, investigation.Contacts, investigation.Studies, investigation.Comments, remarks);
-}
-
-/**
- * Update the investigation with the values of the given newInvestigation
- */
-export function Investigation_updateBy(updateOption, investigation, newInvestigation) {
- const this$ = updateOption;
- const recordType_1 = investigation;
- const recordType_2 = newInvestigation;
- switch (this$.tag) {
- case 2:
- return makeRecord(Investigation_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Investigation_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Investigation_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
-}
-
-export function Investigation_update_33B81164(investigation) {
- try {
- return new Investigation(investigation.ID, investigation.FileName, investigation.Identifier, investigation.Title, investigation.Description, investigation.SubmissionDate, investigation.PublicReleaseDate, investigation.OntologySourceReferences, investigation.Publications, investigation.Contacts, map((list) => map_1(Study_update_7312BC8B, list), investigation.Studies), investigation.Comments, investigation.Remarks);
- }
- catch (err) {
- return toFail(`Could not update investigation ${investigation.Identifier}:
-${err.message}`);
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Material.js b/js/ISA/ISA/JsonTypes/Material.js
deleted file mode 100644
index 4ea8f033..00000000
--- a/js/ISA/ISA/JsonTypes/Material.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { choose, empty, length } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { MaterialType_$reflection, MaterialType__get_AsString } from "./MaterialType.js";
-import { record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { MaterialAttributeValue_$reflection } from "./MaterialAttributeValue.js";
-
-export class Material extends Record {
- constructor(ID, Name, MaterialType, Characteristics, DerivesFrom) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.MaterialType = MaterialType;
- this.Characteristics = Characteristics;
- this.DerivesFrom = DerivesFrom;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- const chars = length(defaultArg(this$.Characteristics, empty())) | 0;
- const matchValue = this$.MaterialType;
- if (matchValue == null) {
- const arg_3 = Material__get_NameText(this$);
- return toText(printf("%s [%i characteristics]"))(arg_3)(chars);
- }
- else {
- const t = matchValue;
- const arg = Material__get_NameText(this$);
- const arg_1 = MaterialType__get_AsString(t);
- return toText(printf("%s [%s; %i characteristics]"))(arg)(arg_1)(chars);
- }
- }
-}
-
-export function Material_$reflection() {
- return record_type("ARCtrl.ISA.Material", [], Material, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["MaterialType", option_type(MaterialType_$reflection())], ["Characteristics", option_type(list_type(MaterialAttributeValue_$reflection()))], ["DerivesFrom", option_type(list_type(Material_$reflection()))]]);
-}
-
-export function Material_make(id, name, materialType, characteristics, derivesFrom) {
- return new Material(id, name, materialType, characteristics, derivesFrom);
-}
-
-export function Material_create_Z31BE6CDD(Id, Name, MaterialType, Characteristics, DerivesFrom) {
- return Material_make(Id, Name, MaterialType, Characteristics, DerivesFrom);
-}
-
-export function Material_get_empty() {
- return Material_create_Z31BE6CDD();
-}
-
-export function Material__get_NameText(this$) {
- return defaultArg(this$.Name, "");
-}
-
-export function Material_getUnits_Z42815C11(m) {
- return choose((c) => c.Unit, defaultArg(m.Characteristics, empty()));
-}
-
-export function Material_setCharacteristicValues(values, m) {
- return new Material(m.ID, m.Name, m.MaterialType, values, m.DerivesFrom);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/MaterialAttribute.js b/js/ISA/ISA/JsonTypes/MaterialAttribute.js
deleted file mode 100644
index 721f5054..00000000
--- a/js/ISA/ISA/JsonTypes/MaterialAttribute.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation__get_TryNameText, OntologyAnnotation__get_NameText, OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { bind, map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-
-export class MaterialAttribute extends Record {
- constructor(ID, CharacteristicType) {
- super();
- this.ID = ID;
- this.CharacteristicType = CharacteristicType;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- return "OA " + MaterialAttribute__get_NameText(this$);
- }
-}
-
-export function MaterialAttribute_$reflection() {
- return record_type("ARCtrl.ISA.MaterialAttribute", [], MaterialAttribute, () => [["ID", option_type(string_type)], ["CharacteristicType", option_type(OntologyAnnotation_$reflection())]]);
-}
-
-export function MaterialAttribute_make(id, characteristicType) {
- return new MaterialAttribute(id, characteristicType);
-}
-
-export function MaterialAttribute_create_Z6C54B221(Id, CharacteristicType) {
- return MaterialAttribute_make(Id, CharacteristicType);
-}
-
-export function MaterialAttribute_get_empty() {
- return MaterialAttribute_create_Z6C54B221();
-}
-
-/**
- * Create a ISAJson MaterialAttribute from ISATab string entries
- */
-export function MaterialAttribute_fromString_Z2304A83C(term, source, accession, comments) {
- const oa = OntologyAnnotation_fromString_2EB0E147(term, source, accession, unwrap(comments));
- return MaterialAttribute_make(void 0, fromValueWithDefault(OntologyAnnotation_get_empty(), oa));
-}
-
-/**
- * Get ISATab string entries from an ISAJson MaterialAttribute object
- */
-export function MaterialAttribute_toString_Z5F39696D(ma) {
- const value = {
- TermAccessionNumber: "",
- TermName: "",
- TermSourceREF: "",
- };
- return defaultArg(map(OntologyAnnotation_toString_5E3DAF0D, ma.CharacteristicType), value);
-}
-
-/**
- * Returns the name of the characteristic as string
- */
-export function MaterialAttribute__get_NameText(this$) {
- return defaultArg(map(OntologyAnnotation__get_NameText, this$.CharacteristicType), "");
-}
-
-/**
- * Returns the name of the characteristic as string
- */
-export function MaterialAttribute__get_TryNameText(this$) {
- return bind(OntologyAnnotation__get_TryNameText, this$.CharacteristicType);
-}
-
-export function MaterialAttribute__MapCategory_Z69DD836A(this$, f) {
- return new MaterialAttribute(this$.ID, map(f, this$.CharacteristicType));
-}
-
-export function MaterialAttribute__SetCategory_Z4C0FE73C(this$, c) {
- return new MaterialAttribute(this$.ID, c);
-}
-
-/**
- * Returns the name of the characteristic as string if it exists
- */
-export function MaterialAttribute_tryGetNameText_Z5F39696D(ma) {
- return MaterialAttribute__get_NameText(ma);
-}
-
-/**
- * Returns the name of the characteristic as string
- */
-export function MaterialAttribute_getNameText_Z5F39696D(ma) {
- return MaterialAttribute__get_TryNameText(ma);
-}
-
-/**
- * Returns true if the given name matches the name of the characteristic
- */
-export function MaterialAttribute_nameEqualsString(name, ma) {
- return MaterialAttribute__get_NameText(ma) === name;
-}
-
diff --git a/js/ISA/ISA/JsonTypes/MaterialAttributeValue.js b/js/ISA/ISA/JsonTypes/MaterialAttributeValue.js
deleted file mode 100644
index ed1a4ec1..00000000
--- a/js/ISA/ISA/JsonTypes/MaterialAttributeValue.js
+++ /dev/null
@@ -1,126 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { bind, defaultArg, map } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { MaterialAttribute__SetCategory_Z4C0FE73C, MaterialAttribute_create_Z6C54B221, MaterialAttribute__MapCategory_Z69DD836A, MaterialAttribute__get_TryNameText, MaterialAttribute_$reflection, MaterialAttribute__get_NameText } from "./MaterialAttribute.js";
-import { OntologyAnnotation_$reflection, OntologyAnnotation__get_NameText } from "./OntologyAnnotation.js";
-import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Value_$reflection } from "./Value.js";
-import { int32ToString } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-
-export class MaterialAttributeValue extends Record {
- constructor(ID, Category, Value, Unit) {
- super();
- this.ID = ID;
- this.Category = Category;
- this.Value = Value;
- this.Unit = Unit;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- let value_2, category_2, category_1, value_1;
- const this$ = this;
- const category = map(MaterialAttribute__get_NameText, this$.Category);
- const unit = map(OntologyAnnotation__get_NameText, this$.Unit);
- const value = map((v) => {
- const s = v.PrintCompact();
- if (unit == null) {
- return s;
- }
- else {
- return (s + " ") + unit;
- }
- }, this$.Value);
- return (category == null) ? ((value == null) ? "" : ((value_2 = value, value_2))) : ((value == null) ? ((category_2 = category, (category_2 + ":") + "No Value")) : ((category_1 = category, (value_1 = value, (category_1 + ":") + value_1))));
- }
-}
-
-export function MaterialAttributeValue_$reflection() {
- return record_type("ARCtrl.ISA.MaterialAttributeValue", [], MaterialAttributeValue, () => [["ID", option_type(string_type)], ["Category", option_type(MaterialAttribute_$reflection())], ["Value", option_type(Value_$reflection())], ["Unit", option_type(OntologyAnnotation_$reflection())]]);
-}
-
-export function MaterialAttributeValue_make(id, category, value, unit) {
- return new MaterialAttributeValue(id, category, value, unit);
-}
-
-export function MaterialAttributeValue_create_7F714043(Id, Category, Value, Unit) {
- return MaterialAttributeValue_make(Id, Category, Value, Unit);
-}
-
-export function MaterialAttributeValue_get_empty() {
- return MaterialAttributeValue_create_7F714043();
-}
-
-/**
- * Returns the name of the category as string
- */
-export function MaterialAttributeValue__get_NameText(this$) {
- return defaultArg(map(MaterialAttribute__get_NameText, this$.Category), "");
-}
-
-/**
- * Returns the name of the category as string
- */
-export function MaterialAttributeValue__get_TryNameText(this$) {
- return bind(MaterialAttribute__get_TryNameText, this$.Category);
-}
-
-export function MaterialAttributeValue__get_ValueText(this$) {
- return defaultArg(map((oa) => {
- switch (oa.tag) {
- case 2:
- return oa.fields[0].toString();
- case 1:
- return int32ToString(oa.fields[0]);
- case 3:
- return oa.fields[0];
- default:
- return OntologyAnnotation__get_NameText(oa.fields[0]);
- }
- }, this$.Value), "");
-}
-
-export function MaterialAttributeValue__get_ValueWithUnitText(this$) {
- const unit = map(OntologyAnnotation__get_NameText, this$.Unit);
- const v = MaterialAttributeValue__get_ValueText(this$);
- if (unit == null) {
- return v;
- }
- else {
- const u = unit;
- return toText(printf("%s %s"))(v)(u);
- }
-}
-
-export function MaterialAttributeValue__MapCategory_Z69DD836A(this$, f) {
- return new MaterialAttributeValue(this$.ID, map((p) => MaterialAttribute__MapCategory_Z69DD836A(p, f), this$.Category), this$.Value, this$.Unit);
-}
-
-export function MaterialAttributeValue__SetCategory_Z4C0FE73C(this$, c) {
- let matchValue;
- return new MaterialAttributeValue(this$.ID, (matchValue = this$.Category, (matchValue == null) ? MaterialAttribute_create_Z6C54B221(void 0, c) : MaterialAttribute__SetCategory_Z4C0FE73C(matchValue, c)), this$.Value, this$.Unit);
-}
-
-/**
- * Returns the name of the characteristic value as string if it exists
- */
-export function MaterialAttributeValue_tryGetNameText_43A5B238(mv) {
- return MaterialAttributeValue__get_TryNameText(mv);
-}
-
-/**
- * Returns the name of the characteristic value as string
- */
-export function MaterialAttributeValue_getNameAsString_43A5B238(mv) {
- return MaterialAttributeValue__get_TryNameText(mv);
-}
-
-/**
- * Returns true if the given name matches the name of the characteristic value
- */
-export function MaterialAttributeValue_nameEqualsString(name, mv) {
- return MaterialAttributeValue__get_NameText(mv) === name;
-}
-
diff --git a/js/ISA/ISA/JsonTypes/MaterialType.js b/js/ISA/ISA/JsonTypes/MaterialType.js
deleted file mode 100644
index d571804c..00000000
--- a/js/ISA/ISA/JsonTypes/MaterialType.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Union } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { union_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-
-export class MaterialType extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["ExtractName", "LabeledExtractName"];
- }
-}
-
-export function MaterialType_$reflection() {
- return union_type("ARCtrl.ISA.MaterialType", [], MaterialType, () => [[], []]);
-}
-
-export function MaterialType_create_Z721C83C5(t) {
- switch (t) {
- case "Extract Name":
- return new MaterialType(0, []);
- case "Labeled Extract Name":
- return new MaterialType(1, []);
- default:
- throw new Error("No other value than \"Extract Name\" or \"Labeled Extract Name\" allowed for materialtype");
- }
-}
-
-/**
- * Returns the type of the MaterialType
- */
-export function MaterialType__get_AsString(this$) {
- if (this$.tag === 1) {
- return "Labeled Extract";
- }
- else {
- return "Extract";
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/OntologyAnnotation.js b/js/ISA/ISA/JsonTypes/OntologyAnnotation.js
deleted file mode 100644
index 59556e91..00000000
--- a/js/ISA/ISA/JsonTypes/OntologyAnnotation.js
+++ /dev/null
@@ -1,340 +0,0 @@
-import { equals, int32ToString, stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, array_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { AnnotationValue_toString_Z6FAD7738, AnnotationValue_fromString_Z721C83C5, AnnotationValue_$reflection } from "./AnnotationValue.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { value as value_4, map, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { ActivePatterns_$007CRegex$007C_$007C, tryParseTermAnnotation, ActivePatterns_$007CTermAnnotation$007C_$007C } from "../Regex.js";
-import { filter, map as map_1, singleton, append, exists, tryFind } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { map2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { mapDefault } from "../OptionExtensions.js";
-
-export class OntologyAnnotation extends Record {
- constructor(ID, Name, TermSourceREF, LocalID, TermAccessionNumber, Comments) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.TermSourceREF = TermSourceREF;
- this.LocalID = LocalID;
- this.TermAccessionNumber = TermAccessionNumber;
- this.Comments = Comments;
- }
- Equals(other) {
- const this$ = this;
- if (other instanceof OntologyAnnotation) {
- return this$["System.IEquatable`1.Equals2B595"](other);
- }
- else if (typeof other === "string") {
- const s = other;
- return ((OntologyAnnotation__get_NameText(this$) === s) ? true : (OntologyAnnotation__get_TermAccessionShort(this$) === s)) ? true : (OntologyAnnotation__get_TermAccessionOntobeeUrl(this$) === s);
- }
- else {
- return false;
- }
- }
- GetHashCode() {
- const this$ = this;
- return stringHash(OntologyAnnotation__get_NameText(this$) + OntologyAnnotation__get_TermAccessionShort(this$)) | 0;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- return "OA " + OntologyAnnotation__get_NameText(this$);
- }
- "System.IEquatable`1.Equals2B595"(other) {
- const this$ = this;
- return ((this$.TermAccessionNumber != null) && (other.TermAccessionNumber != null)) ? ((OntologyAnnotation__get_TermAccessionShort(other) === OntologyAnnotation__get_TermAccessionShort(this$)) ? true : (OntologyAnnotation__get_TermAccessionOntobeeUrl(other) === OntologyAnnotation__get_TermAccessionOntobeeUrl(this$))) : (((this$.Name != null) && (other.Name != null)) ? (OntologyAnnotation__get_NameText(other) === OntologyAnnotation__get_NameText(this$)) : ((((this$.TermAccessionNumber == null) && (other.TermAccessionNumber == null)) && (this$.Name == null)) && (other.Name == null)));
- }
-}
-
-export function OntologyAnnotation_$reflection() {
- return record_type("ARCtrl.ISA.OntologyAnnotation", [], OntologyAnnotation, () => [["ID", option_type(string_type)], ["Name", option_type(AnnotationValue_$reflection())], ["TermSourceREF", option_type(string_type)], ["LocalID", option_type(string_type)], ["TermAccessionNumber", option_type(string_type)], ["Comments", option_type(array_type(Comment$_$reflection()))]]);
-}
-
-export function OntologyAnnotation_make(id, name, termSourceREF, localID, termAccessionNumber, comments) {
- return new OntologyAnnotation(id, name, termSourceREF, localID, termAccessionNumber, comments);
-}
-
-/**
- * This function creates the type exactly as given. If you want a more streamlined approach use `OntologyAnnotation.fromString`.
- */
-export function OntologyAnnotation_create_Z61CCDEEC(Id, Name, TermSourceREF, LocalID, TermAccessionNumber, Comments) {
- return OntologyAnnotation_make(Id, Name, TermSourceREF, LocalID, TermAccessionNumber, Comments);
-}
-
-export function OntologyAnnotation_get_empty() {
- return OntologyAnnotation_create_Z61CCDEEC();
-}
-
-/**
- * Returns the name of the ontology as string
- */
-export function OntologyAnnotation__get_NameText(this$) {
- return defaultArg(map((av) => {
- switch (av.tag) {
- case 1:
- return av.fields[0].toString();
- case 2:
- return int32ToString(av.fields[0]);
- default:
- return av.fields[0];
- }
- }, this$.Name), "");
-}
-
-/**
- * Returns the name of the ontology as string
- */
-export function OntologyAnnotation__get_TryNameText(this$) {
- return map((av) => {
- switch (av.tag) {
- case 1:
- return av.fields[0].toString();
- case 2:
- return int32ToString(av.fields[0]);
- default:
- return av.fields[0];
- }
- }, this$.Name);
-}
-
-/**
- * Returns the term source of the ontology as string
- */
-export function OntologyAnnotation__get_TermSourceREFString(this$) {
- return defaultArg(this$.TermSourceREF, "");
-}
-
-/**
- * Returns the term accession number of the ontology as string
- */
-export function OntologyAnnotation__get_TermAccessionString(this$) {
- return defaultArg(this$.TermAccessionNumber, "");
-}
-
-/**
- * Create a path in form of `http://purl.obolibrary.org/obo/MS_1000121` from it's Term Accession Source `MS` and Local Term Accession Number `1000121`.
- */
-export function OntologyAnnotation_createUriAnnotation(termSourceRef, localTAN) {
- return `${"http://purl.obolibrary.org/obo/"}${termSourceRef}_${localTAN}`;
-}
-
-/**
- * Create a ISAJson Ontology Annotation value from ISATab string entries, will try to reduce `termAccessionNumber` with regex matching.
- *
- * Exmp. 1: http://purl.obolibrary.org/obo/GO_000001 --> GO:000001
- */
-export function OntologyAnnotation_fromString_2EB0E147(term, tsr, tan, comments) {
- let activePatternResult, tan_1;
- const patternInput = (tan != null) ? ((activePatternResult = ActivePatterns_$007CTermAnnotation$007C_$007C(tan), (activePatternResult != null) ? ((tan_1 = activePatternResult, [(tsr != null) ? tsr : tan_1.TermSourceREF, tan_1.LocalTAN])) : [tsr, void 0])) : [tsr, void 0];
- return OntologyAnnotation_make(void 0, map(AnnotationValue_fromString_Z721C83C5, term), patternInput[0], patternInput[1], tan, comments);
-}
-
-/**
- * Will always be created without `OntologyAnnotion.Name`
- */
-export function OntologyAnnotation_fromTermAnnotation_Z721C83C5(termAnnotation) {
- const r = value_4(tryParseTermAnnotation(termAnnotation));
- return OntologyAnnotation_fromString_2EB0E147("", r.TermSourceREF, (r.TermSourceREF + ":") + r.LocalTAN);
-}
-
-/**
- * Parses any value in `TermAccessionString` to term accession format "termsourceref:localtan". Exmp.: "MS:000001".
- *
- * If `TermAccessionString` cannot be parsed to this format, returns empty string!
- */
-export function OntologyAnnotation__get_TermAccessionShort(this$) {
- const matchValue = this$.TermSourceREF;
- const matchValue_1 = this$.LocalID;
- let matchResult, id, tsr;
- if (matchValue != null) {
- if (matchValue_1 != null) {
- matchResult = 0;
- id = matchValue_1;
- tsr = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return `${tsr}:${id}`;
- default:
- return "";
- }
-}
-
-export function OntologyAnnotation__get_TermAccessionOntobeeUrl(this$) {
- const matchValue = this$.TermSourceREF;
- const matchValue_1 = this$.LocalID;
- let matchResult, id, tsr;
- if (matchValue != null) {
- if (matchValue_1 != null) {
- matchResult = 0;
- id = matchValue_1;
- tsr = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return OntologyAnnotation_createUriAnnotation(tsr, id);
- default:
- return "";
- }
-}
-
-export function OntologyAnnotation__get_TermAccessionAndOntobeeUrlIfShort(this$) {
- const matchValue = this$.TermAccessionNumber;
- if (matchValue != null) {
- const tan = matchValue;
- if (ActivePatterns_$007CRegex$007C_$007C("(?\\w+?):(?\\w+)", tan) != null) {
- return OntologyAnnotation__get_TermAccessionOntobeeUrl(this$);
- }
- else {
- return tan;
- }
- }
- else {
- return "";
- }
-}
-
-/**
- * Get a ISATab string entries from an ISAJson Ontology Annotation object (name,source,accession)
- *
- * `asOntobeePurlUrl`: option to return term accession in Ontobee purl-url format (`http://purl.obolibrary.org/obo/MS_1000121`)
- */
-export function OntologyAnnotation_toString_5E3DAF0D(oa, asOntobeePurlUrlIfShort) {
- let url;
- const asOntobeePurlUrlIfShort_1 = defaultArg(asOntobeePurlUrlIfShort, false);
- const TermName = defaultArg(map(AnnotationValue_toString_Z6FAD7738, oa.Name), "");
- const TermSourceREF = defaultArg(oa.TermSourceREF, "");
- return {
- TermAccessionNumber: asOntobeePurlUrlIfShort_1 ? ((url = OntologyAnnotation__get_TermAccessionAndOntobeeUrlIfShort(oa), (url === "") ? defaultArg(oa.TermAccessionNumber, "") : url)) : defaultArg(oa.TermAccessionNumber, ""),
- TermName: TermName,
- TermSourceREF: TermSourceREF,
- };
-}
-
-/**
- * Returns the name of the ontology as string if it has a name
- */
-export function OntologyAnnotation_tryGetNameText_Z4C0FE73C(oa) {
- return OntologyAnnotation__get_TryNameText(oa);
-}
-
-/**
- * Returns the name of the ontology as string if it has a name
- */
-export function OntologyAnnotation_getNameText_Z4C0FE73C(oa) {
- return OntologyAnnotation__get_NameText(oa);
-}
-
-/**
- * Returns true if the given name matches the name of the ontology annotation
- */
-export function OntologyAnnotation_nameEqualsString(name, oa) {
- return OntologyAnnotation__get_NameText(oa) === name;
-}
-
-/**
- * If an ontology annotation with the given annotation value exists in the list, returns it
- */
-export function OntologyAnnotation_tryGetByName(name, annotations) {
- return tryFind((d) => equals(d.Name, name), annotations);
-}
-
-/**
- * If a ontology annotation with the given annotation value exists in the list, returns true
- */
-export function OntologyAnnotation_existsByName(name, annotations) {
- return exists((d) => equals(d.Name, name), annotations);
-}
-
-/**
- * Adds the given ontology annotation to the Study.StudyDesignDescriptors
- */
-export function OntologyAnnotation_add(onotolgyAnnotations, onotolgyAnnotation) {
- return append(onotolgyAnnotations, singleton(onotolgyAnnotation));
-}
-
-/**
- * Updates all ontology annotations for which the predicate returns true with the given ontology annotations values
- */
-export function OntologyAnnotation_updateBy(predicate, updateOption, design, annotations) {
- if (exists(predicate, annotations)) {
- return map_1((d) => {
- if (predicate(d)) {
- const this$ = updateOption;
- const recordType_1 = d;
- const recordType_2 = design;
- switch (this$.tag) {
- case 2:
- return makeRecord(OntologyAnnotation_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(OntologyAnnotation_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(OntologyAnnotation_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }
- else {
- return d;
- }
- }, annotations);
- }
- else {
- return annotations;
- }
-}
-
-/**
- * If an ontology annotation with the same annotation value as the given annotation value exists in the list, updates it with the given ontology annotation
- */
-export function OntologyAnnotation_updateByName(updateOption, design, annotations) {
- return OntologyAnnotation_updateBy((f) => equals(f.Name, design.Name), updateOption, design, annotations);
-}
-
-/**
- * If a ontology annotation with the annotation value exists in the list, removes it
- */
-export function OntologyAnnotation_removeByName(name, annotations) {
- return filter((d) => !equals(d.Name, name), annotations);
-}
-
-/**
- * Returns comments of a ontology annotation
- */
-export function OntologyAnnotation_getComments_Z4C0FE73C(annotation) {
- return annotation.Comments;
-}
-
-/**
- * Applies function f on comments of a ontology annotation
- */
-export function OntologyAnnotation_mapComments(f, annotation) {
- return new OntologyAnnotation(annotation.ID, annotation.Name, annotation.TermSourceREF, annotation.LocalID, annotation.TermAccessionNumber, mapDefault([], f, annotation.Comments));
-}
-
-/**
- * Replaces comments of a ontology annotation by given comment list
- */
-export function OntologyAnnotation_setComments(annotation, comments) {
- return new OntologyAnnotation(annotation.ID, annotation.Name, annotation.TermSourceREF, annotation.LocalID, annotation.TermAccessionNumber, comments);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/OntologySourceReference.js b/js/ISA/ISA/JsonTypes/OntologySourceReference.js
deleted file mode 100644
index 981c5b19..00000000
--- a/js/ISA/ISA/JsonTypes/OntologySourceReference.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { empty, filter, map, singleton, append, exists, tryFind } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { map2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { mapDefault } from "../OptionExtensions.js";
-
-export class OntologySourceReference extends Record {
- constructor(Description, File, Name, Version, Comments) {
- super();
- this.Description = Description;
- this.File = File;
- this.Name = Name;
- this.Version = Version;
- this.Comments = Comments;
- }
-}
-
-export function OntologySourceReference_$reflection() {
- return record_type("ARCtrl.ISA.OntologySourceReference", [], OntologySourceReference, () => [["Description", option_type(string_type)], ["File", option_type(string_type)], ["Name", option_type(string_type)], ["Version", option_type(string_type)], ["Comments", option_type(list_type(Comment$_$reflection()))]]);
-}
-
-export function OntologySourceReference_make(description, file, name, version, comments) {
- return new OntologySourceReference(description, file, name, version, comments);
-}
-
-export function OntologySourceReference_create_5CD5B036(Description, File, Name, Version, Comments) {
- return OntologySourceReference_make(Description, File, Name, Version, Comments);
-}
-
-export function OntologySourceReference_get_empty() {
- return OntologySourceReference_create_5CD5B036();
-}
-
-/**
- * If an ontology source reference with the given name exists in the list, returns it
- */
-export function OntologySourceReference_tryGetByName(name, ontologies) {
- return tryFind((t) => equals(t.Name, name), ontologies);
-}
-
-/**
- * If an ontology source reference with the given name exists in the list, returns true
- */
-export function OntologySourceReference_existsByName(name, ontologies) {
- return exists((t) => equals(t.Name, name), ontologies);
-}
-
-/**
- * Adds the given ontology source reference to the investigation
- */
-export function OntologySourceReference_add(ontologySourceReference, ontologies) {
- return append(ontologies, singleton(ontologySourceReference));
-}
-
-/**
- * Updates all ontology source references for which the predicate returns true with the given ontology source reference values
- */
-export function OntologySourceReference_updateBy(predicate, updateOption, ontologySourceReference, ontologies) {
- if (exists(predicate, ontologies)) {
- return map((t) => {
- if (predicate(t)) {
- const this$ = updateOption;
- const recordType_1 = t;
- const recordType_2 = ontologySourceReference;
- switch (this$.tag) {
- case 2:
- return makeRecord(OntologySourceReference_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(OntologySourceReference_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(OntologySourceReference_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }
- else {
- return t;
- }
- }, ontologies);
- }
- else {
- return ontologies;
- }
-}
-
-/**
- * If an ontology source reference with the same name as the given name exists in the investigation, updates it with the given ontology source reference
- */
-export function OntologySourceReference_updateByName(updateOption, ontologySourceReference, ontologies) {
- return OntologySourceReference_updateBy((t) => equals(t.Name, ontologySourceReference.Name), updateOption, ontologySourceReference, ontologies);
-}
-
-/**
- * If a ontology source reference with the given name exists in the list, removes it
- */
-export function OntologySourceReference_removeByName(name, ontologies) {
- return filter((t) => !equals(t.Name, name), ontologies);
-}
-
-/**
- * Returns comments of ontology source ref
- */
-export function OntologySourceReference_getComments_Z79C650B(ontology) {
- return ontology.Comments;
-}
-
-/**
- * Applies function f on comments in ontology source ref
- */
-export function OntologySourceReference_mapComments(f, ontology) {
- return new OntologySourceReference(ontology.Description, ontology.File, ontology.Name, ontology.Version, mapDefault(empty(), f, ontology.Comments));
-}
-
-/**
- * Replaces comments in ontology source ref by given comment list
- */
-export function OntologySourceReference_setComments(ontology, comments) {
- return new OntologySourceReference(ontology.Description, ontology.File, ontology.Name, ontology.Version, comments);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Person.js b/js/ISA/ISA/JsonTypes/Person.js
deleted file mode 100644
index 3255b600..00000000
--- a/js/ISA/ISA/JsonTypes/Person.js
+++ /dev/null
@@ -1,155 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, array_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { map2, map, tryFind } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { singleton, append } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { mapDefault } from "../OptionExtensions.js";
-
-export class Person extends Record {
- constructor(ID, LastName, FirstName, MidInitials, EMail, Phone, Fax, Address, Affiliation, Roles, Comments) {
- super();
- this.ID = ID;
- this.LastName = LastName;
- this.FirstName = FirstName;
- this.MidInitials = MidInitials;
- this.EMail = EMail;
- this.Phone = Phone;
- this.Fax = Fax;
- this.Address = Address;
- this.Affiliation = Affiliation;
- this.Roles = Roles;
- this.Comments = Comments;
- }
-}
-
-export function Person_$reflection() {
- return record_type("ARCtrl.ISA.Person", [], Person, () => [["ID", option_type(string_type)], ["LastName", option_type(string_type)], ["FirstName", option_type(string_type)], ["MidInitials", option_type(string_type)], ["EMail", option_type(string_type)], ["Phone", option_type(string_type)], ["Fax", option_type(string_type)], ["Address", option_type(string_type)], ["Affiliation", option_type(string_type)], ["Roles", option_type(array_type(OntologyAnnotation_$reflection()))], ["Comments", option_type(array_type(Comment$_$reflection()))]]);
-}
-
-export function Person_make(id, lastName, firstName, midInitials, email, phone, fax, address, affiliation, roles, comments) {
- return new Person(id, lastName, firstName, midInitials, email, phone, fax, address, affiliation, roles, comments);
-}
-
-export function Person_create_4538B98B(Id, LastName, FirstName, MidInitials, Email, Phone, Fax, Address, Affiliation, Roles, Comments) {
- return Person_make(Id, LastName, FirstName, MidInitials, Email, Phone, Fax, Address, Affiliation, Roles, Comments);
-}
-
-export function Person_get_empty() {
- return Person_create_4538B98B();
-}
-
-export function Person_tryGetByFullName(firstName, midInitials, lastName, persons) {
- return tryFind((p) => ((midInitials === "") ? (equals(p.FirstName, firstName) && equals(p.LastName, lastName)) : ((equals(p.FirstName, firstName) && equals(p.MidInitials, midInitials)) && equals(p.LastName, lastName))), persons);
-}
-
-/**
- * If an person with the given FirstName, MidInitials and LastName exists in the list, returns true
- */
-export function Person_existsByFullName(firstName, midInitials, lastName, persons) {
- return persons.some((p) => ((midInitials === "") ? (equals(p.FirstName, firstName) && equals(p.LastName, lastName)) : ((equals(p.FirstName, firstName) && equals(p.MidInitials, midInitials)) && equals(p.LastName, lastName))));
-}
-
-/**
- * adds the given person to the persons
- */
-export function Person_add(persons, person) {
- return append(persons, singleton(person));
-}
-
-/**
- * Updates all persons for which the predicate returns true with the given person values
- */
-export function Person_updateBy(predicate, updateOption, person, persons) {
- if (persons.some(predicate)) {
- return map((p) => {
- if (predicate(p)) {
- const this$ = updateOption;
- const recordType_1 = p;
- const recordType_2 = person;
- switch (this$.tag) {
- case 2:
- return makeRecord(Person_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Person_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Person_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }
- else {
- return p;
- }
- }, persons);
- }
- else {
- return persons;
- }
-}
-
-/**
- * Updates all persons with the same FirstName, MidInitials and LastName as the given person with its values
- */
-export function Person_updateByFullName(updateOption, person, persons) {
- return Person_updateBy((p) => {
- if (equals(p.FirstName, person.FirstName) && equals(p.MidInitials, person.MidInitials)) {
- return equals(p.LastName, person.LastName);
- }
- else {
- return false;
- }
- }, updateOption, person, persons);
-}
-
-/**
- * If a person with the given FirstName, MidInitials and LastName exists in the list, removes it
- */
-export function Person_removeByFullName(firstName, midInitials, lastName, persons) {
- return persons.filter((p) => ((midInitials === "") ? !(equals(p.FirstName, firstName) && equals(p.LastName, lastName)) : !((equals(p.FirstName, firstName) && equals(p.MidInitials, midInitials)) && equals(p.LastName, lastName))));
-}
-
-/**
- * Returns roles of a person
- */
-export function Person_getRoles_Z22779EAF(person) {
- return person.Roles;
-}
-
-/**
- * Applies function f on roles of a person
- */
-export function Person_mapRoles(f, person) {
- return new Person(person.ID, person.LastName, person.FirstName, person.MidInitials, person.EMail, person.Phone, person.Fax, person.Address, person.Affiliation, mapDefault([], f, person.Roles), person.Comments);
-}
-
-/**
- * Replaces roles of a person with the given roles
- */
-export function Person_setRoles(person, roles) {
- return new Person(person.ID, person.LastName, person.FirstName, person.MidInitials, person.EMail, person.Phone, person.Fax, person.Address, person.Affiliation, roles, person.Comments);
-}
-
-/**
- * Returns comments of a person
- */
-export function Person_getComments_Z22779EAF(person) {
- return person.Comments;
-}
-
-/**
- * Applies function f on comments of a person
- */
-export function Person_mapComments(f, person) {
- return new Person(person.ID, person.LastName, person.FirstName, person.MidInitials, person.EMail, person.Phone, person.Fax, person.Address, person.Affiliation, person.Roles, mapDefault([], f, person.Comments));
-}
-
-/**
- * Replaces comments of a person by given comment list
- */
-export function Person_setComments(person, comments) {
- return new Person(person.ID, person.LastName, person.FirstName, person.MidInitials, person.EMail, person.Phone, person.Fax, person.Address, person.Affiliation, person.Roles, comments);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Process.js b/js/ISA/ISA/JsonTypes/Process.js
deleted file mode 100644
index 8ead058a..00000000
--- a/js/ISA/ISA/JsonTypes/Process.js
+++ /dev/null
@@ -1,402 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { zip, tryPick, map as map_1, tryFind, append, collect, choose, empty, length } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { map, value as value_4, bind, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { getRecordFields, makeRecord, record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Protocol_$reflection } from "./Protocol.js";
-import { ProcessParameterValue_$reflection } from "./ProcessParameterValue.js";
-import { ProcessInput_tryMaterial_102B6859, ProcessInput_trySample_102B6859, ProcessInput_tryData_102B6859, ProcessInput_trySource_102B6859, ProcessInput_tryGetCharacteristicValues_102B6859, ProcessInput_$reflection } from "./ProcessInput.js";
-import { ProcessOutput_tryGetFactorValues_11830B70, ProcessOutput_tryGetCharacteristicValues_11830B70, ProcessOutput_$reflection } from "./ProcessOutput.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { create, match } from "../../../fable_modules/fable-library.4.1.4/RegExp.js";
-import { parse } from "../../../fable_modules/fable-library.4.1.4/Int32.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { safeHash, equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { ProtocolParameter_get_empty } from "./ProtocolParameter.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-import { Update_UpdateOptions } from "../Update.js";
-import { map2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-
-export class Process extends Record {
- constructor(ID, Name, ExecutesProtocol, ParameterValues, Performer, Date$, PreviousProcess, NextProcess, Inputs, Outputs, Comments) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.ExecutesProtocol = ExecutesProtocol;
- this.ParameterValues = ParameterValues;
- this.Performer = Performer;
- this.Date = Date$;
- this.PreviousProcess = PreviousProcess;
- this.NextProcess = NextProcess;
- this.Inputs = Inputs;
- this.Outputs = Outputs;
- this.Comments = Comments;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- const inputCount = length(defaultArg(this$.Inputs, empty())) | 0;
- const outputCount = length(defaultArg(this$.Outputs, empty())) | 0;
- const paramCount = length(defaultArg(this$.ParameterValues, empty())) | 0;
- const name = defaultArg(this$.Name, "Unnamed Process");
- return toText(printf("%s [%i Inputs -> %i Params -> %i Outputs]"))(name)(inputCount)(paramCount)(outputCount);
- }
-}
-
-export function Process_$reflection() {
- return record_type("ARCtrl.ISA.Process", [], Process, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["ExecutesProtocol", option_type(Protocol_$reflection())], ["ParameterValues", option_type(list_type(ProcessParameterValue_$reflection()))], ["Performer", option_type(string_type)], ["Date", option_type(string_type)], ["PreviousProcess", option_type(Process_$reflection())], ["NextProcess", option_type(Process_$reflection())], ["Inputs", option_type(list_type(ProcessInput_$reflection()))], ["Outputs", option_type(list_type(ProcessOutput_$reflection()))], ["Comments", option_type(list_type(Comment$_$reflection()))]]);
-}
-
-export function Process_make(id, name, executesProtocol, parameterValues, performer, date, previousProcess, nextProcess, inputs, outputs, comments) {
- return new Process(id, name, executesProtocol, parameterValues, performer, date, previousProcess, nextProcess, inputs, outputs, comments);
-}
-
-export function Process_create_Z42860F3E(Id, Name, ExecutesProtocol, ParameterValues, Performer, Date$, PreviousProcess, NextProcess, Inputs, Outputs, Comments) {
- return Process_make(Id, Name, ExecutesProtocol, ParameterValues, Performer, Date$, PreviousProcess, NextProcess, Inputs, Outputs, Comments);
-}
-
-export function Process_get_empty() {
- return Process_create_Z42860F3E();
-}
-
-export function Process_composeName(processNameRoot, i) {
- return `${processNameRoot}_${i}`;
-}
-
-export function Process_decomposeName_Z721C83C5(name) {
- const r = match(create("(?.+)_(?\\d+)"), name);
- if (r != null) {
- return [(r.groups && r.groups.name) || "", parse((r.groups && r.groups.num) || "", 511, false, 32)];
- }
- else {
- return [name, void 0];
- }
-}
-
-/**
- * Returns the name of the protocol the given process executes
- */
-export function Process_tryGetProtocolName_716E708F(p) {
- return bind((p_1) => p_1.Name, p.ExecutesProtocol);
-}
-
-/**
- * Returns the name of the protocol the given process executes
- */
-export function Process_getProtocolName_716E708F(p) {
- return value_4(bind((p_1) => p_1.Name, p.ExecutesProtocol));
-}
-
-/**
- * Returns the parameter values describing the process
- */
-export function Process_getParameterValues_716E708F(p) {
- return defaultArg(p.ParameterValues, empty());
-}
-
-/**
- * Returns the parameters describing the process
- */
-export function Process_getParameters_716E708F(p) {
- return choose((pv) => pv.Category, Process_getParameterValues_716E708F(p));
-}
-
-/**
- * Returns the characteristics describing the inputs of the process
- */
-export function Process_getInputCharacteristicValues_716E708F(p) {
- const matchValue = p.Inputs;
- if (matchValue == null) {
- return empty();
- }
- else {
- return List_distinct(collect((inp) => defaultArg(ProcessInput_tryGetCharacteristicValues_102B6859(inp), empty()), matchValue), {
- Equals: equals,
- GetHashCode: safeHash,
- });
- }
-}
-
-/**
- * Returns the characteristics describing the outputs of the process
- */
-export function Process_getOutputCharacteristicValues_716E708F(p) {
- const matchValue = p.Outputs;
- if (matchValue == null) {
- return empty();
- }
- else {
- return List_distinct(collect((out) => defaultArg(ProcessOutput_tryGetCharacteristicValues_11830B70(out), empty()), matchValue), {
- Equals: equals,
- GetHashCode: safeHash,
- });
- }
-}
-
-/**
- * Returns the characteristic values describing the inputs and outputs of the process
- */
-export function Process_getCharacteristicValues_716E708F(p) {
- return List_distinct(append(Process_getInputCharacteristicValues_716E708F(p), Process_getOutputCharacteristicValues_716E708F(p)), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns the characteristics describing the inputs and outputs of the process
- */
-export function Process_getCharacteristics_716E708F(p) {
- return List_distinct(choose((cv) => cv.Category, Process_getCharacteristicValues_716E708F(p)), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns the factor values of the samples of the process
- */
-export function Process_getFactorValues_716E708F(p) {
- return List_distinct(collect((arg_1) => defaultArg(ProcessOutput_tryGetFactorValues_11830B70(arg_1), empty()), defaultArg(p.Outputs, empty())), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns the factors of the samples of the process
- */
-export function Process_getFactors_716E708F(p) {
- return List_distinct(choose((fv) => fv.Category, Process_getFactorValues_716E708F(p)), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns the units of the process
- */
-export function Process_getUnits_716E708F(p) {
- return append(choose((cv) => cv.Unit, Process_getCharacteristicValues_716E708F(p)), append(choose((pv) => pv.Unit, Process_getParameterValues_716E708F(p)), choose((fv) => fv.Unit, Process_getFactorValues_716E708F(p))));
-}
-
-/**
- * If the process implements the given parameter, return the list of input files together with their according parameter values of this parameter
- */
-export function Process_tryGetInputsWithParameterBy(predicate, p) {
- const matchValue = p.ParameterValues;
- if (matchValue == null) {
- return void 0;
- }
- else {
- const matchValue_1 = tryFind((pv) => predicate(defaultArg(pv.Category, ProtocolParameter_get_empty())), matchValue);
- if (matchValue_1 == null) {
- return void 0;
- }
- else {
- const paramValue = matchValue_1;
- return map((list_1) => map_1((i) => [i, paramValue], list_1), p.Inputs);
- }
- }
-}
-
-/**
- * If the process implements the given parameter, return the list of output files together with their according parameter values of this parameter
- */
-export function Process_tryGetOutputsWithParameterBy(predicate, p) {
- const matchValue = p.ParameterValues;
- if (matchValue == null) {
- return void 0;
- }
- else {
- const matchValue_1 = tryFind((pv) => predicate(defaultArg(pv.Category, ProtocolParameter_get_empty())), matchValue);
- if (matchValue_1 == null) {
- return void 0;
- }
- else {
- const paramValue = matchValue_1;
- return map((list_1) => map_1((i) => [i, paramValue], list_1), p.Outputs);
- }
- }
-}
-
-/**
- * If the process implements the given characteristic, return the list of input files together with their according characteristic values of this characteristic
- */
-export function Process_tryGetInputsWithCharacteristicBy(predicate, p) {
- const matchValue = p.Inputs;
- if (matchValue == null) {
- return void 0;
- }
- else {
- return fromValueWithDefault(empty(), choose((i) => tryPick((mv) => {
- const matchValue_1 = mv.Category;
- let matchResult, m_1;
- if (matchValue_1 != null) {
- if (predicate(matchValue_1)) {
- matchResult = 0;
- m_1 = matchValue_1;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return [i, mv];
- default:
- return void 0;
- }
- }, defaultArg(ProcessInput_tryGetCharacteristicValues_102B6859(i), empty())), matchValue));
- }
-}
-
-/**
- * If the process implements the given characteristic, return the list of output files together with their according characteristic values of this characteristic
- */
-export function Process_tryGetOutputsWithCharacteristicBy(predicate, p) {
- const matchValue = p.Inputs;
- const matchValue_1 = p.Outputs;
- let matchResult, is, os;
- if (matchValue != null) {
- if (matchValue_1 != null) {
- matchResult = 0;
- is = matchValue;
- os = matchValue_1;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return fromValueWithDefault(empty(), choose((tupledArg) => tryPick((mv) => {
- const matchValue_3 = mv.Category;
- let matchResult_1, m_1;
- if (matchValue_3 != null) {
- if (predicate(matchValue_3)) {
- matchResult_1 = 0;
- m_1 = matchValue_3;
- }
- else {
- matchResult_1 = 1;
- }
- }
- else {
- matchResult_1 = 1;
- }
- switch (matchResult_1) {
- case 0:
- return [tupledArg[1], mv];
- default:
- return void 0;
- }
- }, defaultArg(ProcessInput_tryGetCharacteristicValues_102B6859(tupledArg[0]), empty())), zip(is, os)));
- default:
- return void 0;
- }
-}
-
-/**
- * If the process implements the given factor, return the list of output files together with their according factor values of this factor
- */
-export function Process_tryGetOutputsWithFactorBy(predicate, p) {
- const matchValue = p.Outputs;
- if (matchValue == null) {
- return void 0;
- }
- else {
- return fromValueWithDefault(empty(), choose((o) => tryPick((mv) => {
- const matchValue_1 = mv.Category;
- let matchResult, m_1;
- if (matchValue_1 != null) {
- if (predicate(matchValue_1)) {
- matchResult = 0;
- m_1 = matchValue_1;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return [o, mv];
- default:
- return void 0;
- }
- }, defaultArg(ProcessOutput_tryGetFactorValues_11830B70(o), empty())), matchValue));
- }
-}
-
-export function Process_getSources_716E708F(p) {
- return List_distinct(choose(ProcessInput_trySource_102B6859, defaultArg(p.Inputs, empty())), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function Process_getData_716E708F(p) {
- return List_distinct(append(choose(ProcessInput_tryData_102B6859, defaultArg(p.Inputs, empty())), choose(ProcessInput_tryData_102B6859, defaultArg(p.Inputs, empty()))), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function Process_getSamples_716E708F(p) {
- return List_distinct(append(choose(ProcessInput_trySample_102B6859, defaultArg(p.Inputs, empty())), choose(ProcessInput_trySample_102B6859, defaultArg(p.Inputs, empty()))), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function Process_getMaterials_716E708F(p) {
- return List_distinct(append(choose(ProcessInput_tryMaterial_102B6859, defaultArg(p.Inputs, empty())), choose(ProcessInput_tryMaterial_102B6859, defaultArg(p.Inputs, empty()))), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function Process_updateProtocol(referenceProtocols, p) {
- let this$, recordType_1, recordType_2;
- const matchValue = p.ExecutesProtocol;
- let matchResult, protocol_1;
- if (matchValue != null) {
- if (matchValue.Name != null) {
- matchResult = 0;
- protocol_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0: {
- const matchValue_1 = tryFind((prot) => (value_4(prot.Name) === defaultArg(protocol_1.Name, "")), referenceProtocols);
- if (matchValue_1 != null) {
- return new Process(p.ID, p.Name, (this$ = (new Update_UpdateOptions(3, [])), (recordType_1 = protocol_1, (recordType_2 = matchValue_1, (this$.tag === 2) ? makeRecord(Protocol_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 1) ? makeRecord(Protocol_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 3) ? makeRecord(Protocol_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : recordType_2))))), p.ParameterValues, p.Performer, p.Date, p.PreviousProcess, p.NextProcess, p.Inputs, p.Outputs, p.Comments);
- }
- else {
- return p;
- }
- }
- default:
- return p;
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/ProcessInput.js b/js/ISA/ISA/JsonTypes/ProcessInput.js
deleted file mode 100644
index cb05ef5a..00000000
--- a/js/ISA/ISA/JsonTypes/ProcessInput.js
+++ /dev/null
@@ -1,297 +0,0 @@
-import { Union, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { Source_create_7A281ED9, Source_getUnits_Z28BE5327, Source_setCharacteristicValues, Source_get_empty, Source_$reflection } from "./Source.js";
-import { Sample_create_E50ED22, Sample_getUnits_Z29207F1E, Sample_setCharacteristicValues, Sample_$reflection } from "./Sample.js";
-import { Data_create_Z326CF519, Data_$reflection } from "./Data.js";
-import { Material_create_Z31BE6CDD, Material_getUnits_Z42815C11, Material_setCharacteristicValues, Material_$reflection } from "./Material.js";
-import { union_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { unwrap, map, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { empty, choose } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { DataFile } from "./DataFile.js";
-
-export class ProcessInput extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Source", "Sample", "Data", "Material"];
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- switch (this$.tag) {
- case 0: {
- const arg_1 = this$.fields[0].PrintCompact();
- return toText(printf("Source {%s}"))(arg_1);
- }
- case 3: {
- const arg_2 = this$.fields[0].PrintCompact();
- return toText(printf("Material {%s}"))(arg_2);
- }
- case 2: {
- const arg_3 = this$.fields[0].PrintCompact();
- return toText(printf("Data {%s}"))(arg_3);
- }
- default: {
- const arg = this$.fields[0].PrintCompact();
- return toText(printf("Sample {%s}"))(arg);
- }
- }
- }
-}
-
-export function ProcessInput_$reflection() {
- return union_type("ARCtrl.ISA.ProcessInput", [], ProcessInput, () => [[["Item", Source_$reflection()]], [["Item", Sample_$reflection()]], [["Item", Data_$reflection()]], [["Item", Material_$reflection()]]]);
-}
-
-export function ProcessInput__get_TryName(this$) {
- switch (this$.tag) {
- case 0:
- return this$.fields[0].Name;
- case 3:
- return this$.fields[0].Name;
- case 2:
- return this$.fields[0].Name;
- default:
- return this$.fields[0].Name;
- }
-}
-
-export function ProcessInput__get_Name(this$) {
- return defaultArg(ProcessInput__get_TryName(this$), "");
-}
-
-export function ProcessInput_get_Default() {
- return new ProcessInput(0, [Source_get_empty()]);
-}
-
-/**
- * Returns name of processInput
- */
-export function ProcessInput_tryGetName_102B6859(pi) {
- return ProcessInput__get_TryName(pi);
-}
-
-/**
- * Returns name of processInput
- */
-export function ProcessInput_getName_102B6859(pi) {
- return ProcessInput__get_Name(pi);
-}
-
-/**
- * Returns true, if given name equals name of processInput
- */
-export function ProcessInput_nameEquals(name, pi) {
- return ProcessInput__get_Name(pi) === name;
-}
-
-/**
- * Returns true, if Process Input is Sample
- */
-export function ProcessInput_isSample_102B6859(pi) {
- if (pi.tag === 1) {
- return true;
- }
- else {
- return false;
- }
-}
-
-/**
- * Returns true, if Process Input is Source
- */
-export function ProcessInput_isSource_102B6859(pi) {
- if (pi.tag === 0) {
- return true;
- }
- else {
- return false;
- }
-}
-
-/**
- * Returns true, if Process Input is Data
- */
-export function ProcessInput_isData_102B6859(pi) {
- if (pi.tag === 2) {
- return true;
- }
- else {
- return false;
- }
-}
-
-/**
- * Returns true, if Process Input is Material
- */
-export function ProcessInput_isMaterial_102B6859(pi) {
- if (pi.tag === 3) {
- return true;
- }
- else {
- return false;
- }
-}
-
-/**
- * Returns true, if Process Input is Source
- */
-export function ProcessInput__isSource(this$) {
- return ProcessInput_isSource_102B6859(this$);
-}
-
-/**
- * Returns true, if Process Input is Sample
- */
-export function ProcessInput__isSample(this$) {
- return ProcessInput_isSample_102B6859(this$);
-}
-
-/**
- * Returns true, if Process Input is Data
- */
-export function ProcessInput__isData(this$) {
- return ProcessInput_isData_102B6859(this$);
-}
-
-/**
- * Returns true, if Process Input is Material
- */
-export function ProcessInput__isMaterial(this$) {
- return ProcessInput_isMaterial_102B6859(this$);
-}
-
-/**
- * If given process input is a sample, returns it, else returns None
- */
-export function ProcessInput_trySample_102B6859(pi) {
- if (pi.tag === 1) {
- return pi.fields[0];
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If given process input is a source, returns it, else returns None
- */
-export function ProcessInput_trySource_102B6859(pi) {
- if (pi.tag === 0) {
- return pi.fields[0];
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If given process input is a data, returns it, else returns None
- */
-export function ProcessInput_tryData_102B6859(pi) {
- if (pi.tag === 2) {
- return pi.fields[0];
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If given process input is a material, returns it, else returns None
- */
-export function ProcessInput_tryMaterial_102B6859(pi) {
- if (pi.tag === 3) {
- return pi.fields[0];
- }
- else {
- return void 0;
- }
-}
-
-export function ProcessInput_setCharacteristicValues(characteristics, pi) {
- switch (pi.tag) {
- case 0:
- return new ProcessInput(0, [Source_setCharacteristicValues(characteristics, pi.fields[0])]);
- case 3:
- return new ProcessInput(3, [Material_setCharacteristicValues(characteristics, pi.fields[0])]);
- case 2:
- return pi;
- default:
- return new ProcessInput(1, [Sample_setCharacteristicValues(characteristics, pi.fields[0])]);
- }
-}
-
-/**
- * If given process input contains characteristics, returns them
- */
-export function ProcessInput_tryGetCharacteristicValues_102B6859(pi) {
- switch (pi.tag) {
- case 0:
- return pi.fields[0].Characteristics;
- case 3:
- return pi.fields[0].Characteristics;
- case 2:
- return void 0;
- default:
- return pi.fields[0].Characteristics;
- }
-}
-
-/**
- * If given process input contains characteristics, returns them
- */
-export function ProcessInput_tryGetCharacteristics_102B6859(pi) {
- return map((list) => choose((c) => c.Category, list), ProcessInput_tryGetCharacteristicValues_102B6859(pi));
-}
-
-export function ProcessInput_getCharacteristicValues_102B6859(pi) {
- return defaultArg(ProcessInput_tryGetCharacteristicValues_102B6859(pi), empty());
-}
-
-/**
- * If given process output contains units, returns them
- */
-export function ProcessInput_getUnits_102B6859(pi) {
- switch (pi.tag) {
- case 1:
- return Sample_getUnits_Z29207F1E(pi.fields[0]);
- case 3:
- return Material_getUnits_Z42815C11(pi.fields[0]);
- case 2:
- return empty();
- default:
- return Source_getUnits_Z28BE5327(pi.fields[0]);
- }
-}
-
-export function ProcessInput_createSource_7888CE42(name, characteristics) {
- return new ProcessInput(0, [Source_create_7A281ED9(void 0, name, unwrap(characteristics))]);
-}
-
-export function ProcessInput_createSample_Z6DF16D07(name, characteristics, factors, derivesFrom) {
- return new ProcessInput(1, [Sample_create_E50ED22(void 0, name, unwrap(characteristics), unwrap(factors), unwrap(derivesFrom))]);
-}
-
-export function ProcessInput_createMaterial_2363974C(name, characteristics, derivesFrom) {
- return new ProcessInput(3, [Material_create_Z31BE6CDD(void 0, name, void 0, unwrap(characteristics), unwrap(derivesFrom))]);
-}
-
-export function ProcessInput_createImageFile_Z721C83C5(name) {
- return new ProcessInput(2, [Data_create_Z326CF519(void 0, name, new DataFile(2, []))]);
-}
-
-export function ProcessInput_createRawData_Z721C83C5(name) {
- return new ProcessInput(2, [Data_create_Z326CF519(void 0, name, new DataFile(0, []))]);
-}
-
-export function ProcessInput_createDerivedData_Z721C83C5(name) {
- return new ProcessInput(2, [Data_create_Z326CF519(void 0, name, new DataFile(1, []))]);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/ProcessOutput.js b/js/ISA/ISA/JsonTypes/ProcessOutput.js
deleted file mode 100644
index 5c21d0dc..00000000
--- a/js/ISA/ISA/JsonTypes/ProcessOutput.js
+++ /dev/null
@@ -1,263 +0,0 @@
-import { Union, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { Sample_create_E50ED22, Sample_getUnits_Z29207F1E, Sample_setFactorValues, Sample_get_empty, Sample_$reflection } from "./Sample.js";
-import { Data_create_Z326CF519, Data_$reflection } from "./Data.js";
-import { Material_create_Z31BE6CDD, Material_getUnits_Z42815C11, Material_$reflection } from "./Material.js";
-import { union_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { unwrap, map, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { empty, choose } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { DataFile } from "./DataFile.js";
-
-export class ProcessOutput extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Sample", "Data", "Material"];
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- switch (this$.tag) {
- case 2: {
- const arg_1 = this$.fields[0].PrintCompact();
- return toText(printf("Material {%s}"))(arg_1);
- }
- case 1: {
- const arg_2 = this$.fields[0].PrintCompact();
- return toText(printf("Data {%s}"))(arg_2);
- }
- default: {
- const arg = this$.fields[0].PrintCompact();
- return toText(printf("Sample {%s}"))(arg);
- }
- }
- }
-}
-
-export function ProcessOutput_$reflection() {
- return union_type("ARCtrl.ISA.ProcessOutput", [], ProcessOutput, () => [[["Item", Sample_$reflection()]], [["Item", Data_$reflection()]], [["Item", Material_$reflection()]]]);
-}
-
-export function ProcessOutput__get_TryName(this$) {
- switch (this$.tag) {
- case 2:
- return this$.fields[0].Name;
- case 1:
- return this$.fields[0].Name;
- default:
- return this$.fields[0].Name;
- }
-}
-
-export function ProcessOutput__get_Name(this$) {
- return defaultArg(ProcessOutput__get_TryName(this$), "");
-}
-
-export function ProcessOutput_get_Default() {
- return new ProcessOutput(0, [Sample_get_empty()]);
-}
-
-/**
- * Returns name of processOutput
- */
-export function ProcessOutput_tryGetName_11830B70(po) {
- return ProcessOutput__get_TryName(po);
-}
-
-/**
- * Returns name of processInput
- */
-export function ProcessOutput_getName_11830B70(po) {
- return ProcessOutput__get_Name(po);
-}
-
-/**
- * Returns true, if given name equals name of processOutput
- */
-export function ProcessOutput_nameEquals(name, po) {
- return ProcessOutput__get_Name(po) === name;
-}
-
-/**
- * Returns true, if Process Output is Sample
- */
-export function ProcessOutput_isSample_11830B70(po) {
- if (po.tag === 0) {
- return true;
- }
- else {
- return false;
- }
-}
-
-/**
- * Returns true, if Process Output is Data
- */
-export function ProcessOutput_isData_11830B70(po) {
- if (po.tag === 1) {
- return true;
- }
- else {
- return false;
- }
-}
-
-/**
- * Returns true, if Process Output is Material
- */
-export function ProcessOutput_isMaterial_11830B70(po) {
- if (po.tag === 2) {
- return true;
- }
- else {
- return false;
- }
-}
-
-/**
- * Returns true, if Process Output is Sample
- */
-export function ProcessOutput__isSample(this$) {
- return ProcessOutput_isSample_11830B70(this$);
-}
-
-/**
- * Returns true, if Process Output is Data
- */
-export function ProcessOutput__isData(this$) {
- return ProcessOutput_isData_11830B70(this$);
-}
-
-/**
- * Returns true, if Process Output is Material
- */
-export function ProcessOutput__isMaterial(this$) {
- return ProcessOutput_isMaterial_11830B70(this$);
-}
-
-/**
- * If given process output is a sample, returns it, else returns None
- */
-export function ProcessOutput_trySample_11830B70(po) {
- if (po.tag === 0) {
- return po.fields[0];
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If given process output is a data, returns it, else returns None
- */
-export function ProcessOutput_tryData_11830B70(po) {
- if (po.tag === 1) {
- return po.fields[0];
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If given process output is a material, returns it, else returns None
- */
-export function ProcessOutput_tryMaterial_11830B70(po) {
- if (po.tag === 2) {
- return po.fields[0];
- }
- else {
- return void 0;
- }
-}
-
-/**
- * If given process output contains characteristics, returns them
- */
-export function ProcessOutput_tryGetCharacteristicValues_11830B70(po) {
- switch (po.tag) {
- case 2:
- return po.fields[0].Characteristics;
- case 1:
- return void 0;
- default:
- return po.fields[0].Characteristics;
- }
-}
-
-/**
- * If given process output contains characteristics, returns them
- */
-export function ProcessOutput_tryGetCharacteristics_11830B70(po) {
- return map((list) => choose((c) => c.Category, list), ProcessOutput_tryGetCharacteristicValues_11830B70(po));
-}
-
-/**
- * If given process output contains factors, returns them
- */
-export function ProcessOutput_tryGetFactorValues_11830B70(po) {
- switch (po.tag) {
- case 2:
- return void 0;
- case 1:
- return void 0;
- default:
- return po.fields[0].FactorValues;
- }
-}
-
-export function ProcessOutput_setFactorValues(values, po) {
- switch (po.tag) {
- case 2:
- return po;
- case 1:
- return po;
- default:
- return new ProcessOutput(0, [Sample_setFactorValues(values, po.fields[0])]);
- }
-}
-
-export function ProcessOutput_getFactorValues_11830B70(po) {
- return defaultArg(ProcessOutput_tryGetFactorValues_11830B70(po), empty());
-}
-
-/**
- * If given process output contains units, returns them
- */
-export function ProcessOutput_getUnits_11830B70(po) {
- switch (po.tag) {
- case 2:
- return Material_getUnits_Z42815C11(po.fields[0]);
- case 1:
- return empty();
- default:
- return Sample_getUnits_Z29207F1E(po.fields[0]);
- }
-}
-
-export function ProcessOutput_createSample_Z6DF16D07(name, characteristics, factors, derivesFrom) {
- return new ProcessOutput(0, [Sample_create_E50ED22(void 0, name, unwrap(characteristics), unwrap(factors), unwrap(derivesFrom))]);
-}
-
-export function ProcessOutput_createMaterial_2363974C(name, characteristics, derivesFrom) {
- return new ProcessOutput(2, [Material_create_Z31BE6CDD(void 0, name, void 0, unwrap(characteristics), unwrap(derivesFrom))]);
-}
-
-export function ProcessOutput_createImageFile_Z721C83C5(name) {
- return new ProcessOutput(1, [Data_create_Z326CF519(void 0, name, new DataFile(2, []))]);
-}
-
-export function ProcessOutput_createRawData_Z721C83C5(name) {
- return new ProcessOutput(1, [Data_create_Z326CF519(void 0, name, new DataFile(0, []))]);
-}
-
-export function ProcessOutput_createDerivedData_Z721C83C5(name) {
- return new ProcessOutput(1, [Data_create_Z326CF519(void 0, name, new DataFile(1, []))]);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/ProcessParameterValue.js b/js/ISA/ISA/JsonTypes/ProcessParameterValue.js
deleted file mode 100644
index 40e073e2..00000000
--- a/js/ISA/ISA/JsonTypes/ProcessParameterValue.js
+++ /dev/null
@@ -1,129 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { bind, defaultArg, map } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { ProtocolParameter__SetCategory_Z4C0FE73C, ProtocolParameter_create_Z6C54B221, ProtocolParameter__MapCategory_Z69DD836A, ProtocolParameter__get_TryNameText, ProtocolParameter_$reflection, ProtocolParameter__get_NameText } from "./ProtocolParameter.js";
-import { OntologyAnnotation_$reflection, OntologyAnnotation__get_NameText } from "./OntologyAnnotation.js";
-import { record_type, option_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Value_$reflection } from "./Value.js";
-import { int32ToString } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-
-export class ProcessParameterValue extends Record {
- constructor(Category, Value, Unit) {
- super();
- this.Category = Category;
- this.Value = Value;
- this.Unit = Unit;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- let value_2, category_2, category_1, value_1;
- const this$ = this;
- const category = map(ProtocolParameter__get_NameText, this$.Category);
- const unit = map(OntologyAnnotation__get_NameText, this$.Unit);
- const value = map((v) => {
- const s = v.PrintCompact();
- if (unit == null) {
- return s;
- }
- else {
- return (s + " ") + unit;
- }
- }, this$.Value);
- return (category == null) ? ((value == null) ? "" : ((value_2 = value, value_2))) : ((value == null) ? ((category_2 = category, (category_2 + ":") + "No Value")) : ((category_1 = category, (value_1 = value, (category_1 + ":") + value_1))));
- }
-}
-
-export function ProcessParameterValue_$reflection() {
- return record_type("ARCtrl.ISA.ProcessParameterValue", [], ProcessParameterValue, () => [["Category", option_type(ProtocolParameter_$reflection())], ["Value", option_type(Value_$reflection())], ["Unit", option_type(OntologyAnnotation_$reflection())]]);
-}
-
-export function ProcessParameterValue_make(category, value, unit) {
- return new ProcessParameterValue(category, value, unit);
-}
-
-export function ProcessParameterValue_create_569825F3(Category, Value, Unit) {
- return ProcessParameterValue_make(Category, Value, Unit);
-}
-
-export function ProcessParameterValue_get_empty() {
- return ProcessParameterValue_create_569825F3();
-}
-
-/**
- * Returns the name of the category as string
- */
-export function ProcessParameterValue__get_NameText(this$) {
- return defaultArg(map(ProtocolParameter__get_NameText, this$.Category), "");
-}
-
-/**
- * Returns the name of the category as string
- */
-export function ProcessParameterValue__get_TryNameText(this$) {
- return bind(ProtocolParameter__get_TryNameText, this$.Category);
-}
-
-export function ProcessParameterValue__get_ValueText(this$) {
- return defaultArg(map((oa) => {
- switch (oa.tag) {
- case 2:
- return oa.fields[0].toString();
- case 1:
- return int32ToString(oa.fields[0]);
- case 3:
- return oa.fields[0];
- default:
- return OntologyAnnotation__get_NameText(oa.fields[0]);
- }
- }, this$.Value), "");
-}
-
-export function ProcessParameterValue__get_ValueWithUnitText(this$) {
- const unit = map(OntologyAnnotation__get_NameText, this$.Unit);
- const v = ProcessParameterValue__get_ValueText(this$);
- if (unit == null) {
- return v;
- }
- else {
- const u = unit;
- return toText(printf("%s %s"))(v)(u);
- }
-}
-
-export function ProcessParameterValue__MapCategory_Z69DD836A(this$, f) {
- return new ProcessParameterValue(map((p) => ProtocolParameter__MapCategory_Z69DD836A(p, f), this$.Category), this$.Value, this$.Unit);
-}
-
-export function ProcessParameterValue__SetCategory_Z4C0FE73C(this$, c) {
- let matchValue;
- return new ProcessParameterValue((matchValue = this$.Category, (matchValue == null) ? ProtocolParameter_create_Z6C54B221(void 0, c) : ProtocolParameter__SetCategory_Z4C0FE73C(matchValue, c)), this$.Value, this$.Unit);
-}
-
-/**
- * Returns the name of the paramater value as string if it exists
- */
-export function ProcessParameterValue_tryGetNameText_5FD7232D(pv) {
- return ProcessParameterValue__get_TryNameText(pv);
-}
-
-/**
- * Returns the name of the paramater value as string
- */
-export function ProcessParameterValue_getNameText_5FD7232D(pv) {
- return ProcessParameterValue__get_NameText(pv);
-}
-
-/**
- * Returns true if the given name matches the name of the parameter value
- */
-export function ProcessParameterValue_nameEqualsString(name, pv) {
- return ProcessParameterValue__get_NameText(pv) === name;
-}
-
-export function ProcessParameterValue_getCategory_5FD7232D(pv) {
- return pv.Category;
-}
-
diff --git a/js/ISA/ISA/JsonTypes/ProcessSequence.js b/js/ISA/ISA/JsonTypes/ProcessSequence.js
deleted file mode 100644
index 5816e147..00000000
--- a/js/ISA/ISA/JsonTypes/ProcessSequence.js
+++ /dev/null
@@ -1,255 +0,0 @@
-import { List_groupBy, List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { singleton, zip, map, empty, collect, concat, filter, choose } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { value as value_3, defaultArg, bind } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { arrayHash, equalArrays, comparePrimitives, safeHash, equals, stringHash } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { Process_updateProtocol, Process_getMaterials_716E708F, Process_getSamples_716E708F, Process_getSources_716E708F, Process_getData_716E708F, Process_getUnits_716E708F, Process_getFactors_716E708F, Process_tryGetOutputsWithFactorBy, Process_tryGetOutputsWithCharacteristicBy, Process_tryGetInputsWithCharacteristicBy, Process_getCharacteristics_716E708F, Process_getParameters_716E708F, Process_tryGetOutputsWithParameterBy, Process_tryGetInputsWithParameterBy } from "./Process.js";
-import { FSharpSet__Contains, ofList } from "../../../fable_modules/fable-library.4.1.4/Set.js";
-import { ProcessOutput__get_Name, ProcessOutput_getName_11830B70 } from "./ProcessOutput.js";
-import { ProcessInput__get_Name, ProcessInput_getName_102B6859 } from "./ProcessInput.js";
-import { FSharpMap__TryFind, ofList as ofList_1 } from "../../../fable_modules/fable-library.4.1.4/Map.js";
-
-/**
- * Returns the names of the protocols the given processes impelement
- */
-export function getProtocolNames(processSequence) {
- return List_distinct(choose((p) => bind((protocol) => protocol.Name, p.ExecutesProtocol), processSequence), {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- });
-}
-
-/**
- * Returns the protocols the given processes impelement
- */
-export function getProtocols(processSequence) {
- return List_distinct(choose((p) => p.ExecutesProtocol, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns a list of the processes, containing only the ones executing a protocol for which the predicate returns true
- */
-export function filterByProtocolBy(predicate, processSequence) {
- return filter((p) => {
- const matchValue = p.ExecutesProtocol;
- let matchResult, protocol_1;
- if (matchValue != null) {
- if (predicate(matchValue)) {
- matchResult = 0;
- protocol_1 = matchValue;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return true;
- default:
- return false;
- }
- }, processSequence);
-}
-
-/**
- * Returns a list of the processes, containing only the ones executing a protocol with the given name
- */
-export function filterByProtocolName(protocolName, processSequence) {
- return filterByProtocolBy((p) => equals(p.Name, protocolName), processSequence);
-}
-
-/**
- * If the processes contain a process implementing the given parameter, return the list of input files together with their according parameter values of this parameter
- */
-export function getInputsWithParameterBy(predicate, processSequence) {
- return concat(choose((arg_1) => Process_tryGetInputsWithParameterBy(predicate, arg_1), processSequence));
-}
-
-/**
- * If the processes contain a process implementing the given parameter, return the list of output files together with their according parameter values of this parameter
- */
-export function getOutputsWithParameterBy(predicate, processSequence) {
- return concat(choose((arg_1) => Process_tryGetOutputsWithParameterBy(predicate, arg_1), processSequence));
-}
-
-/**
- * Returns the parameters implemented by the processes contained in these processes
- */
-export function getParameters(processSequence) {
- return List_distinct(collect(Process_getParameters_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns the characteristics describing the inputs and outputs of the processssequence
- */
-export function getCharacteristics(processSequence) {
- return List_distinct(collect(Process_getCharacteristics_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * If the processes contain a process implementing the given parameter, return the list of input files together with their according parameter values of this parameter
- */
-export function getInputsWithCharacteristicBy(predicate, processSequence) {
- return concat(choose((arg_1) => Process_tryGetInputsWithCharacteristicBy(predicate, arg_1), processSequence));
-}
-
-/**
- * If the processes contain a process implementing the given parameter, return the list of output files together with their according parameter values of this parameter
- */
-export function getOutputsWithCharacteristicBy(predicate, processSequence) {
- return concat(choose((arg_1) => Process_tryGetOutputsWithCharacteristicBy(predicate, arg_1), processSequence));
-}
-
-/**
- * If the processes contain a process implementing the given factor, return the list of output files together with their according factor values of this factor
- */
-export function getOutputsWithFactorBy(predicate, processSequence) {
- return concat(choose((arg_1) => Process_tryGetOutputsWithFactorBy(predicate, arg_1), processSequence));
-}
-
-/**
- * Returns the factors implemented by the processes contained in these processes
- */
-export function getFactors(processSequence) {
- return List_distinct(collect(Process_getFactors_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns the initial inputs final outputs of the processSequence, to which no processPoints
- */
-export function getRootInputs(processSequence) {
- const inputs = collect((p) => defaultArg(p.Inputs, empty()), processSequence);
- const outputs = ofList(collect((p_1) => map(ProcessOutput_getName_11830B70, defaultArg(p_1.Outputs, empty())), processSequence), {
- Compare: comparePrimitives,
- });
- return filter((i) => !FSharpSet__Contains(outputs, ProcessInput_getName_102B6859(i)), inputs);
-}
-
-/**
- * Returns the final outputs of the processSequence, which point to no further nodes
- */
-export function getFinalOutputs(processSequence) {
- const inputs = ofList(collect((p) => map(ProcessInput_getName_102B6859, defaultArg(p.Inputs, empty())), processSequence), {
- Compare: comparePrimitives,
- });
- return filter((o) => !FSharpSet__Contains(inputs, ProcessOutput_getName_11830B70(o)), collect((p_1) => defaultArg(p_1.Outputs, empty()), processSequence));
-}
-
-/**
- * Returns the initial inputs final outputs of the processSequence, to which no processPoints
- */
-export function getRootInputOf(processSequence, sample) {
- const mappings = ofList_1(map((tupledArg) => [tupledArg[0], map((tuple_1) => tuple_1[1], tupledArg[1])], List_groupBy((tuple) => tuple[0], collect((p) => List_distinct(zip(map(ProcessOutput__get_Name, value_3(p.Outputs)), map(ProcessInput__get_Name, value_3(p.Inputs))), {
- Equals: equalArrays,
- GetHashCode: arrayHash,
- }), processSequence), {
- Equals: (x_1, y_1) => (x_1 === y_1),
- GetHashCode: stringHash,
- })), {
- Compare: comparePrimitives,
- });
- const loop = (lastState_mut, state_mut) => {
- loop:
- while (true) {
- const lastState = lastState_mut, state = state_mut;
- if (equals(lastState, state)) {
- return state;
- }
- else {
- lastState_mut = state;
- state_mut = collect((s) => defaultArg(FSharpMap__TryFind(mappings, s), singleton(s)), state);
- continue loop;
- }
- break;
- }
- };
- return loop(empty(), singleton(sample));
-}
-
-/**
- * Returns the final outputs of the processSequence, which point to no further nodes
- */
-export function getFinalOutputsOf(processSequence, sample) {
- const mappings = ofList_1(map((tupledArg) => [tupledArg[0], map((tuple_1) => tuple_1[1], tupledArg[1])], List_groupBy((tuple) => tuple[0], collect((p) => List_distinct(zip(map(ProcessInput__get_Name, value_3(p.Inputs)), map(ProcessOutput__get_Name, value_3(p.Outputs))), {
- Equals: equalArrays,
- GetHashCode: arrayHash,
- }), processSequence), {
- Equals: (x_1, y_1) => (x_1 === y_1),
- GetHashCode: stringHash,
- })), {
- Compare: comparePrimitives,
- });
- const loop = (lastState_mut, state_mut) => {
- loop:
- while (true) {
- const lastState = lastState_mut, state = state_mut;
- if (equals(lastState, state)) {
- return state;
- }
- else {
- lastState_mut = state;
- state_mut = collect((s) => defaultArg(FSharpMap__TryFind(mappings, s), singleton(s)), state);
- continue loop;
- }
- break;
- }
- };
- return loop(empty(), singleton(sample));
-}
-
-export function getUnits(processSequence) {
- return List_distinct(collect(Process_getUnits_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns the data the given processes contain
- */
-export function getData(processSequence) {
- return List_distinct(collect(Process_getData_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function getSources(processSequence) {
- return List_distinct(collect(Process_getSources_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function getSamples(processSequence) {
- return List_distinct(collect(Process_getSamples_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function getMaterials(processSequence) {
- return List_distinct(collect(Process_getMaterials_716E708F, processSequence), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-export function updateProtocols(protocols, processSequence) {
- return map((arg_1) => Process_updateProtocol(protocols, arg_1), processSequence);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Protocol.js b/js/ISA/ISA/JsonTypes/Protocol.js
deleted file mode 100644
index 7338953e..00000000
--- a/js/ISA/ISA/JsonTypes/Protocol.js
+++ /dev/null
@@ -1,277 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { ProtocolParameter_$reflection } from "./ProtocolParameter.js";
-import { Component_$reflection } from "./Component.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { empty, filter, map, singleton, append, exists, tryFind } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { map2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { defaultArg, map as map_1 } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-
-export class Protocol extends Record {
- constructor(ID, Name, ProtocolType, Description, Uri, Version, Parameters, Components, Comments) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.ProtocolType = ProtocolType;
- this.Description = Description;
- this.Uri = Uri;
- this.Version = Version;
- this.Parameters = Parameters;
- this.Components = Components;
- this.Comments = Comments;
- }
-}
-
-export function Protocol_$reflection() {
- return record_type("ARCtrl.ISA.Protocol", [], Protocol, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["ProtocolType", option_type(OntologyAnnotation_$reflection())], ["Description", option_type(string_type)], ["Uri", option_type(string_type)], ["Version", option_type(string_type)], ["Parameters", option_type(list_type(ProtocolParameter_$reflection()))], ["Components", option_type(list_type(Component_$reflection()))], ["Comments", option_type(list_type(Comment$_$reflection()))]]);
-}
-
-export function Protocol_make(id, name, protocolType, description, uri, version, parameters, components, comments) {
- return new Protocol(id, name, protocolType, description, uri, version, parameters, components, comments);
-}
-
-export function Protocol_create_Z7DFD6E67(Id, Name, ProtocolType, Description, Uri, Version, Parameters, Components, Comments) {
- return Protocol_make(Id, Name, ProtocolType, Description, Uri, Version, Parameters, Components, Comments);
-}
-
-export function Protocol_get_empty() {
- return Protocol_create_Z7DFD6E67();
-}
-
-/**
- * If a protocol with the given identfier exists in the list, returns it
- */
-export function Protocol_tryGetByName(name, protocols) {
- return tryFind((p) => equals(p.Name, name), protocols);
-}
-
-/**
- * If a protocol with the given name exists in the list exists, returns true
- */
-export function Protocol_existsByName(name, protocols) {
- return exists((p) => equals(p.Name, name), protocols);
-}
-
-/**
- * Adds the given protocol to the protocols
- */
-export function Protocol_add(protocols, protocol) {
- return append(protocols, singleton(protocol));
-}
-
-/**
- * Updates all protocols for which the predicate returns true with the given protocol values
- */
-export function Protocol_updateBy(predicate, updateOption, protocol, protocols) {
- if (exists(predicate, protocols)) {
- return map((p) => {
- if (predicate(p)) {
- const this$ = updateOption;
- const recordType_1 = p;
- const recordType_2 = protocol;
- return (this$.tag === 2) ? makeRecord(Protocol_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 1) ? makeRecord(Protocol_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 3) ? makeRecord(Protocol_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : recordType_2));
- }
- else {
- return p;
- }
- }, protocols);
- }
- else {
- return protocols;
- }
-}
-
-/**
- * Updates all protocols with the same name as the given protocol with its values
- */
-export function Protocol_updateByName(updateOption, protocol, protocols) {
- return Protocol_updateBy((p) => equals(p.Name, protocol.Name), updateOption, protocol, protocols);
-}
-
-/**
- * If a protocol with the given name exists in the list, removes it
- */
-export function Protocol_removeByName(name, protocols) {
- return filter((p) => !equals(p.Name, name), protocols);
-}
-
-/**
- * Returns comments of a protocol
- */
-export function Protocol_getComments_Z5F51792E(protocol) {
- return protocol.Comments;
-}
-
-/**
- * Applies function f on comments of a protocol
- */
-export function Protocol_mapComments(f, protocol) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, map_1(f, protocol.Comments));
-}
-
-/**
- * Replaces comments of a protocol by given comment list
- */
-export function Protocol_setComments(protocol, comments) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, comments);
-}
-
-/**
- * Returns protocol type of a protocol
- */
-export function Protocol_getProtocolType_Z5F51792E(protocol) {
- return protocol.ProtocolType;
-}
-
-/**
- * Applies function f on protocol type of a protocol
- */
-export function Protocol_mapProtocolType(f, protocol) {
- return new Protocol(protocol.ID, protocol.Name, map_1(f, protocol.ProtocolType), protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Replaces protocol type of a protocol by given protocol type
- */
-export function Protocol_setProtocolType(protocol, protocolType) {
- return new Protocol(protocol.ID, protocol.Name, protocolType, protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Returns protocol version of a protocol
- */
-export function Protocol_getVersion_Z5F51792E(protocol) {
- return protocol.Version;
-}
-
-/**
- * Applies function f on protocol version of a protocol
- */
-export function Protocol_mapVersion(f, protocol) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, map_1(f, protocol.Version), protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Replaces protocol version of a protocol by given protocol version
- */
-export function Protocol_setVersion(protocol, version) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Protocol Name
- * Returns protocol name of a protocol
- */
-export function Protocol_getName_Z5F51792E(protocol) {
- return protocol.Name;
-}
-
-/**
- * Applies function f on protocol name of a protocol
- */
-export function Protocol_mapName(f, protocol) {
- return new Protocol(protocol.ID, map_1(f, protocol.Name), protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Replaces protocol name of a protocol by given protocol name
- */
-export function Protocol_setName(protocol, name) {
- return new Protocol(protocol.ID, name, protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Returns protocol description of a protocol
- */
-export function Protocol_getDescription_Z5F51792E(protocol) {
- return protocol.Description;
-}
-
-/**
- * Applies function f on protocol description of a protocol
- */
-export function Protocol_mapDescription(f, protocol) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, map_1(f, protocol.Description), protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Replaces protocol description of a protocol by given protocol description
- */
-export function Protocol_setDescription(protocol, description) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, description, protocol.Uri, protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Returns protocol URI of a protocol
- */
-export function Protocol_getUri_Z5F51792E(protocol) {
- return protocol.Uri;
-}
-
-/**
- * Applies function f on protocol URI of a protocol
- */
-export function Protocol_mapUri(f, protocol) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, map_1(f, protocol.Uri), protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Replaces protocol URI of a protocol by given protocol URI
- */
-export function Protocol_setUri(protocol, uri) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, uri, protocol.Version, protocol.Parameters, protocol.Components, protocol.Comments);
-}
-
-/**
- * Returns components of a protocol
- */
-export function Protocol_getComponents_Z5F51792E(protocol) {
- return protocol.Components;
-}
-
-/**
- * Applies function f on components of a protocol
- */
-export function Protocol_mapComponents(f, protocol) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, map_1(f, protocol.Components), protocol.Comments);
-}
-
-/**
- * Replaces components of a protocol by given component list
- */
-export function Protocol_setComponents(protocol, components) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, protocol.Parameters, components, protocol.Comments);
-}
-
-export function Protocol_addComponent(comp, protocol) {
- return Protocol_setComponents(protocol, append(defaultArg(protocol.Components, empty()), singleton(comp)));
-}
-
-/**
- * Returns protocol parameters of a protocol
- */
-export function Protocol_getParameters_Z5F51792E(protocol) {
- return protocol.Parameters;
-}
-
-/**
- * Applies function f on protocol parameters of a protocol
- */
-export function Protocol_mapParameters(f, protocol) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, map_1(f, protocol.Parameters), protocol.Components, protocol.Comments);
-}
-
-/**
- * Replaces protocol parameters of a protocol by given protocol parameter list
- */
-export function Protocol_setParameters(protocol, parameters) {
- return new Protocol(protocol.ID, protocol.Name, protocol.ProtocolType, protocol.Description, protocol.Uri, protocol.Version, parameters, protocol.Components, protocol.Comments);
-}
-
-export function Protocol_addParameter(parameter, protocol) {
- return Protocol_setParameters(protocol, append(defaultArg(protocol.Parameters, empty()), singleton(parameter)));
-}
-
diff --git a/js/ISA/ISA/JsonTypes/ProtocolParameter.js b/js/ISA/ISA/JsonTypes/ProtocolParameter.js
deleted file mode 100644
index 17273eb9..00000000
--- a/js/ISA/ISA/JsonTypes/ProtocolParameter.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { record_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation__get_TryNameText, OntologyAnnotation__get_NameText, OntologyAnnotation_toString_5E3DAF0D, OntologyAnnotation_get_empty, OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { bind, map, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { fromValueWithDefault } from "../OptionExtensions.js";
-
-export class ProtocolParameter extends Record {
- constructor(ID, ParameterName) {
- super();
- this.ID = ID;
- this.ParameterName = ParameterName;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- return "OA " + ProtocolParameter__get_NameText(this$);
- }
-}
-
-export function ProtocolParameter_$reflection() {
- return record_type("ARCtrl.ISA.ProtocolParameter", [], ProtocolParameter, () => [["ID", option_type(string_type)], ["ParameterName", option_type(OntologyAnnotation_$reflection())]]);
-}
-
-export function ProtocolParameter_make(id, parameterName) {
- return new ProtocolParameter(id, parameterName);
-}
-
-export function ProtocolParameter_create_Z6C54B221(Id, ParameterName) {
- return ProtocolParameter_make(Id, ParameterName);
-}
-
-export function ProtocolParameter_get_empty() {
- return ProtocolParameter_create_Z6C54B221();
-}
-
-/**
- * Create a ISAJson Protocol Parameter from ISATab string entries
- */
-export function ProtocolParameter_fromString_Z2304A83C(term, source, accession, comments) {
- const oa = OntologyAnnotation_fromString_2EB0E147(term, source, accession, unwrap(comments));
- return ProtocolParameter_make(void 0, fromValueWithDefault(OntologyAnnotation_get_empty(), oa));
-}
-
-/**
- * Get ISATab string entries from an ISAJson ProtocolParameter object (name,source,accession)
- */
-export function ProtocolParameter_toString_Z3A4310A5(pp) {
- const value = {
- TermAccessionNumber: "",
- TermName: "",
- TermSourceREF: "",
- };
- return defaultArg(map(OntologyAnnotation_toString_5E3DAF0D, pp.ParameterName), value);
-}
-
-/**
- * Returns the name of the parameter as string
- */
-export function ProtocolParameter__get_NameText(this$) {
- return defaultArg(map(OntologyAnnotation__get_NameText, this$.ParameterName), "");
-}
-
-/**
- * Returns the name of the parameter as string
- */
-export function ProtocolParameter__get_TryNameText(this$) {
- return bind(OntologyAnnotation__get_TryNameText, this$.ParameterName);
-}
-
-export function ProtocolParameter__MapCategory_Z69DD836A(this$, f) {
- return new ProtocolParameter(this$.ID, map(f, this$.ParameterName));
-}
-
-export function ProtocolParameter__SetCategory_Z4C0FE73C(this$, c) {
- return new ProtocolParameter(this$.ID, c);
-}
-
-/**
- * Returns the name of the paramater as string if it exists
- */
-export function ProtocolParameter_tryGetNameText_Z3A4310A5(pp) {
- return ProtocolParameter__get_TryNameText(pp);
-}
-
-/**
- * Returns the name of the paramater as string
- */
-export function ProtocolParameter_getNameText_Z3A4310A5(pp) {
- return defaultArg(ProtocolParameter_tryGetNameText_Z3A4310A5(pp), "");
-}
-
-/**
- * Returns true if the given name matches the name of the parameter
- */
-export function ProtocolParameter_nameEqualsString(name, pp) {
- return ProtocolParameter__get_NameText(pp) === name;
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Publication.js b/js/ISA/ISA/JsonTypes/Publication.js
deleted file mode 100644
index c9e7a918..00000000
--- a/js/ISA/ISA/JsonTypes/Publication.js
+++ /dev/null
@@ -1,169 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, array_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { filter, map, tryFind, exists, singleton, append } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { map2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { map as map_1 } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { mapDefault } from "../OptionExtensions.js";
-
-export class Publication extends Record {
- constructor(PubMedID, DOI, Authors, Title, Status, Comments) {
- super();
- this.PubMedID = PubMedID;
- this.DOI = DOI;
- this.Authors = Authors;
- this.Title = Title;
- this.Status = Status;
- this.Comments = Comments;
- }
-}
-
-export function Publication_$reflection() {
- return record_type("ARCtrl.ISA.Publication", [], Publication, () => [["PubMedID", option_type(string_type)], ["DOI", option_type(string_type)], ["Authors", option_type(string_type)], ["Title", option_type(string_type)], ["Status", option_type(OntologyAnnotation_$reflection())], ["Comments", option_type(array_type(Comment$_$reflection()))]]);
-}
-
-export function Publication_make(pubMedID, doi, authors, title, status, comments) {
- return new Publication(pubMedID, doi, authors, title, status, comments);
-}
-
-export function Publication_create_496BCAB8(PubMedID, Doi, Authors, Title, Status, Comments) {
- return Publication_make(PubMedID, Doi, Authors, Title, Status, Comments);
-}
-
-export function Publication_get_empty() {
- return Publication_create_496BCAB8();
-}
-
-/**
- * Adds the given publication to the publications
- */
-export function Publication_add(publications, publication) {
- return append(publications, singleton(publication));
-}
-
-/**
- * Returns true, if a publication with the given doi exists in the investigation
- */
-export function Publication_existsByDoi(doi, publications) {
- return exists((p) => equals(p.DOI, doi), publications);
-}
-
-/**
- * Returns true, if a publication with the given pubmedID exists in the investigation
- */
-export function Publication_existsByPubMedID(pubMedID, publications) {
- return exists((p) => equals(p.PubMedID, pubMedID), publications);
-}
-
-/**
- * If a publication with the given doi exists in the investigation, returns it
- */
-export function Publication_tryGetByDoi(doi, publications) {
- return tryFind((publication) => equals(publication.DOI, doi), publications);
-}
-
-/**
- * Updates all publications for which the predicate returns true with the given publication values
- */
-export function Publication_updateBy(predicate, updateOption, publication, publications) {
- if (exists(predicate, publications)) {
- return map((p) => {
- if (predicate(p)) {
- const this$ = updateOption;
- const recordType_1 = p;
- const recordType_2 = publication;
- switch (this$.tag) {
- case 2:
- return makeRecord(Publication_$reflection(), map2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Publication_$reflection(), map2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Publication_$reflection(), map2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }
- else {
- return p;
- }
- }, publications);
- }
- else {
- return publications;
- }
-}
-
-/**
- * Updates all protocols with the same DOI as the given publication with its values
- */
-export function Publication_updateByDOI(updateOption, publication, publications) {
- return Publication_updateBy((p) => equals(p.DOI, publication.DOI), updateOption, publication, publications);
-}
-
-/**
- * Updates all protocols with the same pubMedID as the given publication with its values
- */
-export function Publication_updateByPubMedID(updateOption, publication, publications) {
- return Publication_updateBy((p) => equals(p.PubMedID, publication.PubMedID), updateOption, publication, publications);
-}
-
-/**
- * If a publication with the given doi exists in the investigation, removes it from the investigation
- */
-export function Publication_removeByDoi(doi, publications) {
- return filter((p) => !equals(p.DOI, doi), publications);
-}
-
-/**
- * If a publication with the given pubMedID exists in the investigation, removes it
- */
-export function Publication_removeByPubMedID(pubMedID, publications) {
- return filter((p) => !equals(p.PubMedID, pubMedID), publications);
-}
-
-/**
- * Status
- * Returns publication status of a publication
- */
-export function Publication_getStatus_Z3279EA88(publication) {
- return publication.Status;
-}
-
-/**
- * Applies function f on publication status of a publication
- */
-export function Publication_mapStatus(f, publication) {
- return new Publication(publication.PubMedID, publication.DOI, publication.Authors, publication.Title, map_1(f, publication.Status), publication.Comments);
-}
-
-/**
- * Replaces publication status of a publication by given publication status
- */
-export function Publication_setStatus(publication, status) {
- return new Publication(publication.PubMedID, publication.DOI, publication.Authors, publication.Title, status, publication.Comments);
-}
-
-/**
- * Returns comments of a protocol
- */
-export function Publication_getComments_Z3279EA88(publication) {
- return publication.Comments;
-}
-
-/**
- * Applies function f on comments of a protocol
- */
-export function Publication_mapComments(f, publication) {
- return new Publication(publication.PubMedID, publication.DOI, publication.Authors, publication.Title, publication.Status, mapDefault([], f, publication.Comments));
-}
-
-/**
- * Replaces comments of a protocol by given comment list
- */
-export function Publication_setComments(publication, comments) {
- return new Publication(publication.PubMedID, publication.DOI, publication.Authors, publication.Title, publication.Status, comments);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Sample.js b/js/ISA/ISA/JsonTypes/Sample.js
deleted file mode 100644
index bcfb1f0d..00000000
--- a/js/ISA/ISA/JsonTypes/Sample.js
+++ /dev/null
@@ -1,71 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { append, choose, empty, length } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { MaterialAttributeValue_$reflection } from "./MaterialAttributeValue.js";
-import { FactorValue_$reflection } from "./FactorValue.js";
-import { Source_$reflection } from "./Source.js";
-
-export class Sample extends Record {
- constructor(ID, Name, Characteristics, FactorValues, DerivesFrom) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.Characteristics = Characteristics;
- this.FactorValues = FactorValues;
- this.DerivesFrom = DerivesFrom;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- const chars = length(defaultArg(this$.Characteristics, empty())) | 0;
- const facts = length(defaultArg(this$.FactorValues, empty())) | 0;
- const arg = Sample__get_NameAsString(this$);
- return toText(printf("%s [%i characteristics; %i factors]"))(arg)(chars)(facts);
- }
-}
-
-export function Sample_$reflection() {
- return record_type("ARCtrl.ISA.Sample", [], Sample, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["Characteristics", option_type(list_type(MaterialAttributeValue_$reflection()))], ["FactorValues", option_type(list_type(FactorValue_$reflection()))], ["DerivesFrom", option_type(list_type(Source_$reflection()))]]);
-}
-
-export function Sample_make(id, name, characteristics, factorValues, derivesFrom) {
- return new Sample(id, name, characteristics, factorValues, derivesFrom);
-}
-
-export function Sample_create_E50ED22(Id, Name, Characteristics, FactorValues, DerivesFrom) {
- return Sample_make(Id, Name, Characteristics, FactorValues, DerivesFrom);
-}
-
-export function Sample_get_empty() {
- return Sample_create_E50ED22();
-}
-
-export function Sample__get_NameAsString(this$) {
- return defaultArg(this$.Name, "");
-}
-
-export function Sample_getCharacteristicUnits_Z29207F1E(s) {
- return choose((c) => c.Unit, defaultArg(s.Characteristics, empty()));
-}
-
-export function Sample_getFactorUnits_Z29207F1E(s) {
- return choose((c) => c.Unit, defaultArg(s.FactorValues, empty()));
-}
-
-export function Sample_getUnits_Z29207F1E(s) {
- return append(Sample_getCharacteristicUnits_Z29207F1E(s), Sample_getFactorUnits_Z29207F1E(s));
-}
-
-export function Sample_setCharacteristicValues(values, s) {
- return new Sample(s.ID, s.Name, values, s.FactorValues, s.DerivesFrom);
-}
-
-export function Sample_setFactorValues(values, s) {
- return new Sample(s.ID, s.Name, s.Characteristics, values, s.DerivesFrom);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Source.js b/js/ISA/ISA/JsonTypes/Source.js
deleted file mode 100644
index f27e444c..00000000
--- a/js/ISA/ISA/JsonTypes/Source.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import { Record, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { choose, empty, length } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { MaterialAttributeValue_$reflection } from "./MaterialAttributeValue.js";
-
-export class Source extends Record {
- constructor(ID, Name, Characteristics) {
- super();
- this.ID = ID;
- this.Name = Name;
- this.Characteristics = Characteristics;
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- const l = length(defaultArg(this$.Characteristics, empty())) | 0;
- const arg = Source__get_NameAsString(this$);
- return toText(printf("%s [%i characteristics]"))(arg)(l);
- }
-}
-
-export function Source_$reflection() {
- return record_type("ARCtrl.ISA.Source", [], Source, () => [["ID", option_type(string_type)], ["Name", option_type(string_type)], ["Characteristics", option_type(list_type(MaterialAttributeValue_$reflection()))]]);
-}
-
-export function Source_make(id, name, characteristics) {
- return new Source(id, name, characteristics);
-}
-
-export function Source_create_7A281ED9(Id, Name, Characteristics) {
- return Source_make(Id, Name, Characteristics);
-}
-
-export function Source_get_empty() {
- return Source_create_7A281ED9();
-}
-
-export function Source__get_NameAsString(this$) {
- return defaultArg(this$.Name, "");
-}
-
-export function Source_getUnits_Z28BE5327(m) {
- return choose((c) => c.Unit, defaultArg(m.Characteristics, empty()));
-}
-
-export function Source_setCharacteristicValues(values, m) {
- return new Source(m.ID, m.Name, values);
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Study.js b/js/ISA/ISA/JsonTypes/Study.js
deleted file mode 100644
index 39c5c8a9..00000000
--- a/js/ISA/ISA/JsonTypes/Study.js
+++ /dev/null
@@ -1,943 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { getRecordFields, makeRecord, record_type, list_type, option_type, string_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Publication_$reflection } from "./Publication.js";
-import { Person_$reflection } from "./Person.js";
-import { OntologyAnnotation_$reflection } from "./OntologyAnnotation.js";
-import { Protocol_$reflection } from "./Protocol.js";
-import { StudyMaterials_get_empty, StudyMaterials_make, StudyMaterials_$reflection } from "./StudyMaterials.js";
-import { Process_$reflection } from "./Process.js";
-import { Assay_update_722A269D, Assay_updateProtocols, Assay_getMaterials_722A269D, Assay_getSamples_722A269D, Assay_getSources_722A269D, Assay_getUnitCategories_722A269D, Assay_getFactors_722A269D, Assay_getCharacteristics_722A269D, Assay_getProtocols_722A269D, Assay_$reflection } from "./Assay.js";
-import { Factor_$reflection } from "./Factor.js";
-import { MaterialAttribute_$reflection } from "./MaterialAttribute.js";
-import { Comment$_$reflection } from "./Comment.js";
-import { collect, empty, filter, map, singleton, append, exists } from "../../../fable_modules/fable-library.4.1.4/List.js";
-import { stringHash, safeHash, structuralHash, equals } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { map2 as map2_2 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
-import { Dict_tryFind, Dict_ofSeqWithMerge, Update_updateOnlyByExistingAppend, Update_updateOnlyByExisting, Update_updateAppend } from "../Update.js";
-import { map as map_1, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { fromValueWithDefault, mapDefault } from "../OptionExtensions.js";
-import { updateProtocols, getMaterials, getSamples, getSources, getUnits, getFactors, getCharacteristics, getProtocols } from "./ProcessSequence.js";
-import { Update_UpdateOptions } from "../Update.js";
-import { List_distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
-import { Source_$reflection } from "./Source.js";
-import { Sample_$reflection } from "./Sample.js";
-import { AssayMaterials_getMaterials_35E61745 } from "./AssayMaterials.js";
-import { Material_$reflection } from "./Material.js";
-import { toFail } from "../../../fable_modules/fable-library.4.1.4/String.js";
-
-export class Study extends Record {
- constructor(ID, FileName, Identifier, Title, Description, SubmissionDate, PublicReleaseDate, Publications, Contacts, StudyDesignDescriptors, Protocols, Materials, ProcessSequence, Assays, Factors, CharacteristicCategories, UnitCategories, Comments) {
- super();
- this.ID = ID;
- this.FileName = FileName;
- this.Identifier = Identifier;
- this.Title = Title;
- this.Description = Description;
- this.SubmissionDate = SubmissionDate;
- this.PublicReleaseDate = PublicReleaseDate;
- this.Publications = Publications;
- this.Contacts = Contacts;
- this.StudyDesignDescriptors = StudyDesignDescriptors;
- this.Protocols = Protocols;
- this.Materials = Materials;
- this.ProcessSequence = ProcessSequence;
- this.Assays = Assays;
- this.Factors = Factors;
- this.CharacteristicCategories = CharacteristicCategories;
- this.UnitCategories = UnitCategories;
- this.Comments = Comments;
- }
-}
-
-export function Study_$reflection() {
- return record_type("ARCtrl.ISA.Study", [], Study, () => [["ID", option_type(string_type)], ["FileName", option_type(string_type)], ["Identifier", option_type(string_type)], ["Title", option_type(string_type)], ["Description", option_type(string_type)], ["SubmissionDate", option_type(string_type)], ["PublicReleaseDate", option_type(string_type)], ["Publications", option_type(list_type(Publication_$reflection()))], ["Contacts", option_type(list_type(Person_$reflection()))], ["StudyDesignDescriptors", option_type(list_type(OntologyAnnotation_$reflection()))], ["Protocols", option_type(list_type(Protocol_$reflection()))], ["Materials", option_type(StudyMaterials_$reflection())], ["ProcessSequence", option_type(list_type(Process_$reflection()))], ["Assays", option_type(list_type(Assay_$reflection()))], ["Factors", option_type(list_type(Factor_$reflection()))], ["CharacteristicCategories", option_type(list_type(MaterialAttribute_$reflection()))], ["UnitCategories", option_type(list_type(OntologyAnnotation_$reflection()))], ["Comments", option_type(list_type(Comment$_$reflection()))]]);
-}
-
-export function Study_make(id, filename, identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, protocols, materials, processSequence, assays, factors, characteristicCategories, unitCategories, comments) {
- return new Study(id, filename, identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, protocols, materials, processSequence, assays, factors, characteristicCategories, unitCategories, comments);
-}
-
-export function Study_create_Z2D28E954(Id, FileName, Identifier, Title, Description, SubmissionDate, PublicReleaseDate, Publications, Contacts, StudyDesignDescriptors, Protocols, Materials, ProcessSequence, Assays, Factors, CharacteristicCategories, UnitCategories, Comments) {
- return Study_make(Id, FileName, Identifier, Title, Description, SubmissionDate, PublicReleaseDate, Publications, Contacts, StudyDesignDescriptors, Protocols, Materials, ProcessSequence, Assays, Factors, CharacteristicCategories, UnitCategories, Comments);
-}
-
-export function Study_get_empty() {
- return Study_create_Z2D28E954();
-}
-
-/**
- * If an study with the given identfier exists in the list, returns true
- */
-export function Study_existsByIdentifier(identifier, studies) {
- return exists((s) => equals(s.Identifier, identifier), studies);
-}
-
-/**
- * Adds the given study to the studies
- */
-export function Study_add(studies, study) {
- return append(studies, singleton(study));
-}
-
-/**
- * Updates all studies for which the predicate returns true with the given study values
- */
-export function Study_updateBy(predicate, updateOption, study, studies) {
- if (exists(predicate, studies)) {
- return map((a) => {
- if (predicate(a)) {
- const this$ = updateOption;
- const recordType_1 = a;
- const recordType_2 = study;
- return (this$.tag === 2) ? makeRecord(Study_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 1) ? makeRecord(Study_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2))) : ((this$.tag === 3) ? makeRecord(Study_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2))) : recordType_2));
- }
- else {
- return a;
- }
- }, studies);
- }
- else {
- return studies;
- }
-}
-
-/**
- * Updates all studies with the same identifier as the given study with its values
- */
-export function Study_updateByIdentifier(updateOption, study, studies) {
- return Study_updateBy((s) => equals(s.Identifier, study.Identifier), updateOption, study, studies);
-}
-
-/**
- * If a study with the given identifier exists in the list, removes it
- */
-export function Study_removeByIdentifier(identifier, studies) {
- return filter((s) => !equals(s.Identifier, identifier), studies);
-}
-
-/**
- * Returns assays of a study
- */
-export function Study_getAssays_7312BC8B(study) {
- return defaultArg(study.Assays, empty());
-}
-
-/**
- * Applies function f to the assays of a study
- */
-export function Study_mapAssays(f, study) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, mapDefault(empty(), f, study.Assays), study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Replaces study assays with the given assay list
- */
-export function Study_setAssays(study, assays) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Applies function f to the factors of a study
- */
-export function Study_mapFactors(f, study) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, study.Assays, mapDefault(empty(), f, study.Factors), study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Replaces study factors with the given assay list
- */
-export function Study_setFactors(study, factors) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, study.Assays, factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Applies function f to the protocols of a study
- */
-export function Study_mapProtocols(f, study) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, study.StudyDesignDescriptors, mapDefault(empty(), f, study.Protocols), study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Replaces study protocols with the given assay list
- */
-export function Study_setProtocols(study, protocols) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, study.StudyDesignDescriptors, protocols, study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Returns all contacts of a study
- */
-export function Study_getContacts_7312BC8B(study) {
- return defaultArg(study.Contacts, empty());
-}
-
-/**
- * Applies function f to contacts of a study
- */
-export function Study_mapContacts(f, study) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, mapDefault(empty(), f, study.Contacts), study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Replaces contacts of a study with the given person list
- */
-export function Study_setContacts(study, persons) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, persons, study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Returns publications of a study
- */
-export function Study_getPublications_7312BC8B(study) {
- return defaultArg(study.Publications, empty());
-}
-
-/**
- * Applies function f to publications of the study
- */
-export function Study_mapPublications(f, study) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, mapDefault(empty(), f, study.Publications), study.Contacts, study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Replaces publications of a study with the given publication list
- */
-export function Study_setPublications(study, publications) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, publications, study.Contacts, study.StudyDesignDescriptors, study.Protocols, study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Returns study design descriptors of a study
- */
-export function Study_getDescriptors_7312BC8B(study) {
- return defaultArg(study.StudyDesignDescriptors, empty());
-}
-
-/**
- * Applies function f to to study design descriptors of a study
- */
-export function Study_mapDescriptors(f, study) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, mapDefault(empty(), f, study.StudyDesignDescriptors), study.Protocols, study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Replaces study design descriptors with the given ontology annotation list
- */
-export function Study_setDescriptors(study, descriptors) {
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, descriptors, study.Protocols, study.Materials, study.ProcessSequence, study.Assays, study.Factors, study.CharacteristicCategories, study.UnitCategories, study.Comments);
-}
-
-/**
- * Returns processSequence of study
- */
-export function Study_getProcesses_7312BC8B(study) {
- return defaultArg(study.ProcessSequence, empty());
-}
-
-/**
- * Returns protocols of a study
- */
-export function Study_getProtocols_7312BC8B(study) {
- const processSequenceProtocols = getProtocols(Study_getProcesses_7312BC8B(study));
- const assaysProtocols = collect(Assay_getProtocols_722A269D, Study_getAssays_7312BC8B(study));
- const updateOptions_2 = new Update_UpdateOptions(3, []);
- const mapping_6 = (p_1) => p_1.Name;
- const list1_1 = defaultArg(study.Protocols, empty());
- let list2_1;
- const updateOptions = new Update_UpdateOptions(3, []);
- const mapping_1 = (p) => p.Name;
- const list1 = assaysProtocols;
- const list2 = processSequenceProtocols;
- try {
- const map1 = Dict_ofSeqWithMerge((arg_1, arg_1_1) => {
- const this$ = updateOptions;
- const recordType_1 = arg_1;
- const recordType_2 = arg_1_1;
- switch (this$.tag) {
- case 2:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }, map((v) => [mapping_1(v), v], list1));
- const map2 = Dict_ofSeqWithMerge((arg_2, arg_3) => {
- const this$_1 = updateOptions;
- const recordType_1_1 = arg_2;
- const recordType_2_1 = arg_3;
- switch (this$_1.tag) {
- case 2:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 1:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 3:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- default:
- return recordType_2_1;
- }
- }, map((v_1) => [mapping_1(v_1), v_1], list2));
- list2_1 = map((k) => {
- const matchValue = Dict_tryFind(k, map1);
- const matchValue_1 = Dict_tryFind(k, map2);
- if (matchValue == null) {
- if (matchValue_1 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1 = matchValue_1;
- return v2_1;
- }
- }
- else if (matchValue_1 == null) {
- const v1_1 = matchValue;
- return v1_1;
- }
- else {
- const v1 = matchValue;
- const v2 = matchValue_1;
- const this$_2 = updateOptions;
- const recordType_1_2 = v1;
- const recordType_2_2 = v2;
- switch (this$_2.tag) {
- case 2:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 1:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 3:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- default:
- return recordType_2_2;
- }
- }
- }, List_distinct(append(map(mapping_1, list1), map(mapping_1, list2)), {
- Equals: equals,
- GetHashCode: structuralHash,
- }));
- }
- catch (err) {
- throw new Error(`Could not mergeUpdate ${"Protocol"} list:
-${err.message}`);
- }
- try {
- const map1_1 = Dict_ofSeqWithMerge((arg_6, arg_1_2) => {
- const this$_3 = updateOptions_2;
- const recordType_1_3 = arg_6;
- const recordType_2_3 = arg_1_2;
- switch (this$_3.tag) {
- case 2:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 1:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 3:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- default:
- return recordType_2_3;
- }
- }, map((v_2) => [mapping_6(v_2), v_2], list1_1));
- const map2_1 = Dict_ofSeqWithMerge((arg_2_1, arg_3_1) => {
- const this$_4 = updateOptions_2;
- const recordType_1_4 = arg_2_1;
- const recordType_2_4 = arg_3_1;
- switch (this$_4.tag) {
- case 2:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 1:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 3:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- default:
- return recordType_2_4;
- }
- }, map((v_1_1) => [mapping_6(v_1_1), v_1_1], list2_1));
- return map((k_1) => {
- const matchValue_3 = Dict_tryFind(k_1, map1_1);
- const matchValue_1_1 = Dict_tryFind(k_1, map2_1);
- if (matchValue_3 == null) {
- if (matchValue_1_1 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1_1 = matchValue_1_1;
- return v2_1_1;
- }
- }
- else if (matchValue_1_1 == null) {
- const v1_1_1 = matchValue_3;
- return v1_1_1;
- }
- else {
- const v1_2 = matchValue_3;
- const v2_2 = matchValue_1_1;
- const this$_5 = updateOptions_2;
- const recordType_1_5 = v1_2;
- const recordType_2_5 = v2_2;
- switch (this$_5.tag) {
- case 2:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 1:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 3:
- return makeRecord(Protocol_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- default:
- return recordType_2_5;
- }
- }
- }, List_distinct(append(map(mapping_6, list1_1), map(mapping_6, list2_1)), {
- Equals: equals,
- GetHashCode: structuralHash,
- }));
- }
- catch (err_1) {
- throw new Error(`Could not mergeUpdate ${"Protocol"} list:
-${err_1.message}`);
- }
-}
-
-/**
- * Returns Characteristics of the study
- */
-export function Study_getCharacteristics_7312BC8B(study) {
- return List_distinct(append(getCharacteristics(Study_getProcesses_7312BC8B(study)), append(collect(Assay_getCharacteristics_722A269D, Study_getAssays_7312BC8B(study)), defaultArg(study.CharacteristicCategories, empty()))), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns factors of the study
- */
-export function Study_getFactors_7312BC8B(study) {
- return List_distinct(append(getFactors(Study_getProcesses_7312BC8B(study)), append(collect(Assay_getFactors_722A269D, Study_getAssays_7312BC8B(study)), defaultArg(study.Factors, empty()))), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns unit categories of the study
- */
-export function Study_getUnitCategories_7312BC8B(study) {
- return List_distinct(append(getUnits(Study_getProcesses_7312BC8B(study)), append(collect(Assay_getUnitCategories_722A269D, Study_getAssays_7312BC8B(study)), defaultArg(study.UnitCategories, empty()))), {
- Equals: equals,
- GetHashCode: safeHash,
- });
-}
-
-/**
- * Returns sources of the study
- */
-export function Study_getSources_7312BC8B(study) {
- const processSequenceSources = getSources(Study_getProcesses_7312BC8B(study));
- const assaysSources = collect(Assay_getSources_722A269D, Study_getAssays_7312BC8B(study));
- const updateOptions_2 = new Update_UpdateOptions(3, []);
- const mapping_6 = (s_2) => defaultArg(s_2.Name, "");
- let list1_1;
- const matchValue = study.Materials;
- list1_1 = ((matchValue == null) ? empty() : defaultArg(matchValue.Sources, empty()));
- let list2_1;
- const updateOptions = new Update_UpdateOptions(3, []);
- const mapping_1 = (s) => defaultArg(s.Name, "");
- const list1 = assaysSources;
- const list2 = processSequenceSources;
- try {
- const map1 = Dict_ofSeqWithMerge((arg_1, arg_1_1) => {
- const this$ = updateOptions;
- const recordType_1 = arg_1;
- const recordType_2 = arg_1_1;
- switch (this$.tag) {
- case 2:
- return makeRecord(Source_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }, map((v) => [mapping_1(v), v], list1));
- const map2 = Dict_ofSeqWithMerge((arg_2, arg_3) => {
- const this$_1 = updateOptions;
- const recordType_1_1 = arg_2;
- const recordType_2_1 = arg_3;
- switch (this$_1.tag) {
- case 2:
- return makeRecord(Source_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 1:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 3:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- default:
- return recordType_2_1;
- }
- }, map((v_1) => [mapping_1(v_1), v_1], list2));
- list2_1 = map((k) => {
- const matchValue_1 = Dict_tryFind(k, map1);
- const matchValue_1_1 = Dict_tryFind(k, map2);
- if (matchValue_1 == null) {
- if (matchValue_1_1 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1 = matchValue_1_1;
- return v2_1;
- }
- }
- else if (matchValue_1_1 == null) {
- const v1_1 = matchValue_1;
- return v1_1;
- }
- else {
- const v1 = matchValue_1;
- const v2 = matchValue_1_1;
- const this$_2 = updateOptions;
- const recordType_1_2 = v1;
- const recordType_2_2 = v2;
- switch (this$_2.tag) {
- case 2:
- return makeRecord(Source_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 1:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 3:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- default:
- return recordType_2_2;
- }
- }
- }, List_distinct(append(map(mapping_1, list1), map(mapping_1, list2)), {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- }));
- }
- catch (err) {
- throw new Error(`Could not mergeUpdate ${"Source"} list:
-${err.message}`);
- }
- try {
- const map1_1 = Dict_ofSeqWithMerge((arg_6, arg_1_2) => {
- const this$_3 = updateOptions_2;
- const recordType_1_3 = arg_6;
- const recordType_2_3 = arg_1_2;
- switch (this$_3.tag) {
- case 2:
- return makeRecord(Source_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 1:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 3:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- default:
- return recordType_2_3;
- }
- }, map((v_2) => [mapping_6(v_2), v_2], list1_1));
- const map2_1 = Dict_ofSeqWithMerge((arg_2_1, arg_3_1) => {
- const this$_4 = updateOptions_2;
- const recordType_1_4 = arg_2_1;
- const recordType_2_4 = arg_3_1;
- switch (this$_4.tag) {
- case 2:
- return makeRecord(Source_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 1:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 3:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- default:
- return recordType_2_4;
- }
- }, map((v_1_1) => [mapping_6(v_1_1), v_1_1], list2_1));
- return map((k_1) => {
- const matchValue_3 = Dict_tryFind(k_1, map1_1);
- const matchValue_1_2 = Dict_tryFind(k_1, map2_1);
- if (matchValue_3 == null) {
- if (matchValue_1_2 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1_1 = matchValue_1_2;
- return v2_1_1;
- }
- }
- else if (matchValue_1_2 == null) {
- const v1_1_1 = matchValue_3;
- return v1_1_1;
- }
- else {
- const v1_2 = matchValue_3;
- const v2_2 = matchValue_1_2;
- const this$_5 = updateOptions_2;
- const recordType_1_5 = v1_2;
- const recordType_2_5 = v2_2;
- switch (this$_5.tag) {
- case 2:
- return makeRecord(Source_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 1:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 3:
- return makeRecord(Source_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- default:
- return recordType_2_5;
- }
- }
- }, List_distinct(append(map(mapping_6, list1_1), map(mapping_6, list2_1)), {
- Equals: (x_1, y_1) => (x_1 === y_1),
- GetHashCode: stringHash,
- }));
- }
- catch (err_1) {
- throw new Error(`Could not mergeUpdate ${"Source"} list:
-${err_1.message}`);
- }
-}
-
-/**
- * Returns sources of the study
- */
-export function Study_getSamples_7312BC8B(study) {
- const processSequenceSamples = getSamples(Study_getProcesses_7312BC8B(study));
- const assaysSamples = collect(Assay_getSamples_722A269D, Study_getAssays_7312BC8B(study));
- const updateOptions_2 = new Update_UpdateOptions(3, []);
- const mapping_6 = (s_2) => defaultArg(s_2.Name, "");
- let list1_1;
- const matchValue = study.Materials;
- list1_1 = ((matchValue == null) ? empty() : defaultArg(matchValue.Samples, empty()));
- let list2_1;
- const updateOptions = new Update_UpdateOptions(3, []);
- const mapping_1 = (s) => defaultArg(s.Name, "");
- const list1 = assaysSamples;
- const list2 = processSequenceSamples;
- try {
- const map1 = Dict_ofSeqWithMerge((arg_1, arg_1_1) => {
- const this$ = updateOptions;
- const recordType_1 = arg_1;
- const recordType_2 = arg_1_1;
- switch (this$.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }, map((v) => [mapping_1(v), v], list1));
- const map2 = Dict_ofSeqWithMerge((arg_2, arg_3) => {
- const this$_1 = updateOptions;
- const recordType_1_1 = arg_2;
- const recordType_2_1 = arg_3;
- switch (this$_1.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- default:
- return recordType_2_1;
- }
- }, map((v_1) => [mapping_1(v_1), v_1], list2));
- list2_1 = map((k) => {
- const matchValue_1 = Dict_tryFind(k, map1);
- const matchValue_1_1 = Dict_tryFind(k, map2);
- if (matchValue_1 == null) {
- if (matchValue_1_1 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1 = matchValue_1_1;
- return v2_1;
- }
- }
- else if (matchValue_1_1 == null) {
- const v1_1 = matchValue_1;
- return v1_1;
- }
- else {
- const v1 = matchValue_1;
- const v2 = matchValue_1_1;
- const this$_2 = updateOptions;
- const recordType_1_2 = v1;
- const recordType_2_2 = v2;
- switch (this$_2.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- default:
- return recordType_2_2;
- }
- }
- }, List_distinct(append(map(mapping_1, list1), map(mapping_1, list2)), {
- Equals: (x, y) => (x === y),
- GetHashCode: stringHash,
- }));
- }
- catch (err) {
- throw new Error(`Could not mergeUpdate ${"Sample"} list:
-${err.message}`);
- }
- try {
- const map1_1 = Dict_ofSeqWithMerge((arg_6, arg_1_2) => {
- const this$_3 = updateOptions_2;
- const recordType_1_3 = arg_6;
- const recordType_2_3 = arg_1_2;
- switch (this$_3.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- default:
- return recordType_2_3;
- }
- }, map((v_2) => [mapping_6(v_2), v_2], list1_1));
- const map2_1 = Dict_ofSeqWithMerge((arg_2_1, arg_3_1) => {
- const this$_4 = updateOptions_2;
- const recordType_1_4 = arg_2_1;
- const recordType_2_4 = arg_3_1;
- switch (this$_4.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- default:
- return recordType_2_4;
- }
- }, map((v_1_1) => [mapping_6(v_1_1), v_1_1], list2_1));
- return map((k_1) => {
- const matchValue_3 = Dict_tryFind(k_1, map1_1);
- const matchValue_1_2 = Dict_tryFind(k_1, map2_1);
- if (matchValue_3 == null) {
- if (matchValue_1_2 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1_1 = matchValue_1_2;
- return v2_1_1;
- }
- }
- else if (matchValue_1_2 == null) {
- const v1_1_1 = matchValue_3;
- return v1_1_1;
- }
- else {
- const v1_2 = matchValue_3;
- const v2_2 = matchValue_1_2;
- const this$_5 = updateOptions_2;
- const recordType_1_5 = v1_2;
- const recordType_2_5 = v2_2;
- switch (this$_5.tag) {
- case 2:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 1:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 3:
- return makeRecord(Sample_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- default:
- return recordType_2_5;
- }
- }
- }, List_distinct(append(map(mapping_6, list1_1), map(mapping_6, list2_1)), {
- Equals: (x_1, y_1) => (x_1 === y_1),
- GetHashCode: stringHash,
- }));
- }
- catch (err_1) {
- throw new Error(`Could not mergeUpdate ${"Sample"} list:
-${err_1.message}`);
- }
-}
-
-/**
- * Returns materials of the study
- */
-export function Study_getMaterials_7312BC8B(study) {
- const processSequenceMaterials = getMaterials(Study_getProcesses_7312BC8B(study));
- const assaysMaterials = collect((arg_2) => AssayMaterials_getMaterials_35E61745(Assay_getMaterials_722A269D(arg_2)), Study_getAssays_7312BC8B(study));
- let materials;
- const updateOptions_2 = new Update_UpdateOptions(3, []);
- const mapping_6 = (s_2) => s_2.Name;
- let list1_1;
- const matchValue = study.Materials;
- list1_1 = ((matchValue == null) ? empty() : defaultArg(matchValue.OtherMaterials, empty()));
- let list2_1;
- const updateOptions = new Update_UpdateOptions(3, []);
- const mapping_1 = (s) => s.Name;
- const list1 = assaysMaterials;
- const list2 = processSequenceMaterials;
- try {
- const map1 = Dict_ofSeqWithMerge((arg_3, arg_1_1) => {
- const this$ = updateOptions;
- const recordType_1 = arg_3;
- const recordType_2 = arg_1_1;
- switch (this$.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1), getRecordFields(recordType_2)));
- default:
- return recordType_2;
- }
- }, map((v) => [mapping_1(v), v], list1));
- const map2 = Dict_ofSeqWithMerge((arg_2_1, arg_3_1) => {
- const this$_1 = updateOptions;
- const recordType_1_1 = arg_2_1;
- const recordType_2_1 = arg_3_1;
- switch (this$_1.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_1), getRecordFields(recordType_2_1)));
- default:
- return recordType_2_1;
- }
- }, map((v_1) => [mapping_1(v_1), v_1], list2));
- list2_1 = map((k) => {
- const matchValue_1 = Dict_tryFind(k, map1);
- const matchValue_1_1 = Dict_tryFind(k, map2);
- if (matchValue_1 == null) {
- if (matchValue_1_1 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1 = matchValue_1_1;
- return v2_1;
- }
- }
- else if (matchValue_1_1 == null) {
- const v1_1 = matchValue_1;
- return v1_1;
- }
- else {
- const v1 = matchValue_1;
- const v2 = matchValue_1_1;
- const this$_2 = updateOptions;
- const recordType_1_2 = v1;
- const recordType_2_2 = v2;
- switch (this$_2.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_2), getRecordFields(recordType_2_2)));
- default:
- return recordType_2_2;
- }
- }
- }, List_distinct(append(map(mapping_1, list1), map(mapping_1, list2)), {
- Equals: equals,
- GetHashCode: structuralHash,
- }));
- }
- catch (err) {
- throw new Error(`Could not mergeUpdate ${"Material"} list:
-${err.message}`);
- }
- try {
- const map1_1 = Dict_ofSeqWithMerge((arg_6, arg_1_2) => {
- const this$_3 = updateOptions_2;
- const recordType_1_3 = arg_6;
- const recordType_2_3 = arg_1_2;
- switch (this$_3.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_3), getRecordFields(recordType_2_3)));
- default:
- return recordType_2_3;
- }
- }, map((v_2) => [mapping_6(v_2), v_2], list1_1));
- const map2_1 = Dict_ofSeqWithMerge((arg_2_2, arg_3_2) => {
- const this$_4 = updateOptions_2;
- const recordType_1_4 = arg_2_2;
- const recordType_2_4 = arg_3_2;
- switch (this$_4.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_4), getRecordFields(recordType_2_4)));
- default:
- return recordType_2_4;
- }
- }, map((v_1_1) => [mapping_6(v_1_1), v_1_1], list2_1));
- materials = map((k_1) => {
- const matchValue_3 = Dict_tryFind(k_1, map1_1);
- const matchValue_1_2 = Dict_tryFind(k_1, map2_1);
- if (matchValue_3 == null) {
- if (matchValue_1_2 == null) {
- throw new Error("If this fails, then I don\'t know how to program");
- }
- else {
- const v2_1_1 = matchValue_1_2;
- return v2_1_1;
- }
- }
- else if (matchValue_1_2 == null) {
- const v1_1_1 = matchValue_3;
- return v1_1_1;
- }
- else {
- const v1_2 = matchValue_3;
- const v2_2 = matchValue_1_2;
- const this$_5 = updateOptions_2;
- const recordType_1_5 = v1_2;
- const recordType_2_5 = v2_2;
- switch (this$_5.tag) {
- case 2:
- return makeRecord(Material_$reflection(), map2_2(Update_updateAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 1:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExisting, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- case 3:
- return makeRecord(Material_$reflection(), map2_2(Update_updateOnlyByExistingAppend, getRecordFields(recordType_1_5), getRecordFields(recordType_2_5)));
- default:
- return recordType_2_5;
- }
- }
- }, List_distinct(append(map(mapping_6, list1_1), map(mapping_6, list2_1)), {
- Equals: equals,
- GetHashCode: structuralHash,
- }));
- }
- catch (err_1) {
- throw new Error(`Could not mergeUpdate ${"Material"} list:
-${err_1.message}`);
- }
- const sources = Study_getSources_7312BC8B(study);
- const samples = Study_getSamples_7312BC8B(study);
- return StudyMaterials_make(fromValueWithDefault(empty(), sources), fromValueWithDefault(empty(), samples), fromValueWithDefault(empty(), materials));
-}
-
-export function Study_update_7312BC8B(study) {
- try {
- const protocols = Study_getProtocols_7312BC8B(study);
- let Materials;
- const v = Study_getMaterials_7312BC8B(study);
- Materials = fromValueWithDefault(StudyMaterials_get_empty(), v);
- const Assays = map_1((list) => map((arg_3) => ((arg_2) => Assay_updateProtocols(protocols, arg_2))(Assay_update_722A269D(arg_3)), list), study.Assays);
- const Protocols = fromValueWithDefault(empty(), protocols);
- const Factors = fromValueWithDefault(empty(), Study_getFactors_7312BC8B(study));
- const CharacteristicCategories = fromValueWithDefault(empty(), Study_getCharacteristics_7312BC8B(study));
- const UnitCategories = fromValueWithDefault(empty(), Study_getUnitCategories_7312BC8B(study));
- return new Study(study.ID, study.FileName, study.Identifier, study.Title, study.Description, study.SubmissionDate, study.PublicReleaseDate, study.Publications, study.Contacts, study.StudyDesignDescriptors, Protocols, Materials, map_1((processSequence) => updateProtocols(protocols, processSequence), study.ProcessSequence), Assays, Factors, CharacteristicCategories, UnitCategories, study.Comments);
- }
- catch (err) {
- return toFail(`Could not update study ${study.Identifier}:
-${err.message}`);
- }
-}
-
diff --git a/js/ISA/ISA/JsonTypes/StudyMaterials.js b/js/ISA/ISA/JsonTypes/StudyMaterials.js
deleted file mode 100644
index 51345009..00000000
--- a/js/ISA/ISA/JsonTypes/StudyMaterials.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import { Record } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { Source_$reflection } from "./Source.js";
-import { record_type, option_type, list_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { Sample_$reflection } from "./Sample.js";
-import { Material_$reflection } from "./Material.js";
-import { defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { empty } from "../../../fable_modules/fable-library.4.1.4/List.js";
-
-export class StudyMaterials extends Record {
- constructor(Sources, Samples, OtherMaterials) {
- super();
- this.Sources = Sources;
- this.Samples = Samples;
- this.OtherMaterials = OtherMaterials;
- }
-}
-
-export function StudyMaterials_$reflection() {
- return record_type("ARCtrl.ISA.StudyMaterials", [], StudyMaterials, () => [["Sources", option_type(list_type(Source_$reflection()))], ["Samples", option_type(list_type(Sample_$reflection()))], ["OtherMaterials", option_type(list_type(Material_$reflection()))]]);
-}
-
-export function StudyMaterials_make(sources, samples, otherMaterials) {
- return new StudyMaterials(sources, samples, otherMaterials);
-}
-
-export function StudyMaterials_create_1BE9FA55(Sources, Samples, OtherMaterials) {
- return StudyMaterials_make(Sources, Samples, OtherMaterials);
-}
-
-export function StudyMaterials_get_empty() {
- return StudyMaterials_create_1BE9FA55();
-}
-
-export function StudyMaterials_getMaterials_Z34D4FD6D(am) {
- return defaultArg(am.OtherMaterials, empty());
-}
-
-export function StudyMaterials_getSamples_Z34D4FD6D(am) {
- return defaultArg(am.Samples, empty());
-}
-
-export function StudyMaterials_getSources_Z34D4FD6D(am) {
- return defaultArg(am.Sources, empty());
-}
-
diff --git a/js/ISA/ISA/JsonTypes/URI.js b/js/ISA/ISA/JsonTypes/URI.js
deleted file mode 100644
index 4fac8e00..00000000
--- a/js/ISA/ISA/JsonTypes/URI.js
+++ /dev/null
@@ -1,19 +0,0 @@
-
-/**
- * Create a ISAJson URI from a ISATab string entry
- *
- * This is a placeholder function. It has currently no function, but as soon as it is implemented it will already be placed at all relevant code locations.
- */
-export function URIModule_fromString(s) {
- return s;
-}
-
-/**
- * Create a ISATab string entry from a ISAJson URI
- *
- * This is a placeholder function. It has currently no function, but as soon as it is implemented it will already be placed at all relevant code locations.
- */
-export function URIModule_toString(s) {
- return s;
-}
-
diff --git a/js/ISA/ISA/JsonTypes/Value.js b/js/ISA/ISA/JsonTypes/Value.js
deleted file mode 100644
index e394c11e..00000000
--- a/js/ISA/ISA/JsonTypes/Value.js
+++ /dev/null
@@ -1,210 +0,0 @@
-import { Union, toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
-import { printf, toText } from "../../../fable_modules/fable-library.4.1.4/String.js";
-import { OntologyAnnotation_fromString_2EB0E147, OntologyAnnotation_$reflection, OntologyAnnotation__get_NameText } from "./OntologyAnnotation.js";
-import { union_type, string_type, float64_type, int32_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { parse } from "../../../fable_modules/fable-library.4.1.4/Double.js";
-import { parse as parse_1 } from "../../../fable_modules/fable-library.4.1.4/Int32.js";
-import { map, defaultArg } from "../../../fable_modules/fable-library.4.1.4/Option.js";
-import { int32ToString } from "../../../fable_modules/fable-library.4.1.4/Util.js";
-import { AnnotationValue_toString_Z6FAD7738 } from "./AnnotationValue.js";
-
-export class Value extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["Ontology", "Int", "Float", "Name"];
- }
- Print() {
- const this$ = this;
- return toString(this$);
- }
- PrintCompact() {
- const this$ = this;
- return (this$.tag === 1) ? toText(printf("%i"))(this$.fields[0]) : ((this$.tag === 2) ? toText(printf("%f"))(this$.fields[0]) : ((this$.tag === 3) ? this$.fields[0] : OntologyAnnotation__get_NameText(this$.fields[0])));
- }
-}
-
-export function Value_$reflection() {
- return union_type("ARCtrl.ISA.Value", [], Value, () => [[["Item", OntologyAnnotation_$reflection()]], [["Item", int32_type]], [["Item", float64_type]], [["Item", string_type]]]);
-}
-
-export function Value_fromString_Z721C83C5(value) {
- try {
- return new Value(1, [parse_1(value, 511, false, 32)]);
- }
- catch (matchValue) {
- try {
- return new Value(2, [parse(value)]);
- }
- catch (matchValue_1) {
- return new Value(3, [value]);
- }
- }
-}
-
-export function Value_fromOptions(value, termSource, termAccesssion) {
- let matchResult, value_1;
- if (value == null) {
- if (termSource == null) {
- if (termAccesssion == null) {
- matchResult = 1;
- }
- else {
- matchResult = 2;
- }
- }
- else {
- matchResult = 2;
- }
- }
- else if (termSource == null) {
- if (termAccesssion == null) {
- matchResult = 0;
- value_1 = value;
- }
- else {
- matchResult = 2;
- }
- }
- else {
- matchResult = 2;
- }
- switch (matchResult) {
- case 0:
- return (() => {
- try {
- return new Value(1, [parse_1(value_1, 511, false, 32)]);
- }
- catch (matchValue_1) {
- try {
- return new Value(2, [parse(value_1)]);
- }
- catch (matchValue_2) {
- return new Value(3, [value_1]);
- }
- }
- })();
- case 1:
- return void 0;
- default:
- return new Value(0, [OntologyAnnotation_fromString_2EB0E147(defaultArg(value, ""), termSource, termAccesssion)]);
- }
-}
-
-export function Value_toOptions_72E9EF0F(value) {
- switch (value.tag) {
- case 1:
- return [int32ToString(value.fields[0]), void 0, void 0];
- case 2:
- return [value.fields[0].toString(), void 0, void 0];
- case 3:
- return [value.fields[0], void 0, void 0];
- default: {
- const oa = value.fields[0];
- return [map(AnnotationValue_toString_Z6FAD7738, oa.Name), oa.TermAccessionNumber, oa.TermSourceREF];
- }
- }
-}
-
-export function Value__get_Text(this$) {
- switch (this$.tag) {
- case 2:
- return this$.fields[0].toString();
- case 1:
- return int32ToString(this$.fields[0]);
- case 3:
- return this$.fields[0];
- default:
- return OntologyAnnotation__get_NameText(this$.fields[0]);
- }
-}
-
-export function Value__AsName(this$) {
- if (this$.tag === 3) {
- return this$.fields[0];
- }
- else {
- throw new Error(`Value ${this$} is not of case name`);
- }
-}
-
-export function Value__AsInt(this$) {
- if (this$.tag === 1) {
- return this$.fields[0] | 0;
- }
- else {
- throw new Error(`Value ${this$} is not of case int`);
- }
-}
-
-export function Value__AsFloat(this$) {
- if (this$.tag === 2) {
- return this$.fields[0];
- }
- else {
- throw new Error(`Value ${this$} is not of case float`);
- }
-}
-
-export function Value__AsOntology(this$) {
- if (this$.tag === 0) {
- return this$.fields[0];
- }
- else {
- throw new Error(`Value ${this$} is not of case ontology`);
- }
-}
-
-export function Value__get_IsAnOntology(this$) {
- if (this$.tag === 0) {
- return true;
- }
- else {
- return false;
- }
-}
-
-export function Value__get_IsNumerical(this$) {
- switch (this$.tag) {
- case 1:
- case 2:
- return true;
- default:
- return false;
- }
-}
-
-export function Value__get_IsAnInt(this$) {
- if (this$.tag === 1) {
- return true;
- }
- else {
- return false;
- }
-}
-
-export function Value__get_IsAFloat(this$) {
- if (this$.tag === 2) {
- return true;
- }
- else {
- return false;
- }
-}
-
-export function Value__get_IsAText(this$) {
- if (this$.tag === 3) {
- return true;
- }
- else {
- return false;
- }
-}
-
-export function Value_getText_72E9EF0F(v) {
- return Value__get_Text(v);
-}
-
diff --git a/js/ISA/ISA/OptionExtensions.js b/js/ISA/ISA/OptionExtensions.js
deleted file mode 100644
index ead229fc..00000000
--- a/js/ISA/ISA/OptionExtensions.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import { equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { value, some } from "../../fable_modules/fable-library.4.1.4/Option.js";
-
-/**
- * If the value matches the default, a None is returned, else a Some is returned
- */
-export function fromValueWithDefault(d, v) {
- if (equals(d, v)) {
- return void 0;
- }
- else {
- return some(v);
- }
-}
-
-/**
- * Applies the function f on the value of the option if it exists, else applies it on the default value. If the result value matches the default, a None is returned
- */
-export function mapDefault(d, f, o) {
- return fromValueWithDefault(d, (o == null) ? f(d) : f(value(o)));
-}
-
-/**
- * Applies the function f on the value of the option if it exists, else returns the default value.
- */
-export function mapOrDefault(d, f, o) {
- if (o == null) {
- return d;
- }
- else {
- return some(f(value(o)));
- }
-}
-
diff --git a/js/ISA/ISA/Regex.js b/js/ISA/ISA/Regex.js
deleted file mode 100644
index 38cff9ce..00000000
--- a/js/ISA/ISA/Regex.js
+++ /dev/null
@@ -1,583 +0,0 @@
-import { create, match } from "../../fable_modules/fable-library.4.1.4/RegExp.js";
-import { value as value_1, map, some } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { parse } from "../../fable_modules/fable-library.4.1.4/Int32.js";
-
-/**
- * Matches, if the input string matches the given regex pattern.
- */
-export function ActivePatterns_$007CRegex$007C_$007C(pattern, input) {
- const m = match(create(pattern), input.trim());
- if (m != null) {
- return m;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches any column header starting with some text, followed by one whitespace and a term name inside squared brackets.
- */
-export function ActivePatterns_$007CReferenceColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(Term Source REF|Term Accession Number)\\s\\((?.*)\\)", input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return {
- Annotation: (r.groups && r.groups.id) || "",
- };
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches any column header starting with some text, followed by one whitespace and a term name inside squared brackets.
- */
-export function ActivePatterns_$007CTermColumn$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(?.+)\\s\\[(?.+)\\]", input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return {
- TermColumnType: (r.groups && r.groups.termcolumntype) || "",
- TermName: (r.groups && r.groups.termname) || "",
- };
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Unit" column header.
- */
-export function ActivePatterns_$007CUnitColumnHeader$007C_$007C(input) {
- if (ActivePatterns_$007CRegex$007C_$007C("Unit", input) != null) {
- return some(void 0);
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Parameter [Term]" or "Parameter Value [Term]" column header and returns the Term string.
- */
-export function ActivePatterns_$007CParameterColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CTermColumn$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- const matchValue = r.TermColumnType;
- switch (matchValue) {
- case "Parameter":
- case "Parameter Value":
- return r.TermName;
- default:
- return void 0;
- }
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Factor [Term]" or "Factor Value [Term]" column header and returns the Term string.
- */
-export function ActivePatterns_$007CFactorColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CTermColumn$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- const matchValue = r.TermColumnType;
- switch (matchValue) {
- case "Factor":
- case "Factor Value":
- return r.TermName;
- default:
- return void 0;
- }
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Characteristic [Term]" or "Characteristics [Term]" or "Characteristics Value [Term]" column header and returns the Term string.
- */
-export function ActivePatterns_$007CCharacteristicColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CTermColumn$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- const matchValue = r.TermColumnType;
- switch (matchValue) {
- case "Characteristic":
- case "Characteristics":
- case "Characteristics Value":
- return r.TermName;
- default:
- return void 0;
- }
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Component [Term]" or "Component Value [Term]" column header and returns the Term string.
- */
-export function ActivePatterns_$007CComponentColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CTermColumn$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- const matchValue = r.TermColumnType;
- switch (matchValue) {
- case "Component":
- case "Component Value":
- return r.TermName;
- default:
- return void 0;
- }
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a short term string and returns the term source ref and the annotation number strings.
- *
- * Example: "MS:1003022" --> term source ref: "MS"; annotation number: "1003022"
- */
-export function ActivePatterns_$007CTermAnnotationShort$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(?\\w+?):(?\\w+)", input);
- if (activePatternResult != null) {
- const value = activePatternResult;
- const termsourceref = (value.groups && value.groups.termsourceref) || "";
- return {
- LocalTAN: (value.groups && value.groups.localtan) || "",
- TermSourceREF: termsourceref,
- };
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a term string (either short or URI) and returns the term source ref and the annotation number strings.
- *
- * Example 1: "MS:1003022" --> term source ref: "MS"; annotation number: "1003022"
- *
- * Example 2: "http://purl.obolibrary.org/obo/MS_1003022" --> term source ref: "MS"; annotation number: "1003022"
- */
-export function ActivePatterns_$007CTermAnnotation$007C_$007C(input) {
- let matchResult, value;
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(?\\w+?):(?\\w+)", input);
- if (activePatternResult != null) {
- matchResult = 0;
- value = activePatternResult;
- }
- else {
- const activePatternResult_1 = ActivePatterns_$007CRegex$007C_$007C("http://purl.obolibrary.org/obo/(?\\w+?)_(?\\w+)", input);
- if (activePatternResult_1 != null) {
- matchResult = 0;
- value = activePatternResult_1;
- }
- else {
- const activePatternResult_2 = ActivePatterns_$007CRegex$007C_$007C(".*\\/(?\\w+?)[:_](?\\w+)", input);
- if (activePatternResult_2 != null) {
- matchResult = 0;
- value = activePatternResult_2;
- }
- else {
- matchResult = 1;
- }
- }
- }
- switch (matchResult) {
- case 0: {
- const termsourceref = (value.groups && value.groups.termsourceref) || "";
- return {
- LocalTAN: (value.groups && value.groups.localtan) || "",
- TermAccessionNumber: input,
- TermSourceREF: termsourceref,
- };
- }
- default:
- return void 0;
- }
-}
-
-/**
- * Matches a "Term Source REF (ShortTerm)" column header and returns the ShortTerm as Term Source Ref and Annotation Number.
- *
- * Example: "Term Source REF (MS:1003022)" --> term source ref: "MS"; annotation number: "1003022"
- */
-export function ActivePatterns_$007CTSRColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("Term Source REF\\s\\((?.*)\\)", input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- const matchValue = (r.groups && r.groups.id) || "";
- const activePatternResult_1 = ActivePatterns_$007CTermAnnotation$007C_$007C(matchValue);
- if (activePatternResult_1 != null) {
- const r_1 = activePatternResult_1;
- return r_1;
- }
- else {
- return {
- LocalTAN: "",
- TermAccessionNumber: "",
- TermSourceREF: "",
- };
- }
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Term Accession Number (ShortTerm)" column header and returns the ShortTerm as Term Source Ref and Annotation Number.
- *
- * Example: "Term Accession Number (MS:1003022)" --> term source ref: "MS"; annotation number: "1003022"
- */
-export function ActivePatterns_$007CTANColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("Term Accession Number\\s\\((?.*)\\)", input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- const matchValue = (r.groups && r.groups.id) || "";
- const activePatternResult_1 = ActivePatterns_$007CTermAnnotation$007C_$007C(matchValue);
- if (activePatternResult_1 != null) {
- const r_1 = activePatternResult_1;
- return r_1;
- }
- else {
- return {
- LocalTAN: "",
- TermAccessionNumber: "",
- TermSourceREF: "",
- };
- }
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Input [InputType]" column header and returns the InputType as string.
- */
-export function ActivePatterns_$007CInputColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("Input\\s\\[(?.+)\\]", input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return (r.groups && r.groups.iotype) || "";
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Output [OutputType]" column header and returns the OutputType as string.
- */
-export function ActivePatterns_$007COutputColumnHeader$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("Output\\s\\[(?.+)\\]", input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return (r.groups && r.groups.iotype) || "";
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches auto-generated readable table names. Mainly used in ArcAssay.addTable(). Default tables will get such a name.
- *
- * Will match "New Table 10" and return the number `10`.
- */
-export function ActivePatterns_$007CAutoGeneratedTableName$007C_$007C(input) {
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("^New\\sTable\\s(?\\d+)$", input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return parse((r.groups && r.groups.number) || "", 511, false, 32);
- }
- else {
- return void 0;
- }
-}
-
-export function tryParseReferenceColumnHeader(str) {
- const matchValue = str.trim();
- const activePatternResult = ActivePatterns_$007CReferenceColumnHeader$007C_$007C(matchValue);
- if (activePatternResult != null) {
- const v = activePatternResult;
- return v;
- }
- else {
- return void 0;
- }
-}
-
-export function tryParseTermAnnotationShort(str) {
- const matchValue = str.trim();
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(?\\w+?):(?\\w+)", matchValue);
- if (activePatternResult != null) {
- const value = activePatternResult;
- const termsourceref = (value.groups && value.groups.termsourceref) || "";
- return {
- LocalTAN: (value.groups && value.groups.localtan) || "",
- TermSourceREF: termsourceref,
- };
- }
- else {
- return void 0;
- }
-}
-
-/**
- * This function can be used to extract `IDSPACE:LOCALID` (or: `Term Accession`) from Swate header strings or obofoundry conform URI strings.
- *
- * **Example 1:** "http://purl.obolibrary.org/obo/GO_000001" --> "GO:000001"
- *
- * **Example 2:** "Term Source REF (NFDI4PSO:0000064)" --> "NFDI4PSO:0000064"
- */
-export function tryParseTermAnnotation(str) {
- const matchValue = str.trim();
- let matchResult, value;
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(?\\w+?):(?\\w+)", matchValue);
- if (activePatternResult != null) {
- matchResult = 0;
- value = activePatternResult;
- }
- else {
- const activePatternResult_1 = ActivePatterns_$007CRegex$007C_$007C("http://purl.obolibrary.org/obo/(?\\w+?)_(?\\w+)", matchValue);
- if (activePatternResult_1 != null) {
- matchResult = 0;
- value = activePatternResult_1;
- }
- else {
- const activePatternResult_2 = ActivePatterns_$007CRegex$007C_$007C(".*\\/(?\\w+?)[:_](?\\w+)", matchValue);
- if (activePatternResult_2 != null) {
- matchResult = 0;
- value = activePatternResult_2;
- }
- else {
- matchResult = 1;
- }
- }
- }
- switch (matchResult) {
- case 0: {
- const termsourceref = (value.groups && value.groups.termsourceref) || "";
- return {
- LocalTAN: (value.groups && value.groups.localtan) || "",
- TermSourceREF: termsourceref,
- };
- }
- default:
- return void 0;
- }
-}
-
-/**
- * Tries to parse 'str' to term accession and returns it in the format `Some "termsourceref:localtan"`. Exmp.: `Some "MS:000001"`
- */
-export function tryGetTermAnnotationShortString(str) {
- return map((r) => ((r.TermSourceREF + ":") + r.LocalTAN), tryParseTermAnnotation(str));
-}
-
-/**
- * Parses 'str' to term accession and returns it in the format "termsourceref:localtan". Exmp.: "MS:000001"
- */
-export function getTermAnnotationShortString(str) {
- const matchValue = tryGetTermAnnotationShortString(str);
- if (matchValue == null) {
- throw new Error(`Unable to parse '${str}' to term accession.`);
- }
- else {
- return matchValue;
- }
-}
-
-/**
- * This function is used to parse Excel numberFormat string to term name.
- *
- * **Example 1:** "0.00 "degree Celsius"" --> "degree Celsius"
- */
-export function tryParseExcelNumberFormat(headerStr) {
- const matchValue = headerStr.trim();
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("\"(?(.*?))\"", matchValue);
- if (activePatternResult != null) {
- const value = activePatternResult;
- return (value.groups && value.groups.numberFormat) || "";
- }
- else {
- return void 0;
- }
-}
-
-/**
- * This function is used to match both Input and Output columns and capture the IOType as `iotype` group.
- *
- * **Example 1:** "Input [Sample]" --> "Sample"
- */
-export function tryParseIOTypeHeader(headerStr) {
- const matchValue = headerStr.trim();
- const activePatternResult = ActivePatterns_$007CRegex$007C_$007C("(Input|Output)\\s\\[(?.+)\\]", matchValue);
- if (activePatternResult != null) {
- const value = activePatternResult;
- return (value.groups && value.groups.iotype) || "";
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches any column header starting with some text, followed by one whitespace and a term name inside squared brackets.
- */
-export function tryParseTermColumn(input) {
- const activePatternResult = ActivePatterns_$007CTermColumn$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Unit" column header.
- */
-export function tryParseUnitColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CUnitColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = value_1(activePatternResult);
- return some(void 0);
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Parameter [Term]" or "Parameter Value [Term]" column header and returns the Term string.
- */
-export function tryParseParameterColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CParameterColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Factor [Term]" or "Factor Value [Term]" column header and returns the Term string.
- */
-export function tryParseFactorColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CFactorColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Characteristic [Term]" or "Characteristics [Term]" or "Characteristics Value [Term]" column header and returns the Term string.
- */
-export function tryParseCharacteristicColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CCharacteristicColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Component [Term]" or "Characteristics [Term]" or "Component Value [Term]" column header and returns the Term string.
- */
-export function tryParseComponentColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CComponentColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Term Source REF (ShortTerm)" column header and returns the ShortTerm as Term Source Ref and Annotation Number.
- *
- * Example: "Term Source REF (MS:1003022)" --> term source ref: "MS"; annotation number: "1003022"
- */
-export function tryParseTSRColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CTSRColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Term Accession Number (ShortTerm)" column header and returns the ShortTerm as Term Source Ref and Annotation Number.
- *
- * Example: "Term Accession Number (MS:1003022)" --> term source ref: "MS"; annotation number: "1003022"
- */
-export function tryParseTANColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CTANColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Input [InputType]" column header and returns the InputType as string.
- */
-export function tryParseInputColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007CInputColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
-/**
- * Matches a "Output [OutputType]" column header and returns the OutputType as string.
- */
-export function tryParseOutputColumnHeader(input) {
- const activePatternResult = ActivePatterns_$007COutputColumnHeader$007C_$007C(input);
- if (activePatternResult != null) {
- const r = activePatternResult;
- return r;
- }
- else {
- return void 0;
- }
-}
-
diff --git a/js/ISA/ISA/Update.js b/js/ISA/ISA/Update.js
deleted file mode 100644
index 4b42b0ab..00000000
--- a/js/ISA/ISA/Update.js
+++ /dev/null
@@ -1,267 +0,0 @@
-import { Dictionary } from "../../fable_modules/fable-library.4.1.4/MutableMap.js";
-import { isIterable, defaultOf, structuralHash, equals } from "../../fable_modules/fable-library.4.1.4/Util.js";
-import { isEmpty, iterate } from "../../fable_modules/fable-library.4.1.4/Seq.js";
-import { tryGetValue, addToDict } from "../../fable_modules/fable-library.4.1.4/MapUtil.js";
-import { Union, toString, FSharpRef } from "../../fable_modules/fable-library.4.1.4/Types.js";
-import { value as value_1, some } from "../../fable_modules/fable-library.4.1.4/Option.js";
-import { append_generic, distinct_generic, isList_generic, isMap_generic } from "./Fable.js";
-import { union_type, makeUnion, option_type, makeGenericType, getUnionCases, name, obj_type } from "../../fable_modules/fable-library.4.1.4/Reflection.js";
-import { exactlyOne, partition } from "../../fable_modules/fable-library.4.1.4/Array.js";
-
-export function Dict_ofSeq(s) {
- const dict = new Dictionary([], {
- Equals: equals,
- GetHashCode: structuralHash,
- });
- iterate((tupledArg) => {
- addToDict(dict, tupledArg[0], tupledArg[1]);
- }, s);
- return dict;
-}
-
-export function Dict_tryFind(key, dict) {
- let patternInput;
- let outArg = defaultOf();
- patternInput = [tryGetValue(dict, key, new FSharpRef(() => outArg, (v) => {
- outArg = v;
- })), outArg];
- if (patternInput[0]) {
- return some(patternInput[1]);
- }
- else {
- return void 0;
- }
-}
-
-export function Dict_ofSeqWithMerge(merge, s) {
- const dict = new Dictionary([], {
- Equals: equals,
- GetHashCode: structuralHash,
- });
- iterate((tupledArg) => {
- const k = tupledArg[0];
- const v = tupledArg[1];
- const matchValue = Dict_tryFind(k, dict);
- if (matchValue == null) {
- addToDict(dict, k, v);
- }
- else {
- const v$0027 = value_1(matchValue);
- dict.delete(k);
- addToDict(dict, k, merge(v$0027, v));
- }
- }, s);
- return dict;
-}
-
-/**
- * Get the type of the IEnumerable elements. E.g. for Array<'T> it would be 'T
- */
-export function Update_isMapType(v) {
- return isMap_generic(v);
-}
-
-export function Update_isListType(v) {
- return isList_generic(v);
-}
-
-/**
- * Get the type of the IEnumerable elements. E.g. for Array<'T> it would be 'T
- */
-export function Update_enumGetInnerType(v) {
- return obj_type;
-}
-
-/**
- * updates oldRT with newRT by replacing all values, but appending all lists.
- *
- * newRTList@oldRTList
- */
-export function Update_updateAppend(oldVal, newVal) {
- let matchResult, oldInternal, others;
- if (typeof oldVal === "string") {
- matchResult = 0;
- }
- else if (isIterable(oldVal)) {
- let activePatternResult;
- const a = oldVal;
- activePatternResult = ((a == null) ? void 0 : (undefined));
- if (activePatternResult != null) {
- matchResult = 1;
- oldInternal = value_1(activePatternResult);
- }
- else {
- matchResult = 2;
- }
- }
- else {
- let activePatternResult_1;
- const a_1 = oldVal;
- activePatternResult_1 = ((a_1 == null) ? void 0 : (undefined));
- if (activePatternResult_1 != null) {
- matchResult = 1;
- oldInternal = value_1(activePatternResult_1);
- }
- else {
- matchResult = 3;
- others = oldVal;
- }
- }
- switch (matchResult) {
- case 0:
- return newVal;
- case 1:
- if (typeof oldInternal === "string") {
- return newVal;
- }
- else if (isIterable(oldInternal)) {
- let activePatternResult_2;
- const a_2 = newVal;
- activePatternResult_2 = ((a_2 == null) ? void 0 : (undefined));
- if (activePatternResult_2 != null) {
- const newInternal = value_1(activePatternResult_2);
- const v = Update_updateAppend(oldInternal, newInternal);
- const cases_1 = partition((x) => (name(x) === "Some"), getUnionCases(makeGenericType(option_type(obj_type), [obj_type])));
- const patternInput = [exactlyOne(cases_1[0]), [v]];
- return makeUnion(patternInput[0], patternInput[1]);
- }
- else {
- return oldVal;
- }
- }
- else {
- return newVal;
- }
- case 2: {
- const oldSeq = oldVal;
- const newSeq = newVal;
- const innerType = Update_enumGetInnerType(oldVal);
- if (Update_isMapType(oldVal)) {
- return newVal;
- }
- else {
- return distinct_generic(append_generic(oldSeq, newSeq));
- }
- }
- default:
- return newVal;
- }
-}
-
-/**
- * updates oldRT with newRT by replacing all values, but only if the new value is not empty.
- */
-export function Update_updateOnlyByExisting(oldVal, newVal) {
- if (equals(newVal, defaultOf())) {
- return oldVal;
- }
- else {
- let activePatternResult;
- const a = oldVal;
- activePatternResult = ((a == null) ? void 0 : (undefined));
- if (activePatternResult != null) {
- const oldInternal = value_1(activePatternResult);
- let activePatternResult_1;
- const a_1 = newVal;
- activePatternResult_1 = ((a_1 == null) ? void 0 : (undefined));
- if (activePatternResult_1 != null) {
- const newInternal = value_1(activePatternResult_1);
- const v = Update_updateOnlyByExisting(oldInternal, newInternal);
- const cases_1 = partition((x) => (name(x) === "Some"), getUnionCases(makeGenericType(option_type(obj_type), [obj_type])));
- const patternInput = [exactlyOne(cases_1[0]), [v]];
- return makeUnion(patternInput[0], patternInput[1]);
- }
- else {
- return oldVal;
- }
- }
- else if (typeof oldVal === "string") {
- const newStr = newVal;
- if (toString(newStr) === "") {
- return oldVal;
- }
- else {
- return newStr;
- }
- }
- else if (isIterable(oldVal)) {
- const newSeq = newVal;
- if (isEmpty(newSeq)) {
- return oldVal;
- }
- else {
- return newSeq;
- }
- }
- else {
- return newVal;
- }
- }
-}
-
-/**
- * updates oldRT with newRT by replacing all values, but only if the new value is not empty.
- */
-export function Update_updateOnlyByExistingAppend(oldVal, newVal) {
- if (equals(newVal, defaultOf())) {
- return oldVal;
- }
- else {
- let activePatternResult;
- const a = oldVal;
- activePatternResult = ((a == null) ? void 0 : (undefined));
- if (activePatternResult != null) {
- const oldInternal = value_1(activePatternResult);
- let activePatternResult_1;
- const a_1 = newVal;
- activePatternResult_1 = ((a_1 == null) ? void 0 : (undefined));
- if (activePatternResult_1 != null) {
- const newInternal = value_1(activePatternResult_1);
- const v = Update_updateOnlyByExistingAppend(oldInternal, newInternal);
- const cases_1 = partition((x) => (name(x) === "Some"), getUnionCases(makeGenericType(option_type(obj_type), [obj_type])));
- const patternInput = [exactlyOne(cases_1[0]), [v]];
- return makeUnion(patternInput[0], patternInput[1]);
- }
- else {
- return oldVal;
- }
- }
- else if (typeof oldVal === "string") {
- const newStr = newVal;
- if (toString(newStr) === "") {
- return oldVal;
- }
- else {
- return newStr;
- }
- }
- else if (isIterable(oldVal)) {
- const innerType = Update_enumGetInnerType(oldVal);
- if (Update_isMapType(oldVal)) {
- return newVal;
- }
- else {
- return distinct_generic(append_generic(oldVal, newVal));
- }
- }
- else {
- return newVal;
- }
- }
-}
-
-export class Update_UpdateOptions extends Union {
- constructor(tag, fields) {
- super();
- this.tag = tag;
- this.fields = fields;
- }
- cases() {
- return ["UpdateAll", "UpdateByExisting", "UpdateAllAppendLists", "UpdateByExistingAppendLists"];
- }
-}
-
-export function Update_UpdateOptions_$reflection() {
- return union_type("ARCtrl.ISA.Aux.Update.UpdateOptions", [], Update_UpdateOptions, () => [[], [], [], []]);
-}
-
diff --git a/package-lock.json b/package-lock.json
index ec12818b..1b559b2b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,18 +1,19 @@
{
"name": "arcapi",
- "version": "1.0.0",
+ "version": "1.0.0+4892f43",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "arcapi",
- "version": "1.0.0",
+ "version": "1.0.0+4892f43",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"fable-library": "^1.1.1"
},
"devDependencies": {
+ "mkdirp": "3.0.1",
"mocha": "^10.2.0"
}
},
@@ -569,6 +570,21 @@
"node": ">=10"
}
},
+ "node_modules/mkdirp": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz",
+ "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
+ "dev": true,
+ "bin": {
+ "mkdirp": "dist/cjs/src/bin.js"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/mocha": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
@@ -1324,6 +1340,12 @@
"brace-expansion": "^2.0.1"
}
},
+ "mkdirp": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz",
+ "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
+ "dev": true
+ },
"mocha": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
diff --git a/package.json b/package.json
index e6ae289e..6078a9e5 100644
--- a/package.json
+++ b/package.json
@@ -4,24 +4,24 @@
"description": "Top level ARC DataModel and API function descriptions.",
"type": "module",
"scripts": {
- "prebundle-js": "dotnet fable clean -o ./js --yes",
- "bundle-js": "dotnet fable ./src/ARCtrl -o ./js",
- "prebundle-ts": "dotnet fable clean -o ./ts --yes --extension .ts",
- "bundle-ts": "dotnet fable ./src/ARCtrl -o ./ts --lang ts",
+ "prebundlejs": "mkdirp .\\dist/js && dotnet fable clean -o ./dist/js --yes",
+ "bundlejs": "dotnet fable ./src/ARCtrl -o ./dist/js",
+ "prebundlets": "mkdirp .\\dist/ts && dotnet fable clean -o ./dist/ts --yes --extension .ts",
+ "bundlets": "dotnet fable ./src/ARCtrl -o ./dist/ts --lang ts",
"pretestJson": "dotnet fable tests/ISA/ISA.Json.Tests -o tests/ISA/ISA.Json.Tests/js",
"testJson": "mocha tests/ISA/ISA.Json.Tests/js --timeout 20000",
"pretestSpreadsheet": "dotnet fable tests/ISA/ISA.Spreadsheet.Tests -o tests/ISA/ISA.Spreadsheet.Tests/js",
"testSpreadsheet": "mocha tests/ISA/ISA.Spreadsheet.Tests/js",
"pretest": "dotnet fable tests/ISA/ISA.Tests -o tests/ISA/ISA.Tests/js",
"test": "mocha tests/ISA/ISA.Tests/js",
- "pretestFS": "dotnet fable tests/FileSystem/FileSystem.Tests -o tests/FileSystem/FileSystem.Tests/js",
- "testFS": "mocha tests/FileSystem/FileSystem.Tests/js",
+ "pretestFS": "dotnet fable tests/FileSystem -o tests/FileSystem/js",
+ "testFS": "mocha tests/FileSystem/js",
"pretestARC": "dotnet fable tests/ARCtrl -o tests/ARCtrl/js",
"testARC": "mocha tests/ARCtrl/js",
- "pretestJavaScript": "dotnet fable src/ARCtrl -o tests/JavaScript/ARCtrl",
- "testJavaScript": "mocha tests/JavaScript",
- "pretestPython": "dotnet fable src/ARCtrl -o tests/Python/ARCtrl --lang py ",
- "testPython": "",
+ "pretestjs": "dotnet fable src/ARCtrl -o tests/JavaScript/ARCtrl",
+ "testjs": "mocha tests/JavaScript",
+ "pretestpy": "dotnet fable src/ARCtrl -o tests/Python/ARCtrl --lang py ",
+ "testpy": "",
"postinstall": "cd src/ISA & npm install"
},
"repository": {
@@ -38,6 +38,7 @@
"fable-library": "^1.1.1"
},
"devDependencies": {
- "mocha": "^10.2.0"
+ "mocha": "^10.2.0",
+ "mkdirp": "3.0.1"
}
}
diff --git a/paket.dependencies b/paket.dependencies
new file mode 100644
index 00000000..9aa4b79f
--- /dev/null
+++ b/paket.dependencies
@@ -0,0 +1,14 @@
+source https://api.nuget.org/v3/index.json
+
+storage: none
+framework: net6.0, netstandard2.0
+
+nuget Fable.Core ~> 4.0.0
+nuget FSharp.Core
+nuget FsSpreadsheet 3.3.0
+
+// Test NuGet packages
+nuget Expecto ~> 9.0.4
+nuget Fable.Mocha ~> 2.16.0
+nuget Microsoft.NET.Test.Sdk ~> 17.4.0
+nuget YoloDev.Expecto.TestSdk ~> 0.13.2
\ No newline at end of file
diff --git a/paket.lock b/paket.lock
new file mode 100644
index 00000000..c14cceb3
--- /dev/null
+++ b/paket.lock
@@ -0,0 +1,37 @@
+STORAGE: NONE
+RESTRICTION: || (== net6.0) (== netstandard2.0)
+NUGET
+ remote: https://api.nuget.org/v3/index.json
+ Expecto (9.0.4)
+ FSharp.Core (>= 4.6)
+ Mono.Cecil (>= 0.11.3)
+ Fable.Core (4.0)
+ Fable.Mocha (2.16)
+ Fable.Core (>= 3.0)
+ FSharp.Core (>= 4.7)
+ FSharp.Core (7.0.300)
+ FsSpreadsheet (3.3)
+ Fable.Core (>= 4.0)
+ FSharp.Core (>= 6.0.7)
+ Microsoft.CodeCoverage (17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ Microsoft.NET.Test.Sdk (17.4.1)
+ Microsoft.CodeCoverage (>= 17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ Microsoft.TestPlatform.TestHost (>= 17.4.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ Microsoft.TestPlatform.ObjectModel (17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ NuGet.Frameworks (>= 6.5)
+ System.Reflection.Metadata (>= 1.6)
+ Microsoft.TestPlatform.TestHost (17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ Microsoft.TestPlatform.ObjectModel (>= 17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ Mono.Cecil (0.11.5)
+ Newtonsoft.Json (13.0.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ NuGet.Frameworks (6.6.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ System.Collections.Immutable (7.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ System.Runtime.CompilerServices.Unsafe (>= 6.0)
+ System.Reflection.Metadata (7.0.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ System.Collections.Immutable (>= 7.0)
+ System.Runtime.CompilerServices.Unsafe (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ YoloDev.Expecto.TestSdk (0.13.3)
+ Expecto (>= 9.0 < 10.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ FSharp.Core (>= 4.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
+ System.Collections.Immutable (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
diff --git a/src/ARCtrl/ARCtrl.fsproj b/src/ARCtrl/ARCtrl.fsproj
index dfba4f3c..314d5ec9 100644
--- a/src/ARCtrl/ARCtrl.fsproj
+++ b/src/ARCtrl/ARCtrl.fsproj
@@ -1,11 +1,11 @@
-
-
+
+
netstandard2.0
true
-
+
@@ -15,8 +15,6 @@
-
-
@@ -25,17 +23,12 @@
-
-
-
-
-
nfdi4plants, Lukas Weil, Kevin Frey, Kevin Schneider, Oliver Maus
Library for management of Annotated Research Contexts (ARCs) using an in-memory representation and runtimer agnostic contract systems.
@@ -46,5 +39,5 @@
https://github.com/nfdi4plants/ARCtrl
git
-
-
+
+
\ No newline at end of file
diff --git a/src/ARCtrl/paket.references b/src/ARCtrl/paket.references
new file mode 100644
index 00000000..2387b156
--- /dev/null
+++ b/src/ARCtrl/paket.references
@@ -0,0 +1,2 @@
+FSharp.Core
+Fable.Core
\ No newline at end of file
diff --git a/src/CWL/ARCtrl.CWL.fsproj b/src/CWL/ARCtrl.CWL.fsproj
index ba41d260..aa13ecc7 100644
--- a/src/CWL/ARCtrl.CWL.fsproj
+++ b/src/CWL/ARCtrl.CWL.fsproj
@@ -1,24 +1,18 @@
-
-
+
+
netstandard2.0
true
-
+
-
-
-
-
-
-
nfdi4plants
ARC helper functions for Common workflow language.
@@ -29,5 +23,5 @@
https://github.com/nfdi4plants/ARCtrl
git
-
-
+
+
\ No newline at end of file
diff --git a/src/CWL/paket.references b/src/CWL/paket.references
new file mode 100644
index 00000000..2387b156
--- /dev/null
+++ b/src/CWL/paket.references
@@ -0,0 +1,2 @@
+FSharp.Core
+Fable.Core
\ No newline at end of file
diff --git a/src/Contract/ARCtrl.Contract.fsproj b/src/Contract/ARCtrl.Contract.fsproj
index ad403245..ce8cee60 100644
--- a/src/Contract/ARCtrl.Contract.fsproj
+++ b/src/Contract/ARCtrl.Contract.fsproj
@@ -1,24 +1,18 @@
-
-
+
+
netstandard2.0
true
-
-
-
-
-
+
-
-
nfdi4plants, Kevin Frey, Lukas Weil, Kevin Schneider, Oliver Maus
ARC helper functions for contracts management.
@@ -29,6 +23,5 @@
https://github.com/nfdi4plants/ARCtrl
git
-
-
-
+
+
\ No newline at end of file
diff --git a/src/Contract/paket.references b/src/Contract/paket.references
new file mode 100644
index 00000000..2387b156
--- /dev/null
+++ b/src/Contract/paket.references
@@ -0,0 +1,2 @@
+FSharp.Core
+Fable.Core
\ No newline at end of file
diff --git a/src/FileSystem/ARCtrl.FileSystem.fsproj b/src/FileSystem/ARCtrl.FileSystem.fsproj
index 371dd97a..0f4bd397 100644
--- a/src/FileSystem/ARCtrl.FileSystem.fsproj
+++ b/src/FileSystem/ARCtrl.FileSystem.fsproj
@@ -1,28 +1,22 @@
-
-
+
+
netstandard2.0
true
-
+
-
-
-
-
-
-
nfdi4plants, Kevin Frey, Lukas Weil
ARC helper functions for filesystem management.
@@ -33,5 +27,5 @@
https://github.com/nfdi4plants/ARCtrl
git
-
-
+
+
\ No newline at end of file
diff --git a/src/FileSystem/paket.references b/src/FileSystem/paket.references
new file mode 100644
index 00000000..2387b156
--- /dev/null
+++ b/src/FileSystem/paket.references
@@ -0,0 +1,2 @@
+FSharp.Core
+Fable.Core
\ No newline at end of file
diff --git a/src/ISA/ISA.Json/ARCtrl.ISA.Json.fsproj b/src/ISA/ISA.Json/ARCtrl.ISA.Json.fsproj
index 6a9130f0..019010c4 100644
--- a/src/ISA/ISA.Json/ARCtrl.ISA.Json.fsproj
+++ b/src/ISA/ISA.Json/ARCtrl.ISA.Json.fsproj
@@ -1,12 +1,14 @@
-
+
+
netstandard2.0
true
+
- Always
-
+ Always
+
@@ -27,36 +29,28 @@
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
nfdi4plants, Lukas Weil, Florian Wetzels, Kevin Frey
ARC and ISA json compliant parser for experimental metadata toolkit in F#. This project is meant as an easy means to open, manipulate and save ISA (Investigation,Study,Assay) metadata files in isa-json format.
@@ -67,5 +61,5 @@
https://github.com/nfdi4plants/ARCtrl
git
-
+
\ No newline at end of file
diff --git a/src/ISA/ISA.Json/Ontology.fs b/src/ISA/ISA.Json/Ontology.fs
index 74b677fc..43bd68c6 100644
--- a/src/ISA/ISA.Json/Ontology.fs
+++ b/src/ISA/ISA.Json/Ontology.fs
@@ -62,7 +62,7 @@ module OntologySourceReference =
File = get.Optional.Field "file" Decode.string
Name = get.Optional.Field "name" Decode.string
Version = get.Optional.Field "version" Decode.string
- Comments = get.Optional.Field "comments" (Decode.list (Comment.decoder options))
+ Comments = get.Optional.Field "comments" (Decode.array (Comment.decoder options))
}
)
diff --git a/src/ISA/ISA.Json/paket.references b/src/ISA/ISA.Json/paket.references
new file mode 100644
index 00000000..2387b156
--- /dev/null
+++ b/src/ISA/ISA.Json/paket.references
@@ -0,0 +1,2 @@
+FSharp.Core
+Fable.Core
\ No newline at end of file
diff --git a/src/ISA/ISA.Spreadsheet/ARCtrl.ISA.Spreadsheet.fsproj b/src/ISA/ISA.Spreadsheet/ARCtrl.ISA.Spreadsheet.fsproj
index ea580932..a70c4771 100644
--- a/src/ISA/ISA.Spreadsheet/ARCtrl.ISA.Spreadsheet.fsproj
+++ b/src/ISA/ISA.Spreadsheet/ARCtrl.ISA.Spreadsheet.fsproj
@@ -1,15 +1,14 @@
-
-
+
+
netstandard2.0
true
-
-
+
@@ -32,21 +31,13 @@
-
-
-
-
-
-
-
+
-
-
nfdi4plants, Lukas Weil
ARC and ISA xlsx compliant parser for experimental metadata toolkit in F#. This project is meant as an easy means to open, manipulate and save ISA (Investigation,Study,Assay) metadata files in isa-xlsx format.
@@ -57,5 +48,5 @@
https://github.com/nfdi4plants/ARCtrl
git
-
-
+
+
\ No newline at end of file
diff --git a/src/ISA/ISA.Spreadsheet/InvestigationFile/OntologySourceReference.fs b/src/ISA/ISA.Spreadsheet/InvestigationFile/OntologySourceReference.fs
index 1ab4cf3b..651561e1 100644
--- a/src/ISA/ISA.Spreadsheet/InvestigationFile/OntologySourceReference.fs
+++ b/src/ISA/ISA.Spreadsheet/InvestigationFile/OntologySourceReference.fs
@@ -21,12 +21,12 @@ module OntologySourceReference =
(Option.fromValueWithDefault "" file)
(Option.fromValueWithDefault "" name)
(Option.fromValueWithDefault "" version)
- (Option.fromValueWithDefault [] comments)
+ (Option.fromValueWithDefault [||] comments)
let fromSparseTable (matrix : SparseTable) =
if matrix.ColumnCount = 0 && matrix.CommentKeys.Length <> 0 then
let comments = SparseTable.GetEmptyComments matrix
- OntologySourceReference.create(Comments = List.ofArray comments)
+ OntologySourceReference.create(Comments = comments)
|> List.singleton
else
List.init matrix.ColumnCount (fun i ->
@@ -35,6 +35,7 @@ module OntologySourceReference =
matrix.CommentKeys
|> List.map (fun k ->
Comment.fromString k (matrix.TryGetValueDefault("",(k,i))))
+ |> Array.ofList
fromString
(matrix.TryGetValueDefault("",(descriptionLabel,i)))
@@ -59,7 +60,7 @@ module OntologySourceReference =
| None -> ()
| Some c ->
c
- |> List.iter (fun comment ->
+ |> Array.iter (fun comment ->
let n,v = comment |> Comment.toString
commentKeys <- n :: commentKeys
matrix.Matrix.Add((n,i),v)
diff --git a/src/ISA/ISA.Spreadsheet/paket.references b/src/ISA/ISA.Spreadsheet/paket.references
new file mode 100644
index 00000000..d95dfd31
--- /dev/null
+++ b/src/ISA/ISA.Spreadsheet/paket.references
@@ -0,0 +1,3 @@
+FSharp.Core
+Fable.Core
+FsSpreadsheet
\ No newline at end of file
diff --git a/src/ISA/ISA/ARCtrl.ISA.fsproj b/src/ISA/ISA/ARCtrl.ISA.fsproj
index 92aeb74f..d5459a88 100644
--- a/src/ISA/ISA/ARCtrl.ISA.fsproj
+++ b/src/ISA/ISA/ARCtrl.ISA.fsproj
@@ -1,11 +1,11 @@
-
-
+
+
netstandard2.0
true
-
+
@@ -64,23 +64,12 @@
-
-
-
-
-
-
-
-
-
-
-
nfdi4plants, Lukas Weil, Kevin Frey, Kevin Schneider, Oliver Muas
ARC and ISA compliant experimental metadata toolkit in F#. This project is meant as an easy means to open, manipulate and save ISA (Investigation,Study,Assay) metadata files in the dotnet environment.
@@ -89,7 +78,7 @@
ARC F# FSharp dotnet .Net bioinformatics biology fable-library datascience dataplant nfdi metadata investigation study assay ISA Json
https://github.com/nfdi4plants/ARCtrl/tree/main/src/ISA
https://github.com/nfdi4plants/ARCtrl
- git
+ git
-
-
+
+
\ No newline at end of file
diff --git a/src/ISA/ISA/ArcTypes/ArcAssay.fs b/src/ISA/ISA/ArcTypes/ArcAssay.fs
index ae5ab9e5..d21b77b0 100644
--- a/src/ISA/ISA/ArcTypes/ArcAssay.fs
+++ b/src/ISA/ISA/ArcTypes/ArcAssay.fs
@@ -336,18 +336,20 @@ type ArcAssay(identifier: string, ?measurementType : OntologyAnnotation, ?techno
assay
member this.Copy() : ArcAssay =
- let newTables = ResizeArray()
+ let nextTables = ResizeArray()
for table in this.Tables do
let copy = table.Copy()
- newTables.Add(copy)
+ nextTables.Add(copy)
+ let nextComments = this.Comments |> Array.map (fun c -> c.Copy())
+ let nextPerformers = this.Performers |> Array.map (fun c -> c.Copy())
ArcAssay(
this.Identifier,
?measurementType = this.MeasurementType,
?technologyType = this.TechnologyType,
?technologyPlatform = this.TechnologyPlatform,
- tables=newTables,
- performers=this.Performers,
- comments=this.Comments
+ tables=nextTables,
+ performers=nextPerformers,
+ comments=nextComments
)
/// Transform an ArcAssay to an ISA Json Assay.
@@ -386,8 +388,8 @@ type ArcAssay(identifier: string, ?measurementType : OntologyAnnotation, ?techno
| None -> Identifier.createMissingIdentifier()
ArcAssay.create(
identifer,
- ?measurementType = a.MeasurementType,
- ?technologyType = a.TechnologyType,
+ ?measurementType = (a.MeasurementType |> Option.map (fun x -> x.Copy())),
+ ?technologyType = (a.TechnologyType |> Option.map (fun x -> x.Copy())),
?technologyPlatform = a.TechnologyPlatform,
?tables = tables,
?comments = (a.Comments |> Option.map Array.ofList)
diff --git a/src/ISA/ISA/ArcTypes/ArcInvestigation.fs b/src/ISA/ISA/ArcTypes/ArcInvestigation.fs
index 48f08876..e4837e84 100644
--- a/src/ISA/ISA/ArcTypes/ArcInvestigation.fs
+++ b/src/ISA/ISA/ArcTypes/ArcInvestigation.fs
@@ -247,22 +247,27 @@ type ArcInvestigation(identifier : string, ?title : string, ?description : strin
// )
member this.Copy() : ArcInvestigation =
- let newStudies = ResizeArray()
+ let nextStudies = ResizeArray()
for study in this.Studies do
let copy = study.Copy()
- newStudies.Add(copy)
+ nextStudies.Add(copy)
+ let nextComments = this.Comments |> Array.map (fun c -> c.Copy())
+ let nextRemarks = this.Remarks |> Array.map (fun c -> c.Copy())
+ let nextContacts = this.Contacts |> Array.map (fun c -> c.Copy())
+ let nextPublications = this.Publications |> Array.map (fun c -> c.Copy())
+ let nextOntologySourceReferences = this.OntologySourceReferences |> Array.map (fun c -> c.Copy())
ArcInvestigation(
this.Identifier,
?title = this.Title,
?description = this.Description,
?submissionDate = this.SubmissionDate,
?publicReleaseDate = this.PublicReleaseDate,
- ontologySourceReferences = this.OntologySourceReferences,
- publications = this.Publications,
- contacts = this.Contacts,
- studies = newStudies, // correct mutable behaviour is tested on this field
- comments = this.Comments,
- remarks = this.Remarks
+ ontologySourceReferences = nextOntologySourceReferences,
+ publications = nextPublications,
+ contacts = nextContacts,
+ studies = nextStudies, // correct mutable behaviour is tested on this field
+ comments = nextComments,
+ remarks = nextRemarks
)
diff --git a/src/ISA/ISA/ArcTypes/ArcStudy.fs b/src/ISA/ISA/ArcTypes/ArcStudy.fs
index cafe313d..98483dd9 100644
--- a/src/ISA/ISA/ArcTypes/ArcStudy.fs
+++ b/src/ISA/ISA/ArcTypes/ArcStudy.fs
@@ -452,27 +452,32 @@ type ArcStudy(identifier : string, ?title, ?description, ?submissionDate, ?publi
newAssay.GetRow(tableName, rowIndex)
member this.Copy() : ArcStudy =
- let newTables = ResizeArray()
- let newAssays = ResizeArray()
+ let nextTables = ResizeArray()
+ let nextAssays = ResizeArray()
for table in this.Tables do
let copy = table.Copy()
- newTables.Add(copy)
+ nextTables.Add(copy)
for study in this.Assays do
let copy = study.Copy()
- newAssays.Add(copy)
+ nextAssays.Add(copy)
+ let nextComments = this.Comments |> Array.map (fun c -> c.Copy())
+ let nextFactors = this.Factors |> Array.map (fun c -> c.Copy())
+ let nextContacts = this.Contacts |> Array.map (fun c -> c.Copy())
+ let nextPublications = this.Publications |> Array.map (fun c -> c.Copy())
+ let nextStudyDesignDescriptors = this.StudyDesignDescriptors |> Array.map (fun c -> c.Copy())
ArcStudy(
this.Identifier,
?title = this.Title,
?description = this.Description,
- ?submissionDate = submissionDate,
+ ?submissionDate = this.SubmissionDate,
?publicReleaseDate = this.PublicReleaseDate,
- publications = this.Publications,
- contacts = this.Contacts,
- studyDesignDescriptors = this.StudyDesignDescriptors,
- tables = newTables,
- assays = newAssays,
- factors = this.Factors,
- comments = this.Comments
+ publications = nextPublications,
+ contacts = nextContacts,
+ studyDesignDescriptors = nextStudyDesignDescriptors,
+ tables = nextTables,
+ assays = nextAssays,
+ factors = nextFactors,
+ comments = nextComments
)
/// Transform an ArcStudy to an ISA Json Study.
diff --git a/src/ISA/ISA/JsonTypes/Comment.fs b/src/ISA/ISA/JsonTypes/Comment.fs
index 29916e07..69651133 100644
--- a/src/ISA/ISA/JsonTypes/Comment.fs
+++ b/src/ISA/ISA/JsonTypes/Comment.fs
@@ -2,6 +2,9 @@ namespace ARCtrl.ISA
type EMail = string
+open Fable.Core
+
+[]
type Comment =
{
ID : URI option
@@ -25,8 +28,11 @@ type Comment =
static member toString (comment : Comment) =
Option.defaultValue "" comment.Name, Option.defaultValue "" comment.Value
+ member this.Copy() =
+ Comment.make this.ID this.Name this.Value
+[]
type Remark =
{
Line : int
@@ -43,4 +49,7 @@ type Remark =
Remark.make line value
static member toTuple (remark : Remark ) =
- remark.Line, remark.Value
\ No newline at end of file
+ remark.Line, remark.Value
+
+ member this.Copy() =
+ Remark.make this.Line this.Value
\ No newline at end of file
diff --git a/src/ISA/ISA/JsonTypes/Factor.fs b/src/ISA/ISA/JsonTypes/Factor.fs
index e7b96383..571fd990 100644
--- a/src/ISA/ISA/JsonTypes/Factor.fs
+++ b/src/ISA/ISA/JsonTypes/Factor.fs
@@ -2,7 +2,9 @@ namespace ARCtrl.ISA
open ARCtrl.ISA.Aux
open Update
+open Fable.Core
+[]
type Factor =
{
ID : URI option
@@ -113,7 +115,10 @@ type Factor =
static member getNameAsString (f : Factor) =
f.NameText
-
/// Returns true if the given name matches the name of the factor
static member nameEqualsString (name : string) (f : Factor) =
f.NameText = name
+
+ member this.Copy() =
+ let nextComments = this.Comments |> Option.map (Array.map (fun c -> c.Copy()))
+ Factor.make this.ID this.Name this.FactorType nextComments
diff --git a/src/ISA/ISA/JsonTypes/OntologyAnnotation.fs b/src/ISA/ISA/JsonTypes/OntologyAnnotation.fs
index e34e6876..e3a5bec5 100644
--- a/src/ISA/ISA/JsonTypes/OntologyAnnotation.fs
+++ b/src/ISA/ISA/JsonTypes/OntologyAnnotation.fs
@@ -2,8 +2,10 @@ namespace ARCtrl.ISA
open ARCtrl.ISA.Aux
open Update
+open Fable.Core
[]
+[]
type OntologyAnnotation =
{
ID : URI option
@@ -228,4 +230,8 @@ type OntologyAnnotation =
/// Replaces comments of a ontology annotation by given comment list
static member setComments (annotation : OntologyAnnotation) (comments : Comment []) =
{ annotation with
- Comments = Some comments }
\ No newline at end of file
+ Comments = Some comments }
+
+ member this.Copy() =
+ let nextComments = this.Comments |> Option.map (Array.map (fun c -> c.Copy()))
+ OntologyAnnotation.make this.ID this.Name this.TermSourceREF this.LocalID this.TermAccessionNumber nextComments
\ No newline at end of file
diff --git a/src/ISA/ISA/JsonTypes/OntologySourceReference.fs b/src/ISA/ISA/JsonTypes/OntologySourceReference.fs
index 3718d098..43f3fc28 100644
--- a/src/ISA/ISA/JsonTypes/OntologySourceReference.fs
+++ b/src/ISA/ISA/JsonTypes/OntologySourceReference.fs
@@ -2,14 +2,16 @@
open ARCtrl.ISA.Aux
open Update
+open Fable.Core
+[]
type OntologySourceReference =
{
Description : string option
File : string option
Name : string option
Version : string option
- Comments : Comment list option
+ Comments : Comment [] option
}
static member make description file name version comments =
@@ -62,11 +64,15 @@ type OntologySourceReference =
ontology.Comments
/// Applies function f on comments in ontology source ref
- static member mapComments (f : Comment list -> Comment list) (ontology : OntologySourceReference) =
+ static member mapComments (f : Comment [] -> Comment []) (ontology : OntologySourceReference) =
{ ontology with
- Comments = Option.mapDefault [] f ontology.Comments}
+ Comments = Option.mapDefault [||] f ontology.Comments}
/// Replaces comments in ontology source ref by given comment list
- static member setComments (ontology : OntologySourceReference) (comments : Comment list) =
+ static member setComments (ontology : OntologySourceReference) (comments : Comment []) =
{ ontology with
- Comments = Some comments }
\ No newline at end of file
+ Comments = Some comments }
+
+ member this.Copy() =
+ let nextComments = this.Comments |> Option.map (Array.map (fun c -> c.Copy()))
+ OntologySourceReference.make this.Description this.File this.Name this.Version nextComments
\ No newline at end of file
diff --git a/src/ISA/ISA/JsonTypes/Person.fs b/src/ISA/ISA/JsonTypes/Person.fs
index f04019e2..df021fc2 100644
--- a/src/ISA/ISA/JsonTypes/Person.fs
+++ b/src/ISA/ISA/JsonTypes/Person.fs
@@ -2,7 +2,9 @@ namespace ARCtrl.ISA
open ARCtrl.ISA.Aux
open Update
+open Fable.Core
+[]
type Person =
{
ID : URI option
@@ -127,3 +129,18 @@ type Person =
{ person with
Comments = Some comments }
+ member this.Copy() : Person =
+ let nextComments = this.Comments |> Option.map (Array.map (fun c -> c.Copy()))
+ let nextRoles = this.Roles |> Option.map (Array.map (fun c -> c.Copy()))
+ Person.make
+ this.ID
+ this.LastName
+ this.FirstName
+ this.MidInitials
+ this.EMail
+ this.Phone
+ this.Fax
+ this.Address
+ this.Affiliation
+ nextRoles
+ nextComments
diff --git a/src/ISA/ISA/JsonTypes/Publication.fs b/src/ISA/ISA/JsonTypes/Publication.fs
index 0745a5ab..9408f2df 100644
--- a/src/ISA/ISA/JsonTypes/Publication.fs
+++ b/src/ISA/ISA/JsonTypes/Publication.fs
@@ -2,7 +2,9 @@ namespace ARCtrl.ISA
open ARCtrl.ISA.Aux
open Update
+open Fable.Core
+[]
type Publication =
{
PubMedID : URI option
@@ -101,3 +103,10 @@ type Publication =
static member setComments (publication : Publication) (comments : Comment []) =
{ publication with
Comments = Some comments }
+
+
+ //
+
+ member this.Copy() =
+ let nextComments = this.Comments |> Option.map (Array.map (fun c -> c.Copy()))
+ Publication.make this.PubMedID this.DOI this.Authors this.Title this.Status nextComments
\ No newline at end of file
diff --git a/src/ISA/ISA/paket.references b/src/ISA/ISA/paket.references
new file mode 100644
index 00000000..2387b156
--- /dev/null
+++ b/src/ISA/ISA/paket.references
@@ -0,0 +1,2 @@
+FSharp.Core
+Fable.Core
\ No newline at end of file
diff --git a/tests/ARCtrl/ARCtrl.Tests.fsproj b/tests/ARCtrl/ARCtrl.Tests.fsproj
index ab8b3d65..afca3aaa 100644
--- a/tests/ARCtrl/ARCtrl.Tests.fsproj
+++ b/tests/ARCtrl/ARCtrl.Tests.fsproj
@@ -1,26 +1,18 @@
-
-
+
+
Exe
net6.0
false
-
+
-
-
-
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/tests/ARCtrl/paket.references b/tests/ARCtrl/paket.references
new file mode 100644
index 00000000..2561dfaa
--- /dev/null
+++ b/tests/ARCtrl/paket.references
@@ -0,0 +1,6 @@
+FSharp.Core
+Fable.Core
+Expecto
+Fable.Mocha
+Microsoft.NET.Test.Sdk
+YoloDev.Expecto.TestSdk
\ No newline at end of file
diff --git a/tests/FileSystem/FileSystem.Tests.fsproj b/tests/FileSystem/FileSystem.Tests.fsproj
new file mode 100644
index 00000000..013ed572
--- /dev/null
+++ b/tests/FileSystem/FileSystem.Tests.fsproj
@@ -0,0 +1,18 @@
+
+
+
+ Exe
+ net6.0
+ false
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FileSystem/FileSystem.Tests/FileSystem.Tests.fsproj b/tests/FileSystem/FileSystem.Tests/FileSystem.Tests.fsproj
deleted file mode 100644
index 2685a07e..00000000
--- a/tests/FileSystem/FileSystem.Tests/FileSystem.Tests.fsproj
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- Exe
- net6.0
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/FileSystem/FileSystem.Tests/FileSystemTree.Tests.fs b/tests/FileSystem/FileSystemTree.Tests.fs
similarity index 100%
rename from tests/FileSystem/FileSystem.Tests/FileSystemTree.Tests.fs
rename to tests/FileSystem/FileSystemTree.Tests.fs
diff --git a/tests/FileSystem/FileSystem.Tests/Main.fs b/tests/FileSystem/Main.fs
similarity index 100%
rename from tests/FileSystem/FileSystem.Tests/Main.fs
rename to tests/FileSystem/Main.fs
diff --git a/tests/FileSystem/FileSystem.Tests/Utils.fs b/tests/FileSystem/Utils.fs
similarity index 100%
rename from tests/FileSystem/FileSystem.Tests/Utils.fs
rename to tests/FileSystem/Utils.fs
diff --git a/tests/FileSystem/paket.references b/tests/FileSystem/paket.references
new file mode 100644
index 00000000..2561dfaa
--- /dev/null
+++ b/tests/FileSystem/paket.references
@@ -0,0 +1,6 @@
+FSharp.Core
+Fable.Core
+Expecto
+Fable.Mocha
+Microsoft.NET.Test.Sdk
+YoloDev.Expecto.TestSdk
\ No newline at end of file
diff --git a/tests/ISA/ISA.Json.Tests/ISA.Json.Tests.fsproj b/tests/ISA/ISA.Json.Tests/ISA.Json.Tests.fsproj
index 504210c1..78e9bcd5 100644
--- a/tests/ISA/ISA.Json.Tests/ISA.Json.Tests.fsproj
+++ b/tests/ISA/ISA.Json.Tests/ISA.Json.Tests.fsproj
@@ -1,12 +1,12 @@
-
-
+
+
Exe
net6.0
false
-
+
@@ -21,18 +21,8 @@
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/tests/ISA/ISA.Json.Tests/Json.Tests.fs b/tests/ISA/ISA.Json.Tests/Json.Tests.fs
index a910da96..05d21258 100644
--- a/tests/ISA/ISA.Json.Tests/Json.Tests.fs
+++ b/tests/ISA/ISA.Json.Tests/Json.Tests.fs
@@ -1235,7 +1235,7 @@ let testInvestigationFile =
(Some "filePath.txt")
(Some "OO")
(Some "1.3.3")
- (Some [comment])
+ (Some [|comment|])
let publicationStatus =
OntologyAnnotation.make
@@ -1671,7 +1671,7 @@ let testInvestigationFileLD =
(Some "filePath.txt")
(Some "OO")
(Some "1.3.3")
- (Some [comment])
+ (Some [|comment|])
let publicationStatus =
OntologyAnnotation.make
diff --git a/tests/ISA/ISA.Json.Tests/paket.references b/tests/ISA/ISA.Json.Tests/paket.references
new file mode 100644
index 00000000..2561dfaa
--- /dev/null
+++ b/tests/ISA/ISA.Json.Tests/paket.references
@@ -0,0 +1,6 @@
+FSharp.Core
+Fable.Core
+Expecto
+Fable.Mocha
+Microsoft.NET.Test.Sdk
+YoloDev.Expecto.TestSdk
\ No newline at end of file
diff --git a/tests/ISA/ISA.Spreadsheet.Tests/ISA.Spreadsheet.Tests.fsproj b/tests/ISA/ISA.Spreadsheet.Tests/ISA.Spreadsheet.Tests.fsproj
index f25b614a..a3e59a30 100644
--- a/tests/ISA/ISA.Spreadsheet.Tests/ISA.Spreadsheet.Tests.fsproj
+++ b/tests/ISA/ISA.Spreadsheet.Tests/ISA.Spreadsheet.Tests.fsproj
@@ -1,12 +1,12 @@
-
-
+
+
Exe
net6.0
false
-
+
@@ -25,14 +25,8 @@
-
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/tests/ISA/ISA.Spreadsheet.Tests/paket.references b/tests/ISA/ISA.Spreadsheet.Tests/paket.references
new file mode 100644
index 00000000..2561dfaa
--- /dev/null
+++ b/tests/ISA/ISA.Spreadsheet.Tests/paket.references
@@ -0,0 +1,6 @@
+FSharp.Core
+Fable.Core
+Expecto
+Fable.Mocha
+Microsoft.NET.Test.Sdk
+YoloDev.Expecto.TestSdk
\ No newline at end of file
diff --git a/tests/ISA/ISA.Tests/ISA.Tests.fsproj b/tests/ISA/ISA.Tests/ISA.Tests.fsproj
index ce704485..1cb3d262 100644
--- a/tests/ISA/ISA.Tests/ISA.Tests.fsproj
+++ b/tests/ISA/ISA.Tests/ISA.Tests.fsproj
@@ -1,16 +1,15 @@
-
+
+
Exe
net6.0
false
-
-
-
-
+
+
@@ -25,15 +24,9 @@
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/tests/ISA/ISA.Tests/Main.fs b/tests/ISA/ISA.Tests/Main.fs
index 86157087..b821bcec 100644
--- a/tests/ISA/ISA.Tests/Main.fs
+++ b/tests/ISA/ISA.Tests/Main.fs
@@ -11,6 +11,7 @@ let all = testSequenced <| testList "All" [
Update.Tests.main
DataModel.Tests.main
Regex.Tests.main
+ Person.Tests.main
CompositeHeader.Tests.main
CompositeCell.Tests.main
CompositeColumn.Tests.main
diff --git a/tests/ISA/ISA.Tests/Person.Tests.fs b/tests/ISA/ISA.Tests/Person.Tests.fs
new file mode 100644
index 00000000..3efac474
--- /dev/null
+++ b/tests/ISA/ISA.Tests/Person.Tests.fs
@@ -0,0 +1,27 @@
+module Person.Tests
+
+open ARCtrl.ISA
+
+#if FABLE_COMPILER
+open Fable.Mocha
+#else
+open Expecto
+#endif
+
+let private createTestPerson() = Person.create(FirstName="Kevin", LastName="Frey",Email="MyAwesomeMail@Awesome.mail")
+
+let private tests_Copy = testList "Copy" [
+ testCase "test copy" <| fun _ ->
+ // this test is silly in dotnet as record types are immutable. Test this in js native too!
+ let person = createTestPerson()
+ Expect.equal person.FirstName (Some "Kevin") "firstname"
+ let copy = person.Copy()
+ let changedPerson = {person with FirstName = Some "DefNotKevin"}
+ Expect.equal copy.FirstName (Some "Kevin") "copy firstname"
+ Expect.equal changedPerson.FirstName (Some "DefNotKevin") "changedPerson firstname"
+]
+
+let main =
+ testList "Person" [
+ tests_Copy
+ ]
\ No newline at end of file
diff --git a/tests/ISA/ISA.Tests/paket.references b/tests/ISA/ISA.Tests/paket.references
new file mode 100644
index 00000000..2561dfaa
--- /dev/null
+++ b/tests/ISA/ISA.Tests/paket.references
@@ -0,0 +1,6 @@
+FSharp.Core
+Fable.Core
+Expecto
+Fable.Mocha
+Microsoft.NET.Test.Sdk
+YoloDev.Expecto.TestSdk
\ No newline at end of file
diff --git a/tests/JavaScript/ISA.Person.js b/tests/JavaScript/ISA.Person.js
new file mode 100644
index 00000000..25fadc2f
--- /dev/null
+++ b/tests/JavaScript/ISA.Person.js
@@ -0,0 +1,28 @@
+import { equal, deepEqual } from 'assert';
+import { Person } from "./ARCtrl/ISA/ISA/JsonTypes/Person.js";
+import { Comment$ as Comment } from "./ARCtrl/ISA/ISA/JsonTypes/Comment.js";
+
+describe('ISA.Person', function () {
+ describe('copy', function () {
+ it('check mutable', function () {
+ const person = Person.create(void 0, "Frey", "Kevin", void 0, "MyAwesomeMail@Awesome.mail");
+ const copy = person.Copy()
+ equal(person.FirstName, "Kevin");
+ equal(copy.FirstName, "Kevin");
+ person.FirstName = "NotKevin"
+ equal(person.FirstName, "NotKevin");
+ equal(copy.FirstName, "Kevin");
+ });
+ it('check nested mutable', function(){
+ const comment = Comment.fromString("TestKey", "TestValue")
+ const person = Person.create(void 0, "Frey", "Kevin", void 0, "MyAwesomeMail@Awesome.mail", void 0, void 0, void 0, void 0, void 0, [comment]);
+ const copy = person.Copy()
+ equal(person.Comments.length,1)
+ deepEqual(person.Comments,copy.Comments, "Should be same")
+ person.Comments[0].Name = "NewTestName"
+ let expectedComment = Comment.fromString("NewTestName", "TestValue")
+ deepEqual(person.Comments[0], expectedComment,"Should be new comment")
+ deepEqual(copy.Comments[0], Comment.fromString("TestKey", "TestValue"), "should be original comment")
+ })
+ });
+});
\ No newline at end of file
diff --git a/ts/ARCtrl.ts b/ts/ARCtrl.ts
deleted file mode 100644
index a04516ee..00000000
--- a/ts/ARCtrl.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import { tryFind, exactlyOne, choose, map } from "./fable_modules/fable-library-ts/Array.js";
-import { fromFsWorkbook } from "./ISA/ISA.Spreadsheet/ArcAssay.js";
-import { FsWorkbook } from "./fable_modules/FsSpreadsheet.3.1.1/FsWorkbook.fs.js";
-import { ArcAssay } from "./ISA/ISA/ArcTypes/ArcAssay.js";
-import { tryFromContract } from "./Contracts/Contracts.ArcAssay.js";
-import { Contract } from "./Contract/Contract.js";
-import { defaultArg, value, Option } from "./fable_modules/fable-library-ts/Option.js";
-import { fromFsWorkbook as fromFsWorkbook_1 } from "./ISA/ISA.Spreadsheet/ArcStudy.js";
-import { ArcStudy } from "./ISA/ISA/ArcTypes/ArcStudy.js";
-import { tryFromContract as tryFromContract_1 } from "./Contracts/Contracts.ArcStudy.js";
-import { fromFsWorkbook as fromFsWorkbook_2 } from "./ISA/ISA.Spreadsheet/InvestigationFile/Investigation.js";
-import { tryFromContract as tryFromContract_2 } from "./Contracts/Contracts.ArcInvestigation.js";
-import { ArcInvestigation_$reflection, ArcInvestigation } from "./ISA/ISA/ArcTypes/ArcInvestigation.js";
-import { FileSystem_$reflection, FileSystem as FileSystem_1 } from "./FileSystem/FileSystem.js";
-import { tryISAReadContractFromPath } from "./Contracts/Contracts.ARCtrl.js";
-import { iterate } from "./fable_modules/fable-library-ts/Seq.js";
-import { printf, toConsole } from "./fable_modules/fable-library-ts/String.js";
-import { Record } from "./fable_modules/fable-library-ts/Types.js";
-import { IEquatable } from "./fable_modules/fable-library-ts/Util.js";
-import { record_type, unit_type, option_type, TypeInfo } from "./fable_modules/fable-library-ts/Reflection.js";
-
-export function ARCAux_getArcAssaysFromContracts(contracts: Contract[]): ArcAssay[] {
- return map(fromFsWorkbook, choose(tryFromContract, contracts));
-}
-
-export function ARCAux_getArcStudiesFromContracts(contracts: Contract[]): ArcStudy[] {
- return map(fromFsWorkbook_1, choose(tryFromContract_1, contracts));
-}
-
-export function ARCAux_getArcInvestigationFromContracts(contracts: Contract[]): ArcInvestigation {
- return fromFsWorkbook_2(exactlyOne(choose(tryFromContract_2, contracts)));
-}
-
-export class ARC extends Record implements IEquatable {
- readonly ISA: Option;
- readonly CWL: Option;
- readonly FileSystem: Option;
- constructor(ISA: Option, CWL: Option, FileSystem: Option) {
- super();
- this.ISA = ISA;
- this.CWL = CWL;
- this.FileSystem = FileSystem;
- }
- static create(isa?: ArcInvestigation, cwl?: Option, fs?: FileSystem_1): ARC {
- return new ARC(isa, cwl, fs);
- }
- static fromFilePaths(filePaths: string[]): ARC {
- const fs: FileSystem_1 = FileSystem_1.fromFilePaths(filePaths);
- return ARC.create(void 0, void 0, fs);
- }
- addFSFromFilePaths(filePaths: string[]): ARC {
- const this$: ARC = this;
- return new ARC(this$.ISA, this$.CWL, FileSystem_1.fromFilePaths(filePaths));
- }
- getReadContracts(): Contract[] {
- const this$: ARC = this;
- const matchValue: Option = this$.FileSystem;
- if (matchValue == null) {
- throw new Error("Cannot create READ contracts from ARC without FileSystem.\r\n\r\nYou could initialized your ARC with `ARC.fromFilePaths` or run `yourArc.addFSFromFilePaths` to avoid this issue.");
- }
- else {
- const fs: FileSystem_1 = value(matchValue);
- return choose(tryISAReadContractFromPath, fs.Tree.ToFilePaths());
- }
- }
- addISAFromContracts(contracts: Contract[], enableLogging?: boolean): ARC {
- const this$: ARC = this;
- const enableLogging_1: boolean = defaultArg(enableLogging, false);
- const investigation: ArcInvestigation = ARCAux_getArcInvestigationFromContracts(contracts);
- const studies: ArcStudy[] = ARCAux_getArcStudiesFromContracts(contracts);
- const assays: ArcAssay[] = ARCAux_getArcAssaysFromContracts(contracts);
- const copy: ArcInvestigation = investigation.Copy();
- iterate((studyRegisteredIdent: string): void => {
- const studyOpt: Option = tryFind((s: ArcStudy): boolean => (s.Identifier === studyRegisteredIdent), studies);
- if (studyOpt == null) {
- if (enableLogging_1) {
- toConsole(printf("Unable to find registered study \'%s\' in fullfilled READ contracts!"))(studyRegisteredIdent);
- }
- }
- else {
- const study: ArcStudy = value(studyOpt);
- if (enableLogging_1) {
- toConsole(printf("Found study: %s"))(studyRegisteredIdent);
- }
- iterate((assayRegisteredIdent: string): void => {
- const assayOpt: Option = tryFind((a: ArcAssay): boolean => (a.Identifier === assayRegisteredIdent), assays);
- if (assayOpt == null) {
- if (enableLogging_1) {
- toConsole(printf("Unable to find registered assay \'%s\' in fullfilled READ contracts!"))(assayRegisteredIdent);
- }
- }
- else {
- const assay: ArcAssay = value(assayOpt);
- if (enableLogging_1) {
- toConsole(printf("Found assay: %s - %s"))(studyRegisteredIdent)(assayRegisteredIdent);
- }
- study.AddAssay(assay);
- }
- }, copy.GetStudy(studyRegisteredIdent).AssayIdentifiers);
- investigation.SetStudy(studyRegisteredIdent, study);
- }
- }, copy.StudyIdentifiers);
- return new ARC(investigation, this$.CWL, this$.FileSystem);
- }
-}
-
-export function ARC_$reflection(): TypeInfo {
- return record_type("ARCtrl.ARC", [], ARC, () => [["ISA", option_type(ArcInvestigation_$reflection())], ["CWL", option_type(unit_type)], ["FileSystem", option_type(FileSystem_$reflection())]]);
-}
-
diff --git a/ts/Contract/Contract.ts b/ts/Contract/Contract.ts
deleted file mode 100644
index 7a9b01b6..00000000
--- a/ts/Contract/Contract.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { Record } from "../fable_modules/fable-library-ts/Types.js";
-import { IComparable, IEquatable } from "../fable_modules/fable-library-ts/Util.js";
-import { class_type, option_type, record_type, array_type, string_type, TypeInfo } from "../fable_modules/fable-library-ts/Reflection.js";
-import { FsWorkbook } from "../fable_modules/FsSpreadsheet.3.1.1/FsWorkbook.fs.js";
-import { Option, defaultArg } from "../fable_modules/fable-library-ts/Option.js";
-
-export type DTOType =
- | "ISA_Assay"
- | "ISA_Study"
- | "ISA_Investigation"
- | "JSON"
- | "Markdown"
- | "CWL"
- | "PlainText"
- | "Cli"
-
-export class CLITool extends Record implements IEquatable, IComparable {
- readonly Name: string;
- readonly Arguments: string[];
- constructor(Name: string, Arguments: string[]) {
- super();
- this.Name = Name;
- this.Arguments = Arguments;
- }
- static create(name: string, arguments$: string[]): CLITool {
- return new CLITool(name, arguments$);
- }
-}
-
-export function CLITool_$reflection(): TypeInfo {
- return record_type("Contract.CLITool", [], CLITool, () => [["Name", string_type], ["Arguments", array_type(string_type)]]);
-}
-
-export type DTO =
- | FsWorkbook
- | string
- | CLITool
-
-export type Operation =
- | "CREATE"
- | "UPDATE"
- | "DELETE"
- | "READ"
- | "EXECUTE"
-
-export class Contract extends Record implements IEquatable {
- readonly Operation: Operation;
- readonly Path: string;
- readonly DTOType: Option;
- readonly DTO: Option;
- constructor(Operation: Operation, Path: string, DTOType: Option, DTO: Option) {
- super();
- this.Operation = Operation;
- this.Path = Path;
- this.DTOType = DTOType;
- this.DTO = DTO;
- }
- static create(op: Operation, path: string, { dtoType, dto }: {dtoType?: DTOType, dto?: DTO }): Contract {
- return new Contract(op, path, dtoType, dto);
- }
- static createCreate(path: string, dtoType: DTOType, dto: DTO): Contract {
- return new Contract("CREATE", path, dtoType, dto);
- }
- static createUpdate(path: string, dtoType: DTOType, dto: DTO): Contract {
- return new Contract("UPDATE", path, dtoType, dto);
- }
- static createDelete(path: string): Contract {
- return new Contract("DELETE", path, void 0, void 0);
- }
- static createRead(path: string, dtoType: DTOType): Contract {
- return new Contract("READ", path, dtoType, void 0);
- }
- static createExecute(dto: CLITool, { path }: {path?: string }): Contract {
- return new Contract("EXECUTE", defaultArg(path, ""), "Cli", dto);
- }
-}
-
-export function Contract_$reflection(): TypeInfo {
- return record_type("Contract.Contract", [], Contract, () => [["Operation", string_type], ["Path", string_type], ["DTOType", option_type(string_type)], ["DTO", option_type(class_type("Contract.DTO"))]]);
-}
-
diff --git a/ts/Contracts/Contracts.ARCtrl.ts b/ts/Contracts/Contracts.ARCtrl.ts
deleted file mode 100644
index 9dd9a144..00000000
--- a/ts/Contracts/Contracts.ARCtrl.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { split as split_1 } from "../FileSystem/Path.js";
-import { $007CInvestigationPath$007C_$007C } from "./Contracts.ArcInvestigation.js";
-import { value, Option } from "../fable_modules/fable-library-ts/Option.js";
-import { Contract } from "../Contract/Contract.js";
-import { $007CAssayPath$007C_$007C } from "./Contracts.ArcAssay.js";
-import { $007CStudyPath$007C_$007C } from "./Contracts.ArcStudy.js";
-
-/**
- * Tries to create READ contract with DTOType = ISA_Assay, ISA_Study or ISA_Investigation from given path relative to ARC root.
- */
-export function tryISAReadContractFromPath(path: string): Option {
- const split: string[] = split_1(path);
- const activePatternResult: Option = $007CInvestigationPath$007C_$007C(split);
- if (activePatternResult != null) {
- const p: string = value(activePatternResult);
- return Contract.createRead(p, "ISA_Investigation");
- }
- else {
- const activePatternResult_1: Option = $007CAssayPath$007C_$007C(split);
- if (activePatternResult_1 != null) {
- const p_1: string = value(activePatternResult_1);
- return Contract.createRead(p_1, "ISA_Assay");
- }
- else {
- const activePatternResult_2: Option = $007CStudyPath$007C_$007C(split);
- if (activePatternResult_2 != null) {
- const p_2: string = value(activePatternResult_2);
- return Contract.createRead(p_2, "ISA_Study");
- }
- else {
- return void 0;
- }
- }
- }
-}
-
diff --git a/ts/Contracts/Contracts.ArcAssay.ts b/ts/Contracts/Contracts.ArcAssay.ts
deleted file mode 100644
index f812817d..00000000
--- a/ts/Contracts/Contracts.ArcAssay.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { int32 } from "../fable_modules/fable-library-ts/Int32.js";
-import { FsWorkbook } from "../fable_modules/FsSpreadsheet.3.1.1/FsWorkbook.fs.js";
-import { Option, value } from "../fable_modules/fable-library-ts/Option.js";
-import { Contract } from "../Contract/Contract.js";
-import { combineMany } from "../FileSystem/Path.js";
-import { equalsWith } from "../fable_modules/fable-library-ts/Array.js";
-import { defaultOf } from "../fable_modules/fable-library-ts/Util.js";
-
-export function tryFromContract(c: Contract): Option {
- let matchResult: int32, fsworkbook: FsWorkbook;
- if (c.Operation === "READ") {
- if (c.DTOType != null) {
- if (value(c.DTOType) === "ISA_Assay") {
- if (c.DTO != null) {
- if (value(c.DTO) instanceof FsWorkbook) {
- matchResult = 0;
- fsworkbook = value(c.DTO);
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return fsworkbook!;
- default:
- return void 0;
- }
-}
-
-export function $007CAssayPath$007C_$007C(input: string[]): Option {
- let matchResult: int32;
- if (!equalsWith((x: string, y: string): boolean => (x === y), input, defaultOf()) && (input.length === 3)) {
- if (input[0] === "assays") {
- if (input[2] === "isa.assay.xlsx") {
- matchResult = 0;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0: {
- const anyAssayName: string = input[1];
- return combineMany(input);
- }
- default:
- return void 0;
- }
-}
-
diff --git a/ts/Contracts/Contracts.ArcInvestigation.ts b/ts/Contracts/Contracts.ArcInvestigation.ts
deleted file mode 100644
index 42bd5134..00000000
--- a/ts/Contracts/Contracts.ArcInvestigation.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { int32 } from "../fable_modules/fable-library-ts/Int32.js";
-import { FsWorkbook } from "../fable_modules/FsSpreadsheet.3.1.1/FsWorkbook.fs.js";
-import { Option, value } from "../fable_modules/fable-library-ts/Option.js";
-import { Contract } from "../Contract/Contract.js";
-import { combineMany } from "../FileSystem/Path.js";
-import { equalsWith } from "../fable_modules/fable-library-ts/Array.js";
-import { defaultOf } from "../fable_modules/fable-library-ts/Util.js";
-
-export function tryFromContract(c: Contract): Option {
- let matchResult: int32, fsworkbook: FsWorkbook;
- if (c.Operation === "READ") {
- if (c.DTOType != null) {
- if (value(c.DTOType) === "ISA_Investigation") {
- if (c.DTO != null) {
- if (value(c.DTO) instanceof FsWorkbook) {
- matchResult = 0;
- fsworkbook = value(c.DTO);
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return fsworkbook!;
- default:
- return void 0;
- }
-}
-
-export function $007CInvestigationPath$007C_$007C(input: string[]): Option {
- let matchResult: int32;
- if (!equalsWith((x: string, y: string): boolean => (x === y), input, defaultOf()) && (input.length === 1)) {
- if (input[0] === "isa.investigation.xlsx") {
- matchResult = 0;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return combineMany(input);
- default:
- return void 0;
- }
-}
-
diff --git a/ts/Contracts/Contracts.ArcStudy.ts b/ts/Contracts/Contracts.ArcStudy.ts
deleted file mode 100644
index fce0706b..00000000
--- a/ts/Contracts/Contracts.ArcStudy.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { int32 } from "../fable_modules/fable-library-ts/Int32.js";
-import { FsWorkbook } from "../fable_modules/FsSpreadsheet.3.1.1/FsWorkbook.fs.js";
-import { Option, value } from "../fable_modules/fable-library-ts/Option.js";
-import { Contract } from "../Contract/Contract.js";
-import { combineMany } from "../FileSystem/Path.js";
-import { equalsWith } from "../fable_modules/fable-library-ts/Array.js";
-import { defaultOf } from "../fable_modules/fable-library-ts/Util.js";
-
-export function tryFromContract(c: Contract): Option {
- let matchResult: int32, fsworkbook: FsWorkbook;
- if (c.Operation === "READ") {
- if (c.DTOType != null) {
- if (value(c.DTOType) === "ISA_Study") {
- if (c.DTO != null) {
- if (value(c.DTO) instanceof FsWorkbook) {
- matchResult = 0;
- fsworkbook = value(c.DTO);
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0:
- return fsworkbook!;
- default:
- return void 0;
- }
-}
-
-export function $007CStudyPath$007C_$007C(input: string[]): Option {
- let matchResult: int32;
- if (!equalsWith((x: string, y: string): boolean => (x === y), input, defaultOf()) && (input.length === 3)) {
- if (input[0] === "studies") {
- if (input[2] === "isa.study.xlsx") {
- matchResult = 0;
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- }
- else {
- matchResult = 1;
- }
- switch (matchResult) {
- case 0: {
- const anyStudyName: string = input[1];
- return combineMany(input);
- }
- default:
- return void 0;
- }
-}
-
diff --git a/ts/FileSystem/Commit.ts b/ts/FileSystem/Commit.ts
deleted file mode 100644
index 0f2fde07..00000000
--- a/ts/FileSystem/Commit.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Record } from "../fable_modules/fable-library-ts/Types.js";
-import { IComparable, IEquatable } from "../fable_modules/fable-library-ts/Util.js";
-import { record_type, class_type, string_type, TypeInfo } from "../fable_modules/fable-library-ts/Reflection.js";
-
-export class Commit extends Record implements IEquatable, IComparable {
- readonly Hash: string;
- readonly UserName: string;
- readonly UserEmail: string;
- readonly Date: Date;
- readonly Message: string;
- constructor(Hash: string, UserName: string, UserEmail: string, Date$: Date, Message: string) {
- super();
- this.Hash = Hash;
- this.UserName = UserName;
- this.UserEmail = UserEmail;
- this.Date = Date$;
- this.Message = Message;
- }
-}
-
-export function Commit_$reflection(): TypeInfo {
- return record_type("FileSystem.Commit", [], Commit, () => [["Hash", string_type], ["UserName", string_type], ["UserEmail", string_type], ["Date", class_type("System.DateTime")], ["Message", string_type]]);
-}
-
diff --git a/ts/FileSystem/FileSystem.ts b/ts/FileSystem/FileSystem.ts
deleted file mode 100644
index c1b87684..00000000
--- a/ts/FileSystem/FileSystem.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { defaultArg } from "../fable_modules/fable-library-ts/Option.js";
-import { Commit_$reflection, Commit } from "./Commit.js";
-import { FileSystemTree_$reflection, FileSystemTree, FileSystemTree_$union } from "./FileSystemTree.js";
-import { Record } from "../fable_modules/fable-library-ts/Types.js";
-import { IComparable, IEquatable } from "../fable_modules/fable-library-ts/Util.js";
-import { record_type, array_type, TypeInfo } from "../fable_modules/fable-library-ts/Reflection.js";
-
-export class FileSystem extends Record implements IEquatable, IComparable {
- readonly Tree: FileSystemTree_$union;
- readonly History: Commit[];
- constructor(Tree: FileSystemTree_$union, History: Commit[]) {
- super();
- this.Tree = Tree;
- this.History = History;
- }
- static create({ tree, history }: {tree: FileSystemTree_$union, history?: Commit[] }): FileSystem {
- return new FileSystem(tree, defaultArg(history, []));
- }
- AddFile(path: string): FileSystem {
- const this$: FileSystem = this;
- return new FileSystem(this$.Tree.AddFile(path), this$.History);
- }
- static addFile(path: string): ((arg0: FileSystem) => FileSystem) {
- return (fs: FileSystem): FileSystem => fs.AddFile(path);
- }
- static fromFilePaths(paths: string[]): FileSystem {
- const tree: FileSystemTree_$union = FileSystemTree.fromFilePaths(paths);
- return FileSystem.create({
- tree: tree,
- });
- }
-}
-
-export function FileSystem_$reflection(): TypeInfo {
- return record_type("FileSystem.FileSystem", [], FileSystem, () => [["Tree", FileSystemTree_$reflection()], ["History", array_type(Commit_$reflection())]]);
-}
-
diff --git a/ts/FileSystem/FileSystemTree.ts b/ts/FileSystem/FileSystemTree.ts
deleted file mode 100644
index aea9fba6..00000000
--- a/ts/FileSystem/FileSystemTree.ts
+++ /dev/null
@@ -1,167 +0,0 @@
-import { Option, unwrap, defaultArg } from "../fable_modules/fable-library-ts/Option.js";
-import { singleton, append, delay, toArray } from "../fable_modules/fable-library-ts/Seq.js";
-import { choose, equalsWith, tail, head, map } from "../fable_modules/fable-library-ts/Array.js";
-import { Array_distinct, Array_groupBy } from "../fable_modules/fable-library-ts/Seq2.js";
-import { curry2, arrayHash, stringHash } from "../fable_modules/fable-library-ts/Util.js";
-import { int32 } from "../fable_modules/fable-library-ts/Int32.js";
-import { combineMany, split } from "./Path.js";
-import { empty, FSharpList, reverse, toArray as toArray_1, cons } from "../fable_modules/fable-library-ts/List.js";
-import { Union } from "../fable_modules/fable-library-ts/Types.js";
-import { union_type, array_type, string_type, TypeInfo } from "../fable_modules/fable-library-ts/Reflection.js";
-
-export type FileSystemTree_$union =
- | FileSystemTree<0>
- | FileSystemTree<1>
-
-export type FileSystemTree_$cases = {
- 0: ["File", [string]],
- 1: ["Folder", [string, FileSystemTree_$union[]]]
-}
-
-export function FileSystemTree_File(name: string) {
- return new FileSystemTree<0>(0, [name]);
-}
-
-export function FileSystemTree_Folder(name: string, children: FileSystemTree_$union[]) {
- return new FileSystemTree<1>(1, [name, children]);
-}
-
-export class FileSystemTree extends Union {
- constructor(readonly tag: Tag, readonly fields: FileSystemTree_$cases[Tag][1]) {
- super();
- }
- cases() {
- return ["File", "Folder"];
- }
- get Name(): string {
- const this$ = this as FileSystemTree_$union;
- let n: string;
- if (this$.tag === /* Folder */ 1) {
- n = this$.fields[0];
- }
- else {
- n = this$.fields[0];
- }
- return n!;
- }
- get isFolder(): boolean {
- const this$ = this as FileSystemTree_$union;
- return this$.tag === /* Folder */ 1;
- }
- get isFile(): boolean {
- const this$ = this as FileSystemTree_$union;
- return this$.tag === /* File */ 0;
- }
- static get ROOT_NAME(): string {
- return "root";
- }
- static createFile(name: string): FileSystemTree_$union {
- return FileSystemTree_File(name);
- }
- static createFolder(name: string, children?: FileSystemTree_$union[]): FileSystemTree_$union {
- return FileSystemTree_Folder(name, defaultArg(children, []));
- }
- AddFile(path: string): FileSystemTree_$union {
- const this$ = this as FileSystemTree_$union;
- const existingPaths: string[] = this$.ToFilePaths();
- const filePaths: string[] = toArray(delay((): Iterable => append(singleton(path), delay((): Iterable => existingPaths))));
- return FileSystemTree.fromFilePaths(filePaths);
- }
- static addFile(path: string): ((arg0: FileSystemTree_$union) => FileSystemTree_$union) {
- return (tree: FileSystemTree_$union): FileSystemTree_$union => tree.AddFile(path);
- }
- static fromFilePaths(paths: string[]): FileSystemTree_$union {
- const loop = (paths_1: string[][], parent: FileSystemTree_$union): FileSystemTree_$union => {
- const files: FileSystemTree_$union[] = map((arg_1: string[]): FileSystemTree_$union => {
- const arg: string = head(arg_1);
- return FileSystemTree.createFile(arg);
- }, paths_1.filter((p: string[]): boolean => (p.length === 1)));
- const folders: FileSystemTree_$union[] = map<[string, string[][]], FileSystemTree_$union>((tupledArg: [string, string[][]]): FileSystemTree_$union => {
- const parent_1: FileSystemTree_$union = FileSystemTree.createFolder(tupledArg[0], []);
- return loop(map(tail, tupledArg[1]), parent_1);
- }, Array_groupBy(head, paths_1.filter((p_1: string[]): boolean => (p_1.length > 1)), {
- Equals: (x_3: string, y_2: string): boolean => (x_3 === y_2),
- GetHashCode: stringHash,
- }));
- if (parent.tag === /* Folder */ 1) {
- const name: string = parent.fields[0];
- return FileSystemTree.createFolder(name, toArray(delay((): Iterable => append(files, delay((): Iterable => folders)))));
- }
- else {
- return parent;
- }
- };
- return loop(Array_distinct(map(split, paths), {
- Equals: (x: string[], y: string[]): boolean => equalsWith((x_1: string, y_1: string): boolean => (x_1 === y_1), x, y),
- GetHashCode: arrayHash,
- }), FileSystemTree.createFolder(FileSystemTree.ROOT_NAME, []));
- }
- ToFilePaths(removeRoot?: boolean): string[] {
- const this$ = this as FileSystemTree_$union;
- const res: string[] = [];
- const loop = (output: FSharpList, parent: FileSystemTree_$union): void => {
- if (parent.tag === /* Folder */ 1) {
- const n_1: string = parent.fields[0];
- const array: FileSystemTree_$union[] = parent.fields[1];
- array.forEach((filest: FileSystemTree_$union): void => {
- loop(cons(n_1, output), filest);
- });
- }
- else {
- const arg: string = combineMany(toArray_1(reverse(cons(parent.fields[0], output))));
- void (res.push(arg));
- }
- };
- if (defaultArg(removeRoot, true)) {
- if (this$.tag === /* File */ 0) {
- const n_2: string = this$.fields[0];
- void (res.push(n_2));
- }
- else {
- const children_1: FileSystemTree_$union[] = this$.fields[1];
- const action_1: ((arg0: FileSystemTree_$union) => void) = curry2(loop)(empty());
- children_1.forEach(action_1);
- }
- }
- else {
- loop(empty(), this$);
- }
- return Array.from(res);
- }
- static toFilePaths(removeRoot?: boolean): ((arg0: FileSystemTree_$union) => string[]) {
- return (root: FileSystemTree_$union): string[] => root.ToFilePaths(unwrap(removeRoot));
- }
- Filter(predicate: ((arg0: string) => boolean)): Option {
- const this$ = this as FileSystemTree_$union;
- const loop = (parent: FileSystemTree_$union): Option => {
- if (parent.tag === /* Folder */ 1) {
- const n_1: string = parent.fields[0];
- const filteredChildren: FileSystemTree_$union[] = choose(loop, parent.fields[1]);
- if (filteredChildren.length === 0) {
- return void 0;
- }
- else {
- return FileSystemTree_Folder(n_1, filteredChildren);
- }
- }
- else {
- const n: string = parent.fields[0];
- if (predicate(n)) {
- return FileSystemTree_File(n);
- }
- else {
- return void 0;
- }
- }
- };
- return loop(this$);
- }
- static filter(predicate: ((arg0: string) => boolean)): ((arg0: FileSystemTree_$union) => Option) {
- return (tree: FileSystemTree_$union): Option => tree.Filter(predicate);
- }
-}
-
-export function FileSystemTree_$reflection(): TypeInfo {
- return union_type("FileSystem.FileSystemTree", [], FileSystemTree, () => [[["name", string_type]], [["name", string_type], ["children", array_type(FileSystemTree_$reflection())]]]);
-}
-
diff --git a/ts/FileSystem/Path.ts b/ts/FileSystem/Path.ts
deleted file mode 100644
index a5291fa2..00000000
--- a/ts/FileSystem/Path.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { trim, join, trimStart, trimEnd, split as split_1 } from "../fable_modules/fable-library-ts/String.js";
-import { last, mapIndexed } from "../fable_modules/fable-library-ts/Array.js";
-import { int32 } from "../fable_modules/fable-library-ts/Int32.js";
-
-export const seperators: string[] = ["/", "\\"];
-
-export function split(path: string): string[] {
- return split_1(path, seperators, void 0, 3);
-}
-
-export function combine(path1: string, path2: string): string {
- return (trimEnd(path1, ...seperators) + "/") + trimStart(path2, ...seperators);
-}
-
-export function combineMany(paths: string[]): string {
- return join("/", mapIndexed((i: int32, p: string): string => {
- if (i === 0) {
- return trimEnd(p, ...seperators);
- }
- else if (i === (paths.length - 1)) {
- return trimStart(p, ...seperators);
- }
- else {
- return trim(p, ...seperators);
- }
- }, paths));
-}
-
-export function getFileName(path: string): string {
- return last(split(path));
-}
-
-/**
- * Checks if `path` points to a file with the name `fileName`
- */
-export function isFile(fileName: string, path: string): boolean {
- return getFileName(path) === fileName;
-}
-
diff --git a/ts/ISA/ISA.Json/Assay.ts b/ts/ISA/ISA.Json/Assay.ts
deleted file mode 100644
index fb6782ca..00000000
--- a/ts/ISA/ISA.Json/Assay.ts
+++ /dev/null
@@ -1,133 +0,0 @@
-import { toString, nil, object as object_22 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { FSharpList, ofArray, choose } from "../../fable_modules/fable-library-ts/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library-ts/Util.js";
-import { value as value_13, Option } from "../../fable_modules/fable-library-ts/Option.js";
-import { tryInclude } from "./GEncode.js";
-import { Data_decoder, Data_encoder, Sample_decoder, Sample_encoder } from "./Data.js";
-import { MaterialAttribute_decoder, MaterialAttribute_encoder, Material_decoder, Material_encoder } from "./Material.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID, ConverterOptions } from "./ConverterOptions.js";
-import { string, IOptionalGetter, IGetters, list as list_1, object as object_23 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { FSharpResult$2_$union } from "../../fable_modules/fable-library-ts/Choice.js";
-import { Sample } from "../ISA/JsonTypes/Sample.js";
-import { ErrorReason_$union } from "../../fable_modules/Thoth.Json.10.1.0/Types.fs.js";
-import { Material } from "../ISA/JsonTypes/Material.js";
-import { AssayMaterials } from "../ISA/JsonTypes/AssayMaterials.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { Assay } from "../ISA/JsonTypes/Assay.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library-ts/Seq.js";
-import { OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./Ontology.js";
-import { Process_decoder, Process_encoder } from "./Process.js";
-import { decoder as decoder_5, encoder } from "./Comment.js";
-import { fromString, uri } from "./Decode.js";
-import { OntologyAnnotation } from "../ISA/JsonTypes/OntologyAnnotation.js";
-import { Data } from "../ISA/JsonTypes/Data.js";
-import { MaterialAttribute } from "../ISA/JsonTypes/MaterialAttribute.js";
-import { Process } from "../ISA/JsonTypes/Process.js";
-import { Comment$ } from "../ISA/JsonTypes/Comment.js";
-import { ArcAssay } from "../ISA/ArcTypes/ArcAssay.js";
-
-export function AssayMaterials_encoder(options: ConverterOptions, oa: any): any {
- return object_22(choose<[string, any], [string, any]>((tupledArg: [string, any]): Option<[string, any]> => {
- const v: any = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v] as [string, any];
- }
- }, ofArray([tryInclude("samples", (oa_1: any): any => Sample_encoder(options, oa_1), oa["Samples"]), tryInclude("otherMaterials", (oa_2: any): any => Material_encoder(options, oa_2), oa["OtherMaterials"])])));
-}
-
-export function AssayMaterials_decoder(options: ConverterOptions): ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)) {
- return (path_2: string): ((arg0: any) => FSharpResult$2_$union) => ((v: any): FSharpResult$2_$union => object_23((get$: IGetters): AssayMaterials => {
- let objectArg: IOptionalGetter, objectArg_1: IOptionalGetter;
- return new AssayMaterials((objectArg = get$.Optional, objectArg.Field>("samples", (path: string, value: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1((s: string, json: any): FSharpResult$2_$union => Sample_decoder(options, s, json), path, value))), (objectArg_1 = get$.Optional, objectArg_1.Field>("otherMaterials", (path_1: string, value_1: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1((s_1: string, json_1: any): FSharpResult$2_$union => Material_decoder(options, s_1, json_1), path_1, value_1))));
- }, path_2, v));
-}
-
-export function Assay_genID(a: Assay): string {
- const matchValue: Option = a.ID;
- if (matchValue == null) {
- const matchValue_1: Option = a.FileName;
- if (matchValue_1 == null) {
- return "#EmptyAssay";
- }
- else {
- return value_13(matchValue_1);
- }
- }
- else {
- return URIModule_toString(value_13(matchValue));
- }
-}
-
-export function Assay_encoder(options: ConverterOptions, oa: any): any {
- return object_22(choose<[string, any], [string, any]>((tupledArg: [string, any]): Option<[string, any]> => {
- const v: any = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v] as [string, any];
- }
- }, toList<[string, any]>(delay<[string, any]>((): Iterable<[string, any]> => {
- let value: any, s: string;
- return append<[string, any]>(ConverterOptions__get_SetID(options) ? singleton<[string, any]>(["@id", (value = Assay_genID(oa as Assay), (typeof value === "string") ? ((s = (value as string), s)) : nil)] as [string, any]) : singleton<[string, any]>(tryInclude("@id", (value_2: any): any => {
- let s_1: string;
- const value_3: any = value_2;
- return (typeof value_3 === "string") ? ((s_1 = (value_3 as string), s_1)) : nil;
- }, oa["ID"])), delay<[string, any]>((): Iterable<[string, any]> => {
- let value_5: any, s_2: string;
- return append<[string, any]>(ConverterOptions__get_IncludeType(options) ? singleton<[string, any]>(["@type", (value_5 = "Assay", (typeof value_5 === "string") ? ((s_2 = (value_5 as string), s_2)) : nil)] as [string, any]) : empty<[string, any]>(), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("filename", (value_7: any): any => {
- let s_3: string;
- const value_8: any = value_7;
- return (typeof value_8 === "string") ? ((s_3 = (value_8 as string), s_3)) : nil;
- }, oa["FileName"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("measurementType", (oa_1: any): any => OntologyAnnotation_encoder(options, oa_1), oa["MeasurementType"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("technologyType", (oa_2: any): any => OntologyAnnotation_encoder(options, oa_2), oa["TechnologyType"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("technologyPlatform", (value_10: any): any => {
- let s_4: string;
- const value_11: any = value_10;
- return (typeof value_11 === "string") ? ((s_4 = (value_11 as string), s_4)) : nil;
- }, oa["TechnologyPlatform"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("dataFiles", (oa_3: any): any => Data_encoder(options, oa_3), oa["DataFiles"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("materials", (oa_4: any): any => AssayMaterials_encoder(options, oa_4), oa["Materials"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("characteristicCategories", (oa_5: any): any => MaterialAttribute_encoder(options, oa_5), oa["CharacteristicCategories"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("unitCategories", (oa_6: any): any => OntologyAnnotation_encoder(options, oa_6), oa["UnitCategories"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("processSequence", (oa_7: any): any => Process_encoder(options, oa_7), oa["ProcessSequence"])), delay<[string, any]>((): Iterable<[string, any]> => singleton<[string, any]>(tryInclude("comments", (comment: any): any => encoder(options, comment), oa["Comments"]))))))))))))))))))))));
- }));
- }))));
-}
-
-export function Assay_decoder(options: ConverterOptions): ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)) {
- return (path_7: string): ((arg0: any) => FSharpResult$2_$union) => ((v: any): FSharpResult$2_$union => object_23((get$: IGetters): Assay => {
- let objectArg: IOptionalGetter, objectArg_1: IOptionalGetter, arg_5: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_2: IOptionalGetter, arg_7: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_3: IOptionalGetter, objectArg_4: IOptionalGetter, objectArg_5: IOptionalGetter, arg_13: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_6: IOptionalGetter, arg_15: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>)), decoder_1: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_7: IOptionalGetter, arg_17: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>)), decoder_2: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_8: IOptionalGetter, arg_19: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>)), decoder_3: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_9: IOptionalGetter, arg_21: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>)), decoder_4: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_10: IOptionalGetter;
- return new Assay((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("filename", string)), (arg_5 = OntologyAnnotation_decoder(options), (objectArg_2 = get$.Optional, objectArg_2.Field("measurementType", uncurry2(arg_5)))), (arg_7 = OntologyAnnotation_decoder(options), (objectArg_3 = get$.Optional, objectArg_3.Field("technologyType", uncurry2(arg_7)))), (objectArg_4 = get$.Optional, objectArg_4.Field("technologyPlatform", string)), (objectArg_5 = get$.Optional, objectArg_5.Field>("dataFiles", (path_2: string, value_2: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1((s_1: string, json_1: any): FSharpResult$2_$union => Data_decoder(options, s_1, json_1), path_2, value_2))), (arg_13 = AssayMaterials_decoder(options), (objectArg_6 = get$.Optional, objectArg_6.Field("materials", uncurry2(arg_13)))), (arg_15 = ((decoder_1 = MaterialAttribute_decoder(options), (path_3: string): ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>) => ((value_3: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1(uncurry2(decoder_1), path_3, value_3)))), (objectArg_7 = get$.Optional, objectArg_7.Field>("characteristicCategories", uncurry2(arg_15)))), (arg_17 = ((decoder_2 = OntologyAnnotation_decoder(options), (path_4: string): ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>) => ((value_4: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1(uncurry2(decoder_2), path_4, value_4)))), (objectArg_8 = get$.Optional, objectArg_8.Field>("unitCategories", uncurry2(arg_17)))), (arg_19 = ((decoder_3 = Process_decoder(options), (path_5: string): ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>) => ((value_5: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1(uncurry2(decoder_3), path_5, value_5)))), (objectArg_9 = get$.Optional, objectArg_9.Field>("processSequence", uncurry2(arg_19)))), (arg_21 = ((decoder_4 = decoder_5(options), (path_6: string): ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>) => ((value_6: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1(uncurry2(decoder_4), path_6, value_6)))), (objectArg_10 = get$.Optional, objectArg_10.Field>("comments", uncurry2(arg_21)))));
- }, path_7, v));
-}
-
-export function Assay_fromString(s: string): Assay {
- return fromString(uncurry2(Assay_decoder(ConverterOptions_$ctor())), s);
-}
-
-export function Assay_toString(p: Assay): string {
- return toString(2, Assay_encoder(ConverterOptions_$ctor(), p));
-}
-
-/**
- * exports in json-ld format
- */
-export function Assay_toStringLD(a: Assay): string {
- let returnVal: ConverterOptions;
- return toString(2, Assay_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a));
-}
-
-export function ArcAssay_fromString(s: string): ArcAssay {
- const arg: Assay = fromString(uncurry2(Assay_decoder(ConverterOptions_$ctor())), s);
- return ArcAssay.fromAssay(arg);
-}
-
-export function ArcAssay_toString(a: ArcAssay): string {
- return toString(2, Assay_encoder(ConverterOptions_$ctor(), a.ToAssay()));
-}
-
-/**
- * exports in json-ld format
- */
-export function ArcAssay_toStringLD(a: ArcAssay): string {
- let returnVal: ConverterOptions;
- return toString(2, Assay_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), a.ToAssay()));
-}
-
diff --git a/ts/ISA/ISA.Json/Comment.ts b/ts/ISA/ISA.Json/Comment.ts
deleted file mode 100644
index e13bebd0..00000000
--- a/ts/ISA/ISA.Json/Comment.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { value as value_13, Option } from "../../fable_modules/fable-library-ts/Option.js";
-import { replace } from "../../fable_modules/fable-library-ts/String.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { Comment$ } from "../ISA/JsonTypes/Comment.js";
-import { toString as toString_1, nil, object as object_6 } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { choose } from "../../fable_modules/fable-library-ts/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library-ts/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library-ts/Seq.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID } from "./ConverterOptions.js";
-import { tryInclude } from "./GEncode.js";
-import { IOptionalGetter, IGetters, string, object as object_7 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { fromString as fromString_1, uri } from "./Decode.js";
-import { FSharpResult$2_$union } from "../../fable_modules/fable-library-ts/Choice.js";
-import { ErrorReason_$union } from "../../fable_modules/Thoth.Json.10.1.0/Types.fs.js";
-
-export function genID(c: Comment$): string {
- const matchValue: Option = c.ID;
- if (matchValue == null) {
- const matchValue_1: Option = c.Name;
- if (matchValue_1 == null) {
- return "#EmptyComment";
- }
- else {
- const n: string = value_13(matchValue_1);
- const v: string = (c.Value != null) ? ("_" + replace(value_13(c.Value), " ", "_")) : "";
- return ("#Comment_" + replace(n, " ", "_")) + v;
- }
- }
- else {
- return URIModule_toString(value_13(matchValue));
- }
-}
-
-export function encoder(options: ConverterOptions, comment: any): any {
- return object_6(choose<[string, any], [string, any]>((tupledArg: [string, any]): Option<[string, any]> => {
- const v: any = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v] as [string, any];
- }
- }, toList<[string, any]>(delay<[string, any]>((): Iterable<[string, any]> => {
- let value: any, s: string;
- return append<[string, any]>(ConverterOptions__get_SetID(options) ? singleton<[string, any]>(["@id", (value = genID(comment as Comment$), (typeof value === "string") ? ((s = (value as string), s)) : nil)] as [string, any]) : singleton<[string, any]>(tryInclude("@id", (value_2: any): any => {
- let s_1: string;
- const value_3: any = value_2;
- return (typeof value_3 === "string") ? ((s_1 = (value_3 as string), s_1)) : nil;
- }, comment["ID"])), delay<[string, any]>((): Iterable<[string, any]> => {
- let value_5: any, s_2: string;
- return append<[string, any]>(ConverterOptions__get_IncludeType(options) ? singleton<[string, any]>(["@type", (value_5 = "Comment", (typeof value_5 === "string") ? ((s_2 = (value_5 as string), s_2)) : nil)] as [string, any]) : empty<[string, any]>(), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("name", (value_7: any): any => {
- let s_3: string;
- const value_8: any = value_7;
- return (typeof value_8 === "string") ? ((s_3 = (value_8 as string), s_3)) : nil;
- }, comment["Name"])), delay<[string, any]>((): Iterable<[string, any]> => singleton<[string, any]>(tryInclude("value", (value_10: any): any => {
- let s_4: string;
- const value_11: any = value_10;
- return (typeof value_11 === "string") ? ((s_4 = (value_11 as string), s_4)) : nil;
- }, comment["Value"]))))));
- }));
- }))));
-}
-
-export function decoder(options: ConverterOptions): ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)) {
- return (path_2: string): ((arg0: any) => FSharpResult$2_$union) => ((v: any): FSharpResult$2_$union => object_7((get$: IGetters): Comment$ => {
- let objectArg: IOptionalGetter, objectArg_1: IOptionalGetter, objectArg_2: IOptionalGetter;
- return new Comment$((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("value", string)));
- }, path_2, v));
-}
-
-export function fromString(s: string): Comment$ {
- return fromString_1(uncurry2(decoder(ConverterOptions_$ctor())), s);
-}
-
-export function toString(c: Comment$): string {
- return toString_1(2, encoder(ConverterOptions_$ctor(), c));
-}
-
-/**
- * exports in json-ld format
- */
-export function toStringLD(c: Comment$): string {
- let returnVal: ConverterOptions;
- return toString_1(2, encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), c));
-}
-
diff --git a/ts/ISA/ISA.Json/ConverterOptions.ts b/ts/ISA/ISA.Json/ConverterOptions.ts
deleted file mode 100644
index 72867407..00000000
--- a/ts/ISA/ISA.Json/ConverterOptions.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { class_type, TypeInfo } from "../../fable_modules/fable-library-ts/Reflection.js";
-
-export class ConverterOptions {
- setID: boolean;
- includeType: boolean;
- constructor() {
- this.setID = false;
- this.includeType = false;
- }
-}
-
-export function ConverterOptions_$reflection(): TypeInfo {
- return class_type("ISA.Json.ConverterOptions", void 0, ConverterOptions);
-}
-
-export function ConverterOptions_$ctor(): ConverterOptions {
- return new ConverterOptions();
-}
-
-export function ConverterOptions__get_SetID(this$: ConverterOptions): boolean {
- return this$.setID;
-}
-
-export function ConverterOptions__set_SetID_Z1FBCCD16(this$: ConverterOptions, setId: boolean): void {
- this$.setID = setId;
-}
-
-export function ConverterOptions__get_IncludeType(this$: ConverterOptions): boolean {
- return this$.includeType;
-}
-
-export function ConverterOptions__set_IncludeType_Z1FBCCD16(this$: ConverterOptions, iT: boolean): void {
- this$.includeType = iT;
-}
-
diff --git a/ts/ISA/ISA.Json/Data.ts b/ts/ISA/ISA.Json/Data.ts
deleted file mode 100644
index f7fc5544..00000000
--- a/ts/ISA/ISA.Json/Data.ts
+++ /dev/null
@@ -1,275 +0,0 @@
-import { DataFile_ImageFile, DataFile_DerivedDataFile, DataFile_RawDataFile, DataFile_$union, DataFile } from "../ISA/JsonTypes/DataFile.js";
-import { toString, object as object_10, nil } from "../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
-import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor, ConverterOptions__get_IncludeType, ConverterOptions__get_SetID, ConverterOptions } from "./ConverterOptions.js";
-import { IOptionalGetter, IGetters, list as list_1, object as object_11, string } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
-import { FSharpResult$2_Ok, FSharpResult$2_Error, FSharpResult$2_$union } from "../../fable_modules/fable-library-ts/Choice.js";
-import { ErrorReason_BadPrimitive, ErrorReason_$union } from "../../fable_modules/Thoth.Json.10.1.0/Types.fs.js";
-import { value as value_11, Option } from "../../fable_modules/fable-library-ts/Option.js";
-import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
-import { Data } from "../ISA/JsonTypes/Data.js";
-import { FSharpList, ofArray, choose } from "../../fable_modules/fable-library-ts/List.js";
-import { uncurry2, equals } from "../../fable_modules/fable-library-ts/Util.js";
-import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library-ts/Seq.js";
-import { tryInclude } from "./GEncode.js";
-import { decoder as decoder_3, encoder } from "./Comment.js";
-import { fromString, uri, hasUnknownFields } from "./Decode.js";
-import { Comment$ } from "../ISA/JsonTypes/Comment.js";
-import { replace } from "../../fable_modules/fable-library-ts/String.js";
-import { Source } from "../ISA/JsonTypes/Source.js";
-import { MaterialAttributeValue_decoder, MaterialAttributeValue_encoder } from "./Material.js";
-import { MaterialAttributeValue } from "../ISA/JsonTypes/MaterialAttributeValue.js";
-import { Sample } from "../ISA/JsonTypes/Sample.js";
-import { FactorValue_decoder, FactorValue_encoder } from "./Factor.js";
-import { FactorValue } from "../ISA/JsonTypes/FactorValue.js";
-
-export function DataFile_encoder(options: ConverterOptions, value: any): any {
- if (value instanceof DataFile) {
- if (value.tag === /* DerivedDataFile */ 1) {
- return "Derived Data File";
- }
- else if (value.tag === /* ImageFile */ 2) {
- return "Image File";
- }
- else {
- return "Raw Data File";
- }
- }
- else {
- return nil;
- }
-}
-
-export function DataFile_decoder(options: ConverterOptions, s: string, json: any): FSharpResult$2_$union {
- const matchValue: FSharpResult$2_$union = string(s, json);
- if (matchValue.tag === /* Error */ 1) {
- return FSharpResult$2_Error(matchValue.fields[0]);
- }
- else {
- switch (matchValue.fields[0]) {
- case "Raw Data File":
- return FSharpResult$2_Ok(DataFile_RawDataFile());
- case "Derived Data File":
- return FSharpResult$2_Ok(DataFile_DerivedDataFile());
- case "Image File":
- return FSharpResult$2_Ok(DataFile_ImageFile());
- default: {
- const s_1: string = matchValue.fields[0];
- return FSharpResult$2_Error([`Could not parse ${s_1}.`, ErrorReason_BadPrimitive(s_1, nil)] as [string, ErrorReason_$union]);
- }
- }
- }
-}
-
-export function Data_genID(d: Data): string {
- const matchValue: Option = d.ID;
- if (matchValue == null) {
- const matchValue_1: Option = d.Name;
- if (matchValue_1 == null) {
- return "#EmptyData";
- }
- else {
- return value_11(matchValue_1);
- }
- }
- else {
- return URIModule_toString(value_11(matchValue));
- }
-}
-
-export function Data_encoder(options: ConverterOptions, oa: any): any {
- return object_10(choose<[string, any], [string, any]>((tupledArg: [string, any]): Option<[string, any]> => {
- const v: any = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v] as [string, any];
- }
- }, toList<[string, any]>(delay<[string, any]>((): Iterable<[string, any]> => {
- let value: any, s: string;
- return append<[string, any]>(ConverterOptions__get_SetID(options) ? singleton<[string, any]>(["@id", (value = Data_genID(oa as Data), (typeof value === "string") ? ((s = (value as string), s)) : nil)] as [string, any]) : singleton<[string, any]>(tryInclude("@id", (value_2: any): any => {
- let s_1: string;
- const value_3: any = value_2;
- return (typeof value_3 === "string") ? ((s_1 = (value_3 as string), s_1)) : nil;
- }, oa["ID"])), delay<[string, any]>((): Iterable<[string, any]> => {
- let value_5: any, s_2: string;
- return append<[string, any]>(ConverterOptions__get_IncludeType(options) ? singleton<[string, any]>(["@type", (value_5 = "Data", (typeof value_5 === "string") ? ((s_2 = (value_5 as string), s_2)) : nil)] as [string, any]) : empty<[string, any]>(), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("name", (value_7: any): any => {
- let s_3: string;
- const value_8: any = value_7;
- return (typeof value_8 === "string") ? ((s_3 = (value_8 as string), s_3)) : nil;
- }, oa["Name"])), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("type", (value_10: any): any => DataFile_encoder(options, value_10), oa["DataType"])), delay<[string, any]>((): Iterable<[string, any]> => singleton<[string, any]>(tryInclude("comments", (comment: any): any => encoder(options, comment), oa["Comments"]))))))));
- }));
- }))));
-}
-
-export function Data_decoder(options: ConverterOptions, s: string, json: any): FSharpResult$2_$union {
- if (hasUnknownFields(ofArray(["@id", "name", "type", "comments", "@type"]), json)) {
- return FSharpResult$2_Error(["Unknown fields in Data", ErrorReason_BadPrimitive(s, nil)] as [string, ErrorReason_$union]);
- }
- else {
- return object_11((get$: IGetters): Data => {
- let objectArg: IOptionalGetter, objectArg_1: IOptionalGetter, objectArg_2: IOptionalGetter, arg_7: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>)), decoder: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union)), objectArg_3: IOptionalGetter;
- return new Data((objectArg = get$.Optional, objectArg.Field("@id", uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("type", (s_2: string, json_2: any): FSharpResult$2_$union => DataFile_decoder(options, s_2, json_2))), (arg_7 = ((decoder = decoder_3(options), (path_1: string): ((arg0: any) => FSharpResult$2_$union, [string, ErrorReason_$union]>) => ((value_1: any): FSharpResult$2_$union, [string, ErrorReason_$union]> => list_1(uncurry2(decoder), path_1, value_1)))), (objectArg_3 = get$.Optional, objectArg_3.Field>("comments", uncurry2(arg_7)))));
- }, s, json);
- }
-}
-
-export function Data_fromString(s: string): Data {
- let options: ConverterOptions;
- return fromString(uncurry2((options = ConverterOptions_$ctor(), (s_1: string): ((arg0: any) => FSharpResult$2_$union) => ((json: any): FSharpResult$2_$union => Data_decoder(options, s_1, json)))), s);
-}
-
-export function Data_toString(m: Data): string {
- return toString(2, Data_encoder(ConverterOptions_$ctor(), m));
-}
-
-/**
- * exports in json-ld format
- */
-export function Data_toStringLD(d: Data): string {
- let returnVal: ConverterOptions;
- return toString(2, Data_encoder((returnVal = ConverterOptions_$ctor(), ((ConverterOptions__set_SetID_Z1FBCCD16(returnVal, true), ConverterOptions__set_IncludeType_Z1FBCCD16(returnVal, true)), returnVal)), d));
-}
-
-export function Source_genID(s: Source): string {
- const matchValue: Option = s.ID;
- if (matchValue == null) {
- const matchValue_1: Option = s.Name;
- if (matchValue_1 == null) {
- return "#EmptySource";
- }
- else {
- return "#Source_" + replace(value_11(matchValue_1), " ", "_");
- }
- }
- else {
- return URIModule_toString(value_11(matchValue));
- }
-}
-
-export function Source_encoder(options: ConverterOptions, oa: any): any {
- return object_10(choose<[string, any], [string, any]>((tupledArg: [string, any]): Option<[string, any]> => {
- const v: any = tupledArg[1];
- if (equals(v, nil)) {
- return void 0;
- }
- else {
- return [tupledArg[0], v] as [string, any];
- }
- }, toList<[string, any]>(delay<[string, any]>((): Iterable<[string, any]> => {
- let value: any, s_1: string;
- return append<[string, any]>(ConverterOptions__get_SetID(options) ? singleton<[string, any]>(["@id", (value = Source_genID(oa as Source), (typeof value === "string") ? ((s_1 = (value as string), s_1)) : nil)] as [string, any]) : singleton<[string, any]>(tryInclude("@id", (value_2: any): any => {
- let s_2: string;
- const value_3: any = value_2;
- return (typeof value_3 === "string") ? ((s_2 = (value_3 as string), s_2)) : nil;
- }, oa["ID"])), delay<[string, any]>((): Iterable<[string, any]> => {
- let value_5: any, s_3: string;
- return append<[string, any]>(ConverterOptions__get_IncludeType(options) ? singleton<[string, any]>(["@type", (value_5 = "Source", (typeof value_5 === "string") ? ((s_3 = (value_5 as string), s_3)) : nil)] as [string, any]) : empty<[string, any]>(), delay<[string, any]>((): Iterable<[string, any]> => append<[string, any]>(singleton<[string, any]>(tryInclude("name", (value_7: any): any => {
- let s_4: string;
- const value_8: any = value_7;
- return (typeof value_8 === "string") ? ((s_4 = (value_8 as string), s_4)) : nil;
- }, oa["Name"])), delay<[string, any]>((): Iterable<[string, any]> => singleton<[string, any]>(tryInclude("characteristics", (oa_1: any): any => MaterialAttributeValue_encoder(options, oa_1), oa["Characteristics"]))))));
- }));
- }))));
-}
-
-export function Source_decoder(options: ConverterOptions, s: string, json: any): FSharpResult$2_$union