[Bioperl-l] One letter protein sequence to three letters
Antony03
antony.vincent.1 at ulaval.ca
Tue Mar 26 23:24:20 UTC 2013
Hi!
I wan't to parse a blastp output for have an hsp with three letters code. I
try with this:
my $query1_in = Bio::SeqIO->newFh ( -file => "$infile1",
-format => 'fasta' );
my $query1 = <$query1_in>;
my $query2_in = Bio::SeqIO->newFh ( -file => "$infile2",
-format => 'fasta' );
my $query2 = <$query2_in>;
my $factory = Bio::Tools::Run::StandAloneBlast->new('program' => "$algo");
my $report = $factory->bl2seq($query1, $query2);
############################################################################################################
while (my $result = $report->next_result) { # while 1
print "Query: ".$result->query_name."\n\n";
while (my $hit = $result->next_hit) { # while 2
while (my $hsp = $hit->next_hsp) { # while 3
if ( $hsp->percent_identity >= "$identity" )
{ # start of if
$qseq = $hsp->query_string;
$polypeptide_3char = Bio::SeqUtils->seq3($qseq);
print $polypeptide_3char;
}
} # end of while 3
print "\n";
} # end of while 2
} # end of while 3
And I got this error:
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Not a Bio::PrimarySeqI object but [$self]
STACK: Error::throw
STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:472
STACK: Bio::SeqUtils::seq3 /usr/share/perl5/Bio/SeqUtils.pm:187
STACK: blast_parsing.pl:36
-----------------------------------------------------------
I don't understand why my code generate this error!
Thanks :)
--
View this message in context: http://old.nabble.com/One-letter-protein-sequence-to-three-letters-tp35222270p35222270.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
More information about the Bioperl-l
mailing list