[Biopython] Strange Gaps when writing Multi-Fasta

Peter Cock p.j.a.cock at googlemail.com
Thu Feb 24 20:20:58 UTC 2011


On Thu, Feb 24, 2011 at 8:14 PM, Brett Bowman <bnbowman at gmail.com> wrote:
> An excellent idea - so I just tried it.  Using repr(raw_seq) does
> remove the extra-line, but it adds a single quotes (') around the
> string, making it useless for sequence alignments.

I just meant use repr as a diagnostic for checking your string
objects. It wouldn't remove and new line, just display it as \n
(likewise any carriage return would be shown as \r).

> So I decided to
> take that string and remove the quotes.  However, when I take the
> representation of the string, and use re.sub() or string.replace() to
> remove the single quote chars, the extra blank line returns!  Oy.
>
> Also for the record, I've tried re.sub('(\n|\r|\s)', '', raw_seq) and
> variations thereof with no success.
>
> Now I'm even more confused.

Um. Can you put together a self contained example? e.g. a
short input file and the short Python script?

Peter




More information about the Biopython mailing list