An OBO file format parser, written in F#.
openOBO.NETlettestOntology= OboOntology.fromFile true filepathOOP style (recommended):
letmyOboTerm= OboTerm.Create("TO:00000000", Name ="testTerm", CreatedBy ="myself")Functional style:
letmyOboTerm= 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") NoneletmyOntology= OboOntology.create [myOboTerm][]OboOntology.toFile "myOboOntology.obo" myOntologylettermOfInterest= testOntology.Terms[5]letisAs= OboOntology.getIsAs termOfInterest testOntology
// output is a list of (input OboTerm * is_a OboTerm (if it exists in the given OboOntology))lettermOfInterest= testOntology.Terms[5]letisAs= testOntology.GetParentOntologyAnnotations(termOfInterest.Id)// output is an ISADotNet.OntologyAnnotation listletisAsTerms= isAs |> List.map (fun oa -> testOntology.GetTerm(oa.TermAccessionString.ToString()))// output is an OboTerm listlettermOfInterest= testOntology.Terms[5]letrelatedTerms= OboOntology.getRelatedTerms termOfInterest testOntology
// output is a list of (input OboTerm * relation as string * related OboTerm (if it exists in the given OboOntology))lettermOfInterest= testOntology.Terms[5]letsynonyms= OboOntology.tryGetSynonyms termOfInterest testOntology
// output is a seq of (TermSynonymScope * synonymous OboTerm (if it exists in the given OboOntology))TermRelations are abstractions of all relations that an OboTerm can have with another one. Such TermRelations can be
Empty of SourceTerm(if there is no TermRelation between a SourceTerm and a TargetTerm),TargetMissing of Relation * SourceTerm(if there is a TermRelation between a SourceTerm and a TargetTerm but the TargetTerm is missing),- and
Target of Relation * SourceTerm * TargetTerm. Relation is of generic type'aand can therefore be of any type that you prefer (e.g.stringor a custom-made Record or Union).
lettermOfInterest= testOntology.Terms[5]lettargetOfInterest= testOntology.Terms[7]letemptyTermRelation= Empty termOfInterest
lettargetMissingTermRelation= TargetMissing ("unconnected_to", termOfInterest)lettargetTermRelation= Target ("connected_to", termOfInterest, targetOfInterest)// exemplarytypeMyRelation=| IsA
| HasA
| PartOf
| ConnectedTo
| Unknown ofstringlettargetTermRelation' = Target (ConnectedTo, termOfInterest, targetOfInterest)lettermOfInterest= testOntology.Terms[5]letrelations= OboOntology.getRelations termOfInterest testOntology
// output is a list of TermRelations<string> (includes all relationships and is_as)If not already done, install .NET SDK >= 6.
In any shell, run build.cmd <target> where <target> may be
- if
<target>is empty, it just runs dotnet build after cleaning everything RunTeststo run unit testsRunTestsWithCodeCovto run unit tests with code coverage
ReleaseNotes semver:<version>where<version>may bemajor,minor, orpatchto update RELEASE_NOTES.mdPackto create a NuGet releasePackPreleaseto create a NuGet prerelease
BuildDocsto create docsBuildDocsPrereleaseto create prerelease docs
WatchDocsto create docs and run them locallyWatchDocsPreleaseto create prerelease docs and run them locallyPublishNugetto create a NuGet release and publish itPublishNugetPreleaseto create a NuGet prerelease and publish it