code: def template_align(self, ref_path):
          
          # Run it #
          sh.mothur("#align.seqs(candidate=%s, template=%s, search=blast, flip=false, processors=8);" % (self.path, ref_path))
          # Move things #
          shutil.move(self.path[:-6] + '.align',        self.p.aligned)
          shutil.move(self.path[:-6] + '.align.report', self.p.report)
          shutil.move(self.path[:-6] + '.flip.accnos',  self.p.accnos)
          # Clean up #
          if os.path.exists('formatdb.log'): os.remove('formatdb.log')
          if os.path.exists('error.log') and os.path.getsize('error.log') == 0: os.remove('error.log')
          for p in sh.glob('mothur.*.logfile'): os.remove(p)
docs: We align the sequences in the fasta file with mothur and a template.