code: def run_iqtree(phy, model, threads, cluster, node):
      
      # set ppn based on threads
      if threads > 24:
          ppn = 24
      else:
          ppn = threads
      tree = '%s.treefile' % (phy)
      if check(tree) is False:
          if model is False:
              model = 'TEST'
          dir = os.getcwd()
          command = 'iqtree-omp -s %s -m %s -nt %s -quiet' % \
                      (phy, model, threads)
          if cluster is False:
              p = Popen(command, shell = True)
          else:
              if node is False:
                 node = '1'
              qsub = 'qsub -l nodes=%s:ppn=%s -m e -N iqtree' % (node, ppn)
              command = 'cd /tmp; mkdir iqtree; cd iqtree; cp %s/%s .; %s; mv * %s/; rm -r ../iqtree' \
                      % (dir, phy, command, dir)
              re_call = 'cd %s; %s --no-fast --iq' % (dir.rsplit('/', 1)[0], ' '.join(sys.argv))
              p = Popen('echo "%s;%s" | %s' % (command, re_call, qsub), shell = True)
          p.communicate()
      return tree
docs: run IQ-Tree