struct
module Definition = struct
type t = {name: string; version: string option}
let create ?version name = {name; version}
let to_opam_name {name; version} =
sprintf "%s.%s" name (Option.value ~default:"NOVERSION" version)
let to_string = to_opam_name
let to_directory_name = to_opam_name
let get_version t = t.version
let get_name t = t.name
end
module Default = struct
open Definition
let bwa = create "bwa" ~version:"0.7.10"
let freebayes = create "freebayes" ~version:"1.1.0"
let sambamba = create "sambamba" ~version:"0.6.5"
let samtools = create "samtools" ~version:"1.4"
let bcftools = create "bcftools" ~version:"1.4"
let vcftools = create "vcftools" ~version:"0.1.12b"
let bedtools = create "bedtools" ~version:"2.23.0"
let somaticsniper = create "somaticsniper" ~version:"1.0.3"
let varscan = create "varscan" ~version:"2.3.5"
let mutect = create "mutect"
let gatk = create "gatk"
let strelka = create "strelka" ~version:"1.0.14"
let virmid = create "virmid" ~version:"1.1.1"
let muse = create "muse" ~version:"1.0b"
let star = create "star" ~version:"2.4.1d"
let stringtie = create "stringtie" ~version:"1.2.2"
let cufflinks = create "cufflinks" ~version:"2.2.1"
let hisat = create "hisat" ~version:"0.1.6-beta"
let hisat2 = create "hisat" ~version:"2.0.2-beta"
let mosaik = create "mosaik" ~version:"2.2.3"
let kallisto = create "kallisto" ~version:"0.42.3"
let bowtie = create "bowtie" ~version:"1.1.2"
let fastqc = create "fastqc" ~version:"0.11.5"
let igvxml = create "igvxml" ~version:"0.1.0"
let hlarp = create "hlarp" ~version:"biokepi-branch"
let samblaster = create "samblaster" ~version:"v.0.1.22"
let delly2 = create "delly2" ~version:"0.7.7"
let optitype = create "optitype" ~version:"1.2.1-0"
let seqtk = create "seqtk" ~version:"1.2"
let seq2hla = create "seq2hla" ~version:"2.2"
let picard = create "picard" ~version:"2.9.2"
let snpeff = create "snpeff" ~version:"4.3.1m-0"
let pyensembl = create "pyensembl" ~version:"1.1.0"
let vcfannotatepolyphen = create "vcf-annotate-polyphen" ~version:"0.1.2"
let topiary = create "topiary" ~version:"1.2.1"
let vaxrank = create "vaxrank" ~version:"0.6.0"
let isovar = create "isovar" ~version:"0.7.0"
end
type t = {
definition: Definition.t;
init: Program.t;
ensure: phony_workflow;
}
let create ?init ?ensure definition = {
definition;
init =
Option.value init
~default:(Program.shf "echo 'Tool %s: default init'"
(Definition.to_string definition));
ensure =
Option.value_map
ensure
~f:KEDSL.forget_product
~default:(workflow_node nothing
~name:(sprintf "%s-ensured"
(Definition.to_string definition)));
}
let init t = t.init
let ensure t = t.ensure
module Kit = struct
type tool = t
type t = Definition.t -> tool option
let concat : t list -> t =
fun l ->
fun def ->
List.find_map l ~f:(fun kit -> kit def)
let of_list l : t =
fun def ->
List.find l ~f:(fun {definition; _} -> definition = def)
let get_exn t tool =
match t tool with
| Some s -> s
| None ->
failwithf "Toolkit cannot provide the tool %s"
(Definition.to_string tool)
end
end