Skip to content

Commit

Permalink
🐛 Fix bug with study filename
Browse files Browse the repository at this point in the history
Study filename did not appear in investigation file when adding the study indirectly via `arc a add` when giving no StudyIdentifier.
  • Loading branch information
omaus committed Mar 22, 2022
1 parent 2472be4 commit 8499965
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ArcCommander/APIs/AssayAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module AssayAPI =
|> System.IO.File.Exists

/// Creates an assay file from the given assay in the ARC.
let create (arcConfiguration : ArcConfiguration) (assay) (identifier : string) =
let create (arcConfiguration : ArcConfiguration) assay (identifier : string) =
IsaModelConfiguration.getAssayFilePath identifier arcConfiguration
|> ISADotNet.XLSX.AssayFile.Assay.init (Some assay) None identifier

Expand Down Expand Up @@ -306,14 +306,14 @@ module AssayAPI =
log.Info($"Study with the identifier {studyIdentifier} does not exist yet, creating it now.")
if StudyAPI.StudyFile.exists arcConfiguration studyIdentifier |> not then
StudyAPI.StudyFile.create arcConfiguration (Study.create(Identifier = studyIdentifier)) studyIdentifier
let info = Study.StudyInfo.create studyIdentifier "" "" "" "" "" []
let info = Study.StudyInfo.create studyIdentifier "" "" "" "" (Path.Combine(studyIdentifier, "isa.study.xlsx")) []
Study.fromParts info [] [] [] [assay] [] []
|> API.Study.add studies
| None ->
log.Info($"Study with the identifier {studyIdentifier} does not exist yet, creating it now.")
if StudyAPI.StudyFile.exists arcConfiguration studyIdentifier |> not then
StudyAPI.StudyFile.create arcConfiguration (Study.create(Identifier = studyIdentifier)) studyIdentifier
let info = Study.StudyInfo.create studyIdentifier "" "" "" "" "" []
let info = Study.StudyInfo.create studyIdentifier "" "" "" "" (Path.Combine(studyIdentifier, "isa.study.xlsx")) []
[Study.fromParts info [] [] [] [assay] [] []]
|> API.Investigation.setStudies investigation
|> Investigation.toFile investigationFilePath
Expand Down Expand Up @@ -428,7 +428,7 @@ module AssayAPI =
|> API.Investigation.setStudies investigation
| None ->
log.Trace($"Target Study with the identifier {studyIdentifier} does not exist in the investigation file, creating new study to move assay to.")
let info = Study.StudyInfo.create targetStudyIdentifer "" "" "" "" "" []
let info = Study.StudyInfo.create targetStudyIdentifer "" "" "" "" (Path.Combine(targetStudyIdentifer, "isa.study.xlsx")) []
Study.fromParts info [] [] [] [assay] [] []
|> API.Study.add studies
|> API.Investigation.setStudies investigation
Expand Down

0 comments on commit 8499965

Please sign in to comment.