[Bioperl-l] aligned sequence from hmmer output

Jason Stajich jason.stajich at duke.edu
Wed Jun 15 15:51:33 EDT 2005


You can get them as strings:
$hsp->hit_string and $hsp->query_string.  $hsp->homology_string gives  
you the middle.

-jason
On Jun 15, 2005, at 3:32 PM, Andrew Su wrote:

> Hello,
>
> Does anyone know of an easy way to get the sequence from an  
> alignment in
> hmmer output?  I think from blast output, it's something like
> $hsp->seq('query') or $hsp->seq('target'), but when I try this for a
> hmmer hsp, it throws an exception complaining about trying to create a
> seq object with a sequence that has "." and "+" and such (pasted  
> below).
>
>
> for example, my program looks something like this:
>
> $in = new Bio::SearchIO( -format => 'hmmer',  -file => $ARGV[0] );
> while( my $result = $in->next_result ) {
>     while( $hit = $result->next_hit ) {
>         while( $hsp = $hit->next_domain ) {
>             print
> $hit->name,",",$hsp->evalue,",",$hsp->score, "\n";
>         }
>     }
> }
>
> ... and I'd like to output the matched sequence as well.  Anyone have
> any thoughts on how I would accomplish this?
>
> (apologies if this has previously been addressed; couldn't find the
> right combination of search strings to fish the answer out of the
> archives...)
>
> thanks,
> -andrew
>
>
> ------------- EXCEPTION  -------------
> MSG: Attempting to set the sequence to [aggttaa.a.cggtcaa.aa<-*] which
> does not look healthy
> STACK Bio::PrimarySeq::seq
> /depts/CompDisc/lib/perl/Bio/PrimarySeq.pm:267
> STACK Bio::PrimarySeq::new
> /depts/CompDisc/lib/perl/Bio/PrimarySeq.pm:217
> STACK Bio::LocatableSeq::new
> /depts/CompDisc/lib/perl/Bio/LocatableSeq.pm:100
> STACK Bio::Search::HSP::HSPI::seq
> /depts/CompDisc/lib/perl/Bio/Search/HSP/HSPI.pm:572
> STACK toplevel ./parse_hmmer.pl:17
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/




More information about the Bioperl-l mailing list