1 """Part of an old unused and undocumented sequence writing framework (DEPRECATED)."""
4 class WriteFasta(Writer.Writer):
5 def __init__(self, outfile, seqwidth = 72):
6 Writer.Writer.__init__(self, outfile)
7 assert seqwidth > 0, seqwidth
8 self.seqwidth = seqwidth
10 def write(self, record):
11 self.outfile.write(">%s %s\n" % (record.id, record.description))
13 assert seq.alphabet.size == 1, "cannot handle alphabet of size %d" % \
16 seqwidth = self.seqwidth
17 for i in range(0, len(seq), seqwidth):
18 self.outfile.write(seq[i:i+seqwidth])
19 self.outfile.write("\n")
21 make_writer = WriteFasta