lib/oligoTm.c File Reference

#include "common.h"
#include "oligoTm.h"

Include dependency graph for oligoTm.c:

Go to the source code of this file.

Defines

#define S_A_A   240
#define S_A_C   173
#define S_A_G   208
#define S_A_T   239
#define S_A_N   215
#define S_C_A   129
#define S_C_C   266
#define S_C_G   278
#define S_C_T   208
#define S_C_N   220
#define S_G_A   135
#define S_G_C   267
#define S_G_G   266
#define S_G_T   173
#define S_G_N   210
#define S_T_A   169
#define S_T_C   135
#define S_T_G   129
#define S_T_T   240
#define S_T_N   168
#define S_N_A   168
#define S_N_C   210
#define S_N_G   220
#define S_N_T   215
#define S_N_N   203
#define H_A_A   91
#define H_A_C   65
#define H_A_G   78
#define H_A_T   86
#define H_A_N   80
#define H_C_A   58
#define H_C_C   110
#define H_C_G   119
#define H_C_T   78
#define H_C_N   91
#define H_G_A   56
#define H_G_C   111
#define H_G_G   110
#define H_G_T   65
#define H_G_N   85
#define H_T_A   60
#define H_T_C   56
#define H_T_G   58
#define H_T_T   91
#define H_T_N   66
#define H_N_A   66
#define H_N_C   85
#define H_N_G   91
#define H_N_T   80
#define H_N_N   80
#define G_A_A   1900
#define G_A_C   1300
#define G_A_G   1600
#define G_A_T   1500
#define G_A_N   1575
#define G_C_A   1900
#define G_C_C   3100
#define G_C_G   3600
#define G_C_T   1600
#define G_C_N   2550
#define G_G_A   1600
#define G_G_C   3100
#define G_G_G   3100
#define G_G_T   1300
#define G_G_N   2275
#define G_T_A   900
#define G_T_C   1600
#define G_T_G   1900
#define G_T_T   1900
#define G_T_N   1575
#define G_N_A   1575
#define G_N_C   2275
#define G_N_G   2550
#define G_N_T   1575
#define G_N_N   1994
#define A_CHAR   'A'
#define G_CHAR   'G'
#define T_CHAR   'T'
#define C_CHAR   'C'
#define N_CHAR   'N'
#define CATID5(A, B, C, D, E)   A##B##C##D##E
#define CATID2(A, B)   A##B
#define DO_PAIR(LAST, THIS)
#define STATE(LAST)
#define DO_PAIR(LAST, THIS)

Functions

double oligoTm (char *dna, double DNA_nM, double K_mM)
double oligoDg (char *dna)
double longSeqTm (char *s, int start, int len, double salt_conc)
double seqTm (char *seq, double dna_conc, double salt_conc)


Define Documentation

#define A_CHAR   'A'

Definition at line 156 of file oligoTm.c.

#define C_CHAR   'C'

Definition at line 159 of file oligoTm.c.

#define CATID2 ( A,
 )     A##B

Definition at line 163 of file oligoTm.c.

#define CATID5 ( A,
B,
C,
D,
 )     A##B##C##D##E

Definition at line 162 of file oligoTm.c.

#define DO_PAIR ( LAST,
THIS   ) 

Value:

if (CATID2(THIS,_CHAR) == c) {    \
     dg += CATID5(G,_,LAST,_,THIS); \
     goto CATID2(THIS,_STATE);      \
  }

Definition at line 240 of file oligoTm.c.

#define DO_PAIR ( LAST,
THIS   ) 

Value:

if (CATID2(THIS,_CHAR) == c) {    \
     dh += CATID5(H,_,LAST,_,THIS); \
     ds += CATID5(S,_,LAST,_,THIS); \
     goto CATID2(THIS,_STATE);      \
  }

Definition at line 240 of file oligoTm.c.

#define G_A_A   1900

Definition at line 126 of file oligoTm.c.

#define G_A_C   1300

Definition at line 127 of file oligoTm.c.

#define G_A_G   1600

Definition at line 128 of file oligoTm.c.

