-
Notifications
You must be signed in to change notification settings - Fork 1
/
PrunePrint.C
242 lines (193 loc) · 5.82 KB
/
PrunePrint.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#include"Prune.h"
/*****************************************************************/
void Prune :: generateSpecs()
{
ofstream adlfile("CA3b4p.adl");
ofstream bdlfile("CA3b4p.bdl");
ofstream abpfile("CA3b4p.abp");
ofstream bbpfile("CA3b4p.bbp");
ofstream tdlfile("CA3b4p.tdl");
ofstream tbpfile("CA3b4p.tbp");
int i,j;
double adlsum=0.0;
double bdlsum=0.0;
double abpsum=0.0;
double bbpsum=0.0;
double adlorg=0.0;
double bdlorg=0.0;
double abporg=0.0;
double bbporg=0.0;
for(i=0; i<sdata.na; i++){
adlorg+=sdata.apicalcount[i];
abporg+=BPStats.apicalcount[i];
}
for(i=0; i<sdata.nb; i++){
bdlorg+=sdata.basalcount[i];
bbporg+=BPStats.basalcount[i];
}
for(j=0; j<10000; j++){
setZeta(basefilename);
adlsum=abpsum=bdlsum=bbpsum=0.0;
for(i=0; i<sdata.na; i++){
//adlfile << sdata.apicalcount[i]-adlzeta[i] << " ";
adlfile << adlzeta[i]/sdata.apicalcount[i] << " ";
adlsum += sdata.apicalcount[i]-adlzeta[i];
}
adlfile << endl ;
for(i=0; i<sdata.nb; i++){
//bdlfile << sdata.basalcount[i]-bdlzeta[i] << " ";
bdlfile << bdlzeta[i]/sdata.basalcount[i] << " ";
bdlsum += sdata.basalcount[i]-bdlzeta[i];
}
bdlfile << endl ;
for(i=0; i<sdata.na; i++){
//abpfile << BPStats.apicalcount[i]-abpzeta[i] << " " ;
abpfile << abpzeta[i]/BPStats.apicalcount[i] << " " ;
abpsum += BPStats.apicalcount[i]-abpzeta[i];
}
abpfile << endl ;
for(i=0; i<sdata.nb; i++){
//bbpfile << BPStats.basalcount[i]-bbpzeta[i] << " ";
bbpfile << bbpzeta[i]/BPStats.basalcount[i] << " ";
bbpsum += BPStats.basalcount[i]-bbpzeta[i];
}
bbpfile << endl ;
tdlfile << adlorg << " " << adlsum << " "
<< ((adlorg-adlsum)*100)/adlorg << " "
<< bdlorg << " " << bdlsum << " "
<< ((bdlorg-bdlsum)*100)/bdlorg << " "
<< ((adlorg+bdlorg-adlsum-bdlsum)*100)/(adlorg+bdlorg)
<< endl ;
tbpfile << abporg << " " << abpsum << " "
<< ((abporg-abpsum)*100)/abporg << " "
<< bbporg << " " << bbpsum << " "
<< ((bbporg-bbpsum)*100)/bbporg << " "
<< ((abporg+bbporg-abpsum-bbpsum)*100)/(abporg+bbporg)
<< endl ;
cerr << j << " .....\n";
}
}
/*****************************************************************/
void Prune:: printSubsets()
{
int i;
cerr << "\nThe set of TP's are: ";
for(i=0; i<TP.npts; i++)
cerr << TP.Pts[i] << " ";
cerr << "\nThe set of BP's are: ";
for(i=0; i<BP.npts; i++)
cerr << BP.Pts[i] << " ";
cerr << "\nThe set of Stems are: ";
for(i=0; i<Stems.npts; i++)
cerr << Stems.Pts[i] << " ";
cerr << "\nThe set of Soma are: ";
for(i=0; i<Soma.npts; i++)
cerr << Soma.Pts[i] << " ";
cerr << endl ;
}
/*****************************************************************/
void Prune :: printStatus()
{
int i;
Sholl test;
test.SetComptmt(PruCom,npc);
ShollData stest=test.ShollAnalysis();
cerr << "\nADLPrune:";
for (i=0; i<sdata.na; i++)
cerr << (int)adlprune[i] << " ";
cerr << "\nADLZeta: ";
for (i=0; i<sdata.na; i++)
cerr << (int)adlzeta[i] << " ";
cerr << "\nADLOrig:";
for (i=0; i<sdata.na; i++)
cerr << (int)sdata.apicalcount[i] << " ";
cerr << "\nADLDiff: ";
for (i=0; i<sdata.na; i++)
cerr << (int)(sdata.apicalcount[i] - adlzeta[i]) << " ";
cerr << "\nADLFinal:";
for(i=0; i<stest.na; i++)
cerr << (int) stest.apicalcount[i] << " " ;
cerr << endl ;
cerr << endl << endl << "ABPPrune: ";
for (i=0; i<sdata.na; i++)
cerr << (int)abpprune[i] << " ";
cerr << endl << "ABPZeta: ";
for (i=0; i<sdata.na; i++)
cerr << (int)abpzeta[i] << " ";
cerr << endl << "ABPOrig: ";
for (i=0; i<sdata.na; i++)
cerr << (int)BPStats.apicalcount[i] << " ";
cerr << endl << endl << "BDLPrune: ";
for (i=0; i<sdata.nb; i++)
cerr << (int)bdlprune[i] << " ";
cerr << endl << "BDLZeta: ";
for (i=0; i<sdata.nb; i++)
cerr << (int)bdlzeta[i] << " ";
cerr << endl << "BDLOrig: ";
for (i=0; i<sdata.nb; i++)
cerr << (int)sdata.basalcount[i] << " ";
cerr << endl << endl << "BBPPrune: " ;
for (i=0; i<sdata.nb; i++)
cerr << (int)bbpprune[i] << " ";
cerr << endl << "BBPZeta: " ;
for (i=0; i<sdata.nb; i++)
cerr << (int)bbpzeta[i] << " ";
cerr << endl << "BBPOrig: " ;
for (i=0; i<sdata.nb; i++)
cerr << (int)BPStats.basalcount[i] << " ";
cerr << endl ;
}
/*****************************************************************/
void Prune :: PrintFinal()
{
int i;
ofstream totreddl;
ofstream specabp;
ofstream specbbp;
ofstream specadl;
ofstream specbdl;
ofstream shollabp;
ofstream shollbbp;
ofstream sholladl;
ofstream shollbdl;
totreddl.open("4_totred.dl",ios::app);
totreddl << dlsum << endl ;
specabp.open("4_spe.abp",ios::app);
for (i=0; i<sdata.na; i++)
specabp << BPStats.apicalcount[i]-abpzeta[i] << " ";
specabp << endl ;
specbbp.open("4_spe.bbp",ios::app);
for (i=0; i<sdata.nb; i++)
specbbp << BPStats.basalcount[i]-bbpzeta[i] << " ";
specbbp << endl ;
specadl.open("4_spe.adl",ios::app);
for (i=0; i<sdata.na; i++)
specadl << sdata.apicalcount[i]-adlzeta[i] << " ";
specadl << endl ;
specbdl.open("4_spe.bdl",ios::app);
for (i=0; i<sdata.nb; i++)
specbdl << sdata.basalcount[i]-bdlzeta[i] << " ";
specbdl << endl ;
Sholl test;
test.SetComptmt(PruCom,npc);
ShollData stest=test.ShollAnalysis();
cerr << stest.na << "\t" << stest.nb << "\n";
getBPHist();
shollabp.open("4_sho.abp",ios::app);
for (i=0; i<stest.na; i++)
shollabp << (int)BPStats.apicalcount[i] << " ";
shollabp << endl ;
shollbbp.open("4_sho.bbp",ios::app);
for (i=0; i<stest.nb; i++)
shollbbp << (int)BPStats.basalcount[i] << " ";
shollbbp << endl ;
sholladl.open("4_sho.adl",ios::app);
for(i=0; i<stest.na; i++)
sholladl << (int) stest.apicalcount[i] << " " ;
sholladl << endl ;
shollbdl.open("4_sho.bdl",ios::app);
for(i=0; i<stest.nb; i++)
shollbdl << (int) stest.basalcount[i] << " " ;
shollbdl << endl ;
}
/*****************************************************************/