let flagstat bami = let bam = get_bam (AF.get_file bami) in Flagstat_result (Tools.Samtools.flagstat ~run_with bam) |> AF.with_provenance "flagstat" ["bam", AF.get_provenance bami]