#define G_A_N   1575

Definition at line 130 of file oligoTm.c.

#define G_A_T   1500

Definition at line 129 of file oligoTm.c.

#define G_C_A   1900

Definition at line 132 of file oligoTm.c.

#define G_C_C   3100

Definition at line 133 of file oligoTm.c.

#define G_C_G   3600

Definition at line 134 of file oligoTm.c.

#define G_C_N   2550

Definition at line 136 of file oligoTm.c.

#define G_C_T   1600

Definition at line 135 of file oligoTm.c.

#define G_CHAR   'G'

Definition at line 157 of file oligoTm.c.

#define G_G_A   1600

Definition at line 138 of file oligoTm.c.

#define G_G_C   3100

Definition at line 139 of file oligoTm.c.

#define G_G_G   3100

Definition at line 140 of file oligoTm.c.

#define G_G_N   2275

Definition at line 142 of file oligoTm.c.

#define G_G_T   1300

Definition at line 141 of file oligoTm.c.

#define G_N_A   1575

Definition at line 150 of file oligoTm.c.

#define G_N_C   2275

Definition at line 151 of file oligoTm.c.

#define G_N_G   2550

Definition at line 152 of file oligoTm.c.

#define G_N_N   1994

Definition at line 154 of file oligoTm.c.

#define G_N_T   1575

Definition at line 153 of file oligoTm.c.

#define G_T_A   900

Definition at line 144 of file oligoTm.c.

#define G_T_C   1600

Definition at line 145 of file oligoTm.c.

#define G_T_G   1900

Definition at line 146 of file oligoTm.c.

#define G_T_N   1575

Definition at line 148 of file oligoTm.c.

#define G_T_T   1900

Definition at line 147 of file oligoTm.c.

#define H_A_A   91

Definition at line 95 of file oligoTm.c.

#define H_A_C   65

Definition at line 96 of file oligoTm.c.

#define H_A_G   78

Definition at line 97 of file oligoTm.c.

#define H_A_N   80

Definition at line 99 of file oligoTm.c.

#define H_A_T   86

Definition at line 98 of file oligoTm.c.

#define H_C_A   58

Definition at line 101 of file oligoTm.c.

#define H_C_C   110

Definition at line 102 of file oligoTm.c.

#define H_C_G   119

Definition at line 103 of file oligoTm.c.

#define H_C_N   91

Definition at line 105 of file oligoTm.c.

#define H_C_T   78

Definition at line 104 of file oligoTm.c.

#define H_G_A   56

Definition at line 107 of file oligoTm.c.

#define H_G_C   111

Definition at line 108 of file oligoTm.c.

#define H_G_G   110

Definition at line 109 of file oligoTm.c.

#define H_G_N   85

Definition at line 111 of file oligoTm.c.

#define H_G_T   65

Definition at line 110 of file oligoTm.c.

#define H_N_A   66

Definition at line 119 of file oligoTm.c.

#define H_N_C   85

Definition at line 120 of file oligoTm.c.

#define H_N_G   91

Definition at line 121 of file oligoTm.c.

#define H_N_N   80

Definition at line 123 of file oligoTm.c.

#define H_N_T   80

Definition at line 122 of file oligoTm.c.

#define H_T_A   60

Definition at line 113 of file oligoTm.c.

#define H_T_C   56

Definition at line 114 of file oligoTm.c.

#define H_T_G   58

Definition at line 115 of file oligoTm.c.

#define H_T_N   66

Definition at line 117 of file oligoTm.c.

#define H_T_T   91

Definition at line 116 of file oligoTm.c.

#define N_CHAR   'N'

Definition at line 160 of file oligoTm.c.

#define S_A_A   240

Definition at line 64 of file oligoTm.c.

#define S_A_C   173

Definition at line 65 of file oligoTm.c.

#define S_A_G   208

Definition at line 66 of file oligoTm.c.

#define S_A_N   215

Definition at line 68 of file oligoTm.c.

#define S_A_T   239

Definition at line 67 of file oligoTm.c.

#define S_C_A   129

