struct
type t = int
with sexp
let of_int x =
if (0 <= x) && (x <= 65535) then
Ok x
else
error "flag out of range" x sexp_of_int
let flag_is_set s f = (f land s) <> 0
let has_multiple_segments = flag_is_set 0x1
let each_segment_properly_aligned = flag_is_set 0x2
let segment_unmapped = flag_is_set 0x4
let next_segment_unmapped = flag_is_set 0x8
let seq_is_reverse_complemented = flag_is_set 0x10
let next_seq_is_reverse_complemented = flag_is_set 0x20
let first_segment = flag_is_set 0x40
let last_segment = flag_is_set 0x80
let secondary_alignment = flag_is_set 0x100
let not_passing_quality_controls = flag_is_set 0x200
let pcr_or_optical_duplicate = flag_is_set 0x400
let supplementary_alignment = flag_is_set 0x800
end