[Bioperl-l] use primer3 to design primers with multiplesequences: bug in code!

Cui, Wenwu (NIH/NCI) [F] cuiw at mail.nih.gov
Wed May 10 18:42:36 UTC 2006


Hope this works!

Bio::Tools::Primer3 line 264 should be:
 
$self->{seqobject}=Bio::Seq->new(-seq=>$value, -id=>$id);

Then you should be able to display PRIMER_SEQUENCE_ID by

####read primer3 output file############
my $p3=Bio::Tools::Primer3->new(-file=>"data/primer3_output.txt");

########  print id###############
print $p3->seqobject->id;

Wenwu Cui, PhD
NIH/NCI


-----Original Message-----
From: Wiersma, Paul [mailto:WiersmaP at agr.gc.ca] 
Sent: Wednesday, May 10, 2006 12:09 PM
To: chen li
Cc: bioperl-l at bioperl.org
Subject: Re: [Bioperl-l] use primer3 to design primers with multiplesequences

Brian, no problem with the code, thanks for asking.

Li, PRIMER_SEQUENCE_ID and SEQUENCE are not part of the individual results but only end up by default with $results->primer_results(0).  If you try to access them using $results->primer_results(1) (or anything but 0) you will get an error.

Paul

Paul A. Wiersma
Agriculture and Agri-Food Canada/Agriculture et Agroalimentaire Canada Summerland, BC wiersmap at agr.gc.ca
 
 



-----Original Message-----
From: chen li [mailto:chen_li3 at yahoo.com]
Sent: Tuesday, May 09, 2006 6:04 PM
To: Wiersma, Paul
Cc: bioperl-l at bioperl.org
Subject: RE: [Bioperl-l] use primer3 to design primers with multiple sequences

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 

_______________________________________________
Bioperl-l mailing list
Bioperl-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list