let load fn =
let matrix = load_matrix fn in
let matrix_data = load_matrix_data fn in
let annotations = load_annotation fn in
let res = String.Map.mapi matrix ~f:(fun ~key ~data -> {
id = key ;
jaspar_id = data#jaspar_id ;
collection = data#collection ;
factor_name = data#factor_name ;
factor_class = SSM.find_exn annotations (key, "class") ;
comment = (
match SSM.find annotations (key, "comment") with
| Some "-" -> None
| x -> x
) ;
family = SSM.find annotations (key, "family") ;
medline = SSM.find_exn annotations (key, "medline") ;
matrix = String.Map.find_exn matrix_data key ;
})
in
String.Map.data res