Skip to content

Commit

Permalink
fix GetRegisteredPayload cell conversion failure
Browse files Browse the repository at this point in the history
- iterate through all tables instead of the first only
- use ToFreeTextCell(), which is a proper conversion instead of AsFreeTextCell which is a match that can fail
  • Loading branch information
kMutagene committed Sep 12, 2023
1 parent 095114d commit 907f3a2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/ARCtrl/ARCtrl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,12 @@ type ARC(?isa : ISA.ArcInvestigation, ?cwl : CWL.CWL, ?fs : FileSystem.FileSyste
yield $"{studyFoldername}/README.md"

//just allow any constructed path from cell values. there may be occasions where this includes wrong files, but its good enough for now.
for (kv) in s.Tables[0].Values do
yield kv.Value.AsFreeText // from arc root
yield $"{studyFoldername}/resources/{kv.Value.AsFreeText}" // from study root > resources
yield $"{studyFoldername}/protocols/{kv.Value.AsFreeText}" // from study root > protocols
for table in s.Tables do
for kv in table.Values do
let textValue = kv.Value.ToFreeTextCell().AsFreeText
yield textValue // from arc root
yield $"{studyFoldername}/resources/{textValue}" // from study root > resources
yield $"{studyFoldername}/protocols/{textValue}" // from study root > protocols
]
)
|> Set.unionMany
Expand All @@ -294,10 +296,12 @@ type ARC(?isa : ISA.ArcInvestigation, ?cwl : CWL.CWL, ?fs : FileSystem.FileSyste
yield $"{assayFoldername}/README.md"

//just allow any constructed path from cell values. there may be occasions where this includes wrong files, but its good enough for now.
for (kv) in a.Tables[0].Values do
yield kv.Value.AsFreeText // from arc root
yield $"{assayFoldername}/dataset/{kv.Value.AsFreeText}" // from assay root > dataset
yield $"{assayFoldername}/protocols/{kv.Value.AsFreeText}" // from assay root > protocols
for table in a.Tables do
for kv in table.Values do
let textValue = kv.Value.ToFreeTextCell().AsFreeText
yield textValue // from arc root
yield $"{assayFoldername}/dataset/{textValue}" // from assay root > dataset
yield $"{assayFoldername}/protocols/{textValue}" // from assay root > protocols
]
)
|> Set.unionMany
Expand Down

0 comments on commit 907f3a2

Please sign in to comment.