/* * dcreview.c extracted from: * dcrule.c Simon Towers 05-04-88 * * MODIFICATIONS * ------------- * 01-09-89 jimp Split into two review strategies * 09-05-88 jimp Make use of cnd->nearest information in tests: use * more stringent tests if number of candidates found * simultaneously by both methods < 2. */ #include #include #include #include #include #include /* * first see if a ridiculous number of multi-centric objects * see if whole cell should be rejected */ dcreview1(chc,n) struct chromcands *chc; register int n; { register struct cand *cnd; register struct chromcands *chcp; register int i; int SET,md,md1,dw,dw1,l,dp,dp1,cmerecount,dccount; int cand2; dccount = cmerecount = 0; for (chcp=chc,i=0; ibtype & DICENTRIC) { dccount++; cnd = chcp->cands; for (l=0 ; lncands ; l++,cnd++) if (cnd->ctype) cmerecount++; } } if (dccount > 6 || cmerecount > 15) { for (chcp=chc,i=0; ibtype & DICENTRIC) chcp->btype &= ~DICENTRIC; } } /* * do some comparisons between centromere candidates */ dcreview2(chc,n) struct chromcands *chc; register int n; { register struct cand *cnd; register struct chromcands *chcp; register int i; int SET,md,md1,dw,dw1,l,dp,dp1,cmerecount,dccount; int cand2; /* * apply some simple tests to remaining cells */ for (chcp=chc,i=0; ibtype & DICENTRIC) { cmerecount = 0; cnd = chcp->cands; cand2 = 0; for (l=0 ; lncands ; l++,cnd++) { if (cnd->ctype) { /* lower limit on width */ if (cnd->u.sy.width < 6) cnd->ctype = 0; else cmerecount++; /* candidate from 2 methods ? */ if (cnd->nearest >= 0 && cnd->neardist <= 8) cand2++; } } if (cmerecount <= 1) chcp->btype &= ~DICENTRIC; SET = 0; cnd = chcp->cands; for (l=0 ; lncands ; l++,cnd++) { if (!cnd->ctype) continue; if (!SET) { SET++; dw = cnd->u.sy.width; dp = cnd->u.sy.nprofval; md = cnd->u.sy.modality; } else { dw1 = cnd->u.sy.width; dp1 = cnd->u.sy.nprofval; md1 = cnd->u.sy.modality; if (cand2 >= 2 && /* width difference < 1/3 mean width */ (6*abs(dw-dw1) < dw+dw1) && /* modalities equal */ (md == md1) && /* normalised profile difference < 23 */ (abs(dp-dp1) < 23)) break; else if (cand2 < 2 && /* width difference < 1/4 mean width */ (8*abs(dw-dw1) < dw+dw1) && /* modalities equal */ (md == md1) && /* normalised profile difference < 17 */ (abs(dp-dp1) < 17)) break; else { cmerecount--; cnd->ctype = 0; if (cmerecount <= 1) chcp->btype &= ~DICENTRIC; } } } } } }