Example #1
0
 def write_to_path(self, filename, schema='FASTA'):
     """Writes the sequence data in the specified `file_format` to `filename`"""
     _LOG.debug("Writing alignment of type %s with length %d to file %s" %
                (str(self.__class__), len(self), filename))
     file_obj = open_with_intermediates(filename, 'w')
     self.write(file_obj, file_format=schema)
     file_obj.close()
Example #2
0
 def write_unaligned_fasta(self, filename):
     """Writes the sequence data without gaps as FASTA, but note that the
     lines may bet "ragged".
     """
     file_obj = open_with_intermediates(filename, 'w')
     for name, seq in self.items():
         file_obj.write('>%s\n%s\n' % (name, re.sub(_INDEL, '', seq)))
     file_obj.close()
Example #3
0
 def write_unaligned_fasta(self, filename):
     """Writes the sequence data without gaps as FASTA, but note that the
     lines may bet "ragged".
     """
     file_obj = open_with_intermediates(filename, 'w')
     for name, seq in self.items():
         file_obj.write('>%s\n%s\n' % (name, re.sub(_INDEL, '', seq)))
     file_obj.close()
Example #4
0
 def write_to_path(self, filename, schema='FASTA'):
     """Writes the sequence data in the specified `file_format` to
        `filename`"""
     _LOG.debug(
         "Writing alignment of type %s with length %d to file %s" %
         (str(self.__class__), len(self), filename))
     file_obj = open_with_intermediates(filename, 'w')
     self.write(file_obj, file_format=schema)
     file_obj.close()