let raw_to_string () =
let to_string = function
| `comment c -> sprintf "@CO\t%s\n" c
| `header (t, l) ->
sprintf "@%s\t%s\n" t
(List.map l (fun (a,b) -> sprintf "%s:%s" a b)
|> String.concat ~sep:"\t")
| `alignment a -> alignment_to_string a
in
Biocaml_transform.of_function ~name:"sam_to_string" to_string