Definition at line 70 of file oligoTm.c.

#define S_C_C   266

Definition at line 71 of file oligoTm.c.

#define S_C_G   278

Definition at line 72 of file oligoTm.c.

#define S_C_N   220

Definition at line 74 of file oligoTm.c.

#define S_C_T   208

Definition at line 73 of file oligoTm.c.

#define S_G_A   135

Definition at line 76 of file oligoTm.c.

#define S_G_C   267

Definition at line 77 of file oligoTm.c.

#define S_G_G   266

Definition at line 78 of file oligoTm.c.

#define S_G_N   210

Definition at line 80 of file oligoTm.c.

#define S_G_T   173

Definition at line 79 of file oligoTm.c.

#define S_N_A   168

Definition at line 88 of file oligoTm.c.

#define S_N_C   210

Definition at line 89 of file oligoTm.c.

#define S_N_G   220

Definition at line 90 of file oligoTm.c.

#define S_N_N   203

Definition at line 92 of file oligoTm.c.

#define S_N_T   215

Definition at line 91 of file oligoTm.c.

#define S_T_A   169

Definition at line 82 of file oligoTm.c.

#define S_T_C   135

Definition at line 83 of file oligoTm.c.

#define S_T_G   129

Definition at line 84 of file oligoTm.c.

#define S_T_N   168

Definition at line 86 of file oligoTm.c.

#define S_T_T   240

Definition at line 85 of file oligoTm.c.

#define STATE ( LAST   ) 

Value:

CATID2(LAST,_STATE): \
   c = *s; s++;         \
   DO_PAIR(LAST,A)      \
   else DO_PAIR(LAST,T) \
   else DO_PAIR(LAST,G) \
   else DO_PAIR(LAST,C) \
   else DO_PAIR(LAST,N) \
   else if ('\0' == c)  \
             goto DONE; \
   else goto ERROR \

Definition at line 171 of file oligoTm.c.

Referenced by oligoDg(), and oligoTm().

#define T_CHAR   'T'

Definition at line 158 of file oligoTm.c.


Function Documentation

double longSeqTm ( char *  s,
int  start,
int  len,
double  salt_conc 
)

Definition at line 282 of file oligoTm.c.

References errAbort().

Referenced by seqTm().

