Permalink
Browse files

phylomel: misc

  • Loading branch information...
1 parent 2e15a18 commit c4fa3d2d4caf836e737d5c00cb65664b733597bb @aryx aryx committed Sep 10, 2011
View
No changes.
@@ -0,0 +1,7 @@
+
+val do_calc_forces:
+ Vec2.t array -> BarnesHut.body array -> Phylogram.tree_figure -> unit
+
+val body_of_pos:
+ ?v:Vec2.t -> Vec2.t -> BarnesHut.body
+
@@ -164,7 +164,7 @@ let radial_layout ?(margin= (10.,10.)) ?(reframe = false) width tree =
crop_height h' xs
*)
-let put_points out ?(links_info = None) fig genos =
+let put_points out ?(links_info = None) fig nodeinfo =
let printPoint i {x=x; y=y} =
Svg.circle out
@@ -179,7 +179,7 @@ let put_points out ?(links_info = None) fig genos =
Svg.text out
~anchor:"middle"
~weight:"bold"
- (Genotype.description genos.(i))
+ (nodeinfo i)
(x, y+.4.)
| Some(links,target) ->
let link = links.(i) in
@@ -188,7 +188,7 @@ let put_points out ?(links_info = None) fig genos =
~weight:"bold"
~link:link
~target:target
- (Genotype.description genos.(i))
+ (nodeinfo i)
(x, y+.4.)
end;
@@ -234,7 +234,7 @@ let put_lines out fig =
Array.iteri print_line ps
-let write_svg ?(links_info = None) collec fig out =
+let write_svg ?(links_info = None) nodeinfo fig out =
(*let x0, y0 = margin in
let fig = reframe ~margin:margin fig in
let fig = crop_width (float_of_int(w) -. 2.*.x0) fig in*)
@@ -244,14 +244,14 @@ let write_svg ?(links_info = None) collec fig out =
Svg.put out (Svg.header w h);
put_lines out fig;
- put_points out ~links_info:links_info fig collec.Genotypes.genos;
+ put_points out ~links_info:links_info fig nodeinfo;
Svg.close out
-let write_svg_file ?(links_info = None) collec fig file =
+let write_svg_file ?(links_info = None) nodeinfo fig file =
let out = IO.output_channel (open_out file) in
- write_svg ~links_info:links_info collec fig out
+ write_svg ~links_info:links_info nodeinfo fig out
(*let test =
let t = {
@@ -0,0 +1,4 @@
+country;town
+200;0,0,1,2;g0;xx
+201;0,0,1,3;g1;yy
+202;1,0,1,2;g2;zz
View
@@ -118,6 +118,25 @@ let test_phylomel geno_file =
in
let dmat = GenoMat.create collec in
let tree = Tree.prim_complete collec dmat in
+(*
+ let dist_mat =
+ [|
+ [||];
+ [|1|];
+ [|1;2|];
+ |]
+ in
+ let adj_mat =
+ [|
+ [||];
+ [|true|];
+ [|true;false|];
+ |]
+ in
+
+ let tree = Tree.create adj_mat dist_mat in
+ let infos = [|"n0"; "n1"; "n2"|] in
+*)
let fig = Phylogram.radial_layout ~reframe:false 800. tree in
@@ -138,8 +157,13 @@ let test_phylomel geno_file =
(* let x0 = 10. in *)
(* unsafe_reframe (10., 10.) fig.ps; *)
(* unsafe_crop_width (800.-.2.*.x0) fig.ps; *)
+
+ let nodeinfo =
+ (fun i -> Genotype.description collec.Genotypes.genos.(i))
+ (* (fun i -> infos.(i)) *)
+ in
- Phylogram.write_svg_file collec fig svg_file;
+ Phylogram.write_svg_file nodeinfo fig svg_file;
()
View
@@ -295,9 +295,10 @@
(join-string
(list
"-debugger"
- (case 0
+ (case 1
(0 "-test_phylomel /home/pad/pfff/external/phylomel/tests/geno0 ")
+ (1 "-test_phylomel /home/pad/pfff/external/phylomel/tests/geno_simple")
)
)
)

0 comments on commit c4fa3d2

Please sign in to comment.