Last change
on this file was
2,
checked in by oldcode, 24 years ago
|
Initial revision
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.5 KB
|
Line | |
---|
1 | #include "Flatio.c" |
---|
2 | #define WIDTH 50 |
---|
3 | |
---|
4 | main() |
---|
5 | { |
---|
6 | struct data_format data[10000]; |
---|
7 | int i,j,k,numseqs,maxlen = 0,minlen=999999999; |
---|
8 | int lines_printed; |
---|
9 | int len[1000]; |
---|
10 | char a,b; |
---|
11 | |
---|
12 | numseqs = ReadFlat(stdin,data,10000); |
---|
13 | if(numseqs == 0) |
---|
14 | exit(1); |
---|
15 | |
---|
16 | for(k=0;k<numseqs;k++) |
---|
17 | { |
---|
18 | minlen = MIN(minlen,data[k].offset); |
---|
19 | maxlen = MAX(maxlen,data[j].length+data[k].offset); |
---|
20 | } |
---|
21 | |
---|
22 | for(j=minlen;j<maxlen;j+=WIDTH) |
---|
23 | { |
---|
24 | lines_printed = FALSE; |
---|
25 | for (i=0;i<numseqs;i++) |
---|
26 | { |
---|
27 | data[i].name[19] = '\0'; |
---|
28 | if(((data[i].offset > j+WIDTH) || |
---|
29 | (data[i].offset+data[i].length<j))); |
---|
30 | else |
---|
31 | { |
---|
32 | lines_printed = TRUE; |
---|
33 | printf("\n%20s%5d ", data[i].name, |
---|
34 | indx(j,&(data[i]))); |
---|
35 | for(k=j;k<j+WIDTH;k++) |
---|
36 | { |
---|
37 | if((k<data[i].length+data[i].offset) |
---|
38 | && (k>=data[i].offset)) |
---|
39 | putchar(data[i].nuc[k-data[i].offset]); |
---|
40 | else putchar(' '); |
---|
41 | } |
---|
42 | } |
---|
43 | } |
---|
44 | if(lines_printed) |
---|
45 | { |
---|
46 | printf("\n |---------|---------|---------|---------|---------\n"); |
---|
47 | printf(" %6d %6d %6d %6d %6d\n\n",j+1,j+11,j+21,j+31,j+41); |
---|
48 | } |
---|
49 | } |
---|
50 | putchar('\n'); |
---|
51 | exit(0); |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | int indx(pos,seq) |
---|
56 | int pos; |
---|
57 | struct data_format *seq; |
---|
58 | { |
---|
59 | int j,count=0; |
---|
60 | if(pos < seq->offset) |
---|
61 | return (0); |
---|
62 | if(pos>seq->offset+seq->length) |
---|
63 | pos = seq->offset+seq->length; |
---|
64 | pos -= seq->offset; |
---|
65 | for(j=0;j<pos;j++) |
---|
66 | if(seq->nuc[j] != '-') |
---|
67 | if(seq->nuc[j] != '~') |
---|
68 | count++; |
---|
69 | return (count); |
---|
70 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.