let ref_genomes_workflow =
let edges_of_genome g =
let open Ref_genome in
List.filter_map [fasta; cosmic_exn; dbsnp_exn; gtf_exn; cdna_exn;]
~f:begin fun f ->
try Some (f g |> Ketrew.EDSL.depends_on) with _ -> None
end
in
let open Ketrew.EDSL in
let get_all genome =
workflow_node without_product
~name:(sprintf "Get all of %s's files"
(Ref_genome.name genome))
~edges:(edges_of_genome genome)
in
let edges =
let genomes =
Biokepi_environment_setup.Download_reference_genomes.default_genome_providers in
List.map genomes ~f:(fun (name, pull) ->
let genome = pull ~toolkit ~host ~destination_path ~run_program in
depends_on (get_all genome))
in
workflow_node without_product
~name:(sprintf "All downloads to %s" destination_path)
~tags:["biokepi"; "test"]
~edges