[Bioperl-l] aligned sequence from hmmer output

Andrew Su asu at gnf.org
Wed Jun 15 15:32:35 EDT 2005


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 ) {
$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


------------- EXCEPTION  -------------
MSG: Attempting to set the sequence to [aggttaa.a.cggtcaa.aa<-*] which
does not look healthy
STACK Bio::PrimarySeq::seq
STACK Bio::PrimarySeq::new
STACK Bio::LocatableSeq::new
STACK Bio::Search::HSP::HSPI::seq
STACK toplevel ./parse_hmmer.pl:17

More information about the Bioperl-l mailing list