@@ -36,30 +36,24 @@ def _get_value_from_line(line: str, search_string: str) -> float:
3636 )
3737
3838
39- def get_raxmlng_rfdist_results (log_file : pathlib .Path ) -> tuple [int , float , float ]:
39+ def get_raxmlng_rfdist_results (log_file : pathlib .Path ) -> tuple [int , float ]:
4040 """
41- Method to parse the RAxML-NG log file and extract the number of unique topologies, relative RF-Distance, and absolute RF-Distance.
41+ Method to parse the RAxML-NG log file and extract the number of unique topologies and relative RF-Distance.
4242 Args:
4343 log_file (pathlib.Path): Filepath pointing to the RAxML-NG log file.
4444
4545 Returns:
4646 num_topos (float): Number of unique topologies of the given set of trees.
4747 rel_rfdist (float): Relative RF-Distance of the given set of trees. Computed as average over all pairwise RF-Distances. Value between 0.0 and 1.0.
48- abs_rfdist (float): Absolute RF-Distance of the given set of trees.
4948
5049 """
51- abs_rfdist = None
5250 rel_rfdist = None
5351 num_topos = None
5452
5553 for line in log_file .open ().readlines ():
5654 line = line .strip ()
5755
58- if "Average absolute RF distance in this tree set:" in line :
59- abs_rfdist = _get_value_from_line (
60- line , "Average absolute RF distance in this tree set:"
61- )
62- elif "Average relative RF distance in this tree set:" in line :
56+ if "Average relative RF distance in this tree set:" in line :
6357 rel_rfdist = _get_value_from_line (
6458 line , "Average relative RF distance in this tree set:"
6559 )
@@ -68,10 +62,10 @@ def get_raxmlng_rfdist_results(log_file: pathlib.Path) -> tuple[int, float, floa
6862 line , "Number of unique topologies in this tree set:"
6963 )
7064
71- if abs_rfdist is None or rel_rfdist is None or num_topos is None :
65+ if rel_rfdist is None or num_topos is None :
7266 raise ValueError ("Error parsing raxml-ng log." )
7367
74- return int (num_topos ), rel_rfdist , abs_rfdist
68+ return int (num_topos ), rel_rfdist
7569
7670
7771class RAxMLNG :
@@ -179,8 +173,8 @@ def infer_parsimony_trees(
179173
180174 def get_rfdistance_results (
181175 self , trees_file : pathlib .Path , prefix : pathlib .Path = None , ** kwargs
182- ) -> tuple [float , float , float ]:
183- """Method that computes the number of unique topologies, relative RF-Distance, and absolute RF-Distance for the given set of trees.
176+ ) -> tuple [float , float ]:
177+ """Method that computes the number of unique topologies and the relative RF-Distance for the given set of trees.
184178
185179 Args:
186180 trees_file (pathlib.Path): Filepath pointing to the file containing the trees.
@@ -193,7 +187,6 @@ def get_rfdistance_results(
193187 Returns:
194188 num_topos (float): Number of unique topologies of the given set of trees.
195189 rel_rfdist (float): Relative RF-Distance of the given set of trees. Computed as average over all pairwise RF-Distances. Value between 0.0 and 1.0.
196- abs_rfdist (float): Absolute RF-Distance of the given set of trees.
197190 """
198191 with TemporaryDirectory () as tmpdir :
199192 tmpdir = pathlib .Path (tmpdir )
0 commit comments