Header menu logo BioFSharp

Obo parsing

BinderScriptNotebook

Summary: This example shows how to parse obo formatted files with BioFSharp

OBO format is a popular ontology file format. It can express a subset of the description logic language OWL-DL 2.0 but in addition has standard syntax for representing important classes of meta-data including as synonyms, references to publications and deprecated IDs. It is designed to be human readable and editable.

Reading Obo files

open FSharpAux.IO
open BioFSharp.IO

let fileDir = __SOURCE_DIRECTORY__ + "/data/"  

let psiMs = 
    Seq.fromFile (fileDir + "Psi-MS.obo")
    |> Obo.parseOboTerms true
    |> Seq.toArray

psiMs.[0]
Warning: Output, it-value and value references require --eval
namespace FSharpAux
namespace FSharpAux.IO
namespace BioFSharp
namespace BioFSharp.IO
val fileDir: string
val psiMs: Obo.OboTerm array
Multiple items
module Seq from Microsoft.FSharp.Collections

--------------------
type Seq = static member CSV: separator: string -> header: bool -> flatten: bool -> data: 'a seq -> string seq static member CSVwith: valFunc: ('a -> ('a -> obj) array) -> strFunc: (string -> bool -> obj -> obj -> string) -> separator: string -> header: bool -> flatten: bool -> data: 'a seq -> string seq static member fromFile: filePath: string -> string seq static member fromFileWithCsvSchema: filePath: string * separator: char * firstLineHasHeader: bool * ?skipLines: int * ?skipLinesBeforeHeader: int * ?schemaMode: SchemaModes -> 'schema seq static member fromFileWithSep: separator: char -> filePath: string -> string array seq static member stringFunction: separator: string -> flatten: bool -> input: 'a -> (obj -> string) static member valueFunction: dataEntry: 'a -> ('a -> obj) array static member write: path: string -> data: 'a seq -> unit static member writeOrAppend: path: string -> data: 'a seq -> unit
static member Seq.fromFile: filePath: string -> string seq
module Obo from BioFSharp.IO
<summary> Functions for par </summary>
val parseOboTerms: verbose: bool -> input: string seq -> Obo.OboTerm seq
<summary> Parse Obo Terms [Term] from seq&lt;string&gt; </summary>
val toArray: source: 'T seq -> 'T array

Type something to start searching.