package biocaml
Install
Dune Dependency
Authors
Maintainers
Sources
md5=497e3f2f7128a6ca347d66848da38a3d
sha512=4a76ebbafda3bc944afaff40d69791dfe153a0638ef5d7e6e1bc962b7f991d9545cd0af2d7930b39f8b31dbf067d0603cfa03d9b7a49396ab1ae452df47fd1f3
doc/biocaml.unix/Biocaml_unix/Bed/index.html
Module Biocaml_unix.Bed
BED data files.
A BED file is in the format shown below, where columns must be separated by a tab character.
chrA lo1 hi1 chrA lo2 hi2 . . . . . . . . . chrB lo1 hi1 chrB lo2 hi2 . . . . . . . . .
The definition is that intervals are zero based and half-open. So by default the line "chrA lo hi" is parsed to the interval [lo + 1, hi]
on chromosome chrA
. Similarly, when printing, the default is to print [lo - 1, hi]
. The optional argument increment_lo_hi
allows changing this behavior for non-conformant files. In addition, the optional argument chr_map
is a string -> string
function that allows changing of the chromosome name to a specified format, and defaults to identity
.
Some tools require that the set of intervals do not overlap within each chromosome. This is not enforced, but you can use any_overlap
to verify this property when needed.
Item Types
type item = string * int * int * Table.Row.t
The type of BED data stream items.
Tags: Describe The Format: TODO
The specification of how to parse the remaining columns.
Error Types
module Error : sig ... end
Definitions of error types (with sexp
)
In_channel
Functions
exception Error of Error.t
val in_channel_to_item_stream :
?buffer_size:int ->
?more_columns:parsing_spec ->
Core_kernel.In_channel.t ->
(item, [> Error.parsing ]) Core_kernel.result Stream.t
Parse an input-channel into item
values.
val in_channel_to_item_stream_exn :
?buffer_size:int ->
?more_columns:parsing_spec ->
Core_kernel.In_channel.t ->
item Stream.t
Like in_channel_to_item_stream
but use exceptions for errors (raised within Stream.next
).
Conversions to/from Line.t
See also Line.t
.
val item_of_line :
how:parsing_spec ->
Lines.item ->
(item, [> Error.parsing ]) Core_kernel.result
Basic parsing of a single line.
val item_to_line : item -> Lines.item
Basic “printing” of one single item
.
Transforms
module Transform : sig ... end
Lower-level transforms of BED data-streams.
S-Expressions
val item_of_sexp : Sexplib.Sexp.t -> item
val sexp_of_item : item -> Sexplib.Sexp.t
val parsing_spec_of_sexp : Sexplib.Sexp.t -> parsing_spec
val sexp_of_parsing_spec : parsing_spec -> Sexplib.Sexp.t