********>Bugfix 6: Author: Scott Brozell Date: October 24, 2006 Program: dock Description: Amber_score was not writing the final pose of the ligand to the 'ligand_outfile_prefix'_scored.mol2 file. Also a memory allocation check was corrected. Fix: make the following changes to the files src/dock/dockmol.cpp, src/dock/dockmol.h, and src/dock/score_amber.cpp. This is most easily performed via cd $DOCK_HOME; patch -p0 < bugfix.6 ------------------------------------------------------------------------- *** src/dock/dockmol.cpp 2 Aug 2006 21:19:47 -0000 1.11.2.1 --- src/dock/dockmol.cpp 25 Oct 2006 03:34:31 -0000 *************** *** 1293,1295 **** --- 1293,1312 ---- } } + + /*********************************************/ + /* + Copy the Cartesian coordinates from the argument to this DOCKMol. + The linear memory representation of argument xyz, starting from *xyz, is + first atom x, first atom y, first atom z, second atom x, ... + */ + void + DOCKMol::setxyz( const double * xyz ) + { + for (int i = 0; i < num_atoms; ++ i) { + x[i] = xyz[ 3 * i + 0 ]; + y[i] = xyz[ 3 * i + 1 ]; + z[i] = xyz[ 3 * i + 2 ]; + } + } + =================================================================== *** src/dock/dockmol.h 2 Aug 2006 21:19:47 -0000 1.7.2.1 --- src/dock/dockmol.h 25 Oct 2006 03:34:31 -0000 *************** *** 117,122 **** --- 117,123 ---- bool atoms_are_one_three(int, int); bool atoms_are_one_four(int, int); void prepare_molecule(); + void setxyz( const double * xyz ); void operator=(const DOCKMol &mol); =================================================================== diff -c -r1.32.2.6 score_amber.cpp *** src/dock/score_amber.cpp 24 Aug 2006 01:12:25 -0000 1.32.2.6 --- src/dock/score_amber.cpp 25 Oct 2006 03:34:31 -0000 *************** *** 358,363 **** --- 358,364 ---- import_dockmol_ligand ( mol ); mol.current_score = calculate_amber_energy ( ); mol.current_data = output_score_summary ( mol.current_score ); + mol.setxyz( &ligand_xyz[0] ); } return true; *************** *** 406,412 **** // putpdb( "initial.ligand.nab.pdb", ligand, NULL ); // putpdb( "initial.complex.nab.pdb", complex, NULL ); ! if ( ligand_xyz.capacity ( ) < lig.num_atoms ) { ligand_xyz.reserve ( 3 * ( lig.num_atoms ) ); complex_xyz.reserve ( 3 * ( num_receptor_atoms + lig.num_atoms ) ); gradient_xyz.reserve ( 3 * ( num_receptor_atoms + lig.num_atoms ) ); --- 407,413 ---- // putpdb( "initial.ligand.nab.pdb", ligand, NULL ); // putpdb( "initial.complex.nab.pdb", complex, NULL ); ! if ( ligand_xyz.capacity ( ) < 3 * lig.num_atoms ) { ligand_xyz.reserve ( 3 * ( lig.num_atoms ) ); complex_xyz.reserve ( 3 * ( num_receptor_atoms + lig.num_atoms ) ); gradient_xyz.reserve ( 3 * ( num_receptor_atoms + lig.num_atoms ) ); ------------------------------------------------------------------------- Workaround: none.