[Biopython] Write FASTA sequence on a single line

Martin Mokrejs mmokrejs at fold.natur.cuni.cz
Sun Mar 4 18:09:28 UTC 2012


Hi,
  is there an option to tell FASTA writer to write output with a
sequence on a single line (so that a FASTA entry would span just
two lines altogether)? I see it should be faster to eventually
parse using SeqIO because one would avoid calls for each line in
the FASTAinput file.

In my code I have
for _record in SeqIO.parse(fastah, 'fasta'):

which boils down to biopython's:
append(line.rstrip().replace(" ","").replace("\r",""))

per every line with _sequence_.

Thank you for comments,
Martin
  

  



More information about the Biopython mailing list