[Biopython] Write FASTA sequence on a single line

Peter Cock p.j.a.cock at googlemail.com
Sun Mar 4 19:15:36 UTC 2012


On Sun, Mar 4, 2012 at 6:46 PM, Wibowo Arindrarto
<w.arindrarto at gmail.com> wrote:
> Hi Martin,
>
> A quick glance at Bio.SeqIO.FastaIO.FastaWriter shows
> that there is indeed an option to set the line wrapping length.
> However, the regular writing function that calls FastaWriter
> (SeqIO.write) only accepts three parameters (sequence,
> handle, and format), so if you really want to use Biopython's
> fasta writer, you should call FastaWriter directly.

Exactly. The top level SeqIO API is file format neutral, so
if you want to do something format specific, you have to
import and use the underlying parser/writer directly - in
this case Bio.SeqIO.FastaIO.FastaWriter as you showed.

Peter



More information about the Biopython mailing list