/* EGAD: FUNCTION_LIST Navin Pokala and Tracy Handel Dept. of Molecular and Cell Biology University of California, Berkeley Copyright (C) 2003 Regents of the University of California GNU Public License Aug 12 2003 Absolutely no warranties are made or are implied with the use of this program or its parts. List of functions and macros used in EGAD. */ For simplicity, macros (#define) are described here as if they were functions, with datatypes for arguments and return behavior Listed in alphabetical order. See the referring .cpp or .h files for code and internal documentation. This is not a complete list. Example: SOUND marge(HOMER *doh, BART *woohoo) Location: springfield.h springfield.cpp Description: returns the sound ("oh homey"; "bart!"; "mgrrrrr") depending on the HOMER and BART inputs. /***********************************************************************************************************/ void add_atompair_vdw_energy(VDW_ENERGY *vdwE, ATOMRESPARAM *i, ATOMRESPARAM *j, double r2, int soft_flag); Location: energy_functions.h Description: calculate vdw energies, and add components to VDW_ENERGY vdwE CARTESIAN add_CARTESIAN(CARTESIAN a, CARTESIAN b); Location: moremath.h moremath.cpp Description: return CARTESIAN whose dimensions are the sum of the dimensions of a and b #define void add_VDW_ENERGY_to_ENERGY(ENERGY energy, VDW_ENERGY vdwE) Location: energy_functions.h Description: scales the vdw sub energies from vdwE and puts them into energy void append_file(char *name1, char *target); Location: io.h io.cpp Description: append file name1 to the end of file name2 void append_mini_pdbATOM(mini_pdbATOM pdb[], mini_pdbATOM target[]); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: append pdb to the end of pre-loaded array target void append_pdbATOM(pdbATOM pdb[], pdbATOM target[]); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: append pdb to the end of pre-loaded array target #define double arccos(double n) Location: moremath.h Description: arccos of double argument; returns degree value #define void array_0( (int/float/double) c, int start, int end) Location: moremath.h Description: c[i] = 0, for i=start->end #define void array_diff( (int/float/double) c, (int/float/double) a, (int/float/double) b, int start, int end) Location: moremath.h Description: c[i] = a[i] - b[i], for i=start->end #define void array_sum( (int/float/double) c, (int/float/double) a, (int/float/double) b, int start, int end) Location: moremath.h Description: c[i] = a[i] + b[i], for i=start->end int atomnamecompare_atomresparam(const void *node1, const void *node2); Location: search_and_sort.h search_and_sort.cpp Description: ATOMRESPARAM atomname comparision function for bsearch/qsort void attach_ptr_pdbATOM(pdbATOM *pdb, RESPARAM *resparam); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: This function attached atom_ptrs to all the atoms in pdb = array of pdbATOM. resparam = main resparam array; void BACKBONE_to_CARTESIAN_array(BACKBONE *bkbn, CARTESIAN **cartesian, int *exclude_res, int *include_res); Location: minimize.h minimize.cpp Description: For bkbn, an array of CARTESIAN pointers is assigned such that cartesian[i] = &bkbn.X (X=N,H,CA,etc). if exclude_res!=NULL, the listed positions are not included. if include_res!=NULL, only those listed positions are included. called by bkbn_torsion_overlay_rmsd. double bkbn_torsion_overlay_rmsd(double *delta_dihedral_array); Location: minimize.h minimize.cpp Description: for delta_dihedral_array, this function returns the rmsd (rmsd = current structure-starting structure bkbn rmsd). working_protein->torsion_exclude_res!=NULL --> listed positions not included in scoring. working_protein->torsion_include_res!=NULL --> only listed positions scored. delta_dihedral_array = array of backbone dihedral perturbations (phi,psi,omega) for all residues void boltzmann_CHROMOSOME(CHROMOSOME *chr, double *T, int *pop_size); Location: GA_utilities.h GA_utilities.cpp Description: This function calculates the boltzmann distribution for the first pop_size members of a sorted CHROMOSOME array at a given temperature T. The probabilities are stored in chr[i].boltzProbab (for energy-based probabilties) and in chr[i[.rankProbab for rank-based probabilties. void born_bonded(RESPARAM *inputresparam); Location: energy_functions.h energy_functions.cpp Description: This function pre-calculates the components of desolvation due to atoms whose relative distances will not change during any of the calculations in EGAD (atoms <=1,3 and atoms on the same rigid ring). Called by read_forcefield.cpp: read_forcefield.. GB implementation of Dominy and Brooks J Phys Chem B 103:3765-3773 (1999) #define double BORN_CONST(double f) Location: energy_functions.h Description: returns Born const for solvation energies; includes salt-dependence. double born_nonbond_calc(ATOMRESPARAM *atom_i, ATOMRESPARAM *atom_j, double r2); Location: energy_functions.h energy_functions.cpp Description: calculates the desolvation components for a pair of non-bonded (>=1,4) atoms for Born radii calcs GB implementation of Dominy and Brooks J Phys Chem B 103:3765-3773 (1999) void born_radius_sasa(mini_pdbATOM *pdb); Location: born_radius_sasa.h born_radius_sasa.cpp Description: Calculates born radii and sasa for each atom in pdb (array of mini_pdbATOM) places these values in pdb[i].born_radius and pdb[i].sasa respectively void build_a_Ligand(SIDECHAIN *side, RESPARAM *resparam, double chi[]); Location: ligand_stuff.h ligand_stuff.cpp Description: Called by build_a_Sidechain. This function loads the SIDECHAIN ligand with coords corresponding to "rotamer" chi. For "rotamers" = coordinates, chi = rotamerlib index. For "rotamers" = transform matrix + dihedrals, chi = matrix + dihedrals. resparam must be assigned to the proper ligand by the calling function. void build_a_SideChain(SIDECHAIN *side, BACKBONE *bkbn, RESPARAM *resparam, int *res_position, double chi[]); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: given the position, the resparam, and the rotamers, this function will generate the cartesian coords of the sidechain atoms into side void build_BACKBONE(BACKBONE *bkbn); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: This function generates coordinates for a BACKBONE array that has been loaded w/ dihedrals bkbn[1] must contain backbone coords for the first residue void calculate_charge_products(RESPARAM *resparam); Location: read_forcefield.h read_forcefield.cpp Description: generate and calculate CHARGE_PRODUCT matrix for all possible atompairs. called by read_forcefield.cpp: read_forcefield. #define void CARTESIAN_zero(CARTESIAN a) Location: moremath.h Description: set CARTESIAN a to (0,0,0) void cat_mini_pdbATOM(mini_pdbATOM pdb1[], mini_pdbATOM pdb2[], mini_pdbATOM target[]); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: concatanates (cat) pdb1 and pdb2 into target void cat_pdbATOM(pdbATOM pdb1[], pdbATOM pdb2[], pdbATOM target[]); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: concatanates (cat) pdb1 and pdb2 into target int charge_within_specifications(double overall_charge_pH_avg); Location: solubility.h solubility.cpp Description: Given a charge of a protein overall_charge_pH_avg, this function returns 1 if the charge is within the inputed specifications. If SOLUBILITY_CUTOFF_FLAG=0, 1 is returned immediately. Returns 0 if overall_charge_pH_avg is not within the specifications int check_lookup_table(PROTEIN *protein); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: if using lookup table on disk, check to make sure that forcefield and template pdb are identical. Reference state values and solubility filters are included only after everything has been saved/loaded from disk, so these do not need to be identical to the job that generated the table previously. If this is a new table, create the path. CARTESIAN chi2xyz(CARTESIAN *contactAtom, CARTESIAN *twobondAtom, CARTESIAN *dihedAtom, double *bondlength,double *bondangle, double *dihedral); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: returns the coordinates of atom P P---contactAtom \ twobondAtom------dihedAtom bondlength = P-b bondlength bondangle = orbital hybridization angle of P-b-c dihedral = P-d dihedral angle, w/ respect to d, clockwise #define void CHOICE_to_GENE(GENE gene, CHOICE choice, int choice_index) Location: GA_utilities.h Description: given a residuetype choice, select a rotamer for the gene if applicable void CHROMOSOME_to_lookupEnergy(CHROMOSOME *chr, double *fixed_energy); Location: CHROMOSOME_to_lookupEnergy.h CHROMOSOME_to_lookupEnergy.cpp Description: This function calculates the energy of a CHROMOSOME chr by adding up the pre-calculated variable residue/ rotamer energies stored in the LOOKUP_ENERGY structure. The genes in the chromosome must be linked to the appropriate pointers. fixed_energy is calculated by fixedatoms_energy and adjusted by generate_lookup_table to include internal energies of non-moving sidechains. void CHROMOSOME_to_mini_pdbATOM(CHROMOSOME *chr, mini_pdbATOM *fixed_atoms, mini_pdbATOM *pdb, BACKBONE *chain_anchor_bkbn); Location: GENES_pdb.h GENES_pdb.cpp Description: generate mini_pdbATOM array pdb (allocated by calling function). If fixed_atoms == NULL, build the backbone using the bkbngenes linked list on the chromosome. If fixed_atoms !=NULL, use its coordinates for the backbone atoms. Sidechain atom coords generated from the dihedrals stored in the genes. void CHROMOSOME_to_pdbATOM(CHROMOSOME *chr, pdbATOM *fixed_atoms, pdbATOM *pdb, BACKBONE *chain_anchor_bkbn); Location: GENES_pdb.h GENES_pdb.cpp Description: This function generates a pdbATOM array pdb (allocated by calling function) for a chromosome chr; If fixed_atoms == NULL, build the backbone using the bkbngenes linked list on the chromosome. If fixed_atoms !=NULL, use its coordinates for the backbone atoms. Sidechain atom coords generated from the dihedrals stored in the genes. void CHROMOSOME_to_sequence(CHROMOSOME *chr, INVARIABLE_POSITIONS *invar_pos, char *sequence); Location: sequence_CHROMOSOME_stuff.h sequence_CHROMOSOME_stuff.cpp Description: generates amino acid sequence corresponding to the chromosome chr; invar_pos used to include pro,gly in the sequence. sequence must be allocated by the calling function void CHROMOSOME_to_slave_inputfile(CHROMOSOME *chr, char *filename); Location: rotamer_calc_master.h rotamer_calc_master.cpp Description: given a CHROMOSOME chr, create a file that can be used as a slave inputfile. Only the user-defined positions are written; the others are inferred from the top of the main inputfile sent to the foreman job (from the OTHER_POSITIONS line). void complex_formation_energy_master(char *inputfilename, PROTEIN *protein); Location: complex_formation_energy.h complex_formation_energy.cpp Description: This function rotamer-optimizes the complex in protein, splits the complex, rotamer-optimizes the free, and outputs all the structures and energies If strncmp(protein->parameters.algorithm,"STATIC",6)==0, rotamer optimization is not performed. ENERGY complex_formation_energy(mini_pdbATOM *input_complex, char *chain_id_list, SUPER_CHAIN_ID_LIST *super_chain_id_list); Location: complex_formation_energy.h complex_formation_energy.cpp Description: given a complex in input_complex, this function returns the complex_formation energy, and prints energies to stdout double conf_matrix_diff(LOOKUP_ENERGY *lookupEnergy, VARIABLE_POSITION *varPos); Location: scmf.h scmf.cpp Description: calculates the difference in rotamer probabilties between the current and previous SCMF cycle; used for determining scmf convergence void convert_delta_dihedral_array_to_CHROMOSOME(CHROMOSOME *chr_new, double *delta_dihedral_array, CHROMOSOME *chr, int backbone_flag, int *fixed_res, int *float_res); Location: minimize.h minimize.cpp Description: given a base chr and delta_dihedral_array, generate chr_new (allocated by calling function). if backbone_flag == 1, bkbnGENES are built. fixed_res!=NULL -> fix dihedrals for these seq positions. float_res!=NULL -> float dihedrals only for these seq positions. delta_dihedral_array - all sidechain rotamer perturbations listed first, then all backbone dihedral perturbations. ligands, pro, gly, cyd, ala sidechain dihedrals are defined as fixed, phi, psi, and omega are allowed to vary for backbone. chr_new can be used for CHROMOSOME_to_mini_pdbATOM void convert_scmf_probabs_to_rotamer_probabs(VARIABLE_POSITION *var_pos); Location: scmf.h scmf.cpp Description: convert probabs in lookupEnergy.P entries (from scmf optimization) to residue and rotamer probabilities void convert_string_to_all_caps(char *keyword); Location: io.h io.cpp Description: converts lower-case characters in string keyword to uppercase; useful for making input case-independent. #define void copyCHROMOSOME(CHROMOSOME b, CHROMOSOME a) Location: GA_utilities.h Description: copies CHROMOSOME a into CHROMOSOME b #define void copyGENE(GENE b, GENE a) Location: GA_utilities.h Description: copies GENE a into GENE b double correllation(double *x, double *y, int n); Location: moremath.h moremath.cpp Description: Returns the linear correlation between two double arrays x and y of n elements. Modified from the pearsn function from Numerical Recipies in C #define double cosd(double n) Location: moremath.h Description: cos of degree argument double coulomb_energy_q2_per_angstrom(double r, ATOMRESPARAM *i, ATOMRESPARAM *j) Location: energy_functions.h Description: returns coulombic interaction energy between atoms i and j seperated by distance r. Has NOT been multiplied by COULOMB_CONST; value is in units of e^2/A^2 (e=electron charge, A = angstrom). void cp_file(char *name1, char *name2); Location: io.h io.cpp Description: cp file name1 to file name2 void cramers_rule(int n, double **matrix_A, double *vector_X, double *vector_D); Location: moremath.h moremath.cpp Description: solves a system of n linear equations w/ n unknowns; form of AX=D where matrix_A contains coefficients; vector_X = variable vector; vector_D = constant term ie: 2x + 3y + 8z = 12 5x + 8y + 3z = 9 7x + 4y + z = 3 2 3 8 x 12 A = 5 8 3 X = y D = 9 7 4 1 z 3 int create_directory(char *directoryname, char *path); Location: io.h io.cpp Description: creates directory directoryname inside of path CARTESIAN cross_product(CARTESIAN a, CARTESIAN b) Location: moremath.h Description: return cross product between vectors a and b void cys_to_cyd_disulfides(pdbATOM *pdb, int num_cys, int *index_sg, char *chain_id_list, SUPER_CHAIN_ID_LIST **super_chain_id_list); Location: readpdbfile.cpp (NOT in readpdbfile.h) Description: re-assign CYS to CYD for disulfide-bonds. called by readpdbfile. int DeeControl(PROTEIN *protein); Location: DeeControl.h DeeControl.cpp Description: This function controls DEE for rotamer optimization If DEE does not converge, or does not converge within RUNTIME, simulated annealling is performed. Final_chr, energies, structures are stored in protein, and is ready to send to output_PROTEIN. void dee_logfile(char logfile_line[], const char *logfile); Location: dee_utilities.h dee_utilities.cpp Description: write logfile_line to logfile. #define double dice() Location: moremath.h Description: return a random double between 0 and 1 double dihedral(CARTESIAN *A, CARTESIAN *B, CARTESIAN *C, CARTESIAN *D); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: This function returns the dihedral angle between atoms A and D double distance_between_two_mini_pdbATOM(mini_pdbATOM *new_A, mini_pdbATOM *free_B); Location: complex_formation_energy.h Description: returns the minimal distance between atoms stored in mini_pdbATOM arrays new_A and free_B double Distance(const CARTESIAN& a, const CARTESIAN& b) Location: moremath.h Description: return distance between a and b double Distance_sqrd(CARTESIAN a, CARTESIAN b) Location: moremath.h Description: return squared distance between a and b int does_this_file_exist(char *filename); Location: io.h io.cpp Description: return 0 if file does not exist, 1 if it does int do_these_interact(milli_pdbATOM **i_atoms, milli_pdbATOM **j_atoms, int num_i, int num_j); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: returns 1 if i and j have at least one atom for all rotamers within FORCEFIELD_DISTANCE_CUTOFF of each other. double dot_prd(double *a, double *b, int start, int end); Location: moremath.h moremath.cpp Description: for two double arrays a and b, return the sum of a[i]*b[i], i=start->end double dotproduct(CARTESIAN a, CARTESIAN b) Location: moremath.h Description: return dotproduct for two vectors a and b void HQM_rotamers(CHROMOSOME *chr, VARIABLE_POSITION *var_pos, double *fixedatoms_energy, int num_cycles); Location: HQM_rotamers.h HQM_rotamers.cpp Description: exhaustive downhill line minimization for the sidechains defined by CHROMOSOME chr. chr must be soluble. Used as a quench at the end of GA or MC. #define void ENERGY_0(ENERGY energy) Location: energy_functions.h Description: set ENERGY components to 0 #define void ENERGY_ADD(ENERGY a, ENERGY b, ENERGY c) Location: energy_functions.h Description: adds components of ENERGY b and ENERGY c into ENERGY a ENERGY energy_calc(mini_pdbATOM *pdb, int electr_calc_flag, int input_sasa_flag); Location: energy_functions.h energy_functions.cpp Description: This function calculates all energies for the structure in pdb; returned as ENERGY. pdb must have atom_ptrs assigned and be terminated with atom_ptr=NULL, seq_position=ENDFLAG. electr_calc_flag=0: no born calculations electr_calc_flag=1: calculate born radii and electrostatics. electr_calc_flag=2: calculate electrostatics w/ born radii already in pdb[i].born_radius. sasa_flag=1: calculate surface-area based energies. Surface area components also stored in extern SASA_SUM SASA_SUM_TEMP; this can be accessed by the calling function #define void ENERGY_SUBTRACT(ENERGY a, ENERGY b, ENERGY c) Location: energy_functions.h Description: subtracts components of ENERGY c from ENERGY b into ENERGY a #define double ENERGY_TOTAL(ENERGY energy) Location: energy_functions.h Description: return sum of ENERGY components #define double ENERGY_TOTAL_SCALED(ENERGY energy) Location: energy_functions.h Description: return sum of ENERGY components, scaled by OVERALL_ENERGY_SCALE and component usage flags; used for final output void erase_double_array(double *array); Location: moremath.h moremath.cpp Description: This function assigns a 0 to each element of an array of type double. The array must be ended w/ a ENDFLAG value. void evolve_sidechains(PARAMETERS *parameters, CHROMOSOME chrs[], VARIABLE_POSITION var_pos[], char *logfile); Location: GA.h GA.cpp Description: this is a GA that uses a pre-calculated lookuptable for rotamer optimization. input a seeded CHROMOSOME 2*parameters->pop_size array chrs[]. all chrs must be soluble. best soln stored in chr[1]. void extract_bkbn(pdbATOM *atom, BACKBONE bkbn[]); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: extract BACKBONE array from atom (array of pdbATOM). bkbn must be allocated by the calling function. void extract_composition(int *composition, char *sequence); Location: sequence_CHROMOSOME_stuff.h sequence_CHROMOSOME_stuff.cpp Description: This function extracts the sequence composition for all 20 ACDEFGHIKLMNPQRSTVWY residuetypes in sequence, and places the number of each residue into composition; for example sequence = "AAFGHLMN" composition[1] = 2; (A) composition[5] = 1; (F) composition[6] = 1; (G) composition[7] = 1; (H) composition[11] = 1; (M) composition[12] = 1; (N) void extract_dihedrals(pdbATOM *pdb, double chi[], RESPARAM *resparam); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: This function extracts the dihedrals from a pdbATOM array containing the atoms for a single residue.The dihedrals are returned in chi array of double. resparam must be for the residuetype of interest. void extract_mini_to_bkbn(mini_pdbATOM *atom, BACKBONE bkbn[]); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: extract BACKBONE array from atom (array of mini_pdbATOM). bkbn must be allocated by the calling function. void extract_sub_structures(mini_pdbATOM *mini_Template, mini_pdbATOM *backbone, mini_pdbATOM **sidechain); Location: energy_profile_table.h energy_profile_table.cpp Description: place backbone atoms (not CB) from pdb into backbone array (allocated by calling function). for each sidechain i, place sidechain atoms (including CB) into sidechain[i] array. (**sidechain allocated by calling function). void extract_transform_matrix_for_ligand(pdbATOM *pdb, double *chi, RESPARAM *resparam); Location: ligand_stuff.h ligand_stuff.cpp Description: Extracts the transform matrix for a ligand given its coords in pdb. resparam must be assigned to the proper ligand by the calling function.The matrix is read into the chi array (allocated by calling function).If the ligand "rotamers" are input directly as coordinates, this function places the coords in pdb into the last "rotamer" for this ligand. This function is called by extract_dihedral; rotatable bond dihedrals are calculated there if needed. int extract_words(char *line, char **word); Location: io.h io.cpp Description: returns the number of words (seperated by space or tab) in a string line (end w/ '\0'). Places each word into string array **word; word[n] is the nth word in line. Memory for word must be allocated by the calling function. void final_chr_to_final_pdb_final_energy(PROTEIN *protein); Location: CHROMOSOME_to_lookupEnergy.h CHROMOSOME_to_lookupEnergy.cpp Description: protein->final_chr contains the final solution CHROMOSOME. This function allocates memory for protein->final_energy, protein->final_pdb, and protein->final_minipdb, calculates the coordinates, structures, and energy components. Should be called before output_PROTEIN. #define void find_backbone_atom(mini_pdbATOM *atom1, char *target_atomname, int step) Location: energy_functions.h Description: finds the target backbone atom with atomname target_atomname; atom1 should be set to some atom within the residue of interest. step -/+ 1; best guess for whether the target atom is before/after atom1 in the mini_pdbATOM array. upon exit, atom1 = pointer to the atom of interest. See energy_functions.cpp: get_atom_connectivity for usage examples. double find_best_res_res_rot(int i, VARIABLE_POSITION *var_pos, GENE firstgene,double fixed_sasa, double fixed_hphob_sasa, double fixed_charge, double fixed_E_transfer,int *best_res, int *best_res_rot); Location: HQM_rotamers.h Description: exhaustively place all resimers at position i and identify the best_res, best_res_rot (lowest energy).Used for HQM_rotamers int find_neighbors(int *var_seqpos, pdbATOM *pdb, int *neighbors, double *cutoff, double window); Location: VARIABLE_POSITION.h VARIABLE_POSITION.cpp Description: Given an array var_seqpos of variable positions (ending with ENDFLAG), a pdb structure pdb, a distance cutoff, and a scale factor window, this function returns the number of neighbors and variable positions; these are also included in the array neighbors. Called by #define void find_sidechain_atom(mini_pdbATOM *atom1, int target_atomnumber, int step) Location: energy_functions.h Description: finds the target sidechain atom with atomnumber target_atomnumber; atom1 should be set to some atom within the residue of interest. step -/+ 1; best guess for whether the target atom is before/after atom1 in the mini_pdbATOM array. upon exit, atom1 = pointer to the atom of interest. See energy_functions.cpp: get_atom_connectivity for usage examples. ENERGY fixedatoms_energy(mini_pdbATOM *input_fixed_atoms, VARIABLE_POSITION *varpos, RESPARAM *resparam); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: This function returns energy for the fixed atoms. Called by input_VARIABLE_POSITIONS. void fixed_position_sasa_charge(CHROMOSOME *dummychr, double *fixed_sasa, double *fixed_hphob_sasa, double *fixed_charge, double *fixed_E_transfer); Location: solubility.h solubility.cpp Description: Calculate the sasa and overall_charge of the dummychr CHROMOSOME for all fixed positions. Used by MC_rotamers and HQM_rotamers when SOLUBILITY_CUTOFF_FLAG=1. #define double f_of_r2_alpha(double r2, double a) Location: energy_functions.h Description: returns f for distance r2 and alpha a; distance-dependent & Born radii-dependent dielectric model of Still (JACS 112:6127-6129 (1990)) FILE * fopen_file(const char *filename, const char *mode); Location: io.h io.cpp Description: wrapper for fopen; usage exactly like fopen in void fprintf_composition_vector(FILE *file_ptr, PROTEIN *protein); Location: output_stuff.h output_stuff.cpp Description: prints to file_ptr stream the sum of probabilities of each residuetype in a VARIABLE_POSITION array that has been subjected to mean-field optimization of residue probabilities. void free_BKBNGENE(bkbnGENE gene); Location: GA_utilities.h GA_utilities.cpp Description: This function de-allocates memory for a BKBNGENE linked-list. void freeCARTESIAN_VECTOR(CARTESIAN_VECTOR *vector); Location: SASA.h SASA.cpp Description: free some memory void free_CARTESIAN_VECTOR_ptr(CARTESIAN_VECTOR ***vector_ptr, int sizeof_array); Location: SASA.h SASA.cpp Description: free some memory void free_CHROMOSOME(CHROMOSOME *chr); Location: GA_utilities.h GA_utilities.cpp Description: This function de-allocates memory for a CHROMOSOME. void freeCOULOMBIC(COULOMBIC *coulombic); Location: energy_functions.h energy_functions.cpp Description: free a COULOMBIC linked-list; standard recursive linked-list freeing algorithm void free_GENE(GENE gene); Location: GA_utilities.h GA_utilties.cpp Description: This function de-allocates memory for a GENE linked-list. void free_lookup_table(LOOKUP_ENERGY *lookupEnergy, VARIABLE_POSITION *varPos); Location: lookup_table.h lookup_table.cpp Description: This function de-allocates memory occupied by the lookup table. Called by input_stuff.cpp: free_PROTEIN #define void free_memory(void *pointer) Location: structure_types.h Description: macro for freeing memory; requires that the arguement not be NULL. void free_PROTEIN(PROTEIN *protein); Location: input_stuff.h input_stuff.cpp Description: This function frees memory from PROTEIN structures, including the lookup table. void free_ROTAMERLET(ROTAMERLET *rotamerlet, RESPARAM *resparam_ptr); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: free rotamerlet coordinates from memory; resparam_ptr and rotamerlet are for a given position and residuetype. void GA_rotamer_control(PARAMETERS *parameters, CHROMOSOME *soln_last_method_chr, mini_pdbATOM fixed_atoms[], VARIABLE_POSITION var_pos[], CHROMOSOME *final_chr, char *filename); Location: GA.h GA.cpp Description: This function seeds parameters->numSuperGen GAs with the last_method_soln_chr in the population, as well as random members. After all the GA's are done, the best chromosome is stored in final_chr. void GA_rotamers_master_control(PROTEIN *protein); Location: GA.h GA.cpp Description: This function controls the GA. It launches the protein->parameters.numSuperGen number of independent GA's, pools the results, and launches an GA seeded with the winners from the independent runs. Final soln information stored in protein->final_*; ready for output_PROTEIN. Assumes protein has been initialized with input_stuff and generate_lookup_table. void generate_energy_profile_table(double ***energy_table, mini_pdbATOM *pdb, int num_res); Location: energy_profile_table.h energy_profile_table.cpp Description: given num_res residues in mini_pdbATOM pdb, generate the energy_profile_table input_energy_table. input_energy_table == NULL ---> memory will be allocated by this function. void generate_lookup_table(PROTEIN *protein); Location: lookup_table.h lookup_table.cpp Description: This function generates a lookup table for all possible var_residue-fixed_atom and var-var pairwise interaction energies for fixed backbone optimizations. Links protein->var_pos lookup_table pointers to appropriate locations. Assumes that protein has been initialized with input_stuff.cpp: input_stuff All the rotamer optimization jobs assume that this function has been called. void GENE_to_mini_pdbATOM(GENE *gene, mini_pdbATOM *pdb); Location: GENES_pdb.h GENES_pdb.cpp Description: This function loads a mini_pdbATOM array (allocated by calling function) with the variable sidechain atoms represented by gene void GENE_to_var_pdbATOM(GENE *gene, pdbATOM *pdb); Location: GENES_pdb.h GENES_pdb.cpp Description: This function loads a pdbATOM array (allocated by calling function) with the variable sidechain atoms represented by gene int get_atom_connectivity(double r2, mini_pdbATOM *pdb_i, mini_pdbATOM *pdb_j, mini_pdbATOM **firstAtom, mini_pdbATOM **contactAtom, mini_pdbATOM **twobondAtom, mini_pdbATOM **dihedAtom); Location: energy_functions.h energy_functions.cpp Description: determines connectivity between two atoms pdb_i and pdb_j in an array of mini_pdbATOM in the calling function. returns 0 for <=1,3; 1 for 1,4; 2 for >1,4 ; for 1,4, returns non-NULL values for dihedral atoms. CARTESIAN get_centroid(mini_pdbATOM *pdb); Location: dee_utilities.h dee_utilities.cpp Description: returns the coordinates of the centroid for an array of mini_pdbATOM. double get_energy(const PROTEIN *protein, const int i, const int i_resimer, const int j, const int j_resimer); Location: dee_utilities.h dee_utilities.cpp Description: returns the pair energy for resimer pair (i,i_resimer),(j,j_resimer); i,j = seq indexes. if i==j, and i_resimer == j_resimer, self energy for i,i_resimer returned else, return 0 void get_ENERGY_and_solub_from_egad_pdb_file(char *pdbfilename,ENERGY *energy, double *fraction_sasa_hphob, double *transfer_free_energy_density); Location: rotamer_calc_master.h rotamer_calc_master.cpp Description: given an EGAD output pdb file pdbfilename, return an ENERGY struct with the energy components. void get_i_res_i_res_rot_for_resimer(VARIABLE_POSITION *var_pos, int input_resimer, int *input_i_res, int *input_i_res_rot); Location: dee_utilities.h dee_utilities.cpp Description: for var_pos at some position, and an input_resimer at that position, find i_res and i_res_rot; used for converting from resimers back to residuetypes/rotamers. SASA_SUM get_SASA_SUM(mini_pdbATOM *pdb); Location: SASA.h SASA.cpp Description: for a mini_pdbATOM array that already has sasa's calculated for each atom, return SASA_SUM double get_self_energy(const PROTEIN *protein, const int i, const int i_resimer); Location: dee_utilities.h dee_utilities.cpp Description: returns internal and side-bkbn energy (self energy) for resimer i_resimer at seq index i void hp_pattern_design(FILE *original_input_ptr, PROTEIN *protein); Location: input_stuff.h input_stuff.cpp Description: This function sets up total sequence design, using hp patterning. Called by input_VARIABLE_POSITION when it sees "HP_pattern" following the "VARIABLE_POSITIONS" line in the input file. void initialize_lookuptable_for_dee(PROTEIN *protein); Location: dee_utilities.h dee_utilities.cpp Description: Initializes the lookuptable for dee void initialize_lookuptable_pointers() Location: lookup_table.cpp (NOT in lookup_table.h) Description: initialize non-interaction pointers for the lookuptable, and BASE_THREE_CONVERT matrix for local minimization of methyl groups. called by generate_lookup_table. void initialize_stuff_for_ligands(PROTEIN *protein); Location: ligand_stuff.h ligand_stuff.cpp Description: This function is called after the Template pdb file has been read, and the ligandparam files loaded, but before the VARIABLE_POSITIONS have been parsed. It creates virtual backbone atoms for each ligand (for book-keeping purposes). These (as well as the ligand atoms) are considered to be in chain 'l'. It extracts the ligand coords from the Template pdb file (if any). If "rotamers" = transform matrix, coordinate from pdb file = base_coords for transformation Calculates intrinsic energies for ligands and protein sidechains. void inoculate_sidechains(CHROMOSOME *chr, VARIABLE_POSITION *var_pos, int check_solubility_flag); Location: GA_utilities.h GA_utilities.cpp Description: This function allocates memory for the GENE linked-list in CHROMOSOME, and seeds it with residues and sidechain rotamers. If check_solubility_flag=1, chr is sent to solubilize_CHROMOSOME to generate a soluble chromosome. void input_stuff(char *inputfilename, PROTEIN *protein); Location: input_stuff.h input_stuff.cpp Description: Reads an input file, parses variable positions, reads Template, forcefield files. Initializes and sets lots of variables. See manual for file formats. This is akin to a "constructor" for PROTEIN structures. void input_VARIABLE_POSITION(FILE *input, PROTEIN *protein, int modify_varpos_flag); Location: input_stuff.h input_stuff.cpp Description: Parses file pointer *input set at the line following the "VARIABLE_POSITIONS" line in an input file. Assumes that protein has gone through input_stuff (or has variables from input_stuff set). This function is called by input_stuff, sequence_to_var_pos_file, and rotamer_calc_foreman. If modify_varpos_flag=0, then VARIABLE_POSITIONS.cpp: modify_VARIABLE_POSITIONS is not called. void intrinsic_rotamer_energy(RESPARAM *resparam); Location: energy_functions.h energy_functions.cpp Description: This function precalculates the intrinsic energy for all rotamers. vdw energies between atoms of the same aromatic ring system are NOT calculated. 1,4 and bonded born factors are added and stored in rotamer->born_factor array. Electrostatics between charged atoms are measured and stored in COULOMBIC list. called by read_forcefield.cpp: read_forcefield and ligand_stuff.cpp: read_ligand_data.cpp. int is_this_chr_soluble(CHROMOSOME *chr); Location: solubility.h solubility.cpp Description: returns 1 if soluble; 0 if not. Solubility based on fraction hydrophobic sasa FRACTION_HYDROPHOBIC_SASA_CUTOFF, charge_within_specifications, and TRANSFER_FREE_ENERGY_DENSITY_CUTOFF. If SOLUBILITY_CUTOFF_FLAG=0, returns 1 double laplace_determinant(int n, double **matrix); Location: moremath.h moremath.cpp Description: returns determinant for an n x n matrix void launch_batch_jobs(char *filename) Location: batch_jobs.h batch_jobs.cpp Description: filename contains a list of egad inputfiles. This function serially launches egad jobs to execute those files. A logfile filename.log is written; failures are written to filename.fail. double lennard_jones_energy(double r2, ATOMRESPARAM *i, ATOMRESPARAM *j) Location: energy_functions.h Description: returns lennard_jones vdw energy between atoms i and j seperated by distance_squared r2 #define void level_1_mutate_sidechain(GENE gene, VARIABLE_POSITION var_pos) Location: GA_utilities.h Description: This function picks a residuetype and rotamer for a GENE gene at a VARIABLE_POSITION var_pos void linear_fit(double *x, double *y, int ndata, double *sigma, double *m, double *b); Location: moremath.h moremath.cpp Description: for arrays x and y of ndata points, fit to a line; m = slope, b = y-intercept, sigma = fitting stat Adapted from numerical recipies in C. void linear_transform(double *x_new, double *x_original, int n, double *m, double *b); Location: moremath.h moremath.cpp Description: given a line y[i] = m*x[i] + b and and array of n x-values, calculate the y-values. y must be allocated by the calling function. void listofvarpos_to_VARIABLE_POSITION(int *listofvarpos, VARIABLE_POSITION *var_pos,pdbATOM *pdb, int numVarPos, RESPARAM *resparam); Location: VARIABLE_POSITION.h VARIABLE_POSITION.cpp Description: This function generates a VARIABLE_POSITION array for an array listofvarpos of numVarPos variable positions (ending with ENDFLAG) for a structure pdb. Called by modify_VARIABLE_POSITION. double load_calc_save_lookupResX(GENE a_gene, GENE b_gene); Location: CHROMOSOME_to_lookupEnergy.h CHROMOSOME_to_lookupEnergy.cpp Description: a_gene and b_gene are GENEs with all the pointers and values assigned (ie: mutate_sidechain, inoculate_sidechains). This function returns the pair energy between the two rotamers (NON_INTERACT_PTR if they do not interact). If the lookup table for these residues at these positions have not been calculated or read from disk, this function takes care of that. If the entire table has been precalculated (default for all except for rotamer_foremen jobs), this function is not called. void load_all_lookupRes_coordinates(PROTEIN *protein); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: This function loads sideAtoms coordinates for all LOOKUP_ENERGY_ROTAMER's for all LOOKUP_ENERGY_RESIDUE's at all positions. Assumes that the lookup table for protein has been created with lookup_table.cpp: generate_lookup_table. void load_coordinates_lookupRes(LOOKUP_ENERGY_RESIDUE *lookupRes, RESPARAM *resparam_ptr, char *structure_filename); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: load coordinates for sidechain and rotamerlets from disk for a residue at a position. lookupRes and resparam_ptr are specific for the residue. structure_filename is defined by the calling function for the position and residuetype. int load_lookupRes_from_disk(LOOKUP_ENERGY *lookupEnergy, VARIABLE_POSITION *varPos, PARAMETERS *parameters); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: load all relevant and available var-fix energies from disk. return 1 if there are any energies that need to be calculated by generate_lookup_table. int load_lookupResRes_from_disk(LOOKUP_ENERGY *lookupEnergy, VARIABLE_POSITION *varPos, PARAMETERS *parameters); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: load all relevant and available LOOKUP_ENERGY_RESIDUE_RESIDUE (list of residue-residue pairs that actually interact) from disk. return 1 if the interaction table is missing elements that need to be calculated by generate_lookup_table. void load_lookupResX_from_disk(LOOKUP_ENERGY *lookupEnergy, VARIABLE_POSITION *varPos, PARAMETERS *parameters); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: load all relevant and available LOOKUP_ENERGY_RESIDUE_X (pairs of rotamer energies) from disk; if they are not on disk, calculate and save. double lookup_energy_sasa_charge_other(int i, GENE i_gene, GENE firstgene,double *sasa_other, double *sasa_hphob_other, double *charge_other, double *E_transfer_other); Location: CHROMOSOME_to_lookupEnergy.h Description: returns the interaction energy of the rotamer encoded by i_gene with all other rotamers in the current structure. i = var_pos index of i_gene. firstgene = firstgene of the chromosome containing the current structure. These are calculated if SOLUBILITY_CUTOFF_FLAG=1 (solubility as design restraint): sasa_other = surface area of all other moving non-i residues sasa_hphob_other = hydrophobic surface area of all other moving non-i residues charge_other = total charge of all other moving non-i residues E_transfer_other = water-octanol transfer energy of all other moving non-i residues void lookup_table_foreman(char *inputfilename, int master_pid, int num_jobs); Location: parallel_egad.h parallel_egad.cpp Description: this is launched from a lookup_table_master job; this function launches EGAD lookup_table slaves using the slave inputfiles generated by the master. Once all the inputfiles are done or working, exit. void lookup_table_master(char *inputfilename, PROTEIN *protein); Location: parallel_egad.h parallel_egad.cpp Description: this function creates slave inputfiles for parallel lookuptable generation. requires that protein has been initialized with input_stuff.cpp: input_stuff void make_bkbn_mini_pdbATOM(mini_pdbATOM *pdb, BACKBONE *bkbn); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: for an allocated mini_pdbATOM array, generate coords, etc, from BACKBONE bkbn int make_directory(char *dir_name); Location: io.h io.cpp Description: return 1 if it worked, return 0 if it already exists void make_fixed_pdbATOM(pdbATOM *Template, VARIABLE_POSITION *varPos, pdbATOM *fixed_atm); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: Given template pdbATOM and VARIABLE_POSITION array varPos, this function fills the pdbATOM fixed_atm array (allocated by calling function) with fixed atoms whose structures do not change during the course of an optimization. void make_side_mini_pdbATOM(mini_pdbATOM *var_atm, SIDECHAIN *side); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: generates the mini_pdbATOM array var_atm (allocated by calling function) for a SIDECHAIN void make_side_pdbATOM(pdbATOM *var_atm, SIDECHAIN *side); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: generates the pdbATOM array var_atm (allocated by calling function) for a SIDECHAIN void mate_sidechains(CHROMOSOME *chr, int pop_size,double recombination_freq, double mutation_freq); Location: GA_utilities.h GA_utilities.cpp Description: This function mates an array of CHROMOSOME of size 2*pop_size (allocated by inoculate_sidechains). Members 1->pop_size are mated, based on their mating frequencies chr[i].boltzProbab and chr[i].rankProbab. Crossover occurs with recombination_freq probability. Mutations are permitted to occur on each child with mutation_freq probability. The children are stored in members pop_size+1 -> 2*pop_size and are solubilized w/ solubilize_CHROMOSOME #define (double/char) max( (double/char) a, (double/char) b) Location: moremath.h Description: return the greater value void MC_rotamer_control(PROTEIN *protein); Location: MC.h MC.cpp Description: controls MC_rotamers. assumes that protein has been initialized by input_stuff and generate_lookup_table. Final structures etc generated by final_chr_to_final_pdb_final_energy; ready for output_PROTEIN. void MC_rotamers(CHROMOSOME *chr, VARIABLE_POSITION *var_pos, double *fixedatoms_energy, int num_cycles); Location: MC.h MC.cpp Description: chr is used as a starting point for simulated annealing rotamer/resimer optimization. if solubility is a criterion, chr must be soluble. num_cycles = number of consecutive moves that do not result in a decrease in the best energy. The best soln is returned in chr. void meld_VARIABLE_POSITION(VARIABLE_POSITION *melded, VARIABLE_POSITION *fixed_res,VARIABLE_POSITION *neighbors, VARIABLE_POSITION *user_defined, int *fixed_positions); Location: VARIABLE_POSITION.h VARIABLE_POSITION.cpp Description: This function binds a group of VARIABLE_POSITION arrays. fixed_res contains the positions that are fixed in rotamer and sequence, but are allowed to undergo local rotamer relaxation. neighbors contains the positions that are fixed in sequence, but are allowed to sample all rotamers. user_defined contains the residues that are defined by the user as being variable. The array melded is the final VARIABLE_POSITION. Called by modify_VARIABLE_POSITION. CARTESIAN midpoint(CARTESIAN a, CARTESIAN b); Location: moremath.h moremath.cpp Description: return the midpoint between two CARTESIAN points a & b #define (double/char) min( (double/char) a, (double/char) b) Location: moremath.h Description: return the value of the lesser number double minimization_objective_function(double *delta_dihedral_array, PROTEIN *protein); Location: minimize.h minimize.cpp Description: returns value of minimization_objective_function. delta_dihedral_array - defined as described for convert_delta_dihedral_array_to_CHROMOSOME. builds the structure and evaluates the energy E. if backbone is allowed to move (protein->parameters.rebuild_backbone_flag==1), and if RESTRAIN_MINIMIZATION_FLAG=1, the objective function is: if(E>=0), Fobj = E*rmsd; else Fobj = E/rmsd; (rmsd = current structure-starting structure bkbn rmsd for N, CA, C) if RESTRAIN_MINIMIZATION_FLAG=0, E is returned. void minipdbATOM_to_CARTESIAN_VECTOR(mini_pdbATOM *pdb, CARTESIAN_VECTOR *vector); Location: SASA.h SASA.cpp Description: calculates CARTESIAN_VECTOR for atompairs from a mini_pdbATOM array. use for the self part of pairwise area calcs (presently not implemented) void modify_VARIABLE_POSITION(PROTEIN *protein, int *fixed_positions); Location: VARIABLE_POSITION.h VARIABLE_POSITION.cpp Description: Given a PROTEIN containing PARAMETERS and an array of VARIABLE_POSITION, this function will modify the PARAMETERS and VARIABLE_POSITION inside PROTEIN to include neighboring residues whose rotamer identities are allowed to float, extract the native rotamers if applicable, and attach all the appropriate pointers to VARIABLE_POSITIONS. The born radii and energies of fixed atoms are calculated. Called by input_stuff.cpp: input_VARIABLE_POSITIONS. void move_complex_apart(mini_pdbATOM *free_A, mini_pdbATOM *free_B, mini_pdbATOM *new_A, const double separation_distance, double tolerance); Location: complex_formation_energy.h complex_formation_energy.cpp Description: move proteinA away from proteinB so that they are separation_distance +/- tolerance apart. move along the inter-centroid vector. freeA = coordinates of A; freeB = coordinates of B; newA = new coordinates of A int move_past_comments_and_empty_lines(char *line, FILE *file_ptr); Location: input_stuff.h input_stuff.cpp Description: moves the file_ptr past comments and empty lines to the start of the next command block in the inputfile. Upon return, line and file_ptr are at the line just past the comments. if an empty line or end of file (EOF) is reached, returns 0; else returns 1. line must be allocated by the calling function #define void mutate_sidechain(GENE gene, VARIABLE_POSITIONS var_pos) Location: GA_utilities.h Description: This function mutates a GENE to a permitted choice. It picks a residuetype from the allowed list, then picks a rotamer. If the selected rotamer is forbidden, it keeps trying. void mv_file(char *name1, char *name2); Location: io.h io.cpp Description: mv file name1 to file name2 int number_of_slaves_left(char slavefilelist[]); Location: rotamer_calc_master.h rotamer_calc_master.cpp Description: returns the number of slave files listed in the slavefilelist file that have yet to be launched. void output_data(CHROMOSOME *chr, int *num_solutions, const char *name, PROTEIN *protein); Location: output_stuff.h output_stuff.cpp Description: This function outputs all the energies, sequences, and rotamers encoded by the top num_solutions in the CHROMOSOME array to file name.out void output_energy_profile_table(double **energy_table, char *name, int num_res, SEQPOS_TEXT_MAPPING_LIST *seqpos_text_map, char *sequence); Location: energy_profile_table.h energy_profile_table.cpp Description: output energy_table to file name.energy_profile_table; called by output_PROTEIN. void output_lookup_table(PROTEIN *protein); Location: output_stuff.h output_stuff.cpp Description: output an energy pair table for a given structure to a file. uses energies from the lookup table (JOBTYPE PAIR_ENERGY_TABLE). Use JOBTYPE ENERGY_PROFILE instead, since it uses actual Born radii, sasa, and is faster. This is still kept because this gives the correct energies when local minimization is used void output_PROTEIN(PROTEIN *protein); Location: output_stuff.h output_stuff.cpp Description: This function outputs all the calculated rotamers and the structure encoded by final_chr or final_pdb in a PROTEIN. If final_energy == NULL, this function will also calculate the structs and energy encoded by final_chr. void pairwise_minipdbATOM_to_CARTESIAN_VECTOR(mini_pdbATOM *pdb, mini_pdbATOM *pdb2, CARTESIAN_VECTOR *vector); Location: SASA.h SASA.cpp Description: calculates CARTESIAN_VECTOR for a pair of mini_pdbATOM arrays. use for pairwise area calcs (presently not implemented). int parse_seqpos_string(char *seqpos_string, SEQPOS_TEXT_MAPPING_LIST *seqpos_text_map); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: parses a seqpos string into an internal sequence position (returned value) void pdbATOM_to_CHROMOSOME(pdbATOM *pdb, CHROMOSOME *chr, RESPARAM *resparam); Location: GENES_pdb.h GENES_pdb.cpp Description: This function creates a CHROMOSOME containing the sidechain and backbone dihedrals from the pdbATOM pdb array; resparam = main resparam structure void pdbATOM_to_mini_pdbATOM(pdbATOM *pdb, mini_pdbATOM *minipdb); Location: dihedral_cartesian.h dihedral_cartesian.cpp Description: reduces an array pdb of pdbATOM to an array minipdb of mini_pdbATOM. void pdbATOM_to_sequence(pdbATOM *pdb, char *sequence, RESPARAM *resparam); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: generates sequence (allocated by calling function) for a pdbATOM array. resparam = main resparam array; void pdbATOM_to_VARIABLE_POSITION(VARIABLE_POSITION *varpos, pdbATOM *pdb, RESPARAM *resparam); Location: VARIABLE_POSITION.h VARIABLE_POSITION.cpp Description: Given an array varpos containing desired seq positions (ending w/ endflag), this function extracts sidechain dihedrals from pdbATOM array pdb and creates a rotamer library (w/ rotamerlets) for the native conformation for each residue specified in varpos. resparam = main resparam structure. Called by modify_VARIABLE_POSITION. void pK_calculate(PROTEIN *protein); Location: pK_calculate.h pK_calculate.cpp Description: uses scmf to calculate the pK of ionizable groups in a protein. #define double POW2( (int/float/double) n) Location: moremath.h Description: returns n^2 void powell_PROTEIN(double p[], int n, int max_iterations, double *fret, double (*func)(double [], PROTEIN *), PROTEIN *protein, time_t start_time); Location: powell_PROTEIN.h powell_PROTEIN.cpp Description: powell minimization with objective function (func *) that takes a PROTEIN arguement. Adapted from Numerical Recipies in C. p = solution array of size n. fret = objective function score of p. (func *) = objective function (with arguments double [] and PROTEIN *). Completes at least one full iteration. returns prematurely if NUM_FUNCTION_CALLS > protein->parameters.max_function_calls or if elapsed time > MAX_OPTIMIZATION_TIME SASA_SUM precalcSASAcalc(mini_pdbATOM *pdb_ptr[]); Location: SASA.h SASA.cpp Description: calculates SASA_SUM for mini_pdbATOM array pdb_ptr[]. also calculates SASA for each atom pdb_ptr[i].sasa. uses a precalculated CARTESIAN_VECTOR structure (must be calculated a priori for pdb_ptr[] ) #define void printf_CARTESIAN(CARTESIAN a) Location: output_stuff.h Description: prints out x,y,z coords for CARTESIAN; for debugging void printf_energy(ENERGY energy); Location: output_stuff.h output_stuff.cpp Description: prints each energy component void printf_minipdb(mini_pdbATOM pdb[]); Location: output_stuff.h output_stuff.cpp Description: prints coords in pdb to standard out; for debugging void printf_pdb(pdbATOM pdb[]); Location: output_stuff.h output_stuff.cpp Description: This function prints a pdbATOM array to stdout in the pdb format; for debugging CARTESIAN projection(CARTESIAN u, CARTESIAN v) Location: moremath.h Description: return projection of vector u onto vector v double rand2(); Location: moremath.h moremath.cpp Description: Random number generator ran2 from Numerical Recipies in C #define double rand_double(double n) Location: moremath.h Description: return a random double between 0 and n #define double rand_double_window(double lower_bnd, double upper_bnd) Location: moremath.h Description: return random double between lower_bnd and upper_bnd #define int randint(int n) Location: moremath.h Description: return a random int between 0 and n, inclusive void randomize_sidechains(CHROMOSOME *chr, int check_solubility_flag); Location: GA_utilities.h GA_utilities.cpp Description: This function randomizes GENEs for a CHROMOSOME; it assumes that memory has already been allocated by inoculate_sidechains. If check_solubility_flag=1, chr is sent to solubilize_CHROMOSOME to generate a soluble chromosome. void rank_sort_double(int *first, int *last, double arraydouble[]); Location: search_and_sort.h search_and_sort.cpp Description: sorts an array of double by value (highest->lowest); ie: by rank; opposite order of sort_double. first=1; last = size of array. void read_forcefield(char *atomdatafile, ATOMPARAM *atomparam, RESPARAM *resparam, ROTAMERLIB *rotamerlib); Location: read_forcefield.h read_forcefield.cpp Description: reads forcefield information into atomparam, resparam, and rotamerlib arrays (allocated by calling function). Sets up a lot of cross-pointers between these data structures, initializes some matricies, etc. read SASA tables (requires MAX_ATOMS to be defined) and ligand parameter files as well. Called by input_stuff.cpp: input_stuff. void read_ligand_coords(FILE *file_ptr, pdbATOM *ligand_coords); Location: ligand_stuff.h ligand_stuff.cpp Description: read ligand coordinates into ligand_coords (allocated by calling function). file_ptr at "START" line of the file, immediately preeceding the first coordinate. Reads until "END". void read_ligand_data(char *ligandfilename, RESPARAM *ligand_resparam, ROTAMERLIB *ligand_rotamerlib, ATOMPARAM *atomparam); Location: ligand_stuff.h ligand_stuff.cpp Description: read the ligand data in file ligandfilename. Place ligand info into the main resparam and rotamerlib structures. This function is called from read_forcefield. int readpdbfile(char *pdbfilename, PROTEIN *protein, int rearrange_flag); Location: readpdbfile.h readpdbfile.cpp Description: reads a pdb file; rearrange_flag=1 means rebuild with extracted dihedral angles. If MAX_ATOMS or MAX_RESIDUES is too small, it resets them, and returns 0. If 0 is returned, read again (now with adjusted MAX_ATOMS and MAX_RESIDUES. void read_residuedata(char *resdatafilename, RESPARAM *resparam, ATOMPARAM *atomparam, int count_max_res_size_flag); Location: read_forcefield.h read_forcefield.cpp Description: reads in residue or ligand topologies from resdatafilename into an allocated array of RESPARAM. if count_max_res_size_flag=1, merely counts the size of residues, adjusts MAX_RES_SIZE, and returns. called by read_forcefield.cpp: read_forcefield and ligand_stuff.cpp: read_ligand_data.cpp void read_rotamers(char *rotamerfilename, ROTAMERLIB *rotamerlib); Location: read_forcefield.h read_forcefield.cpp Description: This function reads in a rotamer library from rotamerfilename into an allocated array of ROTAMERLIB. Also reads in ligand "rotamers" called by read_forcefield.cpp: read_forcefield and ligand_stuff.cpp: read_ligand_data.cpp. void read_torsiondata(char *torsionfilename, ATOMPARAM *atomparam); Location: read_forcefield.h read_forcefield.cpp Description: read fourier-series coefficients from torsionfilename for dihedral-angle-dependent torsion energy calcs.called by read_forcefield.cpp: read_forcefield. double relaxed_vdw_energy(CHROMOSOME *chr, mini_pdbATOM *fixed_atoms, PARAMETERS *parameters); Location: output_stuff.h output_stuff.cpp Description: This function inputs a CHROMOSOME and the fixed atoms. It returns the vdw energy based on relaxing sidechains via rotamerlets and methyl-lets This requires that all the sidechain coords be pre-calculated by generate_lookup_table and linked appropriately. int restypecompare_resparam(const void *node1, const void *node2); Location: search_and_sort.h search_and_sort.cpp Description: RESPARAM residuetype comparision function for bsearch/qsort int restypecompare_rotamerlib(const void *node1, const void *node2); Location: search_and_sort.h search_and_sort.cpp Description: ROTAMERLIB residuetype comparision function for bsearch/qsort void rm_file(char *name1); Location: io.h io.cpp Description: rm file name1 int roll_loaded_dice(double *probability, int array_size) Location: moremath.h Description: This function takes an array of probabalities. It picks a random number between 0 and 1. If the random number is within the boundry for a given choice, it returns the index. void rotamer_calc_foreman(char *inputfilename, PROTEIN *original_protein); Location: rotamer_calc_foreman.h rotamer_calc_foreman.cpp Description: opens original_protein->parameters.slave_file_list_filename, goes through the list of files, launches slave optimization jobs double rotamer_pair_energy(GENE i_gene, GENE j_gene); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: returns the energy between two sidechain rotamers represented by i_gene and j_gene, using structures precalculated and stored in the lookup table and linked appropriately. SASA_SUM SASAcalc(mini_pdbATOM *pdb); Location: SASA.h SASA.cpp Description: calculates SASA_SUM for mini_pdbATOM array pdb; also calculates SASA for each atom --> pdb[i].sasa void SASA_readfiles(char *SASA_points_file, ATOMPARAM *atomparam); Location: SASA.h SASA.cpp Description: reads the points file containing the SASA lookup table #define void SASA_SUM_0(SASA_SUM sasa_sum) Location: SASA.h Description: sets the components of sasa_sum to 0 SASA_SUM SASA_SUM_ADD(SASA_SUM b, SASA_SUM c) Location: SASA.h Description: adds sasa components from b and c SASA_SUM sasa_sum_scale(double c, SASA_SUM b); Location: SASA.h SASA.cpp Description: scales components in SASA_SUM by scale factor c SASA_SUM SASA_SUM_SUBTRACT(b, c) Location: SASA.h Description: subtracts sasa components c from b void save_coordinates_lookupRes(LOOKUP_ENERGY_RESIDUE *lookupRes, RESPARAM *resparam_ptr, char *structure_filename); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: save to disk coordinates for sidechain and rotamerlets for a residue at a position. lookupRes and resparam_ptr are specific for the residue. structure_filename is defined by the calling function for the position and residuetype. void save_lookupResRes_to_disk(int i, int i_res, LOOKUP_ENERGY *lookupEnergy, VARIABLE_POSITION *varPos, PARAMETERS *parameters); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: save list of residue-residue pairs that actually interact with i,i_res to disk; varPos is the VARIABLE_POSITION array for all positions, not just i. lookupEnergy is the entire lookuptable structure. void save_lookupRes_to_disk(int seq_position, int fixed_flag, LOOKUP_ENERGY_RESIDUE *lookupRes, RESPARAM *resparam_ptr, PARAMETERS *parameters); Location: lookup_table_disk_stuff.h lookup_table_disk_stuff.cpp Description: save var-fix energies for a residue at position seq_position to disk. Also save coordinates for sidechains and rotamerlets. lookupRes and resparam_ptr are specific for the residuetype at this position. CARTESIAN scalar_multiply_CARTESIAN(double a, CARTESIAN b); Location: moremath.h moremath.cpp Description: multiply the dimensions of b with a; return the scaled vector ENERGY scale_energy(double scale, ENERGY c); Location: energy_functions.h energy_functions.cpp Description: scales each energy component by scale void scmf(PROTEIN *protein); Location: scmf.h scmf.cpp Description: self consistent mean field optimization. assumes that protein has been through input_stuff and generate_lookup_table. double score_CHROMOSOME_solubility(CHROMOSOME *chr); Location: solubility.h solubility.cpp Description: given a CHROMOSOME chr, this function returns a solubility score based on how close it is to satsifying the three solubility criteria of OVERALL_CHARGE, FRACTION_HYDROPHOBIC_SASA_CUTOFF, and TRANSFER_FREE_ENERGY_DENSITY_CUTOFF. A score of 0 means all three criteria have been satisfied. Otherwise, the returned score is >0. score = SIGMA(1.0 - target_value/desired_value <-- inverted dependent on sign and magnitude) Used by solubilize_CHROMOSOME as an objective function. int search_atomname_ATOMRESPARAM(char *atomname, ATOMRESPARAM atomresparam[]); Location: search_and_sort.h search_and_sort.cpp Description: Binary search for a specific atomname in an sorted array of ATOMRESPARAM. Returns the index of the array position. int search_residuetype_RESPARAM(char *residuetype, RESPARAM resparam[]); Location: search_and_sort.h search_and_sort.cpp Description: Binary search for a specific residuetype in an array of RESPARAM; Returns the index of the array position void seperate_the_complex(mini_pdbATOM *input_complex, mini_pdbATOM *seperated_cmplx, char *chain_id_list,SUPER_CHAIN_ID_LIST *super_chain_id_list, double separation_distance); Location: complex_formation_energy.h complex_formation_energy.cpp Distance: this function splits a complex in input_complex separation_distance apart and puts the coords of the separated complex in seperated_cmplx int seqpos_to_inputted_string(int seq_pos, SEQPOS_TEXT_MAPPING_LIST *seqpos_text_map); Location: pdbATOM_utilities.h pdbATOM_utilities.cpp Description: for a sequence position, return the seqpos_text_map index void sequence_to_CHROMOSOME(CHROMOSOME *chr, INVARIABLE_POSITIONS *invar_pos, VARIABLE_POSITION *var_pos, char *sequence); Location: sequence_CHROMOSOME_stuff.h sequence_CHROMOSOME_stuff.cpp Description: Generates a chromosome with the appropriate pointers etc corresponding to a protein sequence. chr must be pre-intialized/allocated with a GENE linked list (using inoculate sidechains). sequence must end with '\0'. void sequence_to_var_pos_file(FILE *input, PROTEIN *protein, int modify_varpos_flag); Location: input_stuff.h input_stuff.cpp Description: Parses file pointer *input set at the line following the "SEQUENCE" line in an input file. Assumes that protein has gone through input_stuff (or has variables from input_stuff set). This function is called by input_stuff and by rotamer_calc_foreman. If modify_varpos_flag=0, then VARIABLE_POSITIONS.cpp: modify_VARIABLE_POSITIONS is not called. void share_lookup_table(PROTEIN *original_protein, PROTEIN *input_protein, PROTEIN *working_protein); Location: rotamer_calc_foreman.h rotamer_calc_foreman.cpp Description: get the var_pos in input_protein to hook up w/ the lookup table in original_protein. define in_use flags, etc. working_protein can be used as input for optimization functions, etc. #define double sind(double n) Location: moremath.h Description: sin of degree argument void solubilize_CHROMOSOME(CHROMOSOME *input_chr) Location: solubility.h solubility.cpp Description: This function returns in CHROMOSOME input_chr (which has allocated GENE linked list) a soluble sequence. A genetic algorithm is performed, scoring solubility with score_CHROMOSOME_solubility. This function does NOT optimize solubility; it merely tries to identify a sequence which satisfies the solubility criteria; the initial population are mutated input_chr to keep solutions near input_chr. void sort_CHOICE(int *first, int *last, CHOICE arrayint[]); Location: search_and_sort.h search_and_sort.cpp Description: sorts an array of CHOICE by resparam_ptr->one_letter_code. first=1; last = size of array. void sort_CHROMOSOME(int *first, int *last, CHROMOSOME chr[]); Location: search_and_sort.h search_and_sort.cpp Description: sorts an array of CHROMOSOMEs by energy (lowest energy-->highest). first=1; last = size of array. void sort_double(int *first, int *last, double arraydouble[]); Location: search_and_sort.h search_and_sort.cpp Description: sorts an array of double by value (lowest->highest). first=1; last = size of array. void sort_int(int *first, int *last, int arrayint[]); Location: search_and_sort.h search_and_sort.cpp Description: sorts an array of int by value (lowest->highest). first=1; last = size of array. void sort_ROTAMER(int *first, int *last, ROTAMER rotamer[]); Location: search_and_sort.h search_and_sort.cpp Description: sorts an array of ROTAMER by freq (highest->lowest). first=1; last = size of array. void sort_VARIABLE_POSITION(int *first, int *last, VARIABLE_POSITION varpos[]); Location: search_and_sort.h search_and_sort.cpp Description: sorts an array of VARIABLE_POSITION by seq_position (lowest->highest). first=1; last = size of array. void split_complex(mini_pdbATOM *input_complex, mini_pdbATOM *free_A, mini_pdbATOM *free_B,char *chain_id_list,SUPER_CHAIN_ID_LIST *super_chain_id_list); Location: complex_formation_energy.h complex_formation_energy.cpp Description: this function splits a complex in input_complex and puts the coords of the separated complex in free_A and free_B super_chain A moves away from B #define void sscanf_flag(char *line, char *dummystring, int FLAG) Location: input_stuff.h Description: parses "true" or "false" text from inputfiles for flag variables; FLAG = 1 or 0 respectively int ssh_command(char *hostname, char *remote_command); Location: io.h io.cpp Description: this function is a wrapper for ssh for sending commands to remote machines. especially useful for parallel processing. If sending jobs to a batch queue master node, define BATCH_QUEUE_PREFIX in the inputfile or change the default in input_stuff.cpp and re-compile. returns value of ssh command (0= success). STATISTICS statistics(double *actual, double *calc, int n); Location: moremath.h moremath.cpp Description: this function returns the r^2, rmsd, and rse between two arrays of n doubles double sum_VDW_ENERGY(VDW_ENERGY vdwE) Location: energy_functions.h energy_functions.cpp Description: returns the sum of the attractive and repulsive components of vdw, scaled appropriately; does not include softening/scaling of the repulsive #define double tand(double n) Location: moremath.h Description: tan of degree argument double torsion_energy(mini_pdbATOM *firstAtom, mini_pdbATOM *contactAtom, mini_pdbATOM *twobondAtom, mini_pdbATOM *dihedAtom); Location: energy_functions.h energy_functions.cpp Description: Given the four atoms, return the dihedral-angle-dependent energy component of 1,4 interactions firstAtom \ contactAtom--------twobondAtom \ dihedAtom void torsion_minimize_PROTEIN(PROTEIN *protein); Location: minimize.h minimize.cpp Description: Manages JOBTYPE MINIMIZE and JOBTYPE ADJUST_BACKBONE_TORSIONS For MINIMIZE, powell-minimize protein->Template in dihedral space (backbone moves if protein->parameters.rebuild_backbone_flag==1). For ADJUST_BACKBONE_TORSIONS, rebuild backbone w/ ideal geometry, adjust torsions to minimize rmsd with original structure. Assumes protein has been initialized with input_stuff. final structure stored in protein->final_pdb for output_PROTEIN void touch_file(char *filename); Location: io.h io.cpp Description: touches file filename, creating it or updating its nfs record CARTESIAN tranform_coordinates(CARTESIAN p, double *matrix); Location: ligand_stuff.h ligand_stuff.cpp Description: Called by build_a_Sidechain. This function loads the SIDECHAIN ligand with coords corresponding to "rotamer" chi. For "rotamers" = coordinates, chi = rotamerlib index. For "rotamers" = transform matrix + dihedrals, chi = matrix + dihedrals. resparam must be assigned to the proper ligand by the calling function. void translate_mini_pdbATOM_along_vector_AB(mini_pdbATOM *free_A, mini_pdbATOM *new_A, double step, CARTESIAN AB_hat); Location: complex_formation_energy.h complex_formation_energy.cpp Description: coords of atoms in free_A are translated step angstroms along vector AB_hat; coords placed in new_A CARTESIAN unitcrossprod(CARTESIAN a, CARTESIAN b) Location: moremath.h Description: return unit crossproduct for two vectors a and b CARTESIAN unitvector(CARTESIAN a, CARTESIAN b) Location: moremath.h Description: return unit vector for vector ab: a(x,y,z) --> b(x,y,z) double value_rotamer(double chi[]); var_fix_ENERGY var_fixed_energy_calc(mini_pdbATOM *fixed_atoms, mini_pdbATOM *var_atoms, int gb_flag); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: returns var_fix_ENERGY between sidechain atoms var_atoms and fixed_atoms, as well as born radii for var_atoms.gb_flag 1 means calculate born radii and energies; 0 does not. var_fix_vdw_ENERGY var_fixed_vdw_screen(mini_pdbATOM *fixed_atoms, CARTESIAN *var_atoms, ATOMRESPARAM **var_atom_ptr, int seq_position); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: minimalist version of var_fixed_energy_calc for rotamerlet local minimization; returns var_fix_vdw_ENERGY #define void VAR_FIX_ENERGY_0(var_fix_ENERGY energy) Location: energy_functions.h Description: set VAR_FIX_ENERGY components to 0 #define void VAR_FIX_ENERGY_ADD(var_fix_ENERGY a, var_fix_ENERGY b, var_fix_ENERGY c) Location: energy_functions.h Description: adds components of VAR_FIX_ENERGY b and VAR_FIX_ENERGY c into VAR_FIX_ENERGY a #define double var_fix_ENERGY_TOTAL(var_fix_ENERGY energy) Location: energy_functions.h Description: return sum of var_fix_ENERGY components #define void VAR_VAR_ENERGY_0(var_var_ENERGY energy) Location: energy_functions.h Description: set VAR_VAR_ENERGY components to 0 var_var_ENERGY var_var_energy_calc(milli_pdbATOM *i_atoms, milli_pdbATOM *j_atoms, ATOMRESPARAM **atom_ptr_i, ATOMRESPARAM **atom_ptr_j); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: returns var_var_ENERGY between sidechain rotamers i and j; the arrays atom_ptr_i and atom_ptr_j are defined in read_residuedata. The array indexing should be such that coordinates in i_atoms[i] and the ATOMRESPARAM in atom_ptr_i[i] correspond to the same atom. #define double var_var_ENERGY_TOTAL(var_var_ENERGY energy) Location: energy_functions.h Description: return sum of var_var_ENERGY components double var_var_vdw_screen_micro(CARTESIAN *i_atoms, CARTESIAN *j_atoms, ATOMRESPARAM **atom_ptr_i, ATOMRESPARAM **atom_ptr_j); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: version of var_var_vdw_screen for methyl local minimization; returns E_vdw double var_var_vdw_screen(milli_pdbATOM *i_atoms, milli_pdbATOM *j_atoms, ATOMRESPARAM **atom_ptr_i, ATOMRESPARAM **atom_ptr_j); Location: pairwise_energy_calc.h pairwise_energy_calc.cpp Description: version of var_var_energy_calc for rotamerlet local minimization; returns E_vdw #define void VDW_ENERGY_0(VDW_ENERGY vdwE) Location: energy_functions.h Description: set VDW_ENERGY to zero double vdw_energy_14(ATOMRESPARAM *i, ATOMRESPARAM *j, double r2) Location: energy_functions.h Description: returns vdw energy for atoms seperated by 3 bonds; must be scaled by NONBOND_FACTOR_1_4 in the calling function CARTESIAN vector_ab(CARTESIAN a, CARTESIAN b); Location: moremath.h moremath.cpp Description: return the vector between a and b double vector_length(CARTESIAN a) Location: moremath.h Description: return length of vector a void volume_bonded(RESPARAM *inputresparam); Location: read_forcefield.h read_forcefield.cpp Description: calculate spherical volumes for each atom, taking into account covalently bound atoms; used for born radius calculations. called by read_forcefield.cpp: read_forcefield. int word_count(char *line); Location: io.h io.cpp Description: returns the number of words (seperated by space or tab) in a string line (end w/ '\0')