[BioPython] Parsing BLAST

Peter biopython at maubp.freeserve.co.uk
Sun Aug 31 15:28:49 UTC 2008


On Fri, Aug 29, 2008 at 5:10 PM, Alex Garbino <agarbino at gmail.com> wrote:
> Assuming I just stick to making the plain sequence the 4th variable
> (instead of in fasta format), how should I add it to my dictionary?
> Doing:
>
> output[x].extend(record.seq.tostring())
>
> Will add each letter individually, so each entry has a few hundred
> elements, rather than the forth element being the full string. join()
> doesn't seem to be it...

Assuming output is a dictionary whose elements are lists, try
output[x].append(record.seq.tostring())

You need to read about the difference between the append and extend
methods of a list in python.

Peter



More information about the Biopython mailing list