10 QVector< US_Model >& imodels )
21 for (
int ii = 0; ii < nxmls; ii++ )
23 QString mxml = xmls[ ii ];
24 int jj = mxml.indexOf(
"description=" );
25 QString mdesc = QString( mxml ).mid( jj, 100 )
26 .section(
'"', 1, 1 );
32 qDebug() <<
"DmS:AdjMd: ii" << ii <<
"xml.desc" << mdesc;
33 qDebug() <<
"DmS:AdjMd: ncomp" << kcomp <<
"nassoc" << kasso;
41 if ( kcomp == ncomp || kasso == nasso )
47 qDebug() <<
"DmS:AdjMd: ***ii=" << ii <<
"kcomp" << kcomp <<
"kassoc" << kasso;
56 QVector< US_Model >& imodels, QVector< double >& rstats )
59 QVector< double > rmsds;
60 QVector< double > rconcs;
62 rstats.fill( 0.0, stsiz );
65 for (
int jj = 0; jj < niters; jj++ )
67 double rmsd = sqrt( imodels[ jj ].variance );
73 qDebug() <<
"Dst:BRs: iters" << niters <<
"RMSD min max mean median"
74 << rstats[0] << rstats[1] << rstats[2] << rstats[3];
79 QVector< US_Model >& imodels, QVector< QVector< double > >& astats )
81 QVector< double > concs;
82 QVector< double > vbars;
83 QVector< double > mwts;
84 QVector< double > scos;
85 QVector< double > dcos;
86 QVector< double > ff0s;
87 QVector< double > kds;
88 QVector< double > koffs;
91 int ncomp = imodels[ 0 ].components.size();
92 int nasso = imodels[ 0 ].associations.size();
93 int ntatts = ncomp * ncatt + nasso * naatt;
94 astats.resize( ntatts );
97 qDebug() <<
"DmS:BMs: ncomp" << ncomp <<
"nasso" << nasso
98 <<
"ntatts" << ntatts <<
"niters" << niters;
101 for (
int ii = 0; ii < ncomp; ii++ )
103 concs.fill( 0.0, niters );
104 vbars.fill( 0.0, niters );
105 mwts .fill( 0.0, niters );
106 scos .fill( 0.0, niters );
107 dcos .fill( 0.0, niters );
108 ff0s .fill( 0.0, niters );
109 int i0 = qMax( 0, ii - 1 );
111 for (
int jj = 0; jj < niters; jj++ )
119 mwts [ jj ] = sc->
mw;
122 ff0s [ jj ] = sc->
f_f0;
131 qDebug() <<
"DmS:BMs: ii" << ii <<
"mean c v w s d k"
132 << astats[kt-6][2] << astats[kt-5][2] << astats[kt-4][2]
133 << astats[kt-3][2] << astats[kt-2][2] << astats[kt-1][2];
137 for (
int ii = 0; ii < nasso; ii++ )
140 int nrcs = as->
rcomps.size();
141 int rc1 = as->
rcomps[ 0 ];
142 int rc2 = as->
rcomps[ 1 ];
146 concs.fill( 0.0, niters );
147 kds .fill( 0.0, niters );
148 koffs.fill( 0.0, niters );
152 for (
int jj = 0; jj < niters; jj++ )
157 kds [ jj ] = as->
k_d;
158 koffs[ jj ] = as->
k_off;
167 for (
int jj = 0; jj < niters; jj++ )
174 kds [ jj ] = as->
k_d;
175 koffs[ jj ] = as->
k_off;
180 qDebug() <<
"DmS:BMs: ii" << ii <<
"mean kd ko"
181 << astats[kt-2][2] << astats[kt-1][2];
185 qDebug() <<
"DmS:BMs: RETURN w ntatts" << ntatts;
191 QVector< double >& vals, QVector< double >& concs,
192 QVector< double >& stats )
194 bool is_fixed =
false;
195 const int stsiz = 23;
197 double vsiz = (double)nvals;
200 double vhi = -9.9e30;
202 QVector< double > xpvec( qMax( nvals, nbins ) );
203 QVector< double > ypvec( qMax( nvals, nbins ) );
205 double *xplot = xpvec.data();
206 double *yplot = ypvec.data();
212 double mode_cen, mode_lo, mode_hi;
213 double conf99lo, conf99hi, conf95lo, conf95hi;
214 double clim99lo, clim99hi, clim95lo, clim95hi;
215 double skew, kurto, slope, vicep, sigma;
216 double corr, sdevi, sderr, vari, area;
217 double bininc, val, conc;
220 stats.resize( stsiz );
224 for (
int jj = 0; jj < nvals; jj++ )
227 conc = concs.at( jj );
228 vsum += ( val * conc );
230 vlo = qMin( vlo, val );
231 vhi = qMax( vhi, val );
232 xplot[jj] = (double)jj;
236 vmean = vsum / vctot;
237 is_fixed = ( vlo == vhi );
265 for (
int jj = 0; jj < nvals; jj++ )
268 double dif = val - vmean;
269 double dsq = dif * dif;
271 vm3 += ( dsq * dif );
272 vm4 += ( dsq * dsq );
278 skew = vm3 / pow( vm2, 1.5 );
279 kurto = vm4 / pow( vm2, 2.0 ) - 3.0;
288 if ( ( hx * 2 ) == nvals )
289 vmedi = ( vmedi + ypvec[ hx - 1 ] ) * 0.5;
292 sdevi = pow( vm2, 0.5 );
293 sderr = sdevi / pow( vsiz, 0.5 );
297 bininc = ( vhi - vlo ) / binsz;
300 for (
int ii = 0; ii < nbins; ii++ )
302 xplot[ii] = vlo + bininc * (double)ii;
305 for (
int jj = 0; jj < nvals; jj++ )
309 if ( val >= xplot[ ii ] && val < ( xplot[ ii ] + bininc ) )
311 yplot[ii] += ( concs.at( jj ) );
315 area += yplot[ ii ] * bininc;
322 for (
int ii = 0; ii < nbins; ii++ )
324 if ( yplot[ii] > val )
331 mode_lo = xplot[ thisb ];
332 mode_hi = mode_lo + bininc;
333 mode_cen = ( mode_lo + mode_hi ) * 0.5;
334 conf99lo = vmean - 2.576 * sdevi;
335 conf99hi = vmean + 2.576 * sdevi;
336 conf95lo = vmean - 1.960 * sdevi;
337 conf95hi = vmean + 1.960 * sdevi;
338 clim95lo = conf95hi - mode_cen;
339 clim95hi = mode_cen - conf95lo;
340 clim99lo = conf99hi - mode_cen;
341 clim99hi = mode_cen - conf99lo;
350 stats[ 6 ] = mode_lo;
351 stats[ 7 ] = mode_hi;
352 stats[ 8 ] = mode_cen;
353 stats[ 9 ] = conf95lo;
354 stats[ 10 ] = conf95hi;
355 stats[ 11 ] = conf99lo;
356 stats[ 12 ] = conf99hi;
363 stats[ 19 ] = clim95lo;
364 stats[ 20 ] = clim95hi;
365 stats[ 21 ] = clim99lo;
366 stats[ 22 ] = clim99hi;
373 QVector< US_Model >& imodels,
US_Model& umodel )
377 stx = ( smtype ==
"mean" ) ? 2 : stx;
378 stx = ( smtype ==
"median" ) ? 3 : stx;
379 stx = ( smtype ==
"mode" ) ? 8 : stx;
380 qDebug() <<
"DmS:AdjMd: stx" << stx;
384 umodel = imodels[ iter - 1 ];
389 umodel = imodels[ 0 ];
390 int niters = imodels.size();
391 QVector< QVector< double > > mstats;
400 for (
int ii = 0; ii < ncomp; ii++ )
402 bool fixs = ( mstats[ ks + 3 ][ 0 ] == mstats[ ks + 3 ][ 1 ] );
403 bool fixd = ( mstats[ ks + 4 ][ 0 ] == mstats[ ks + 4 ][ 1 ] );
404 bool fixk = ( mstats[ ks + 5 ][ 0 ] == mstats[ ks + 5 ][ 1 ] );
405 double conc = mstats[ ks++ ][ stx ];
406 double vbar = mstats[ ks++ ][ stx ];
407 double mw = mstats[ ks++ ][ stx ];
408 double sedc = mstats[ ks++ ][ stx ];
409 double difc = mstats[ ks++ ][ stx ];
410 double ff0 = mstats[ ks++ ][ stx ];
413 umodel.
components[ ii ].signal_concentration = conc;
430 qDebug() <<
"DmS:UajMd: Cii=" << ii <<
"c v w s d k"
436 << umodel.
components[ii].f_f0 <<
"fixs,d,k" << fixs << fixd << fixk;
438 qDebug() <<
"DmS:AdjMd: Cii=" << ii <<
"c v w s d k"
449 qDebug() <<
"DmS:AdjMd: fixS s d k" << umodel.
components[ii].s
455 qDebug() <<
"DmS:AdjMd: fixD s d k" << umodel.
components[ii].s
461 qDebug() <<
"DmS:AdjMd: fixK s d k" << umodel.
components[ii].s
467 qDebug() <<
"DmS:AdjMd: fixD w d k" << umodel.
components[ii].mw
473 qDebug() <<
"DmS:AdjMd: fixK s d w" << umodel.
components[ii].s
478 for (
int ii = 0; ii < nasso; ii++ )
480 bool fltd = ( mstats[ ks ][ 0 ] != mstats[ ks ][ 1 ] );
481 bool flto = ( mstats[ ks + 1 ][ 0 ] != mstats[ ks + 1 ][ 1 ] );
482 double k_d = fltd ? mstats[ ks++ ][ stx ] : mstats[ ks++ ][ 0 ];
483 double k_off = flto ? mstats[ ks++ ][ stx ] : mstats[ ks++ ][ 0 ];
486 qDebug() <<
"DmS:AdjMd: Aii=" << ii <<
"d off"