code: def build_ml_raxml(alignment, outfile, work_dir=".", **kwargs):
      
      work_dir = op.join(work_dir, "work")
      mkdir(work_dir)
      phy_file = op.join(work_dir, "aln.phy")
      AlignIO.write(alignment, file(phy_file, "w"), "phylip-relaxed")
  
      raxml_work = op.abspath(op.join(op.dirname(phy_file), "raxml_work"))
      mkdir(raxml_work)
      raxml_cl = RaxmlCommandline(cmd=RAXML_BIN("raxmlHPC"), \
          sequences=phy_file, algorithm="a", model="GTRGAMMA", \
          parsimony_seed=12345, rapid_bootstrap_seed=12345, \
          num_replicates=100, name="aln", \
          working_dir=raxml_work, **kwargs)
  
      logging.debug("Building ML tree using RAxML: %s" % raxml_cl)
      stdout, stderr = raxml_cl()
  
      tree_file = "{0}/RAxML_bipartitions.aln".format(raxml_work)
      if not op.exists(tree_file):
          print("***RAxML failed.", file=sys.stderr)
          sh("rm -rf %s" % raxml_work, log=False)
          return None
      sh("cp {0} {1}".format(tree_file, outfile), log=False)
  
      logging.debug("ML tree printed to %s" % outfile)
      sh("rm -rf %s" % raxml_work)
  
      return outfile, phy_file
docs: build maximum likelihood tree of DNA seqs with RAxML