This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Parsing online blast results using NCBIXML returns 50 alignments per Blast.Record object

I would like to ask if it is possible that NCBIXML.parse() function returns Blast record objects (one object for a sequence) which contains a MAXIMUM of 50 alignments?

python parsing biopython ncbixml

Hello aleksanderczeszyk,

could you please go more into details of what you are trying to do and why?

The aligments within the Blast record objects are in a list. So you can use the slice syntax to truncate them (if this is what you like to do.

from Bio.Blast import NCBIXML

with open("blast.xml") as b:
    for record in NCBIXML.parse(b):
            record.alignments = record.alignments[:50]

fin swimmer

0 answers

No answers yet.

Log in to answer this question.