Skip to content

Commit

Permalink
Update Readme's minidocs
Browse files Browse the repository at this point in the history
  • Loading branch information
omaus committed Jul 26, 2023
1 parent 244881c commit 2c5aaae
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 32 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ An OBO file format parser, written in F#.
```fsharp
open FsOboParser
let myOboOntology = OboOntology.fromFile true filepath
let testOntology = OboOntology.fromFile true filepath
```

### Create OBO terms
Expand Down Expand Up @@ -65,6 +65,14 @@ let myOntology = OboOntology.create [myOboTerm] []
OboOntology.toFile "myOboOntology.obo" myOntology
```

### Get all `is_a`s of a Term recursively

```fsharp
let termOfInterest = testOntology.Terms[5]
testOntology.GetParentOntologyAnnotations(termOfInterest.Id)
```

## Develop

### Build (QuickStart)
Expand Down
66 changes: 35 additions & 31 deletions playground.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,48 @@ open System.IO

let testPath = Path.Combine(__SOURCE_DIRECTORY__, "./../../nfdi4plants/arc-validate/ErrorClassOntology.obo")

let testOboOntology = OboOntology.fromFile true testPath
let testOntology = OboOntology.fromFile true testPath

let fileLines = File.ReadAllLines testPath
//let fileLines = File.ReadAllLines testPath

OboTerm.fromLines true ((fileLines |> Seq.ofArray).GetEnumerator()) 0
//OboTerm.fromLines true ((fileLines |> Seq.ofArray).GetEnumerator()) 0

OboOntology.toFile "myOboOntology.obo" testOboOntology
//OboOntology.toFile "myOboOntology.obo" testOboOntology

Path.Combine("myOboOntology.obo") |> FileInfo
//Path.Combine("myOboOntology.obo") |> FileInfo

let myOboTerm = OboTerm.Create("TO:00000000", Name = "testTerm", CreatedBy = "myself")

let myOboTerm =
OboTerm.create
"TO:00000000"
(Some "testTerm")
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
(Some "myself")
None

OboTypeDef.Create
//let myOboTerm =
// OboTerm.create
// "TO:00000000"
// (Some "testTerm")
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// None
// (Some "myself")
// None

//OboTypeDef.Create

let myOntology = OboOntology.create [myOboTerm] []

OboOntology.toFile "myOboOntology.obo" myOntology
//OboOntology.toFile "myOboOntology.obo" myOntology

let termOfInterest = testOntology.Terms[5]

testOntology.GetParentOntologyAnnotations(termOfInterest.Id)

0 comments on commit 2c5aaae

Please sign in to comment.