let bam_of_input_exn u =
let open Input in
match u with
| Fastq _ -> failwith "Can't pass Input.t Fastq to bam_of_input_exn"
| Bam {bam_sample_name; path; how; sorting; reference_build} ->
let f = Bfx.input_url path in
Bfx.bam ~sample_name:bam_sample_name ?sorting ~reference_build f