Index: mds-and-trees/tree-genealogy.py
===================================================================
--- mds-and-trees/tree-genealogy.py	(revision 566)
+++ mds-and-trees/tree-genealogy.py	(revision 571)
@@ -6,6 +6,10 @@
 import argparse
 
-TIME = "GENERATIONAL"
-BALANCE = "MIN"
+TIME = "" # BIRTHS / GENERATIONAL / REAL
+BALANCE = "" # MIN / DENSITY
+
+DOT_STYLE = "" # NONE / NORMAL / CLEAR
+
+JITTER = "" #
 
 # ------SVG---------
@@ -14,6 +18,7 @@
 svg_line_style = 'stroke="rgb(90%,10%,16%)" stroke-width="1" stroke-opacity="0.8"'
 svg_dot_style = 'r="2" stroke="black" stroke-width="0.2" fill="red"'
+svg_clear_dot_style = 'r="2" stroke="black" stroke-width="0.4" fill="none"'
+
 svg_spine_line_style = 'stroke="rgb(0%,0%,80%)" stroke-width="2" stroke-opacity="1"'
-#svg_spine_dot_style = 'r="3" stroke="black" stroke-width="0.4" fill="rgb(50%,50%,100%)"'
 svg_spine_dot_style = 'r="1" stroke="black" stroke-width="0.2" fill="rgb(50%,50%,100%)"'
 
@@ -26,4 +31,28 @@
 def svg_generate_line_style(percent):
     # hotdog
+    from_col = [100, 70, 0]
+    to_col = [60, 0, 0]
+    # lava
+    # from_col = [100, 80, 0]
+    # to_col = [100, 0, 0]
+    # neon
+    # from_col = [30, 200, 255]
+    # to_col = [240, 0, 220]
+
+    from_opa = 0.2
+    to_opa = 1.0
+    from_stroke = 1
+    to_stroke = 3
+
+    opa = from_opa*(1-percent) + to_opa*percent
+    stroke = from_stroke*(1-percent) + to_stroke*percent
+
+    percent = 1 - ((1-percent)**20)
+
+    return 'stroke="rgb(' + str(from_col[0]*(1-percent) + to_col[0]*percent) + '%,' \
+           + str(from_col[1]*(1-percent) + to_col[1]*percent) + '%,' \
+           + str(from_col[2]*(1-percent) + to_col[2]*percent) + '%)" stroke-width="' + str(stroke) + '" stroke-opacity="' + str(opa) + '"'
+
+def svg_generate_dot_style(percent):
     from_col = [100, 70, 0]
     to_col = [60, 0, 0]
@@ -34,25 +63,4 @@
     from_opa = 0.2
     to_opa = 1.0
-    from_stroke = 1
-    to_stroke = 3
-
-    opa = from_opa*(1-percent) + to_opa*percent
-    stroke = from_stroke*(1-percent) + to_stroke*percent
-
-    percent = 1 - ((1-percent)**20)
-
-    return 'stroke="rgb(' + str(from_col[0]*(1-percent) + to_col[0]*percent) + '%,' \
-           + str(from_col[1]*(1-percent) + to_col[1]*percent) + '%,' \
-           + str(from_col[2]*(1-percent) + to_col[2]*percent) + '%)" stroke-width="' + str(stroke) + '" stroke-opacity="' + str(opa) + '"'
-
-def svg_generate_dot_style(percent):
-    from_col = [100, 90, 0]
-    to_col = [60, 0, 0]
-    # neon
-    # from_col = [30, 200, 255]
-    # to_col = [240, 0, 220]
-
-    from_opa = 0.2
-    to_opa = 1.0
 
     opa = from_opa*(1-percent) + to_opa*percent
@@ -68,14 +76,14 @@
 
 def load_data(dir):
-    global firstnode, nodes, inv_nodes
+    global firstnode, nodes, inv_nodes, time
     f = open(dir)
     for line in f:
-        sline = line.split(' ', 2)
-        if len(sline) == 3:
-            if sline[1] == "[OFFSPRING]":
-                creature = json.loads(sline[2])
+        sline = line.split(' ', 1)
+        if len(sline) == 2:
+            if sline[0] == "[OFFSPRING]":
+                creature = json.loads(sline[1])
                 #print("B" +str(creature))
                 if "FromIDs" in creature:
