package biocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=4cf944bcae5d36bf47b67f6bcb2455d7
sha512=0262b5768aefd7c080f664c46c88876fce9a658cc6a87358a77b7112c49ae3042e7ab542e76be5738fbaeda853149b308b48d4897960b5c7ae3b4da71d978bd8
doc/biocaml.unix/Biocaml_unix/Bgzf/index.html
Module Biocaml_unix.Bgzf
I/O on Blocked GNU Zip format (BGZF) files
val open_in : string -> in_channelOpens a BGZF file for reading.
val of_in_channel : in_channel -> in_channelUses a regular channel to read a BGZF compressed file.
val close_in : in_channel -> unitCloses an open file. The channel cannot be used after that call.
val dispose_in : in_channel -> unitReleases the resources associated to a (BGZF) channel (it can thus not be used after that call), apart from the underlying regular channel (which can be used further).
val seek_in : in_channel -> Core_kernel.Int64.t -> unitseek_in iz p moves the current handler to the position p, a so-called virtual file offset, as described in paragraph 4.1.1 of the SAM/BAM format specification. The upper 48 bits correspond to a standard file offset which must match a block beginning, and the lower 16 correspond to an offset in the uncompressed data of the block.
val virtual_offset : in_channel -> Core_kernel.Int64.tvirtual_offset iz provides the current position in the file using the same encoding than for seek_in.
Exception signaling an incorrect format while reading data from an open file. All input functions may raise this exception.
val input_char : in_channel -> charval input_u8 : in_channel -> intval input_s8 : in_channel -> intval input_u16 : in_channel -> intval input_s16 : in_channel -> intval input_s32 : in_channel -> int32val input : in_channel -> string -> int -> int -> intinput ic buf pos len reads at most len characters in file ic, stores them in string buf at position pos, and returns the number of characters actually read.
val really_input : in_channel -> string -> int -> int -> unitSame as input but reads exactly len characters.
val input_string : in_channel -> int -> stringSame as really_input but returns the result in a fresh string.
val with_file_in : string -> f:(in_channel -> 'a) -> 'awith_file_in fn ~f opens a channel for reading, pass it to f, and returns the result after having closed the channel. If the call to f raises an exception, it is caught and the channel is closed before the exception is re-raised.
val open_out : ?level:int -> string -> out_channelopen_out ~level fn opens the file at path fn for writing a BGZF-compressed file with compression level level (default is 6, legal values are 1 to 9).
val of_out_channel : ?level:int -> out_channel -> out_channelUses a regular channel to write a BGZF compressed file.
val close_out : out_channel -> unitCloses a file opened for writing. The channel must not be used after that call.
val dispose_out : out_channel -> unitReleases the resources associated to a (BGZF) channel (it can thus not be used after that call), apart from the underlying regular channel (which can be used further).
val output : out_channel -> string -> int -> int -> unitoutput oc buf pos len writes len characters of string buf from position pos into the compressed file oc.
val output_char : out_channel -> char -> unitval output_u8 : out_channel -> int -> unitoutput_u8 oz n writes the 8 least significant bits onto channel oz
val output_s8 : out_channel -> int -> unitoutput_s8 oz n writes a signed representation of n, if n is between -128 and 127.
val output_u16 : out_channel -> int -> unitoutput_u16 oz n writes the 16 least significant bits onto channel oz
val output_s16 : out_channel -> int -> unitoutput_s8 oz n writes a signed representation of n, if n is between -32768 and 32767.
val output_s32 : out_channel -> int32 -> unitoutput_s32 oz n writes a signed representation of n.
val output_string : out_channel -> string -> unitval with_file_out : ?level:int -> string -> f:(out_channel -> 'a) -> 'awith_file_out ~level fn ~f opens a file for writing at compression level level (default is 6), passes the channel to f and returns the result after closing the channel. If the call to f raises an exception, it is re-raised after closing the channel.