[svn-inject] Installing original source of tigr-glimmer
Charles Plessy
16 years ago
0 | # -*- makefile -*- | |
1 | # just make headings for each thing and put the headings | |
2 | # on the line for ALL | |
3 | PROJECTDIR = . | |
4 | BINDIR = $(PROJECTDIR) | |
5 | ||
6 | CC = gcc | |
7 | CPPC = g++ | |
8 | CFLAGS = -O3 -g -Wall | |
9 | LDFLAGS = -lm | |
10 | ||
11 | DEPEND_FILES = *.cc *.c *.h | |
12 | CLEANABLE_FILES = *.o *~ | |
13 | ||
14 | ALL = adjust anomaly build-icm check codon-usage compare-lists \ | |
15 | extract generate get-len get-putative glimmer2 long-orfs | |
16 | ||
17 | .SUFFIXES: .cc .c | |
18 | ||
19 | .c.o: | |
20 | $(CC) $(CFLAGS) -c $*.c -o $*.o | |
21 | ||
22 | .cc.o: | |
23 | $(CPPC) $(CFLAGS) -c $*.cc -o $*.o | |
24 | ||
25 | all: $(ALL) | |
26 | ||
27 | adjust: adjust.o delcher.o | |
28 | $(CPPC) -o $(BINDIR)/$@ adjust.o delcher.o $(LDFLAGS) | |
29 | ||
30 | anomaly: anomaly.o delcher.o gene.o | |
31 | $(CPPC) -o $(BINDIR)/$@ anomaly.o delcher.o gene.o $(LDFLAGS) | |
32 | ||
33 | build-icm: build-icm.o misc.o | |
34 | $(CC) -o $(BINDIR)/$@ build-icm.o misc.o $(LDFLAGS) | |
35 | ||
36 | check: check.o delcher.o | |
37 | $(CPPC) -o $(BINDIR)/$@ check.o delcher.o $(LDFLAGS) | |
38 | ||
39 | codon-usage: codon-usage.o delcher.o gene.o | |
40 | $(CPPC) -o $(BINDIR)/$@ codon-usage.o delcher.o gene.o $(LDFLAGS) | |
41 | ||
42 | compare-lists: compare-lists.o delcher.o | |
43 | $(CPPC) -o $(BINDIR)/$@ compare-lists.o delcher.o $(LDFLAGS) | |
44 | ||
45 | extract: extract.o delcher.o | |
46 | $(CPPC) -o $(BINDIR)/$@ extract.o delcher.o $(LDFLAGS) | |
47 | ||
48 | generate: generate.o delcher.o gene.o | |
49 | $(CPPC) -o $(BINDIR)/$@ generate.o delcher.o gene.o $(LDFLAGS) | |
50 | ||
51 | get-len: get-len.o delcher.o | |
52 | $(CPPC) -o $(BINDIR)/$@ get-len.o delcher.o $(LDFLAGS) | |
53 | ||
54 | get-putative: get-putative.o delcher.o | |
55 | $(CPPC) -o $(BINDIR)/$@ get-putative.o delcher.o $(LDFLAGS) | |
56 | ||
57 | glimmer2: glimmer2.o delcher.o gene.o rnabin.o | |
58 | $(CPPC) -o $(BINDIR)/$@ glimmer2.o delcher.o gene.o rnabin.o $(LDFLAGS) | |
59 | ||
60 | long-orfs: long-orfs.o delcher.o gene.o | |
61 | $(CPPC) -o $(BINDIR)/$@ long-orfs.o delcher.o gene.o $(LDFLAGS) | |
62 | ||
63 | rnabin: rnabin.o delcher.o | |
64 | $(CPPC) -o $(BINDIR)/$@ rnabin.o delcher.o $(LDFLAGS) | |
65 | ||
66 | depend: | |
67 | makedepend $(DEPEND_FILES) | |
68 | ||
69 | clean: | |
70 | /bin/rm -f $(CLEANABLE_FILES) | |
71 | ||
72 | # DO NOT DELETE THIS LINE -- make depend depends on it. | |
73 |
0 | // A. L. Delcher | |
1 | // | |
2 | // File: ANNOTATION/Glimmer/delcher.h | |
3 | // Version: 2.03 3 Dec 2002 | |
4 | // | |
5 | // Copyright (c) 2002 by Arthur Delcher, Steven Salzberg, Simon | |
6 | // Kasif, and Owen White. All rights reserved. Redistribution | |
7 | // is not permitted without the express written permission of | |
8 | // the authors. | |
9 | // | |
10 | // Common generic routines. | |
11 | // | |
12 | ||
13 | ||
14 | #ifndef __DELCHER_H_INCLUDED | |
15 | #define __DELCHER_H_INCLUDED | |
16 | ||
17 | ||
18 | #include <stdio.h> | |
19 | #include <stdlib.h> | |
20 | #include <iostream.h> | |
21 | #include <iomanip.h> | |
22 | #include <fstream.h> | |
23 | #include <math.h> | |
24 | #include <string.h> | |
25 | #include <ctype.h> | |
26 | #include <limits.h> | |
27 | #include <float.h> | |
28 | #include <time.h> | |
29 | #include <assert.h> | |
30 | #include <errno.h> | |
31 | #include <unistd.h> | |
32 | ||
33 | ||
34 | #define TRUE 1 | |
35 | #define FALSE 0 | |
36 | #ifndef EXIT_FAILURE | |
37 | #define EXIT_FAILURE -1 | |
38 | #endif | |
39 | #ifndef EXIT_SUCCESS | |
40 | #define EXIT_SUCCESS 0 | |
41 | #endif | |
42 | ||
43 | ||
44 | const int FASTA_WIDTH = 60; | |
45 | // Max number of characters to print on a FASTA data line | |
46 | ||
47 | ||
48 | const char * Commatize | |
49 | (long int n); | |
50 | void Fasta_Print | |
51 | (FILE * fp, char * s, char * hdr); | |
52 | void Fasta_Print_N | |
53 | (FILE * fp, char * s, int n, char * hdr); | |
54 | FILE * File_Open | |
55 | (const char *, const char *); | |
56 | double Percent | |
57 | (double a, double b); | |
58 | void * Safe_calloc | |
59 | (size_t N, size_t Len, size_t line_num = 0); | |
60 | void * Safe_malloc | |
61 | (size_t Len, size_t line_num = 0); | |
62 | void * Safe_realloc | |
63 | (void * Q, size_t Len, size_t line_num = 0); | |
64 | ||
65 | ||
66 | template <class DT> | |
67 | DT Max (DT, DT); | |
68 | template <class DT> | |
69 | DT Min (DT, DT); | |
70 | template <class DT> | |
71 | void Swap (DT &, DT &); | |
72 | ||
73 | ||
74 | template <class DT> | |
75 | DT Max (DT A, DT B) | |
76 | ||
77 | // Return the larger of A and B . | |
78 | ||
79 | { | |
80 | if (A > B) | |
81 | return A; | |
82 | else | |
83 | return B; | |
84 | } | |
85 | ||
86 | ||
87 | ||
88 | template <class DT> | |
89 | DT Min (DT A, DT B) | |
90 | ||
91 | // Return the smaller of A and B . | |
92 | ||
93 | { | |
94 | if (A < B) | |
95 | return A; | |
96 | else | |
97 | return B; | |
98 | } | |
99 | ||
100 | ||
101 | ||
102 | template <class DT> | |
103 | void Swap (DT & A, DT & B) | |
104 | ||
105 | // Swap the values in A and B . | |
106 | ||
107 | { | |
108 | DT Save; | |
109 | ||
110 | Save = A; | |
111 | A = B; | |
112 | B = Save; | |
113 | ||
114 | return; | |
115 | } | |
116 | ||
117 | ||
118 | ||
119 | #endif |
0 | echo "run Glimmer2" | |
1 | clear | |
2 | echo "Genome is " $1 | |
3 | echo "Find non-overlapping orfs in tmp.coord" | |
4 | rm -f tmp.coord | |
5 | long-orfs $1 | get-putative >tmp.coord | |
6 | echo "Extract training sequences to tmp.train" | |
7 | rm -f tmp.train | |
8 | extract $1 tmp.coord >tmp.train | |
9 | wc tmp.train | |
10 | echo "Build interpolated context model in tmp.model" | |
11 | rm -f tmp.model | |
12 | build-icm <tmp.train >tmp.model | |
13 | echo "Predict genes with Glimmer2 with coordinates in g2.coord" | |
14 | rm -f g2.coord | |
15 | glimmer2 $1 tmp.model | get-putative >g2.coord |