let isovar
?(configuration=Tools.Isovar.Configuration.default)
vcf bam =
let v = get_vcf (AF.get_file vcf) in
let b = get_bam (AF.get_file bam) in
let reference_build =
if v#product#reference_build = b#product#reference_build
then v#product#reference_build
else
ksprintf failwith "VCF and Bam do not agree on their reference build: bam: %s Vs vcf: %s"
b#product#reference_build v#product#reference_build
in
let output_file =
Name_file.in_directory ~readable_suffix:"isovar.csv" Config.work_dir [
Tools.Isovar.Configuration.name configuration;
reference_build;
(Filename.chop_extension (Filename.basename v#product#path));
(Filename.chop_extension (Filename.basename b#product#path));
] in
Isovar_result (
Tools.Isovar.run ~configuration ~run_with ~reference_build
~vcf:v ~bam:b ~output_file
)
|> AF.with_provenance "isovar" ["vcf", AF.get_provenance vcf;
"bam", AF.get_provenance bam]
~string_arguments:[
"reference-build", reference_build;
"configuration-name", Tools.Isovar.Configuration.name configuration;
]
~json_arguments:[
"configuration", Tools.Isovar.Configuration.to_json configuration;
]