Skip to content

Commit

Permalink
wip more restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Aug 1, 2023
1 parent 59f52e4 commit cd4f08b
Show file tree
Hide file tree
Showing 18 changed files with 530 additions and 534 deletions.
123 changes: 121 additions & 2 deletions playground.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#r "nuget: DocumentFormat.OpenXml"
#r "nuget: FSharpAux"
#r "nuget: FsOboParser"
#r "nuget: FsSpreadsheet, 3.1.1"
#r "nuget: FsSpreadsheet.ExcelIO, 3.1.1"
#r "nuget: FSharp.FGL"
Expand All @@ -21,7 +22,6 @@ open FSharp.FGL.ArrayAdjacencyGraph
open System.Collections.Generic



//#r "c:/repos/csbiology/fsspreadsheet/src/FsSpreadsheet/bin/Debug/netstandard2.0/FsSpreadsheet.dll"
//#r "c:/repos/csbiology/fsspreadsheet/src/FsSpreadsheet.CsvIO/bin/Debug/netstandard2.0/FsSpreadsheet.CsvIO.dll"
//#r "c:/repos/csbiology/fsspreadsheet/src/FsSpreadsheet.ExcelIO/bin/Debug/netstandard2.0/FsSpreadsheet.ExcelIO.dll"
Expand All @@ -34,20 +34,139 @@ open System.Collections.Generic

open FsSpreadsheet
open FsSpreadsheet.ExcelIO
open FsOboParser
//open FsSpreadsheet.DSL
open ControlledVocabulary
open ControlledVocabulary.ParamBase
open ArcGraphModel


let expectedTermValuesSimple =
[
[""]
[""]
[""]
[""]
[""]
[""]
[""; "iid"]
[""; "ititle"]
[""; "idesc"]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""; "Maus"; "Keider"; "müller"; "oih"]
[""; "Oliver"; "andreas"]
[""; "L. I."; "C."]
[""; "[email protected]"]
[""]
[""]
[""]
[""; "Affe"]
[""]
[""]
[""]
[""]
[""; "sid"]
[""; "stitle"]
[""; "sdesc"]
[""]
[""]
[""; "sid\isa.study.xlsx"]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""; "aid\isa.assay.xlsx"; "aid2\isa.assay.xlsx"]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""; "weil"]
[""; "lukas"]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
[""]
]

let allExpectedMetadataTermsFull =
Terms.InvestigationMetadata.cvTerms
|> List.skip 1
|> List.zip expectedTermValuesSimple
|> List.map (fun (values,term) ->
values |> List.map ( fun v -> CvParam(term, ParamValue.Value v, []))
)
|> List.concat

let parsedInvestigationMetadataSimple = Investigation.parseMetadataSheetfromXlsxFile (__SOURCE_DIRECTORY__ + "/tests/ArcGraphModel.Tests/Fixtures/correct/investigation_simple.xlsx")

let i_fs = FsWorkbook.fromXlsxFile (__SOURCE_DIRECTORY__ + "/tests/ArcGraphModel.Tests/Fixtures/correct/investigation_simple.xlsx")

(FsWorkbook.getWorksheetByName "isa_investigation" i_fs).CellCollection.GetCells()
|> Seq.filter(fun c -> c.RowNumber = 1)

parsedInvestigationMetadataSimple
|> List.skip 20
|> List.take 20

// Assay annotation table parsing

let assayTokens = Assay.parseAnnotationTablesFromFile (__SOURCE_DIRECTORY__ + "/tests/ArcGraphModel.Tests/Fixtures/correct/assay_with_single_characteristics.xlsx")

// Investigation metadata parsing

let investigationTokens = Investigation.parseMetadataSheetfromXlsxFile (__SOURCE_DIRECTORY__ + "/tests/ArcGraphModel.Tests/Fixtures/correct/full_investigation_mkay.xlsx")

//let inves = FsWorkbook.fromXlsxFile @"C:\Users\revil\OneDrive\CSB-Stuff\NFDI\testARC30\isa.investigation.xlsx"
//let inves = FsWorkbook.fromXlsxFile @"C:\Users\olive\OneDrive\CSB-Stuff\NFDI\testARC30\isa.investigation.xlsx"
let inves = FsWorkbook.fromXlsxFile (__SOURCE_DIRECTORY__ + "/tests/ArcGraphModel.Tests/Fixtures/isa.investigation.xlsx")
let inves = FsWorkbook.fromXlsxFile (__SOURCE_DIRECTORY__ + "/tests/ArcGraphModel.Tests/Fixtures/correct/full_investigation_mkay.xlsx")

let invesWs = FsWorkbook.getWorksheets inves |> Seq.head
invesWs.RescanRows()
Expand Down
File renamed without changes.
29 changes: 18 additions & 11 deletions src/ArcGraphModel/ArcGraphModel.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@
<None Include="structural_ontologies/assay_metadata_structural_ontology.yml" />

<Compile Include="Address.fs" />
<Compile Include="ISA\Terms.fs" />
<Compile Include="ISA\AnnotationTable.fs" />
<Compile Include="ISA\Regex.fs" />
<Compile Include="ISA\KeyParser.fs" />
<Compile Include="ISA\Tokenization.fs" />
<Compile Include="ISA\TokenAggregation.fs" />
<Compile Include="ISA\Worksheet.fs" />
<Compile Include="ISA\TopLevelParsers.fs" />

<Compile Include="Terms.fs" />

<Compile Include="Regex.fs" />

<Compile Include="AnnotationTable.fs" />

<Compile Include="MetadataSheet.fs" />

<Compile Include="Tokenization.fs" />

<Compile Include="Workbook.fs" />
<Compile Include="Worksheet.fs" />
<Compile Include="TopLevelParsers.fs" />
</ItemGroup>


Expand All @@ -38,9 +44,6 @@
<RepositoryType>git</RepositoryType>
</PropertyGroup>


<ItemGroup />

<ItemGroup>
<ProjectReference Include="..\ControlledVocabulary\ControlledVocabulary.fsproj" PackageVersion="[0.0.0, 1.0.0)" />
<PackageReference Include="FSharp.FGL.ArrayAdjacencyGraph" Version="[0.0.2]" />
Expand All @@ -50,6 +53,10 @@
<PackageReference Include="FsSpreadsheet.ExcelIO" Version="[3.1.1]" />
</ItemGroup>

<ItemGroup>
<Folder Include="ISA\" />
</ItemGroup>

<Target Name="UseExplicitPackageVersions" BeforeTargets="GenerateNuspec">
<ItemGroup>
<_ProjectReferenceWithExplicitPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.PackageVersion)' != ''" />
Expand Down
Loading

0 comments on commit cd4f08b

Please sign in to comment.