00284                                             :1390 (1962) as presented in
00285  * Sambrook, Fritsch and Maniatis, Molecular Cloning, p 11.46 (1989, CSHL
00286  * Press).
00287  *
00288  * Tm = 81.5 + 16.6(log10([Na+])) + .41*(%GC) - 600/length
00289  *
00290  * Where [Na+] is the molar sodium concentration, (%GC) is the percent of Gs
00291  * and Cs in the sequence, and length is the length of the sequence.
00292  *
00293  * A similar formula is used by the prime primer selection program in GCG
00294  * (http://www.gcg.com), which instead uses 675.0 / length in the last term
00295  * (after F. Baldino, Jr, M.-F. Chesselet, and M.E.  Lewis, Methods in
00296  * Enzymology 168:766 (1989) eqn (1) on page 766 without the mismatch and
00297  * formamide terms).  The formulas here and in Baldino et al. assume Na+ rather
00298  * than K+.  According to J.G. Wetmur, Critical Reviews in BioChem. and
00299  * Mol. Bio. 26:227 (1991) 50 mM K+ should be equivalent in these formulae to .2
00300  * M Na+.
00301  *
00302  * This function takes salt_conc to be the millimolar (mM) concentration,
00303  * since mM is the usual units in PCR applications.  */
00304 {
00305   int GC_count = 0;
00306   char *p, *end;
00307 
00308   if(start + len > strlen(s) || start < 0 || len <= 0) 
00309         errAbort("bad input to longSeqTm");
00310   end = &s[start + len];
00311   /* Length <= 0 is nonsensical. */
00312   for (p = &s[start]; p < end; p++) {
00313     if ('G' == *p || 'g' == *p || 'C' == *p || 'c' == *p)
00314       GC_count++;
00315   }
00316 
00317   return
00318     81.5
00319     + (16.6 * log10(salt_conc / 1000.0))
00320     + (41.0 * (((double) GC_count) / len))
00321     - (600.0 / len);
00322 
00323 }

Here is the call graph for this function:

Here is the caller graph for this function:

double oligoDg ( char *  dna  ) 

Definition at line 246 of file oligoTm.c.

References cloneString(), errAbort(), freeMem(), and STATE.

00251 {
00252     register int dg = 0;
00253     register char c;
00254     char *dupe = cloneString(dna);
00255     char *s = dupe;
00256 
00257     /* Use a finite-state machine (DFA) to calculate dg s. */
00258     c = *s; s++;
00259     if (c == 'A') goto A_STATE;
00260     else if (c == 'G') goto G_STATE;
00261     else if (c == 'T') goto T_STATE;
00262     else if (c == 'C') goto C_STATE;
00263     else if (c == 'N') goto N_STATE;
00264     else goto ERROR;
00265     STATE(A);
00266     STATE(T);
00267     STATE(G);
00268     STATE(C);
00269     STATE(N);
00270 
00271     DONE:  /* dg is now computed for the given sequence. */
00272     freeMem(dupe);
00273     return dg / 1000.0;
00274 
00275     ERROR:
00276     freeMem(dupe);
00277     errAbort("Not a valid oligo in oligoDg.");
00278     return 0;
00279 }

Here is the call graph for this function:

double oligoTm ( char *  dna,
double  DNA_nM,
double  K_mM 
)

Definition at line 183 of file oligoTm.c.

References cloneString(), ds, errAbort(), freeMem(), STATE, and touppers().

Referenced by seqTm().

00190 {
00191     register int dh = 0, ds = 108;
00192     register char c;
00193     char *dupe = cloneString(dna);
00194     char *s = dupe;
00195     double delta_H, delta_S;
00196 
00197     touppers(s);
00198     /* Use a finite-state machine (DFA) to calucluate dh and ds for s. */
00199     c = *s; s++;
00200     if (c == 'A') goto A_STATE;
00201     else if (c == 'G') goto G_STATE;
00202     else if (c == 'T') goto T_STATE;
00203     else if (c == 'C') goto C_STATE;
00204     else if (c == 'N') goto N_STATE;
00205     else goto ERROR;
00206     STATE(A);
00207     STATE(T);
00208     STATE(G);
00209     STATE(C);
00210     STATE(N);
00211 
00212     DONE:  /* dh and ds are now computed for the given sequence. */
00213     delta_H = dh * -100.0;  /* 
00214                              * Nearest-neighbor thermodynamic values for dh
00215                              * are given in 100 cal/mol of interaction.
00216                              */
00217     delta_S = ds * -0.1;     /*
00218                               * Nearest-neighbor thermodynamic values for ds
00219                               * are in in .1 cal/K per mol of interaction.
00220                               */
00221 
00222     /* 
00223      * See Rychlik, Spencer, Roads, Nucleic Acids Research, vol 18, no 21,
00224      * page 6410, eqn (ii).
00225      */
00226     freeMem(dupe);
00227     return delta_H / (delta_S + 1.987 * log(DNA_nM/4000000000.0))
00228         - 273.15 + 16.6 * log10(K_mM/1000.0);
00229 
00230     ERROR:  /* 
00231           * length of s was less than 2 or there was an illegal character in
00232           * s.
00233           */
00234     freeMem(dupe);
00235     errAbort("Not a valid oligo in oligoTm.");
00236     return 0;
00237 }

Here is the call graph for this function:

Here is the caller graph for this function:

double seqTm ( char *  seq,
double  dna_conc,
double  salt_conc 
)

Definition at line 325 of file oligoTm.c.

References longSeqTm(), and oligoTm().

00328 {
00329   int len = strlen(seq);
00330   return (len > 36)
00331     ? longSeqTm(seq, 0, len, salt_conc) : oligoTm(seq, dna_conc, salt_conc);
00332 }

Here is the call graph for this function:


Generated on Tue Dec 25 20:07:12 2007 for blat by  doxygen 1.5.2