package biocaml
Install
Dune Dependency
Authors
Maintainers
Sources
md5=497e3f2f7128a6ca347d66848da38a3d
sha512=4a76ebbafda3bc944afaff40d69791dfe153a0638ef5d7e6e1bc962b7f991d9545cd0af2d7930b39f8b31dbf067d0603cfa03d9b7a49396ab1ae452df47fd1f3
doc/biocaml.ez/Biocaml_ez/Bam/index.html
Module Biocaml_ez.Bam
include module type of struct include Biocaml_unix.Bam end
A BAM file is composed of a header and a list of alignment records. The datatypes used in this module are based on those defined in the Sam
module.
module Header = Biocaml_unix.Bam.Header
BAM header files contain a plain text SAM header, plus additional information related to the encoding of the file.
type alignment = Biocaml_unix.Sam.alignment
module Alignment0 = Biocaml_unix.Bam.Alignment0
Representation of partially parsed alignments. When traversing a BAM file for a specific calculation, it may be that only some fields of the alignment records are actually used. In that case, it can be significantly faster to use this representation. As a downside, some encoding errors in the BAM file can go unnoticed.
val read0 :
Core_kernel.In_channel.t ->
(Header.t * Alignment0.t Core_kernel.Or_error.t Stream.t)
Core_kernel.Or_error.t
read0 ic
returns an error if a valid header cannot be read from ic
or a pair containing a header and a stream of possibly errored (partially parsed) alignments. The stream stops after the first error.
val write0 :
Header.t ->
Alignment0.t Stream.t ->
Core_kernel.Out_channel.t ->
unit
write0 h xs oc
writes the header h
and (partially parsed) alignments xs
to oc
.
val read :
Core_kernel.In_channel.t ->
(Header.t * alignment Core_kernel.Or_error.t Stream.t) Core_kernel.Or_error.t
read ic
returns an error if a valid header cannot be read from ic
or a pair containing a header and a stream of possibly errored alignments. The stream stops after the first error.
val write :
Header.t ->
alignment Stream.t ->
Core_kernel.Out_channel.t ->
unit Core_kernel.Or_error.t
write h xs oc
writes the header h
and the alignments xs
to oc
.
Low-level access
val read_header :
Biocaml_unix.Bgzf.in_channel ->
Header.t Core_kernel.Or_error.t
val read_alignment :
Biocaml_unix.Bgzf.in_channel ->
Alignment0.t Core_kernel.Or_error.t option
val read_alignment_stream :
Biocaml_unix.Bgzf.in_channel ->
Alignment0.t Core_kernel.Or_error.t Stream.t
val with_file0 :
string ->
f:(Header.t -> Alignment0.t CFStream.Stream.t -> 'a) ->
'a