code: def build_ml_phyml(alignment, outfile, work_dir=".", **kwargs):
      
      phy_file = op.join(work_dir, "work", "aln.phy")
      AlignIO.write(alignment, file(phy_file, "w"), "phylip-relaxed")
  
      phyml_cl = PhymlCommandline(cmd=PHYML_BIN("phyml"), input=phy_file, **kwargs)
      logging.debug("Building ML tree using PhyML: %s" % phyml_cl)
      stdout, stderr = phyml_cl()
  
      tree_file = phy_file + "_phyml_tree.txt"
      if not op.exists(tree_file):
          print("***PhyML failed.", file=sys.stderr)
          return None
      sh("cp {0} {1}".format(tree_file, outfile), log=False)
  
      logging.debug("ML tree printed to %s" % outfile)
  
      return outfile, phy_file
docs: build maximum likelihood tree of DNA seqs with PhyML