simulation_pipeline.mli 2.36 KB
Newer Older
1
open Bistro
Philippe Veber's avatar
Philippe Veber committed
2
open File_formats
3 4

type tree =
Philippe Veber's avatar
Philippe Veber committed
5
  | NHX of nhx file
6
  | Pair_tree of {
7 8 9
      npairs : int;
      branch_length1 : float;
      branch_length2 : float;
10 11
    }

12
module type S = sig
13
  type query
14

15
  include Detection_pipeline.S with type query := query
16

17
  val alignment_plot : query -> svg file
18 19
end

20 21 22 23
module Mutsel : sig
  include S

  val query :
24 25 26 27 28 29 30 31 32
    ?branch_scale:float ->
    ?ne_s:float * float ->
    ?gBGC:float * float ->
    ?seed:int ->
    tree:tree ->
    profiles:string ->
    n_h0:int ->
    n_ha:int ->
    unit ->
33 34
    query

35
  val simulation :
36
    query ->
37 38
    Codepitk.Simulator.Site_independent_mutsel.simulation workflow

39

40 41 42 43 44 45 46 47
  type benchmark = {
    method_labels : string list ;
    method_outputs : float option array list ;
    average_precision : (float * (float * float)) list ;
    site_model : [`Convergent | `Non_convergent] array ;
    ancestral_counts : int Phylogenetics.Amino_acid.table array ;
    convergent_counts : int Phylogenetics.Amino_acid.table array ;
  }
48

49

50 51 52 53 54
  val benchmark_statistics :
    Codepitk.Simulator.Site_independent_mutsel.simulation workflow ->
    labels:string list ->
    results:(text file * int) list ->
    binary_file file
55

56 57 58
  (* val benchmark : t -> (t -> text file) list -> benchmark workflow
   *
   * val rds_of_benchmark : benchmark workflow -> rds file *)
59

60 61 62 63
  (** stuff for gbgc SBME paper *)
  type gBGC_t =
    | Global of float
    | Convergent of float * float
64

65
  type param_t
66

67
  val explore_params : f:(param_t -> 'a) -> ((float * gBGC_t) * 'a) list
68

69
  val simu_of_param : ?n_h0:int -> param_t -> query
70

71 72
  val filter_results :
    f:('a -> bool) -> (param_t * 'a) list -> (param_t * 'a) list
73

74
  type record_t
75

76
  val record_of_simu : query -> record_t workflow
77

78 79
  val realistic_result : record_t -> bool
end
80

81 82
module Bppseqgen : sig
  type t
83

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
  val bppseqgen_mixed :
    ?ne_s:float ->
    ?seed:int ->
    tree:tree ->
    profiles:string ->
    n_h0:int ->
    n_ha:int ->
    unit ->
    t

  val bppseqgen :
    hyp:Convergence_hypothesis.t ->
    tree:tree ->
    profiles:string ->
    nb_sites:int ->
    seed:int ->
    t
101

102 103 104 105 106
  include Detection_pipeline.Query with type t := t

  include Detection_pipeline.S with type query := t

  val oracle : t -> text file
107

108 109 110
  val alignment_plot : t -> svg file

  val multinomial_benchmark : t -> pdf file
111

112 113 114 115
  val benchmark : ?mode:[ `fast | `full ] -> t -> svg file

  val benchmark2 : t -> pdf file
end