1+ from pyneval .io .read_json import read_json
2+
3+
4+ def get_detail_type (metric_name ):
5+ detail_type_annotation = dict ()
6+ detail_type_annotation ["ssd_metric" ] = "# 1: gold standard root\n " \
7+ "# 2: gold standard branch(degree >= 3)\n " \
8+ "# 3: gold standard continuation(degree == 2)\n " \
9+ "# 4: gold standard leaf(degree == 1)\n " \
10+ "# 5: reconstruction root\n " \
11+ "# 6: reconstruction branch(degree >= 3)\n " \
12+ "# 7: reconstruction continuation(degree == 2)\n " \
13+ "# 8: reconstruction leaf(degree == 1)\n " \
14+ "# 9: mismatched node(regardless rules above)\n \n "
15+ detail_type_annotation ["length_metric" ] = "# 1: gold standard root\n " \
16+ "# 2: gold standard branch(degree >= 3)\n " \
17+ "# 3: gold standard continuation(degree == 2)\n " \
18+ "# 4: gold standard leaf(degree == 1)\n " \
19+ "# 5: reconstruction root\n " \
20+ "# 6: reconstruction branch(degree >= 3)\n " \
21+ "# 7: reconstruction continuation(degree == 2)\n " \
22+ "# 8: reconstruction leaf(degree == 1)\n " \
23+ "# 9: edge between this node and its parent is mismatched" \
24+ "(regardless rules above)\n \n "
25+ detail_type_annotation ["branch_metric" ] = "# type of nodes in this metric detail could be change in configs\n " \
26+ "# true_positive_type: successfully reconstructed nodes, " \
27+ "exists in both GS and R\n " \
28+ "# missed: wrongly reconstructed as negative. " \
29+ "exist in GS but not in R\n " \
30+ "# excess: wrongly reconstructed as positive. " \
31+ "exist in R but not in GS.\n \n "
32+ detail_type_annotation ["diadem_metric" ] = "# 1: gold standard root\n " \
33+ "# 2: gold standard branch(degree >= 3)\n " \
34+ "# 3: gold standard continuation(degree == 2)\n " \
35+ "# 4: gold standard leaf(degree == 1)\n " \
36+ "# 5: reconstruction root\n " \
37+ "# 6: reconstruction branch(degree >= 3)\n " \
38+ "# 7: reconstruction continuation(degree == 2)\n " \
39+ "# 8: reconstruction leaf(degree == 1)\n " \
40+ "# 9: missed: exist in GS but not in R\n " \
41+ "# 10 excess: exist in R but not in GS\n \n "
42+ if metric_name not in detail_type_annotation :
43+ return None
44+ return detail_type_annotation [metric_name ]
45+
46+
47+ if __name__ == "__main__" :
48+ print (get_detail_type ("branch_metric" ))
0 commit comments