def METHOD_NAME(self):
    lks = []
    if self.lk_mode == "phyml":
        for job in [j for j in self.jobs if j.flag == "phyml"]:
            tree_file = os.path.join(job.jobdir,
                                     self.alg_basename+"_phyml_tree.txt")
            stats_file = os.path.join(j.jobdir,
                                      self.alg_basename+"_phyml_stats.txt")
            tree = PhyloTree(open(tree_file))
            m = re.search('Log-likelihood:\s+(-?\d+\.\d+)',
                          open(stats_file).read())
            lk = float(m.groups()[0])
            tree.add_property("lk", lk)
            tree.add_property("model", job.args["--model"])
            lks.append([float(tree.lk), tree.model, tree])
    elif self.lk_mode == "raxml":
        for job in [j for j in self.jobs if j.flag == "raxml"]:
            lk = open(os.path.join(job.jobdir, "RAxML_log.%s"
                                   %job.args["-n"])).readline().split()[1]
            tree = PhyloTree(job.args["-t"])
            tree.add_property("lk", lk)
            tree.add_property("model", job.model)
            lks.append([lk, tree.model, tree])
    lks.sort()
    lks.reverse()
    # choose the model with higher likelihood
    best_model = lks[-1][1]
    best_tree = lks[-1][2]
    open(self.best_model_file, "w").write(best_model)
    if self.tree_file:
        tree.write(self.tree_file)
    ModelTesterTask.METHOD_NAME(self)