Types
= private [< `CO | `HD | `Other of string | `PG | `RG | `SQ ]
Header item tags define the different types of header lines. The
term "tag" in this context should not be confused with its use in
"tag-value" pairs, which comprise the content of header items.
type
tag_value = private string * string
A tag-value pair comprising the content of header items. Tag-value
pairs occur in other places too, but this type is specifically for
those in the header.
type
sort_order = [ `Coordinate | `Query_name | `Unknown | `Unsorted ]
= private {
}
@HD. A header consists of different types of lines. Confusingly, one of
these types is called the "header line", which is what this
type refers to. It does not refer generically to any line within a
header.
type
ref_seq = private {
|
name : string ; |
|
length : int ; |
|
assembly : string option ; |
|
md5 : string option ; |
|
species : string option ; |
|
uri : string option ; |
}
@SQ. Reference sequence.
type
platform = [ `Capillary
| `Helicos
| `Illumina
| `Ion_Torrent
| `LS454
| `Pac_Bio
| `Solid ]
type
read_group = private {
|
id : string ; |
|
seq_center : string option ; |
|
description : string option ; |
|
run_date : [ `Date of Core.Std.Date.t | `Time of Core.Std.Time.t ] option ; |
|
flow_order : string option ; |
|
key_seq : string option ; |
|
library : string option ; |
|
program : string option ; |
|
predicted_median_insert_size : int option ; |
|
platform : platform option ; |
|
platform_unit : string option ; |
|
sample : string option ; |
}
@RG.
type
program = private {
|
id : string ; |
|
name : string option ; |
|
command_line : string option ; |
|
previous_id : string option ; |
|
description : string option ; |
|
version : string option ; |
}
@PG.
= private {
}
-
sort_order
: Guaranteed to be
None
if
version = None
.
ref_seqs
: List of @SQ items. Order matters; it dictates
alignment sorting order when sort_order = `Coordinate
.
read_groups
: Unordered list of @RG items.
programs
: List of @PG lines. Currently unordered, but we should
topologically sort.
comments
: Unordered list of @CO lines.
Alignment Types
module Flags:
sig
type
t = private int
Flags are represented as a "bit map".
val of_int : int -> t Core.Std.Or_error.t
end
type
cigar_op = private [< `Alignment_match of int
| `Deletion of int
| `Hard_clipping of int
| `Insertion of int
| `Padding of int
| `Seq_match of int
| `Seq_mismatch of int
| `Skipped of int
| `Soft_clipping of int ]
CIGAR operations.
type
optional_field_value = private [< `A of char
| `B of char * string list
| `H of string
| `Z of string
| `f of float
| `i of Core.Std.Int32.t ]
The constructor encodes the TYPE and each carries its
corresponding VALUE.
type
optional_field = private {
}
type
rnext = private [< `Equal_to_RNAME | `Value of string ]
type
alignment = private {
|
qname : string option ; |
|
flags : Flags.t ; |
|
rname : string option ; |
|
pos : int option ; |
|
mapq : int option ; |
|
cigar : cigar_op list ; |
|
rnext : rnext option ; |
|
pnext : int option ; |
|
tlen : int option ; |
|
seq : string option ; |
|
qual : Biocaml_phred_score.t list ; |
|
optional_fields : optional_field list ; |
}
For cigar
and qual
, empty list indicates no value, i.e. '*',
was given.
module MakeIO: functor (
Future
:
Future.S
) ->
sig
end
Low-level Parsers and Constructors
: version:string ->
?sort_order:sort_order ->
unit -> header_line Core.Std.Or_error.t
Low-level Header Parsers and Constructors
val ref_seq : name:string ->
length:int ->
?assembly:string ->
?md5:string ->
?species:string ->
?uri:string -> unit -> ref_seq Core.Std.Or_error.t
val read_group : id:string ->
?seq_center:string ->
?description:string ->
?run_date:string ->
?flow_order:string ->
?key_seq:string ->
?library:string ->
?program:string ->
?predicted_median_insert_size:int ->
?platform:platform ->
?platform_unit:string ->
?sample:string -> unit -> read_group Core.Std.Or_error.t
The run_date
string will be parsed as a Date.t or Time.t,
whichever is possible. If it is a time without a timezone, local
timezone will be assumed.
: string -> string Core.Std.Or_error.t
: Biocaml_internal_utils.Line.t -> header_item Core.Std.Or_error.t
: string -> header Core.Std.Or_error.t
val alignment : ?ref_seqs:Core.Std.String.Set.t ->
?qname:string ->
flags:Flags.t ->
?rname:string ->
?pos:int ->
?mapq:int ->
?cigar:cigar_op list ->
?rnext:rnext ->
?pnext:int ->
?tlen:int ->
?seq:string ->
?qual:Biocaml_phred_score.t list ->
?optional_fields:optional_field list ->
unit -> alignment Core.Std.Or_error.t
Low-level Alignment Parsers and Constructors
val parse_qname : string -> string option Core.Std.Or_error.t
val parse_rname : string -> string option Core.Std.Or_error.t
val parse_pos : string -> int option Core.Std.Or_error.t
val parse_mapq : string -> int option Core.Std.Or_error.t
val parse_pnext : string -> int option Core.Std.Or_error.t
val parse_tlen : string -> int option Core.Std.Or_error.t
val parse_seq : string -> string option Core.Std.Or_error.t
Low-level Printers
val print_qname : string option -> string
Low-level Alignment Printers
val tag_value_of_sexp : Sexplib.Sexp.t -> tag_value
A tag-value pair comprising the content of header items. Tag-value
pairs occur in other places too, but this type is specifically for
those in the header.
: Sexplib.Sexp.t -> header_line
@HD. A header consists of different types of lines. Confusingly, one of
these types is called the "header line", which is what this
type refers to. It does not refer generically to any line within a
header.
-
sort_order
: Guaranteed to be
None
if
version = None
.
ref_seqs
: List of @SQ items. Order matters; it dictates
alignment sorting order when sort_order = `Coordinate
.
read_groups
: Unordered list of @RG items.
programs
: List of @PG lines. Currently unordered, but we should
topologically sort.
comments
: Unordered list of @CO lines.
Alignment Types
Flags are represented as a "bit map".
Low-level Parsers and Constructors
Low-level Header Parsers and Constructors
The run_date
string will be parsed as a Date.t or Time.t,
whichever is possible. If it is a time without a timezone, local
timezone will be assumed.
Low-level Optional field Parsers and Constructors
Low-level Optional field Parsers and Constructors
Low-level Alignment Parsers and Constructors
Low-level Printers
Low-level Alignment Printers