#define C_P(atom) (atom->name[0] == 'C') #define side_chain_c(atom) (atom->name[0] == 'C' && atom->name[1] != ' ' && atom->name[1] != 'A') #define WATER_ATOM_P(atom) (atom->restype != NULL && (atom->restype->index == first_water_type ||atom->restype->index == second_water_type )) #define PROTEIN_ATOM_P(atom) (atom->restype != NULL && atom->restype->index <= 19 &&atom->restype->index >= 0 ) #define SELECTED_ATOM_P(atom) !(atom->flags & (DONT_CALCULATE_ATOM | IGNORE_ATOM)) #define NOT_SELECTED_ATOM_P(atom) atom->flags & (DONT_CALCULATE_ATOM | IGNORE_ATOM) #define LOOP_RESIDUE_ATOMS(res,body) \ { \ int _atom_index; \ residue_record *_res = res ; \ atom_record **_atoms = _res->file->atoms ; \ \ for(_atom_index = _res->start; _atom_index< _res->end ; \ _atom_index++) \ { \ atom_record *atom = _atoms[_atom_index] ; \ \ body \ }} #define MAIN_CHAIN_ATOM_P(atom) (atom->flags & MAIN_CHAIN_ATOM) #define SET_DOUBLE_FROM_OPTION(var,string) \ { char * a = command_line_arg(string) ; \ if (a != NULL) var = strtod(a,NULL) ;} #define SET_INT_FROM_OPTION(var,string) \ { char * a = command_line_arg(string) ; \ if (a != NULL) var = atoi(a) ;} #define DEBUGGING debugging & DEBUG_LEVEL_1 /* THis does not work for non-standard definitions */ #define PROTEIN_ATOM_DEFINITION_INDEX(ad,rd) (ad - rd->atom_definitions) #define TRAVERSE_FILES(body) { file_records *file ; while((file = read_next_file_checked(0)) != NULL){ body free_file_records(file) ; }} #define ATOM_MEASUREMENT_INDEX(ssbond,rdindex,index) 21 * (ssbond ? 20 :rdindex) + index #define OPERATION_TRANSFORM(so,_tx,_ty,_tz,_sx,_sy,_sz) {\ symmetry_operation *_so = so ; \ tx = _sx * _so->xx + _sy * _so->yx + _sz *_so->zx + _so->addx ; \ ty = _sx * _so->xy + _sy * _so->yy + _sz *_so->zy + _so->addy ; \ tz = _sx * _so->xz + _sy * _so->yz + _sz *_so->zz + _so->addz ; } #define MATRIX_TRANSFORM(so,_tx,_ty,_tz,_sx,_sy,_sz) {\ a_matrix *_so = so ; \ _tx = _sx * _so->xx + _sy * _so->yx + _sz *_so->zx ; \ _ty = _sx * _so->xy + _sy * _so->yy + _sz *_so->zy ; \ _tz = _sx * _so->xz + _sy * _so->yz + _sz *_so->zz ; } #define LOOP_SG_OPERATIONS(sp,start, body) {\ int opnum ; \ space_group * _sp = sp ; \ for(opnum =start ; opnum < _sp->ops_number; opnum++) \ { \ symmetry_operation *so = &_sp->ops[opnum] ; \ body \ }} #define LOOP_ALL_SG_OPERATIONS(sp,body) LOOP_SG_OPERATIONS(sp,0,body) #define LOOP_OTHER_SG_OPERATIONS(sp,body) LOOP_SG_OPERATIONS(sp,1,body) #define RES_CHAR_TO_INDEX(cc) residue_character_types[cc]