annotate mrcanavar-0.34/prep.c @ 0:86522a0b5f59 default tip

Uploaded source code for mrCaNaVaR
author calkan
date Tue, 21 Feb 2012 10:44:13 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
1 #include "prep.h"
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
2
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
3 void prep_genome(void){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
4 FILE *fasta;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
5 FILE *gaps;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
6 FILE *config;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
7
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
8 int num_gaps;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
9
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
10 char chrom[MAX_STR];
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
11 int start, end;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
12 int max_len;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
13
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
14 int i;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
15
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
16 if (GENOME_FASTA == NULL)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
17 print_error("Select genome fasta file (input) through -fasta parameter.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
18 if (GENOME_GAPS == NULL)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
19 print_error("Select genome gaps file (input) through -gaps parameter.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
20 if (GENOME_CONF == NULL)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
21 print_error("Select genome fasta file (output) through -conf parameter.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
22
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
23
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
24 if (LW_SIZE <= 0)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
25 print_error ("Large window size (-lw_size) must be a poitive integer.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
26 if (SW_SIZE <= 0)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
27 print_error ("Small window size (-sw_size) must be a poitive integer.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
28 if (CW_SIZE <= 0)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
29 print_error ("Copy number window size (-cw_size) must be a poitive integer.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
30 if (LW_SLIDE <= 0)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
31 print_error ("Large window slide (-lw_slide) must be a poitive integer.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
32 if (SW_SLIDE <= 0)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
33 print_error ("Small window slide (-sw_slide) must be a poitive integer.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
34
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
35 if (SW_SIZE >= LW_SIZE)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
36 print_error ("Small window size (-sw_size) should be smaller than large window size (-lw_size).\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
37 if (SW_SLIDE > LW_SIZE)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
38 print_error ("Small window slide (-sw_slide) should be smaller than or equal to large window slide (-lw_slide).\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
39
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
40
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
41 fasta = my_fopen(GENOME_FASTA, "r", 0);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
42 gaps = my_fopen(GENOME_GAPS, "r", 0);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
43
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
44 num_gaps = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
45
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
46
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
47 /* initialize gap table */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
48 while (fscanf (gaps, "%s\t%d\t%d\n", chrom, &start, &end) > 0)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
49 num_gaps ++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
50
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
51
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
52 gaptable = (struct gapcell *) malloc(sizeof(struct gapcell) * num_gaps);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
53
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
54 rewind(gaps);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
55
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
56
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
57 /* read gap table */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
58
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
59 i = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
60 while (fscanf (gaps, "%s\t%d\t%d\n", chrom, &start, &end) > 0){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
61 trimspace(chrom);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
62 gaptable[i].chrom = NULL;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
63 set_str(&(gaptable[i].chrom), chrom);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
64 gaptable[i].start = start;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
65 gaptable[i].end = end;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
66 i++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
67 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
68 fclose(gaps);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
69
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
70 fprintf (stdout, "Scanning the reference genome.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
71 /* count basic numbers from the reference genome */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
72 max_len = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
73 num_chrom = count_chrom(fasta, &max_len);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
74 rewind(fasta);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
75
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
76 chromosomes = (struct chrom **) malloc (sizeof (struct chrom *) * num_chrom);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
77
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
78 for (i=0; i<num_chrom; i++)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
79 chromosomes[i] = (struct chrom *) malloc (sizeof (struct chrom) * num_chrom);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
80
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
81 fprintf(stdout, "Total of %d chromosomes in the reference genome, with %d gaps.\nLongest chromosome is %d bp\n", num_chrom, num_gaps, max_len);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
82
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
83 fprintf (stdout, "Reading the reference genome.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
84
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
85 read_ref(fasta, max_len, num_gaps);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
86
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
87 fprintf (stdout, "Saving the reference configuration.\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
88 saveRefConfig(GENOME_CONF);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
89
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
90 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
91
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
92
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
93
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
94 int count_chrom(FILE *fasta, int *max_len){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
95 int length=0; int maxlength=0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
96 char ch;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
97 int cnt = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
98 char skip[MAX_STR];
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
99 char *retStr;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
100
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
101 //while (fscanf(fasta, "%c", &ch) > 0){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
102 while (1){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
103
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
104 ch = fgetc(fasta);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
105 if (feof(fasta)) break;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
106
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
107 if (ch == '>') {
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
108 cnt ++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
109 retStr = fgets(skip, MAX_STR, fasta);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
110 fprintf(stdout, ".");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
111 fflush(stdout);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
112 if (length > maxlength) maxlength = length;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
113 length = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
114 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
115 else if (!isspace(ch)) length++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
116 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
117 fprintf(stdout, "\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
118
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
119 if (length > maxlength)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
120 maxlength = length;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
121
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
122 *max_len = maxlength;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
123 return cnt;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
124 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
125
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
126
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
127
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
128 void read_ref(FILE *fasta, int max_len, int num_gaps){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
129
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
130 char ch;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
131 int cnt = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
132 char chrom_name[MAX_STR];
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
133 int i;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
134 int length;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
135 char *chrom_seq;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
136 char *retStr;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
137
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
138 chrom_seq = (char *) malloc (sizeof(char) * (max_len+1));
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
139 cnt = -1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
140 i = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
141 length = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
142
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
143 // while (fscanf(fasta, "%c", &ch) > 0){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
144 while (1){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
145
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
146 ch = fgetc(fasta);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
147 if (feof(fasta)) break;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
148
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
149 if (ch == '>') {
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
150
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
151 if (cnt != -1){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
152 /* insert the previous chromosome */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
153 chrom_seq[length]=0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
154 insert_chrom(cnt, chrom_name, length, chrom_seq, num_gaps);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
155 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
156
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
157 cnt ++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
158 retStr = fgets(chrom_name, MAX_STR, fasta);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
159 chrom_name[strlen(chrom_name)-1] = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
160 trimspace(chrom_name);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
161 length = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
162 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
163 else if (!isspace(ch)){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
164 chrom_seq[length++] = ch;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
165 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
166 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
167
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
168 /* insert the last chromosome */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
169 chrom_seq[length]=0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
170 trimspace(chrom_name);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
171 insert_chrom(cnt, chrom_name, length, chrom_seq, num_gaps);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
172
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
173 free(chrom_seq);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
174 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
175
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
176
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
177 void insert_chrom(int cnt, char *chrom_name, int length, char *chrom_seq, int num_gaps){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
178
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
179 fprintf(stdout, "Chromosome %s (%d bp). Counting windows ... ", chrom_name, length);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
180 fflush(stdout);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
181
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
182 chromosomes[cnt]->name = NULL;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
183 set_str(&(chromosomes[cnt]->name), chrom_name);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
184 chromosomes[cnt]->length = length;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
185
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
186 windowmaker(num_gaps, cnt, chrom_name, chrom_seq, length, 0);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
187 fprintf(stdout, "\t\tRecalculating windows ... ");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
188 fflush(stdout);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
189 windowmaker(num_gaps, cnt, chrom_name, chrom_seq, length, 1);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
190
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
191 fprintf(stdout, "\n");
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
192 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
193
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
194
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
195 void windowmaker(int num_gaps, int chrom_id, char *chrom_name, char *chrom_seq, int length, int flag){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
196 int i;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
197 int j;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
198 int nchar;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
199 int s, e;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
200
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
201 int gc;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
202 float gc_p;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
203
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
204 int lw_cnt = 0; // large window (5Kb)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
205 int sw_cnt = 0; // small window (1Kb)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
206 int cw_cnt = 0; // copy number window (1kb non-ovp);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
207
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
208
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
209 int win_cnt;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
210
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
211 /* if flag = 0; don't record it */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
212
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
213 if (!flag){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
214 for (i=0;i<num_gaps;i++){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
215 if (!strcmp(gaptable[i].chrom, chrom_name)){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
216 if (gaptable[i].start == gaptable[i].end)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
217 chrom_seq[gaptable[i].start] = 'X';
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
218 else{
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
219 for (j=gaptable[i].start; (j<gaptable[i].end && j<length); j++)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
220 chrom_seq[j] = 'X';
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
221 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
222 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
223 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
224 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
225
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
226
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
227 /* count cw_cnt */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
228
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
229 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
230 s = 0 ; e = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
231 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
232
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
233 for (i=0; i<length; i++){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
234
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
235 if (chrom_seq[i] != 'N' && chrom_seq[i] != 'X')
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
236 nchar++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
237 if (chrom_seq[i] == 'G' || chrom_seq[i] == 'C')
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
238 gc++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
239
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
240 if ((nchar == CW_SIZE || chrom_seq[i] == 'X') && nchar != 0){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
241 e = i;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
242 if (chrom_seq[i] == 'X'){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
243 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
244 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
245 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
246 else if (flag == 1 && nchar == CW_SIZE){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
247 /* save */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
248 chromosomes[chrom_id]->cw[cw_cnt].start = s;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
249 chromosomes[chrom_id]->cw[cw_cnt].end = e+1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
250 chromosomes[chrom_id]->cw[cw_cnt].gc = (float)gc / (float)nchar;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
251 chromosomes[chrom_id]->cw[cw_cnt].depth = 0; // for readability/completeness
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
252 cw_cnt++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
253 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
254 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
255 else if (flag == 0 && nchar == CW_SIZE){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
256 cw_cnt ++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
257 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
258
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
259 s = i + 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
260 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
261 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
262
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
263 if (chrom_seq[i] == 'X'){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
264 s = i + 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
265 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
266 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
267 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
268
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
269 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
270
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
271
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
272 /* count sw_cnt */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
273
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
274 i = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
275 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
276 s = 0 ; e = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
277 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
278
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
279 while (i < length){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
280
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
281 if (chrom_seq[i] != 'N' && chrom_seq[i] != 'X')
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
282 nchar++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
283 if (chrom_seq[i] == 'G' || chrom_seq[i] == 'C')
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
284 gc++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
285
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
286 if ((nchar == SW_SIZE || chrom_seq[i] == 'X') && nchar != 0){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
287 e = i;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
288 if (chrom_seq[i] == 'X'){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
289 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
290 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
291 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
292 else if (flag == 1 && nchar == SW_SIZE){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
293 /* save */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
294 chromosomes[chrom_id]->sw[sw_cnt].start = s;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
295 chromosomes[chrom_id]->sw[sw_cnt].end = e+1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
296 chromosomes[chrom_id]->sw[sw_cnt].gc = (float)gc / (float)nchar;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
297 chromosomes[chrom_id]->sw[sw_cnt].depth = 0; // for readability/completeness
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
298 sw_cnt++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
299 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
300 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
301 else if (flag == 0 && nchar == SW_SIZE)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
302 sw_cnt++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
303
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
304 s = s + SW_SLIDE;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
305 i = s - 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
306 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
307 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
308 if (chrom_seq[i]=='X'){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
309 s = i + 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
310 i = s - 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
311 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
312 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
313
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
314 i++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
315 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
316
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
317
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
318 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
319 i = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
320 s = 0 ; e = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
321 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
322 /* count lw_cnt */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
323
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
324 while (i<length){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
325
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
326 if (chrom_seq[i] != 'N' && chrom_seq[i] != 'X')
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
327 nchar++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
328 if (chrom_seq[i] == 'G' || chrom_seq[i] == 'C')
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
329 gc++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
330
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
331 if ((nchar == LW_SIZE || chrom_seq[i] == 'X') && nchar != 0){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
332 e = i;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
333 if (chrom_seq[i] == 'X'){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
334 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
335 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
336 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
337 else if (flag == 1 && nchar == LW_SIZE){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
338 /* save */
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
339 chromosomes[chrom_id]->lw[lw_cnt].start = s;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
340 chromosomes[chrom_id]->lw[lw_cnt].end = e+1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
341 chromosomes[chrom_id]->lw[lw_cnt].gc = (float)gc / (float)nchar;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
342 chromosomes[chrom_id]->lw[lw_cnt].depth = 0; // for readability/completeness
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
343 lw_cnt++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
344 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
345 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
346 else if (flag == 0 && nchar == LW_SIZE)
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
347 lw_cnt++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
348
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
349 s = s + LW_SLIDE;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
350 i = s - 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
351 nchar = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
352 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
353
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
354 if (chrom_seq[i] == 'X') {
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
355 s = i + 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
356 i = s - 1;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
357 gc = 0;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
358 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
359
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
360 i++;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
361 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
362
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
363
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
364
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
365 if (flag == 0){
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
366
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
367 printf("\n\t\tLW: %d\tSW: %d\tCW: %d\n", lw_cnt, sw_cnt, cw_cnt);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
368
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
369 chromosomes[chrom_id]->lw_cnt = lw_cnt;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
370 chromosomes[chrom_id]->sw_cnt = sw_cnt;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
371 chromosomes[chrom_id]->cw_cnt = cw_cnt;
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
372
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
373 chromosomes[chrom_id]->cw = (struct window *) malloc (sizeof(struct window) * cw_cnt);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
374 chromosomes[chrom_id]->lw = (struct window *) malloc (sizeof(struct window) * lw_cnt);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
375 chromosomes[chrom_id]->sw = (struct window *) malloc (sizeof(struct window) * sw_cnt);
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
376
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
377
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
378 }
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
379
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
380
86522a0b5f59 Uploaded source code for mrCaNaVaR
calkan
parents:
diff changeset
381 }