# include "pdb.h" ExtraAtomRecord ** InitExtraAtomRecords(int n, int size) { int ii; ExtraAtomRecord ** E ; E = (ExtraAtomRecord **) calloc(n+1,sizeof(ExtraAtomRecord *)) ; for (ii = 0 ; ii < n ; ii++) { E[ii] = (ExtraAtomRecord *) calloc(1,size) ; E[ii]->ii = ii ; } return E ; } void CopyAtomVects2To1 (ExtraAtomRecord ** A0, char * A0Rx, ExtraAtomRecord ** B0, char * B0Ry, int n) { char * A0R = (char *) *A0 ; char * B0R = (char *) *B0 ; int Ainc = A0Rx - A0R, Binc = B0Ry - B0R, i ; if (n <= 0) STDERR("ERROR! n <= 0"); if (Binc <= 0) STDERR("ERROR! Binc <= 0"); if (Ainc <= 0) STDERR("ERROR! Ainc <= 0"); for(i=0; iatomnum; ii++) { atom_record * a = f->atoms[ii]; if (!(a->flags & IGNORE_ATOM)) { atom_definition *ad = a->definition ; double std_vol = (a->flags & SULPHUR_BRIDGE ? ad->eradsq : ad->eradius) ; double dV = (std_vol > 1.0 && a->volume > 1.0 ? a->volume - std_vol : 99.99) ; IncrementStats(&s,dV); a->b = dV ; } } s.name = "dV" ; DumpStats(&s,stderr); } void BDivRefVToOcc (file_records * f) { int ii; FlagAllAtomsInCYS(f); for (ii = 0; iiatomnum; ii++) { atom_record * a = f->atoms[ii]; if (!(a->flags & IGNORE_ATOM)) { atom_definition *ad = a->definition ; double std_vol = (a->flags & SULPHUR_BRIDGE ? ad->eradsq : ad->eradius) ; if (std_vol > 1.0) a->occ = a->b / std_vol ; } } } void RefVToB(file_records * f) { int ii; { residue_description * res = find_residue_type("CYS"); atom_definition * ad = find_atom_definition(res,"SG"); FTOE(ad->eradius); FTOE(ad->eradsq); } for (ii = 0; iiatomnum; ii++) { atom_record * a = f->atoms[ii]; if (!(a->flags & IGNORE_ATOM)) { atom_definition *ad = a->definition ; a->b = (a->flags & SULPHUR_BRIDGE ? ad->eradsq : ad->eradius) ; } } } atom_record * InitDummyAtom(atom_record * atom) { atom->atomtype = RECORD_ATOM ; strcpy(atom->ident,"ATOM "); strcpy(atom->resname,"RES"); strcpy(atom->name,"ATM"); atom->chain = ' '; atom->extraflag = ' '; atom->x_char = ' ' ; atom->number = 1; atom->resnum = 1; atom->occ = 1 ; atom->b = 0 ; atom->x = atom->y = atom->z = 0; return atom ; } atom_record * find_atom_in_file(const atom_record * atom ,file_records * f2) { int ii; for (ii = 0 ; ii < f2->atomnum ; ii++) { atom_record * a2 = f2->atoms[ii]; if ((atom->atomtype == a2->atomtype ) && (atom->chain == a2->chain) && (atom->resnum == a2->resnum) && StreqWithSpaces(atom->resname,a2->resname) && StreqWithSpaces(atom->name,a2->name)) return a2 ; } return NULL ; }