struct
type t = {
name: string;
with_cosmic: bool;
with_dbsnp: bool;
parameters: (string * string) list;
}
let to_json {name; with_cosmic; with_dbsnp; parameters}: Yojson.Basic.json =
`Assoc [
"name", `String name;
"with-cosmic", `Bool with_cosmic;
"with-dbsnp", `Bool with_dbsnp;
"parameters",
`Assoc (List.map parameters ~f:(fun (a, b) -> a, `String b));
]
let render {parameters; _} =
List.concat_map parameters ~f:(fun (a,b) -> [a; b])
let default =
{name = "default";
with_cosmic = true; with_dbsnp = true;
parameters = []}
let default_without_cosmic =
{name = "default_without_cosmic";
with_cosmic = false; with_dbsnp = true;
parameters = []}
let name t = t.name
end