let bam_left_align ~reference_build bamf =
let bam = get_bam (AF.get_file bamf) in
let output =
Name_file.from_path bam#product#path ~readable_suffix:"_left-aligned.bam"
[Filename.basename bam#product#path] in
Bam (Tools.Freebayes.bam_left_align ~reference_build ~bam ~run_with output)
|> AF.with_provenance "bam-left-align" ["bam", AF.get_provenance bamf]
~string_arguments:["reference-build", reference_build]