Antony03 | 27 Mar 02:32 2013
Picon

Re: One letter protein sequence to three letters


Yes! That works and I understand now, thanks for you precious help!
:handshake:

Antony03 wrote:
> 
> 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-tp35222270p35222552.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.

Gmane