struct
type t = {
name: string;
min_reads: int;
protein_sequence_length: int;
parameters: (string * string) list;
}
let to_json {name; min_reads; protein_sequence_length; parameters}: Yojson.Basic.json =
`Assoc [
"name", `String name;
"min_reads", `Int min_reads;
"protein_sequence_length", `Int protein_sequence_length;
"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"; min_reads = 2; protein_sequence_length = 30; parameters = []}
let name t = t.name
end