Skip to content

Commit

Permalink
update arctrl.net dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
HLWeil committed Oct 7, 2023
1 parent a3e4994 commit dee2ba1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/ArcCommander/APIs/ArcAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ module ArcAPI =
let output =
if arcArgs.ContainsFlag ProcessSequence then
API.ARC.getProcesses arc
|> ARCtrl.ISA.Json.ProcessSequence.toString
|> ARCtrl.ISA.Json.ProcessSequence.toJsonString
else
arc.ISA.Value
|> ARCtrl.ISA.Json.ArcInvestigation.toString
|> ARCtrl.ISA.Json.ArcInvestigation.toJsonString

match arcArgs.TryGetFieldValue Output with
| Some p -> System.IO.File.WriteAllText(p, output)
Expand Down
35 changes: 22 additions & 13 deletions src/ArcCommander/APIs/AssayAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,26 @@ module AssayAPI =

let assayFileName = Identifier.Assay.fileNameFromIdentifier assayIdentifier

let mt =
OntologyAnnotation.fromString(
?termName = (assayArgs.TryGetFieldValue AssayInitArgs.MeasurementType),
?tan = (assayArgs.TryGetFieldValue AssayInitArgs.MeasurementTypeTermAccessionNumber),
?tsr = (assayArgs.TryGetFieldValue AssayInitArgs.MeasurementTypeTermSourceREF)
)
|> Aux.Option.fromValueWithDefault OntologyAnnotation.empty
let tt =
OntologyAnnotation.fromString(
?termName = (assayArgs.TryGetFieldValue AssayInitArgs.TechnologyType),
?tan = (assayArgs.TryGetFieldValue AssayInitArgs.TechnologyTypeTermAccessionNumber),
?tsr = (assayArgs.TryGetFieldValue AssayInitArgs.TechnologyTypeTermSourceREF)
)
|> Aux.Option.fromValueWithDefault OntologyAnnotation.empty
let tp =
assayArgs.TryGetFieldValue AssayInitArgs.TechnologyPlatform
|> Option.map ArcAssay.decomposeTechnologyPlatform

let assay =
Assays.fromString
(assayArgs.TryGetFieldValue AssayInitArgs.MeasurementType)
(assayArgs.TryGetFieldValue AssayInitArgs.MeasurementTypeTermAccessionNumber)
(assayArgs.TryGetFieldValue AssayInitArgs.MeasurementTypeTermSourceREF)
(assayArgs.TryGetFieldValue AssayInitArgs.TechnologyType)
(assayArgs.TryGetFieldValue AssayInitArgs.TechnologyTypeTermAccessionNumber)
(assayArgs.TryGetFieldValue AssayInitArgs.TechnologyTypeTermSourceREF)
(assayArgs.TryGetFieldValue AssayInitArgs.TechnologyPlatform)
assayFileName
[||]
ArcAssay.create(assayIdentifier, ?measurementType = mt,?technologyType = tt, ?technologyPlatform = tp)

let arc = ARC.load(arcConfiguration)
let isa = arc.ISA |> Option.defaultValue (ArcInvestigation(Identifier.createMissingIdentifier()))
Expand Down Expand Up @@ -371,10 +380,10 @@ module AssayAPI =
if assayArgs.ContainsFlag AssayExportArgs.ProcessSequence then
a.Tables |> Seq.collect (fun t -> t.GetProcesses())
|> Seq.toList
|> ARCtrl.ISA.Json.ProcessSequence.toString
|> ARCtrl.ISA.Json.ProcessSequence.toJsonString
else
Study.create(Contacts = (a.Performers |> Array.toList),Assays = [a.ToAssay()])
|> ARCtrl.ISA.Json.Study.toString
|> ARCtrl.ISA.Json.Study.toJsonString

match assayArgs.TryGetFieldValue AssayExportArgs.Output with
| Some p -> System.IO.File.WriteAllText(p, output)
Expand Down Expand Up @@ -405,7 +414,7 @@ module AssayAPI =
ass
|> Seq.collect (fun a -> a.Tables |> Seq.collect (fun t -> t.GetProcesses()))
|> Seq.toList
|> ARCtrl.ISA.Json.ProcessSequence.toString
|> ARCtrl.ISA.Json.ProcessSequence.toJsonString
else
ass
|> Seq.map (fun a ->
Expand Down
2 changes: 1 addition & 1 deletion src/ArcCommander/ArcCommander.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<!--References-->
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.400" />
<PackageReference Include="ARCtrl.NET" Version="1.0.0-alpha2" />
<PackageReference Include="ARCtrl.NET" Version="1.0.0-alpha3" />
<PackageReference Include="Argu" Version="6.1.1" />
<PackageReference Include="Fake.IO.FileSystem" Version="6.0.0" />
<PackageReference Include="Fake.Tools.Git" Version="6.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/ArcCommander/Server/ArcAPIHandler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ let arcImportHandler : HttpHandler =
let tmpDir = Path.Combine(Path.GetTempPath(), "tmpArc")
let tmpZip = Path.Combine(Path.GetTempPath(), "tmpArc.zip")

ArcInvestigation.fromString isaJsonString
ArcInvestigation.fromJsonString isaJsonString
//|> fun i -> {i with Remarks = []}
|> fun i -> ARC(i).Write(tmpDir)

Expand Down

0 comments on commit dee2ba1

Please sign in to comment.