2
Copyright (c) 1996,1997,1998,1999,2000,2001,2004,2006
3
Whitehead Institute for Biomedical Research, Steve Rozen
4
(http://jura.wi.mit.edu/rozen), and Helen Skaletsky
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions are
11
* Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
* Redistributions in binary form must reproduce the above
14
copyright notice, this list of conditions and the following disclaimer
15
in the documentation and/or other materials provided with the
17
* Neither the names of the copyright holders nor contributors may
18
be used to endorse or promote products derived from this software
19
without specific prior written permission.
21
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
/* Print the melting tm of an oligo on stdout. */
46
char *msg = "Usage: %s [-k salt-conc] [-d template-conc] oligo\n\n"
47
"where oligo is an oligonucleotide sequence of between 2 and 36 bases.\n"
48
"(Bases in oligo must be uppercase.)\n"
49
"salt-conc is mM salt (usually K) concentration; defaults to 50mM\n"
50
"template-conc is nM template concentration\n; defaults to 50nM\n"
51
"Prints oligo's melting temperature on stdout.\n";
56
if (argc < 2 || argc > 6) {
57
fprintf(stderr, msg, argv[0]);
61
for (i=1; i < argc; ++i) {
62
if (!strncmp("-k", argv[i], 2)) {
63
k = strtol(argv[i+1], &endptr, 10);
64
if ('\0' != *endptr) {
65
fprintf(stderr, msg, argv[0]);
69
} else if (!strncmp("-d", argv[i], 2)) {
70
d = strtol(argv[i+1], &endptr, 10);
71
if ('\0' != *endptr) {
72
fprintf(stderr, msg, argv[0]);
76
} else if (!strncmp("-", argv[i], 1)) {
78
fprintf(stderr, msg, argv[0]);
81
break; /* all args processed. go on to sequences. */
84
tm = oligotm(argv[i], d, k);
85
if (OLIGOTM_ERROR == tm) {
87
"%s: length of %s is less than 2 or it contains an illegal character\n",
91
fprintf(stdout, "%f\n", tm);