-                    assert(len(creature["FromIDs"]) == 1)
+                    #assert(len(creature["FromIDs"]) == 1)
                     nodes[creature["ID"]] = creature["FromIDs"][0]
                     if not creature["FromIDs"][0] in nodes:
@@ -151,5 +159,10 @@
     for c in inv_nodes[node]:
         #print(node + "->" + c)
-        dissimilarity = 0.5 #random.gauss(0,0.3)
+        if JITTER == True:
+            dissimilarity = random.gauss(0,1)
+        else:
+            dissimilarity = 1
+            #TODO take this info from proper fields
+
         if TIME == "BIRTHS":
             id = ""
@@ -193,8 +206,13 @@
 
         line_style = (svg_line_style if args.mono_tree else svg_generate_line_style(depth[c]/max_depth))
-        dot_style = (svg_dot_style if args.mono_tree else svg_generate_dot_style(depth[c]/max_depth))
-
         svg_add_line( (w_margin+w_no_margs*(positions[node][0]-min_width)/(max_width-min_width), h_margin+h_no_margs*positions[node][1]/max_height),
             (w_margin+w_no_margs*(positions[c][0]-min_width)/(max_width-min_width), h_margin+h_no_margs*positions[c][1]/max_height), line_style)
+
+        if DOT_STYLE == "NONE":
+            continue
+        elif DOT_STYLE == "CLEAR":
+            dot_style = svg_clear_dot_style
+        else: # NORMAL, default
+            dot_style = svg_generate_dot_style(depth[c]/max_depth)
         svg_add_dot( (w_margin+w_no_margs*(positions[c][0]-min_width)/(max_width-min_width), h_margin+h_no_margs*positions[c][1]/max_height), dot_style)
 def draw_children():
@@ -203,5 +221,11 @@
             max_depth = max(max_depth, v)
     draw_children_recurrent(firstnode, max_depth)
-    dot_style = (svg_dot_style if args.mono_tree else svg_generate_dot_style(depth[firstnode]/max_depth))
+
+    if DOT_STYLE == "NONE":
+        return
+    elif DOT_STYLE == "CLEAR":
+        dot_style = svg_clear_dot_style
+    else: # NORMAL, default
+        dot_style = svg_generate_dot_style(depth[firstnode]/max_depth)
     svg_add_dot( (w_margin+w_no_margs*(positions[firstnode][0]-min_width)/(max_width-min_width), h_margin+h_no_margs*positions[firstnode][1]/max_height), dot_style)
 
@@ -269,5 +293,5 @@
 
 def main():
-    global svg_file, min_skeleton_depth, args, TIME, BALANCE
+    global svg_file, min_skeleton_depth, args, TIME, BALANCE, DOT_STYLE, JITTER
 
     parser = argparse.ArgumentParser(description='Process some integers.')
@@ -287,6 +311,13 @@
 
     #TODO: better names for those parameters
-    parser.add_argument('--time', default='BIRTHS', dest='time', help='values on vertical axis (REAL/GENERATIONAL)')
-    parser.add_argument('--balance', default='MIN',dest='balance', help='method of placing node in the tree (RANDOM/MIN/DENSITY)')
+    parser.add_argument('--time', default='BIRTHS', dest='time', help='values on vertical axis (BIRTHS/GENERATIONAL/REAL); '
+                                                                      'BIRTHS: time measured as the number of births since the beggining; '
+                                                                      'GENERATIONAL: time measured as number of ancestors; '
+                                                                      'REAL: real time of the simulation')
+    parser.add_argument('--balance', default='MIN', dest='balance', help='method of placing node in the tree (RANDOM/MIN/DENSITY)')
+
+    parser.add_argument('--dots', default='NORMAL', dest='dots', help='method of drawing dots (individuals) (NONE/NORMAL/CLEAR)')
+
+    parser.add_argument('-j', '--jitter', dest="jitter", action='store_true', help='draw horizontal positions of children from the normal distribution')
 
     mono_tree_parser = parser.add_mutually_exclusive_group(required=False)
@@ -310,4 +341,6 @@
     TIME = args.time
     BALANCE = args.balance
+    DOT_STYLE = args.dots
+    JITTER = args.jitter
 
     dir = args.input
