[Bioperl-l] use primer3 to design primers with multiple sequences

chen li chen_li3 at yahoo.com
Wed May 10 01:04:08 UTC 2006


Hi Paul,

Thank you very much.

Just like you point out in your lastest email I now
figure out the line
"my $result1=$results->primer_results(1);"

returns a hash reference containing all the
information for the first pair of primer.  1)Since it
is a hash I should be able to get the specific value
for its corresponding  key by telling Perl which key
is the entry for the value. 2) Also it is a reference
I should deference it to get the so-called true value.

I don't know too much OO and Perl and your code looks
a little bit complicated to me. But I get the job done
by adding the following lines directly:

###############################################
#from Primer3 module to get all the infomration 
#foreach my $key (sort keys %{$result1}) {
	   #print "$key\t${$result1}{$key}\n"}
##################################################


#get the value for the key in the hash reference
	   
	   
	   my
$key_PRIMER_LEFT_SEQUENCE='PRIMER_LEFT_SEQUENCE'; 
	   print
"$key_PRIMER_LEFT_SEQUENCE\t${$result1}{$key_PRIMER_LEFT_SEQUENCE}\n";
 

There is one point I don't understand:

When I add these two lines into my code (line 49 in my
code)

	   my $key_PRIMER_SEQUENCE_ID='PRIMER_SEQUENCE_ID';		
  	      
  print
"$key_PRIMER_SEQUENCE_ID\t${$result1}{$key_PRIMER_SEQUENCE_ID}\n";

I don't get the PRIMER_SEQUENCE_ID. Perl complains it
and says "Use of uninitialized value in concatenation
(.) or string at primer3-3 line 49."


Li
	   





--- "Wiersma, Paul" <WiersmaP at AGR.GC.CA> wrote:

> Hi Li,
> 
> Just a bit of clarification of the code that I sent
> earlier. 
> The line "my $result1=$results->primer_results($i);"
> gives you a
> reference to a hash that contains all of the
> information for a primer
> pair.
> To access the entries you dereference the hash, i.e.
> the hash is
> %{$result1} and ${$result1}{'PRIMER_PRODUCT_SIZE'}
> gives you the entry
> for product size.  The following are the available
> entries. All are
> single values or strings except PRIMER_RIGHT and
> PRIMER_LEFT which are
> start,length pairs (e.g. PRIMER_LEFT => '60,20')
> which can be pulled out
> with split. 
> my ($start, $length) = split /,/,
> ${$result1}{'PRIMER_LEFT'};
> my $right_Tm =  ${$result1}{'PRIMER_RIGHT_TM'}  
> PRIMER_PRODUCT_SIZE
> PRIMER_PAIR_COMPL_ANY
> PRIMER_PAIR_COMPL_END
> PRIMER_PAIR_PENALTY
> 
> PRIMER_LEFT
> PRIMER_LEFT_END_STABILITY
> PRIMER_LEFT_PENALTY
> PRIMER_LEFT_TM
> PRIMER_LEFT_GC_PERCENT
> PRIMER_LEFT_SELF_ANY
> PRIMER_LEFT_SELF_END
> PRIMER_LEFT_SEQUENCE
> 
> PRIMER_RIGHT
> PRIMER_RIGHT_END_STABILITY
> PRIMER_RIGHT_PENALTY
> PRIMER_RIGHT_TM
> PRIMER_RIGHT_GC_PERCENT
> PRIMER_RIGHT_SELF_ANY
> PRIMER_RIGHT_SELF_END
> PRIMER_RIGHT_SEQUENCE
> 
> Paul A. Wiersma
> Agriculture and Agri-Food Canada/Agriculture et
> Agroalimentaire Canada
> Summerland, BC
> wiersmap at agr.gc.ca
>  
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Bioperl-l mailing list