[Bioperl-l] HMMER - Parse hmmpfam output using bioperl - help!!
Sendu Bala
bix at sendu.me.uk
Thu May 8 12:57:34 UTC 2008
K. Shameer wrote:
> Dear All,
>
> Here is the code snippet I used to get the hit name and hit length from an
> hmmpfam file. I need to add the sequence start and end information
> (query), description of domain, score and e-value.
>
> I checked for the available method in deobfuscator, but I couldn't find
> the details i wanted. Is there methods available in the Bio::SearchIO or
> related modules.
> __CODE__
> $input = shift;
> use Bio::SearchIO;
> my $in = Bio::SearchIO->new(-format => 'hmmer',
> -file => $input);
> while( my $result = $in->next_result ) {
> while( my $hit = $result->next_hit ) {
> print $hit->name(),"\t";
> while( my $hsp = $hit->next_hsp ) {
> print $hsp->length(), "\n";
> }
> }
> }
You'll find the relevant documentation under Bio::Search::Result,
Bio::Search::Hit and Bio::Search::HSP.
Using Bio::SearchIO->new(-format => 'hmmer_pull') will also give you a
faster parser that may behave more closely to your expectation during
your loops.
Anyway, there are various obvious-named methods you can use:
$result->query_description
$hit->score
$hit->significance
$hit->description
$hit->start('query')
$hit->end('query')
$hsp->start('query')
$hsp->evalue
etc.
More information about the Bioperl-l
mailing list