#!/usr/local/bin/perl -w use CGI qw (:standard); my $q = new CGI; #Some constants my $R = 1.987; my %deltaH; my %deltaS; my $NNParamFile = "./NN_param.txt"; print header; print start_html('Kun\'s Oligonucleotide Tm calculator'), h3('Tm calculator using the Nearest-Neighbor method (NN paramters are based on SantaLucia J Jr. (1998) PNAS, 95:1460-5)'), h3('Tm is adjusted for MgCl2 and DMSO concentration based on von Ahsen et al. Clinical Chemistry 47: 1956-61 (2001)'), start_form, "Oligonucleotide Sequence:", textfield(-name=>'oligo', -size=>50), p, "Primer concentration (nM):", textfield(-name=>'oligoConc', -default=>'200', -size=> 8), p, "Sodium/Potasium concentration (mM):", textfield(-name=>'NaConc', -default=>'50', -size => 6), p, "Magnesium concentration (mM):", textfield(-name=>'MgConc', -default=>'1.5', -size => 6), p, "dNTP concentration (mM):", textfield(-name=>'dNTPConc', -default=>'0.4', -size => 6), p, "Percentage of DMSO (%)", textfield(-name=>'PercentageDMSO', -default=>'0', -size => 6), p, "Percentage of annealed temlate(%)", textfield(-name=>'PercentageAnnealed', -default=>'50', -size => 6), p, submit, end_form, hr; if(param()){ my $seq = uc(param('oligo')); $seq =~ s/ +//g; readNNParam($NNParamFile); print "The temperature is: ", shortOligoTm($seq, param('oligoConc'), param('MgConc'), param('NaConc'), param('dNTPConc'),param('PercentageDMSO'),param('PercentageAnnealed')), hr; } print end_html; =head2 shortOligoTm Title : shortOligoTm Function: To calculate Tm for short oligonucleotides based on SantaLucia J. PNAS 95:1460-1465 (1998). Tm is adjusted for MgCl2 and DMSO concentration based on von Ahsen et al. Clinical Chemistry 47: 1956-61 (2001) Returns : $Tm, the annealing temperature Args : $seq the oligonucleotide sequence (should be in upper case) $C_primer the concentration of oligonucleotide in nM $C_Mg the concentration of magnesium in mM $C_MonovalentIon the concentration of mono-vaent ions (Na+, Ka+) in mM $C_dNTP the concentration of dNTP in mM $percentage_DMSO the concentration of DMSO in (v/v)% $percentage_annealed the percentage of templates that anneal to primers =cut sub shortOligoTm(){ my $seq = shift; my $C_primer = shift; # nM my $C_Mg = shift; # mM my $C_MonovalentIon = shift; #mM my $C_dNTP = shift; #mM my $percentage_DMSO = shift; my $percentage_annealed = shift; #percentage of templates that anneal to primers $seq =~ s/[ \t\n]+//g; $percentage_annealed = 50.0 if (!$percentage_annealed); $percentage_annealed /= 100.0; my $C_SodiumEquivalent = $C_MonovalentIon + 120 * sqrt($C_Mg-$C_dNTP); my $seqLength = length($seq); my $dH = $deltaH{'pm'}->{substr($seq, 0, 1)} + $deltaH{'pm'}->{substr($seq, $seqLength-1, 1)}; my $dS = $deltaS{'pm'}->{substr($seq, 0, 1)} + $deltaS{'pm'}->{substr($seq, $seqLength-1, 1)}; $seq = uc($seq); for(my $i = 0; $i < $seqLength - 1; $i ++){ $dH += $deltaH{'pm'}->{substr($seq, $i, 2)}; $dS += $deltaS{'pm'}->{substr($seq, $i, 2)}; # print "$seq $i ", substr($seq, $i, 2), "\n" if(!$deltaS{'pm'}->{substr($seq, $i, 2)}); } $dS += 0.368 * $seqLength * log($C_SodiumEquivalent/1000.0); my $Tm = sprintf("%5.2f", ($dH * 1000) / ($dS + $R * (log($C_primer*(1-$percentage_annealed)/$percentage_annealed)-21.4164)) - 273.15 - 0.75*$percentage_DMSO); return $Tm; } =head2 readNNParam Title : readNNParam Function: To read Nearest-neighbor parameters from a file. Returns : none Args : $NNParamFile the name of the NN parameter file. =cut sub readNNParam(){ my $NNParamFile = shift; open(NNFILE, $NNParamFile) || die("Error in opening NN parameter file!"); my $line = ; while($line = ){ chop($line); my ($seqF, $seqR, $dH, $dS, $mismatch) = split(/[:\t]/, $line); if(!$mismatch){ $deltaH{'pm'}->{$seqF} = $dH; $deltaS{'pm'}->{$seqF} = $dS; }else{ $deltaH{'mm'}->{$seqF}->{$seqR} = $dH; $deltaS{'mm'}->{$seqF}->{$seqR} = $dS; } } close(NNFILE); }