def setup_workdir (self):
		"""
		Prepare the necessary input files for FastTree.

		This creates a temporary working area, and writes input alignment
		files.

		"""
		## Preconditions & preparations:
		## Main:
		# create workdir and filepaths
		clineapp.ClineApp.setup_workdir (self)
		self._inalign_path = scratchfile.make_scratch_file (INALIGN_NAME,
			self._curr_workdir)
		# write infile workfile
		infile_hndl = open (self._inalign_path, 'w')
		AlignIO.write ([self._in_align], infile_hndl, 'fasta')
示例#2
0
    def setup_workdir(self):
        """
		Perpare the necessary input files for mafft.
		
		This creates a temporary working area, and writes the input sequence
		file.
		
		"""
        # create workdir and input sequence file
        clineapp.ClineApp.setup_workdir(self)
        self._inseq_path = scratchfile.make_scratch_file("inseq.fasta", self._curr_workdir)
        # convert sequences and fill inseq file
        inseqs = []
        for s in self._inseqs:
            assert isinstance(s, SeqRecord.SeqRecord)
            inseqs.append(s)
        inseq_hndl = open(self._inseq_path, "w")
        SeqIO.write(inseqs, inseq_hndl, "fasta")
        inseq_hndl.close()