[Bioperl-l] Bio::Search results

Barry Moore bmoore at genetics.utah.edu
Tue Aug 30 10:40:52 EDT 2005


Don't see anything obviously wrong.  If you want to send your input
file, I'll try to recreate the problem.


-----Original Message-----
From: bioperl-l-bounces at portal.open-bio.org
[mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of Sean
Sent: Tuesday, August 30, 2005 2:55 AM
To: bioperl-l at portal.open-bio.org
Subject: [Bioperl-l] Bio::Search results

The following code snippet is something I use to extract information
from hmmer result files:

use Bio::SearchIO;

my $in =3D new Bio::SearchIO( -format =3D> 'hmmer',  -file =3D> $ARGV[0]
while(my $result =3D $in->next_result) {
  print $result->query_name(), "\n",$result->query_description(),"\n";
  while (my $hit =3D $result->next_hit) {
    while(my $hsp =3D $hit->next_domain) {
      next unless ($hsp->name =3D~ /^ig|^lrr|^fn3|^egf|^tsp|^psi/i);
      print $hsp->start(),"\t",$hsp->end(),"\t",$hsp->evalue(),"\n";

The input file is generated by hmmpfam and is given at the command
line. I use it to scan for specific domain names e.g ig, fn3 lrr etc.
This code works for the first loop and then ends so I get the name and
description (no hsp values as their are none for this result):

pep:novel supercontig::NT_085813:405:1510:-1 gene:ENSMUSG00000054059

My question is why does the loop end after one instance. Incidentally
the outputted  name and description above are the last ones in the
hmmer file (maybe the file is read from the back??? - don't know if this
means anything).
Any thoughts would be appreciated. Thanks,

Bioperl-l mailing list
Bioperl-l at portal.open-bio.org

More information about the Bioperl-l mailing list