[Bioperl-l] BLASTX parsing

Jason Stajich jason at cgt.duhs.duke.edu
Mon May 31 09:41:11 EDT 2004


On Mon, 31 May 2004, Javier Terol wrote:

> Hi,
>
> Thank you very much to all the people who helped me with my question
> about parsing blast files.
>
> Following the advises I am working with the example perl script in the
> Bio::SearchIO HOWTO. I have been working with this script and now I can
> get easily de information I need.
> Now I would like only to get the data from the best hit for each query,
> and not from all the ones obtained in the blast search (I usually get 50
> hits and 20 malignments). Can I do it modifying the perl script I am
> working with? Could you help me o this?

You didn't show your script so I don't know what it looks like, but by
default in BLAST the hits are ordered by bitscore so the best one is
first, searchio returns them in the order they are presented in the file.

Just do:
while( my $r = $in->next_result ) {
  my $besthit = $r->next_hit;
  if( $besthit ) {
  # do something
  } else {
  # no hits for query
  }
}


> On te other hand, do the SearchIO modules work with htm files? I f it is
> not tha case, is it ppossible to transform htm files to txt?

http://bioperl.org/Core/Latest/faq.html#Q3.7

>
> Thank you very much in advance for your help
>
> Javier
>
>    O@@@@@
>   @@@O@@O@      Javier Terol Alcayde
>   @O@@@@O@      Instituto Valenciano de Investigaciones Agrarias (IVIA)
>   @@@O@@@@      Carretera Moncada - Náquera, Km. 4,5
>    @@@@O@       46113 Moncada (Valencia)
>      ||         Tel.     96 342 4000 ext. 70160
>      ||         Fax.    96 342 4001
>
>
>
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu



More information about the Bioperl-l mailing list