Skip to content
Snippets Groups Projects
Commit 7333e2b6 authored by Dominik Brilhaus's avatar Dominik Brilhaus
Browse files

fix issue with data nodes now being objects (not free text)

parent ab95fefd
No related branches found
No related tags found
No related merge requests found
......@@ -31,16 +31,16 @@ type ArcTables with
)
|> ArcTables
// test parameters
let source = __SOURCE_DIRECTORY__
let arcPath = Path.Combine(source, "../../")
let assayName = "Talinum_RNASeq_minimal"
let startingNodeNum = 1
let startingNodeNum = 0
let outName = "rnaseq-samples"
// Load ARC
// Remove all tables with either an input or output column missing 🤣😀
let clean (a : ARC) =
a.ISA.Value.Assays |> Seq.iter (fun a ->
a.Tables
......@@ -64,7 +64,39 @@ let clean (a : ARC) =
)
a
let arc = ARC.load(arcPath) |> clean
// transform all data cells to freetext cells 😀🤣😀😀🤣😀😀🤣😀😀🤣😀😀🤣😀😀🤣😀😀🤣😀
let shittify (a : ARC) =
a.ISA.Value.Assays |> Seq.iter (fun a ->
a.Tables
|> Seq.toArray
|> Seq.iter (fun t ->
t.Values
|> Seq.toArray
|> Seq.iter (fun kv ->
if kv.Value.isData then
t.Values.[kv.Key] <- CompositeCell.createFreeText(kv.Value.AsData.NameText)
)
)
)
a.ISA.Value.Studies |> Seq.iter (fun s ->
s.Tables
|> Seq.toArray
|> Seq.iter (fun t ->
t.Values
|> Seq.toArray
|> Seq.iter (fun kv ->
if kv.Value.isData then
t.Values.[kv.Key] <- CompositeCell.createFreeText(kv.Value.AsData.NameText)
)
)
)
a
let arc = ARC.load(arcPath) |> clean |> shittify
let inv = arc.ISA.Value
......@@ -73,6 +105,7 @@ let inv = arc.ISA.Value
let firstData = inv.GetAssay(assayName).FirstData
// Create headers for output table
let headers = [
CompositeHeader.Input IOType.Sample
......@@ -95,7 +128,6 @@ let headers = [
let getRow (d: QNode) =
[|
CompositeCell.createFreeText (inv.ArcTables.SamplesOf d).[startingNodeNum].Name
for v in inv.ArcTables.ValuesOf d do
......@@ -104,7 +136,7 @@ let getRow (d: QNode) =
else
CompositeCell.Term(v.Value.AsOntology())
CompositeCell.FreeText d.Name
CompositeCell.Data (Data(name = d.Name))
|]
......@@ -113,6 +145,12 @@ let getRow (d: QNode) =
let t = ArcTable.init "FullTable"
t.Headers <- ResizeArray headers
let d = firstData.Head
inv.ArcTables.SamplesOf d
for d in firstData do
t.AddRow (getRow d)
......@@ -125,5 +163,4 @@ wb.AddWorksheet ws
// Write to csv
// wb.To (outName + ".tsv", Separator = '\t')
wb.ToXlsxFile (outName + ".xlsx")
wb.ToXlsxFile (outName + ".xlsx")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment