package biotk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file sam.ml

1
2
3
4
5
6
7
8
9
10
11
12
open Core_kernel

type header = Biocaml_unix.Sam.header
type alignment = Biocaml_unix.Sam.alignment

let fold fn ~init ~f =
  let open Or_error.Monad_infix in
  In_channel.with_file fn ~f:(fun ic ->
      Biocaml_unix.Sam.read ic >>= fun (header, alignments) ->
      let f = f header in
      CFStream.Stream.Or_error.fold' alignments ~init ~f
    )