Skip to content

Commit

Permalink
Fix worksheet naming bug in CommonAPI (Issue #34).
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Sep 10, 2021
1 parent 23a3c33 commit 4f851d9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ISADotnet/JsonIO/AssayCommonAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ module AssayCommonAPI =

static member fromAssay (assay : Assay) =
assay.ProcessSequence |> Option.defaultValue []
|> List.groupBy (fun x -> x.Name.Value.Split '_' |> Array.item 0)
|> List.groupBy (fun x ->
// Data Stewards use '_' as seperator to distinguish between protocol template types.
// Exmp. 1SPL01_plants, in these cases we need to find the last '_' char and remove from that index.
let lastUnderScoreIndex = x.Name.Value.LastIndexOf '_'
x.Name.Value.Remove lastUnderScoreIndex
// Could also be done with `x.ExecutesProtocol.Value.Name.Value`. But i am unsure if this will create further problems.

)
|> List.map (fun (name,processes) -> RowWiseSheet.fromProcesses name processes)
|> RowWiseAssay.create (*(assay.FileName |> Option.defaultValue "")*)

Expand All @@ -109,8 +116,6 @@ module AssayCommonAPI =
File.ReadAllText path
|> RowWiseAssay.fromString



type ParameterColumn =
{
[<JsonPropertyName(@"category")>]
Expand Down

0 comments on commit 4f851d9

Please sign in to comment.