[BioPython] Need help parsing Blastoutput

Rafael C. Jimenez rafael at nbn.ac.za
Fri Apr 14 09:52:42 UTC 2006


On 13 Apr 2006, at 5:07 PM, Halima Rabiu wrote:

> Hi All,
> I have a BLAST output from a local blast

Well, I would say that you can use three alternatives to run blast, and 
somehow you can use all of them locally.
  - Blast web server (Through Blastcl3 or through biopython)
  - Blast standalone
  - wwwblast

I guess that when you say local blast you want to say you are using 
blast standalone to use your own local databases. It makes a difference 
to use one of these three different because you will use different 
modules to parse the output:
  - Bio.Blast.NCBIStandalone for Blast standalone outputs
  - Bio.Blast.NCBIWWW for Blast web server outputs
  - No parser for the wwwblast

> I need to calculate my % alignment coverage as regard to my subject

I am not sure what you mean, but I would say that this % is provided by 
the "Identities" field in nucleotide and protein comparisons for each 
alignment, and also by the "Positives" field in protein comparisons.
Example: Identities = 11/26 (42%), Positives = 15/26 (57%)

> I try parsed the blast output and wanted to print the
> sbjct Start and Sbjct end. but I could not is there anyway I could this

# Open your Blast Output file
blastOutput = open("The name of your blast output", 'r')

Once you have parsed the NCBIWWW output:
     from Bio.Blast import NCBIWWW
     parser = NCBIWWW.BlastParser()
     blastRecord = parser.parse(blastOutput)


.... or the NCBI web server output:
     from Bio.Blast import NCBIWWW
     parser = NCBIWWW.BlastParser()
     blastRecord = parser.parse(blastOutput)


now you can start to recover information using the Bio.Blast.Record 
module

     import Bio.Blast.Record
     # ... for instance you can retreive the Blast version you used when 
you got your output ...
     print 'header.version:',blastRecord.version
     for alignment in blastRecord.alignments:
       # ... or the length of the alignment ...
       print 'alignment.length:', alignment.length
       for hsp in alignment.hsps:
	# ... or the sbjct Start as you want ...
           print 'hsp.sbjct_start:', hsp.sbjct_start

>
> try to get mach coverage between my querry and subject I dont need
> Identities,but total % alignment for querry or subject.
> Thanks
> Halimah

I am working in the NBN central node in UWC, not far away from UCT. 
Don't hesitate to visit us if you want help or advice.

Cheers,
Rafael

Rafael C. Jimenez
-----------------------------------------------------------
National Bioinformatics Network
University of the Western Cape
Private Bag X17
Bellville 7530
South Africa
Tel: +27219592991
rafael at nbn.ac.za
www.nbn.ac.za
-----------------------------------------------------------
Proteomics Services Group
European Bioinformatics Institute (EMBL-EBI)
Wellcome Trust Genome Campus, Hinxton
Cambridge - CB10 1SD - UK
Tel: +441223492610
rafael at ebi.ac.uk
www.ebi.ac.uk
-----------------------------------------------------------

On 13 Apr 2006, at 5:07 PM, Halima Rabiu wrote:

> Hi All,
> I have a BLAST output from a local blast
> I need to calculate my % alignment coverage as regard to my subject
> I try parsed the blast output and wanted to print the
> sbjct Start and Sbjct end. but I could not is there anyway I could this
> try to get mach coverage between my querry and subject I dont need
> Identities,but total % alignment for querry or subject.
> Thanks
> Halimah
>
> _______________________________________________
> BioPython mailing list  -  BioPython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython




More information about the Biopython mailing list