[Biopython] Strange Gaps when writing Multi-Fasta

Brett Bowman bnbowman at gmail.com
Thu Feb 24 20:14:06 UTC 2011


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.  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.

Brett Bowman
Senior Research Associate
Cibus US LLC

On Thu, Feb 24, 2011 at 10:25 AM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> On Thu, Feb 24, 2011 at 5:41 PM, Brett Bowman <bnbowman at gmail.com> wrote:
>> I'm trying to write my own script to parse multiple alignments from
>> the new standalone PSI-Blast output, but when I try to write the
>> results to a file, I get really odd results.
>
> I'd guess you have a new line or carriage return in your string
> somehow (\n or \r). Try printing out repr(...) of you string.
>
> Peter
>



More information about the Biopython mailing list