#include "pdb.h" extern int first_water_type ; extern int second_water_type ; void mark_as_rejected(atom_record *atom,atom_record ** neibours , int count) { int ii ; for(ii = 0 ; ii < count; ii++) SWITCH_ON(neibours[ii],REJECTED_ATOM) ; } void reject_neibours(atom_record *atom, int *what, int index) { switch (*what) { case 1 : if (!WATER_ATOM_P(atom) ) return ; break; case 2 : if (atom->atomtype != RECORD_HETATM) return ; break ; case 3 : if (!WATER_ATOM_P(atom) && ! metal_atom_p(atom)) return ; break; case 4 : if ( ! metal_atom_p(atom)) return ; break; case 0 : return ; } call_with_neibours(atom,mark_as_rejected,CWN_ALL_ATOMS) ; } void reject_touching_atoms(file_records *file, double distance, int all) { double oldd = distance_check ; distance_check = distance ; setup_neibouring_cube(file,distance) ; traverse_file_atom_records(file, reject_neibours, &all); distance_check = oldd ; } int metal_atom_p(atom_record * atom) { char *name = atom->name; return (atom->atomtype == RECORD_HETATM && ((name[0] == 'C' && name[1] == 'A' &&name[2] == ' ') || (name[0] == 'C' && name[1] == 'U') || (name[0] == 'Z' && name[1] == 'N') || (name[0] == 'H' && name[1] == 'G') || (name[0] == 'F' && name[1] == 'E') || (name[0] == 'N' && name[1] == 'A') || (name[0] == 'K') )) ; }