def testUpdateTcoordFromModel(self): ligand = Ligand() ligand.read_pdbqt("./Inputs/ind.pdbqt") ligand.update_tcoord_model("./Results/ind_1.model") exp = ['Axis3: 0.2650, 6.2150, -11.8050', 'Axis3: 1.6440, 6.5520, -11.3580', 'Axis3: 2.5770, 5.4910, -10.8120', 'Axis3: 3.8610, 6.1570, -10.3960', 'Axis3: 3.8790, 6.9140, -9.4330', 'Axis3: 4.9330, 5.8950, -11.1170', 'Axis3: 1.7850, 4.9560, -9.6490', 'Axis3: 0.3230, 4.7560, -9.8090', 'Axis3: -0.4250, 5.7310, -10.6940', 'Axis3: 2.3400, 3.8350, -8.9190', 'Axis3: 2.3890, 4.0350, -7.4040', 'Axis3: 3.5380, 4.7410, -6.6620', 'Axis3: 3.4900, 4.9260, -5.1390', 'Axis3: 4.7390, 5.6420, -4.5980', 'Axis3: 2.2500, 5.6920, -4.6940', 'Axis3: 1.9290, 6.7510, -5.2540', 'Axis3: 1.6390, 5.2110, -3.6150', 'Axis3: 0.6620, 5.9970, -2.8790', 'Axis3: 0.7240, 5.7290, -1.3860', 'Axis3: -0.6400, 6.1130, -0.8570', 'Axis3: -1.7010, 5.8730, -1.9010', 'Axis3: -3.0650, 5.7010, -1.9350', 'Axis3: -3.6710, 5.4540, -3.1710', 'Axis3: -2.9080, 5.3860, -4.3470', 'Axis3: -1.5290, 5.5470, -4.3420', 'Axis3: -0.8420, 5.7860, -3.1940', 'Axis3: 4.7660, 5.2960, -11.9390', 'Axis3: 1.8650, 4.2600, -3.2920', 'Axis3: 2.4490, 2.6750, -7.0990', 'Axis3: 2.0460, 2.1300, -7.8750', 'Axis3: 4.6930, 5.8290, -3.1250', 'Axis3: 4.9250, 7.0630, -2.5180', 'Axis3: 4.9090, 7.1840, -1.1350', 'Axis3: 4.6580, 6.0480, -0.3630', 'Axis3: 4.4170, 4.8090, -0.9700', 'Axis3: 4.4350, 4.7040, -2.3620', 'Axis3: -0.4560, 7.2290, -12.5830', 'Axis3: 0.1500, 7.8440, -13.8500', 'Axis3: 0.7060, 9.1300, -13.8860', 'Axis3: 1.2960, 9.7510, -14.9980', 'Axis3: 1.2650, 8.9090, -16.1080', 'Axis3: 0.7270, 7.6180, -16.1420', 'Axis3: 0.1600, 7.0740, -14.9930', 'Axis3: 6.2880, 6.3080, -10.9420', 'Axis3: 6.6440, 6.0580, -9.4640', 'Axis3: 6.5040, 7.6350, -11.2720', 'Axis3: 7.2500, 5.4970, -11.6940', 'Axis3: 1.0740, 4.3740, -1.1440', 'Axis3: 0.2230, 3.7950, -1.1340'] for i, atom in enumerate(ligand.atoms): self.assertEquals(str(atom.tcoord), exp[i])
def create_ligands(self): base_r_list = np.full(self.number_of_ligands, self.nanoparticle_radius) base_theta_list = np.random.uniform(low=0, high=(2 * np.pi), size=self.number_of_ligands) base_phi_list = np.random.uniform(low=0, high=np.pi, size=self.number_of_ligands) bases = [ np.array([r, theta, phi]) for r, theta, phi in np.nditer( [base_r_list, base_theta_list, base_phi_list]) ] #reshape into one vector tip_r_list = np.random.uniform(low=0, high=self.ligand_length, size=self.number_of_ligands) tip_theta_list = np.random.uniform(low=0, high=(2 * np.pi), size=self.number_of_ligands) tip_phi_list = np.random.uniform(low=0, high=(0.5 * np.pi), size=self.number_of_ligands) tips = [ np.array([r, theta, phi]) for r, theta, phi in np.nditer( [tip_r_list, tip_theta_list, tip_phi_list]) ] for i in range(self.number_of_ligands): ligand = Ligand(i, self.agent_id, self.position, self.nanoparticle_radius, self.ligand_length, bases.pop(), tips.pop(), self.binding_energy, self.ligand_radius, self.time_unit) self.ligands.append(ligand)
def testUpdateTcoordFromModel(self): ligand = Ligand() ligand.read_pdbqt("./Inputs/ind.pdbqt") ligand.update_tcoord_model("./Results/ind_1.model") exp = [ 'Axis3: 0.2650, 6.2150, -11.8050', 'Axis3: 1.6440, 6.5520, -11.3580', 'Axis3: 2.5770, 5.4910, -10.8120', 'Axis3: 3.8610, 6.1570, -10.3960', 'Axis3: 3.8790, 6.9140, -9.4330', 'Axis3: 4.9330, 5.8950, -11.1170', 'Axis3: 1.7850, 4.9560, -9.6490', 'Axis3: 0.3230, 4.7560, -9.8090', 'Axis3: -0.4250, 5.7310, -10.6940', 'Axis3: 2.3400, 3.8350, -8.9190', 'Axis3: 2.3890, 4.0350, -7.4040', 'Axis3: 3.5380, 4.7410, -6.6620', 'Axis3: 3.4900, 4.9260, -5.1390', 'Axis3: 4.7390, 5.6420, -4.5980', 'Axis3: 2.2500, 5.6920, -4.6940', 'Axis3: 1.9290, 6.7510, -5.2540', 'Axis3: 1.6390, 5.2110, -3.6150', 'Axis3: 0.6620, 5.9970, -2.8790', 'Axis3: 0.7240, 5.7290, -1.3860', 'Axis3: -0.6400, 6.1130, -0.8570', 'Axis3: -1.7010, 5.8730, -1.9010', 'Axis3: -3.0650, 5.7010, -1.9350', 'Axis3: -3.6710, 5.4540, -3.1710', 'Axis3: -2.9080, 5.3860, -4.3470', 'Axis3: -1.5290, 5.5470, -4.3420', 'Axis3: -0.8420, 5.7860, -3.1940', 'Axis3: 4.7660, 5.2960, -11.9390', 'Axis3: 1.8650, 4.2600, -3.2920', 'Axis3: 2.4490, 2.6750, -7.0990', 'Axis3: 2.0460, 2.1300, -7.8750', 'Axis3: 4.6930, 5.8290, -3.1250', 'Axis3: 4.9250, 7.0630, -2.5180', 'Axis3: 4.9090, 7.1840, -1.1350', 'Axis3: 4.6580, 6.0480, -0.3630', 'Axis3: 4.4170, 4.8090, -0.9700', 'Axis3: 4.4350, 4.7040, -2.3620', 'Axis3: -0.4560, 7.2290, -12.5830', 'Axis3: 0.1500, 7.8440, -13.8500', 'Axis3: 0.7060, 9.1300, -13.8860', 'Axis3: 1.2960, 9.7510, -14.9980', 'Axis3: 1.2650, 8.9090, -16.1080', 'Axis3: 0.7270, 7.6180, -16.1420', 'Axis3: 0.1600, 7.0740, -14.9930', 'Axis3: 6.2880, 6.3080, -10.9420', 'Axis3: 6.6440, 6.0580, -9.4640', 'Axis3: 6.5040, 7.6350, -11.2720', 'Axis3: 7.2500, 5.4970, -11.6940', 'Axis3: 1.0740, 4.3740, -1.1440', 'Axis3: 0.2230, 3.7950, -1.1340' ] for i, atom in enumerate(ligand.atoms): self.assertEquals(str(atom.tcoord), exp[i])
def rmsd_pdbqts(pdbqt_file1, pdbqt_file2): ligand1 = Ligand() ligand1.read_pdbqt(pdbqt_file1) ligand2 = Ligand() ligand2.read_pdbqt(pdbqt_file2) return Analysis.rmsd_ligands(ligand1, ligand2)
def rmsd_pdbqts(pdbqt_file1, pdbqt_file2): ligand1 = Ligand() ligand1.read_pdbqt(pdbqt_file1) ligand2 = Ligand() ligand2.read_pdbqt(pdbqt_file2) return Analysis.rmsd_ligands(ligand1, ligand2)
def testRead(self): ligand = Ligand() ligand.read_pdbqt("./Inputs/ind.pdbqt") exp = ['N', 'C', 'C', 'C', 'OA', 'N', 'N', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'OA', 'N', 'C', 'C', 'C', 'A', 'A', 'A', 'A', 'A', 'A', 'HD', 'HD', 'OA', 'HD', 'A', 'A', 'A', 'A', 'A', 'A', 'C', 'A', 'A', 'NA', 'A', 'A', 'A', 'C', 'C', 'C', 'C', 'OA', 'HD'] for i, atom in enumerate(ligand.atoms): self.assertEquals(atom.type, exp[i]) exp = ['Axis3: -3.8840, -2.4210, -3.9000', 'Axis3: -3.6460, -0.9580, -4.0310', 'Axis3: -3.2320, -0.3420, -5.3520', 'Axis3: -3.0130, 1.1320, -5.1400', 'Axis3: -2.0700, 1.5250, -4.4640', 'Axis3: -3.8810, 1.9530, -5.6980', 'Axis3: -1.9620, -1.0900, -5.6540', 'Axis3: -1.9050, -2.5470, -5.3780', 'Axis3: -2.6800, -3.0650, -4.1840', 'Axis3: -1.3110, -0.8220, -6.9200', 'Axis3: 0.1790, -0.4990, -6.8030', 'Axis3: 0.7400, 0.9070, -6.5230', 'Axis3: 2.2520, 1.1350, -6.3910', 'Axis3: 2.5990, 2.6090, -6.1250', 'Axis3: 2.8660, 0.2770, -5.2910', 'Axis3: 2.3500, 0.2330, -4.1640', 'Axis3: 4.0270, -0.2960, -5.5960', 'Axis3: 4.8900, -0.8600, -4.5710', 'Axis3: 6.3610, -0.6770, -4.9020', 'Axis3: 7.0790, -1.7600, -4.1290', 'Axis3: 6.2030, -2.9780, -3.9830', 'Axis3: 6.3700, -4.3170, -3.7160', 'Axis3: 5.2370, -5.1380, -3.7120', 'Axis3: 3.9630, -4.6090, -3.9720', 'Axis3: 3.7660, -3.2640, -4.2540', 'Axis3: 4.8000, -2.3820, -4.2870', 'Axis3: -4.6640, 1.4910, -6.1820', 'Axis3: 4.3220, -0.3400, -6.5820', 'Axis3: 0.4840, -0.8300, -8.1240', 'Axis3: 0.5170, 0.0270, -8.6940', 'Axis3: 4.0610, 2.8330, -5.9890', 'Axis3: 4.9780, 2.4140, -6.9530', 'Axis3: 6.3390, 2.6110, -6.7670', 'Axis3: 6.7740, 3.2360, -5.5960', 'Axis3: 5.8560, 3.6650, -4.6300', 'Axis3: 4.4900, 3.4600, -4.8320', 'Axis3: -4.5580, -2.8860, -2.6820', 'Axis3: -5.9930, -2.4600, -2.3510', 'Axis3: -7.1180, -2.9970, -2.9930', 'Axis3: -8.4590, -2.6730, -2.7310', 'Axis3: -8.5480, -1.7190, -1.7190', 'Axis3: -7.4700, -1.1430, -1.0390', 'Axis3: -6.1680, -1.5200, -1.3590', 'Axis3: -3.9080, 3.3800, -5.7390', 'Axis3: -5.2730, 3.7850, -6.3260', 'Axis3: -2.8790, 3.9270, -6.4870', 'Axis3: -3.8780, 4.0050, -4.4130', 'Axis3: 6.5610, -0.7430, -6.3060', 'Axis3: 6.5100, 0.2050, -6.7060'] for i, atom in enumerate(ligand.atoms): self.assertEquals(str(atom.tcoord), exp[i]) exp = [0.096, 0.307, 0.2, 0.242, -0.271, -0.351, -0.395, 0.148, 0.292, 0.149, 0.136, 0.047, 0.084, 0.052, 0.222, -0.273, -0.35, 0.147, 0.149, 0.073, -0.047, 0.008, 0.001, 0.001, 0.01, -0.027, 0.163, 0.163, -0.394, 0.21, -0.057, 0.007, 0.001, 0.0, 0.001, 0.007, 0.312, -0.013, 0.125, -0.273, 0.116, 0.02, 0.012, 0.022, 0.037, 0.037, 0.037, -0.393, 0.21] for i, atom in enumerate(ligand.atoms): self.assertEquals(atom.charge, exp[i]) exp = [0.096, 0.307, 0.2, 0.242, 0.271, 0.351, 0.395, 0.148, 0.292, 0.149, 0.136, 0.047, 0.084, 0.052, 0.222, 0.273, 0.35, 0.147, 0.149, 0.073, 0.047, 0.008, 0.001, 0.001, 0.01, 0.027, 0.163, 0.163, 0.394, 0.21, 0.057, 0.007, 0.001, 0.0, 0.001, 0.007, 0.312, 0.013, 0.125, 0.273, 0.116, 0.02, 0.012, 0.022, 0.037, 0.037, 0.037, 0.393, 0.21] for i, atom in enumerate(ligand.atoms): self.assertEquals(abs(atom.charge), exp[i])
def testRead(self): ligand = Ligand() ligand.read_pdbqt("./Inputs/ind.pdbqt") exp = [ 'N', 'C', 'C', 'C', 'OA', 'N', 'N', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'OA', 'N', 'C', 'C', 'C', 'A', 'A', 'A', 'A', 'A', 'A', 'HD', 'HD', 'OA', 'HD', 'A', 'A', 'A', 'A', 'A', 'A', 'C', 'A', 'A', 'NA', 'A', 'A', 'A', 'C', 'C', 'C', 'C', 'OA', 'HD' ] for i, atom in enumerate(ligand.atoms): self.assertEquals(atom.type, exp[i]) exp = [ 'Axis3: -3.8840, -2.4210, -3.9000', 'Axis3: -3.6460, -0.9580, -4.0310', 'Axis3: -3.2320, -0.3420, -5.3520', 'Axis3: -3.0130, 1.1320, -5.1400', 'Axis3: -2.0700, 1.5250, -4.4640', 'Axis3: -3.8810, 1.9530, -5.6980', 'Axis3: -1.9620, -1.0900, -5.6540', 'Axis3: -1.9050, -2.5470, -5.3780', 'Axis3: -2.6800, -3.0650, -4.1840', 'Axis3: -1.3110, -0.8220, -6.9200', 'Axis3: 0.1790, -0.4990, -6.8030', 'Axis3: 0.7400, 0.9070, -6.5230', 'Axis3: 2.2520, 1.1350, -6.3910', 'Axis3: 2.5990, 2.6090, -6.1250', 'Axis3: 2.8660, 0.2770, -5.2910', 'Axis3: 2.3500, 0.2330, -4.1640', 'Axis3: 4.0270, -0.2960, -5.5960', 'Axis3: 4.8900, -0.8600, -4.5710', 'Axis3: 6.3610, -0.6770, -4.9020', 'Axis3: 7.0790, -1.7600, -4.1290', 'Axis3: 6.2030, -2.9780, -3.9830', 'Axis3: 6.3700, -4.3170, -3.7160', 'Axis3: 5.2370, -5.1380, -3.7120', 'Axis3: 3.9630, -4.6090, -3.9720', 'Axis3: 3.7660, -3.2640, -4.2540', 'Axis3: 4.8000, -2.3820, -4.2870', 'Axis3: -4.6640, 1.4910, -6.1820', 'Axis3: 4.3220, -0.3400, -6.5820', 'Axis3: 0.4840, -0.8300, -8.1240', 'Axis3: 0.5170, 0.0270, -8.6940', 'Axis3: 4.0610, 2.8330, -5.9890', 'Axis3: 4.9780, 2.4140, -6.9530', 'Axis3: 6.3390, 2.6110, -6.7670', 'Axis3: 6.7740, 3.2360, -5.5960', 'Axis3: 5.8560, 3.6650, -4.6300', 'Axis3: 4.4900, 3.4600, -4.8320', 'Axis3: -4.5580, -2.8860, -2.6820', 'Axis3: -5.9930, -2.4600, -2.3510', 'Axis3: -7.1180, -2.9970, -2.9930', 'Axis3: -8.4590, -2.6730, -2.7310', 'Axis3: -8.5480, -1.7190, -1.7190', 'Axis3: -7.4700, -1.1430, -1.0390', 'Axis3: -6.1680, -1.5200, -1.3590', 'Axis3: -3.9080, 3.3800, -5.7390', 'Axis3: -5.2730, 3.7850, -6.3260', 'Axis3: -2.8790, 3.9270, -6.4870', 'Axis3: -3.8780, 4.0050, -4.4130', 'Axis3: 6.5610, -0.7430, -6.3060', 'Axis3: 6.5100, 0.2050, -6.7060' ] for i, atom in enumerate(ligand.atoms): self.assertEquals(str(atom.tcoord), exp[i]) exp = [ 0.096, 0.307, 0.2, 0.242, -0.271, -0.351, -0.395, 0.148, 0.292, 0.149, 0.136, 0.047, 0.084, 0.052, 0.222, -0.273, -0.35, 0.147, 0.149, 0.073, -0.047, 0.008, 0.001, 0.001, 0.01, -0.027, 0.163, 0.163, -0.394, 0.21, -0.057, 0.007, 0.001, 0.0, 0.001, 0.007, 0.312, -0.013, 0.125, -0.273, 0.116, 0.02, 0.012, 0.022, 0.037, 0.037, 0.037, -0.393, 0.21 ] for i, atom in enumerate(ligand.atoms): self.assertEquals(atom.charge, exp[i]) exp = [ 0.096, 0.307, 0.2, 0.242, 0.271, 0.351, 0.395, 0.148, 0.292, 0.149, 0.136, 0.047, 0.084, 0.052, 0.222, 0.273, 0.35, 0.147, 0.149, 0.073, 0.047, 0.008, 0.001, 0.001, 0.01, 0.027, 0.163, 0.163, 0.394, 0.21, 0.057, 0.007, 0.001, 0.0, 0.001, 0.007, 0.312, 0.013, 0.125, 0.273, 0.116, 0.02, 0.012, 0.022, 0.037, 0.037, 0.037, 0.393, 0.21 ] for i, atom in enumerate(ligand.atoms): self.assertEquals(abs(atom.charge), exp[i])
# You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # References: # - AutoDock 4.2.3 Source Code # http://autodock.scripps.edu from Ligand import Ligand from Grid import Grid from Parameters import Field from Map import ElectrostaticMap, DesolvationMap, AtomTypeMap from Dock import Dock ligand = Ligand() ligand.read_pdbqt("./Inputs/ind.pdbqt") ligand.update_tcoord_model("./Results/ind.model") grid = Grid() grid.field = Field("./Parameters/hsg1_rigid.maps.fld") grid.maps['e'] = ElectrostaticMap("./Maps/hsg1_rigid.e.map", grid.field).map grid.maps['d'] = DesolvationMap("./Maps/hsg1_rigid.d.map", grid.field).map grid.maps['A'] = AtomTypeMap("./Maps/hsg1_rigid.A.map", grid.field).map grid.maps['C'] = AtomTypeMap("./Maps/hsg1_rigid.C.map", grid.field).map grid.maps['HD'] = AtomTypeMap("./Maps/hsg1_rigid.HD.map", grid.field).map grid.maps['N'] = AtomTypeMap("./Maps/hsg1_rigid.N.map", grid.field).map grid.maps['NA'] = AtomTypeMap("./Maps/hsg1_rigid.NA.map", grid.field).map grid.maps['OA'] = AtomTypeMap("./Maps/hsg1_rigid.OA.map", grid.field).map dock = Dock(grid, ligand)
def testCalcEnergy(self): ligand = Ligand() ligand.read_pdbqt("./Inputs/ind.pdbqt") ligand.update_tcoord_model("./Results/ind_1.model") grid = Grid() grid.field = Field("./Parameters/hsg1_rigid.maps.fld") grid.maps['e'] = ElectrostaticMap("./Maps/hsg1_rigid.e.map", grid.field).map grid.maps['d'] = DesolvationMap("./Maps/hsg1_rigid.d.map", grid.field).map grid.maps['A'] = AtomTypeMap("./Maps/hsg1_rigid.A.map", grid.field).map grid.maps['C'] = AtomTypeMap("./Maps/hsg1_rigid.C.map", grid.field).map grid.maps['HD'] = AtomTypeMap("./Maps/hsg1_rigid.HD.map", grid.field).map grid.maps['N'] = AtomTypeMap("./Maps/hsg1_rigid.N.map", grid.field).map grid.maps['NA'] = AtomTypeMap("./Maps/hsg1_rigid.NA.map", grid.field).map grid.maps['OA'] = AtomTypeMap("./Maps/hsg1_rigid.OA.map", grid.field).map dock = Dock() dock.ligand = ligand dock.grid = grid dock.calc_energy() exp_elecs = [-0.037623435264000013, -0.11408866126250672, \ -0.13002690236871114, -0.11316478799697538, \ 0.079400682425344024, 0.16382104147968005, \ 0.35572237014565938, -0.13983584352051195, \ -0.14455922704497778, -0.2437679729095111, \ -0.2233031453627734, -0.057756149112888927, \ -0.079042238535680001, -0.032257681663999997, \ -0.14416303698488891, 0.10750629826486036, \ 0.24778700799999992, -0.084038775587896894, \ -0.106404338719744, -0.052751354779306661, \ 0.024654531648227552, -0.0042321141760000005, \ -0.00035986557866666673, -0.00033659216281599992, \ -0.0041046807466666672, 0.012465198300672001, \ -0.090822509727725043, -0.17177248957202962, \ 1.1082351947605333, -0.89707293013333311, \ 0.026757765866666665, -0.0020757145903407409, \ -0.00025216804266666674, -0, -0.00048987137962666649, \ -0.0041342845067377787, -0.077292167626752006, \ 0.0028771771022222214, -0.035468487893333331, \ 0.061588514183964438, -0.025041379570346665, \ -0.0055949960533333357, -0.0031704985600000007, \ -0.0069595652002702214, -0.012058230703198818, \ -0.0079140675343170441, -0.012375409536000002, \ 0.3866265132258988, -0.20299363642879997] self.assertEquals(dock.elecs, exp_elecs) exp_elec_total = -0.689862915434 self.assertLessEqual(dock.elec_total - exp_elec_total, 0.000000000001) self.assertGreaterEqual(dock.elec_total - exp_elec_total, -0.000000000001) exp_emaps = [-0.27127903027200001, -0.16588333043273959, \ -0.20299416690915556, -0.21193308408991288, \ -0.22342833248403907, -0.10887097308672009, \ -0.069412406582518515, -0.32392036196890539, \ -0.22020219191751092, -0.35971221242311113, \ -0.36151369650175996, -0.33589534698001067, \ -0.31399731050837326, -0.37602125178402135, \ -0.18051097352533335, -0.17621873305273847, \ -0.092143525887999983, -0.2309628750124183, \ -0.24049173290393594, -0.30815793025564453, \ -0.39344854528779372, -0.50645809636693317, \ -0.53159663755332287, -0.49475817361601443, \ -0.34577077998990213, -0.31340080937233067, \ 0.083165888601903395, -0.37009113352391104, \ -0.26495262599680025, -0.35829845333333321, \ -0.27628956787200004, -0.36140396483508141, \ -0.31815226712832012, -0.2094688831146666, \ -0.23815943764081771, -0.24906767845688918, \ -0.22192987677536707, -0.25745685461333312, \ -0.19937555381333344, -0.2350488774924894, \ -0.19400907040085333, -0.14228789478968887, \ -0.23528794258204436, -0.4346495467977386, \ -0.44998934942632773, -0.52384750919471401, \ -0.51774914410666673, -0.26729886470788744, \ 0.052065064174933465] self.assertEquals(dock.emaps, exp_emaps) exp_emap_total = -13.5485660526 self.assertLessEqual(dock.emap_total - exp_emap_total, 0.0000000001) self.assertGreaterEqual(dock.emap_total - exp_emap_total, -0.0000000001)
def testCalcLinInterp3(self): ligand = Ligand() ligand.read_pdbqt("./Inputs/ind.pdbqt") ligand.update_tcoord_model("./Results/ind_1.model") grid = Grid() grid.field = Field("./Parameters/hsg1_rigid.maps.fld") grid.maps['e'] = ElectrostaticMap("./Maps/hsg1_rigid.e.map", grid.field).map grid.maps['d'] = DesolvationMap("./Maps/hsg1_rigid.d.map", grid.field).map grid.maps['A'] = AtomTypeMap("./Maps/hsg1_rigid.A.map", grid.field).map grid.maps['C'] = AtomTypeMap("./Maps/hsg1_rigid.C.map", grid.field).map grid.maps['HD'] = AtomTypeMap("./Maps/hsg1_rigid.HD.map", grid.field).map grid.maps['N'] = AtomTypeMap("./Maps/hsg1_rigid.N.map", grid.field).map grid.maps['NA'] = AtomTypeMap("./Maps/hsg1_rigid.NA.map", grid.field).map grid.maps['OA'] = AtomTypeMap("./Maps/hsg1_rigid.OA.map", grid.field).map protein = Protein() u0, v0, w0, u1, v1, w1, \ p000, p001, p010, p011, p100, p101, p110, p111 = \ Dock.calc_linInterp3(grid, ligand, protein) exp_u0 = [24, 27, 30, 33, 33, 36, 28, 24, 22, 29, 29, 32, 32, 35, 29, \ 28, 27, 25, 25, 21, 18, 15, 13, 15, 19, 21, 36, 28, 29, 28, \ 35, 36, 36, 35, 35, 35, 22, 23, 25, 26, 26, 25, 23, 40, 41, \ 40, 42, 26, 23] self.assertEquals(u0, exp_u0) exp_v0 = [29, 30, 27, 29, 31, 28, 25, 25, 27, 22, 23, 25, 25, 27, 27, \ 30, 26, 28, 27, 28, 28, 27, 27, 27, 27, 28, 26, 24, 19, 18, \ 28, 31, 31, 28, 25, 25, 31, 33, 37, 38, 36, 32, 31, 29, 28, \ 33, 27, 24, 22] self.assertEquals(v0, exp_v0) exp_w0 = [18, 19, 21, 22, 24, 20, 24, 23, 21, 26, 30, 32, 36, 37, 37, \ 35, 40, 42, 46, 47, 44, 44, 41, 38, 38, 41, 18, 41, 31, 29, \ 41, 43, 46, 49, 47, 43, 16, 13, 12, 10, 7, 6, 10, 20, 24, \ 19, 18, 46, 46] self.assertEquals(w0, exp_w0) exp_u1 = [25, 28, 31, 34, 34, 37, 29, 25, 23, 30, 30, 33, 33, 36, 30, \ 29, 28, 26, 26, 22, 19, 16, 14, 16, 20, 22, 37, 29, 30, 29, \ 36, 37, 37, 36, 36, 36, 23, 24, 26, 27, 27, 26, 24, 41, 42, \ 41, 43, 27, 24] self.assertEquals(u1, exp_u1) exp_v1 = [30, 31, 28, 30, 32, 29, 26, 26, 28, 23, 24, 26, 26, 28, 28, \ 31, 27, 29, 28, 29, 29, 28, 28, 28, 28, 29, 27, 25, 20, 19, \ 29, 32, 32, 29, 26, 26, 32, 34, 38, 39, 37, 33, 32, 30, 29, \ 34, 28, 25, 23] self.assertEquals(v1, exp_v1) exp_w1 = [19, 20, 22, 23, 25, 21, 25, 24, 22, 27, 31, 33, 37, 38, 38, \ 36, 41, 43, 47, 48, 45, 45, 42, 39, 39, 42, 19, 42, 32, 30, \ 42, 44, 47, 50, 48, 44, 17, 14, 13, 11, 8, 7, 11, 21, 25, \ 20, 19, 47, 47] self.assertEquals(w1, exp_w1) exp_p000 = [0.0049920000000003, 0.07082279822222158, \ 0.010670762666666705, 0.014893662814814962, \ 0.05954753422222141, 0.06692323555555484, \ 0.02218827851851877, 0.05730432948148176, \ 0.09164231111110999, 0.11063039999999903, \ 0.07689557333333293, 0.05574929066666695, \ 0.15205717333333324, 0.510503367111111, \ 0.13600474074074018, 0.3160871632592622, \ 0.14260223999999969, 0.020969604740741634, \ 0.07576166400000024, 0.43352632888888754, \ 0.24339291022222376, 0.11683840000000191, \ 0.06234385066666788, 0.0069254826666658295, \ 0.049472398222222956, 0.004077568000000049, \ 0.005478324148148441, 0.001810014814814871, \ 0.04792319999999972, 0.0, 0.11909688888888928, \ 0.06675531851851867, 0.34005930666666545, \ 0.019190670222224544, 0.022714595555556102, \ 0.02363960888888848, 0.04932630755555612, \ 0.028551111111111964, 0.0027955200000004095, \ 0.002817744592593219, 0.013583075555555114, \ 0.2548221724444463, 0.007528391111110991, \ 0.04061548088888999, 0.031737780148146724, \ 0.017002571851849876, 0.1769813333333323, \ 0.061945476740739906, 0.7125060266666654] self.assertEquals(p000, exp_p000) exp_p001 = [0.0046080000000002855, 0.028647423999999776, \ 0.052845681777776904, 0.038809448296297094, \ 0.010895132444444356, 0.12177009777777835, \ 0.06019394370370367, 0.010699226074073875, \ 0.0982243555555557, 0.40154737777778016, \ 0.22347775999999855, 0.18181870933333166, \ 0.3616494933333342, 0.1806112995555552, \ 0.14577303703703634, 0.0034079478518515044, \ 0.2535150933333334, 0.04401883970370486, \ 0.17345433599999888, 0.17308700444444436, \ 0.018132423111111077, 0.022254933333333133, \ 0.052258816000000166, 0.010048739555554584, \ 0.06794626844444453, 0.004370432000000051, \ 0.02819989807407561, 0.006367762962963142, \ 0.6432768000000015, 0.2736355555555557, \ 0.05954844444444527, 0.16720023703703696, \ 0.009316693333334796, 0.5805177742222254, \ 0.032240071111111795, 0.01006705777777773, \ 0.06143635911111165, 0.3997155555555576, \ 8.448000000000805e-05, 0.5255093665185175, \ 0.28604359111111133, 0.012100494222221909, \ 0.3957782755555553, 0.008835185777778117, \ 0.009876442074073755, 0.0010596503703702597, \ 0.039907555555555606, 0.0033060788148146308, \ 0.01752064000000065] self.assertEquals(p001, exp_p001) exp_p010 = [0.01580800000000109, 0.43991853511111095, \ 0.02382523733333365, 0.1596414482962953, \ 0.5130249102222195, 0.10615409777777662, \ 0.002949499259259329, 0.10673478162962986, \ 0.004891022222222317, 0.013209599999999733, \ 0.10332842666666649, 0.1244747093333352, \ 0.03738282666666654, 0.2064957440000002, \ 0.024884148148148186, 0.15615461451851684, \ 0.11083775999999886, 0.010866839703704239, \ 0.004494336000000094, 0.014331448888888855, \ 0.4986586453333299, 0.017561600000000257, \ 0.23359214933333552, 0.22917051733333157, \ 0.05838893511111133, 0.0383970986666671, \ 0.001462120296296389, 0.06606554074074122, \ 0.011980799999999877, 0.0, 0.4462364444444414, \ 0.0664002370370377, 0.0726340266666656, \ 0.004958663111111672, 0.02357873777777808, \ 0.08857372444444203, 0.0029261368888889743, \ 0.020337777777778118, 0.20686847999999752, \ 0.0013920331851854889, 0.018452479999999438, \ 0.00484716088888932, 0.006658275555555493, \ 0.04261296355555679, 0.006903997629629396, \ 0.6205938725925908, 0.36701866666666505, \ 0.1253896343703712, 0.19322197333333457] self.assertEquals(p010, exp_p010) exp_p011 = [0.01459200000000103, 0.17794457600000016, \ 0.11799165155555476, 0.41598877392592776, \ 0.09386575644444448, 0.19315256888888976, \ 0.008001611851851947, 0.019928329481481058, \ 0.005242311111111285, 0.04794595555555529, \ 0.3002982399999991, 0.4059572906666669, \ 0.08891050666666664, 0.07305625599999993, \ 0.026671407407407432, 0.001683607703703498, \ 0.19704490666666513, 0.02281138251851927, \ 0.010289664000000117, 0.0057218844444444465, \ 0.0371493546666661, 0.003345066666666631, \ 0.19580518399999866, 0.3325219271111166, \ 0.08019239822222142, 0.04115490133333377, \ 0.007526324148148633, 0.2324233481481492, \ 0.16081919999999966, 0.5156977777777759, \ 0.22311822222222305, 0.16631087407407527, \ 0.0019899733333336236, 0.14999955911111074, \ 0.033466595555555895, 0.03771960888888834, \ 0.0036445297777778743, 0.2847288888888866, \ 0.006251519999999605, 0.2596141890370355, \ 0.38858752000000113, 0.0002301724444444573, \ 0.3500350577777798, 0.009269703111111484, \ 0.002148446814814769, 0.03867723851851886, \ 0.08275911111111132, 0.00669214340740717, \ 0.004751360000000215] self.assertEquals(p011, exp_p011) exp_p100 = [0.11980799999999879, 0.027907868444444307, \ 0.04129723733333381, 0.008772114962962983, \ 0.028367132444444516, 0.0702145422222216, \ 0.21554327703703846, 0.23706722607407538, \ 0.36656924444444156, 0.082329599999999, \ 0.03233109333333362, 0.016840931555555577, \ 0.08553215999999973, 0.015427299555555727, \ 0.2720094814814818, 0.34610661451852076, \ 0.059957760000000714, 0.19156017303703798, \ 0.21121433600000142, 0.2582710044444453, \ 0.061865756444445814, 0.6134016000000012, \ 0.05225881600000055, 0.005042517333332682, \ 0.1437791573333353, 0.042258432000000005, \ 0.12291989807407339, 0.004092207407407501, \ 0.007543466666666573, 0.0, 0.021347555555555793, \ 0.07629179259259218, 0.4619673599999994, \ 0.006238663111111675, 0.18009429333333427, \ 0.12410794666666769, 0.37106835911111075, \ 0.010382222222222482, 0.010146702222223856, \ 0.0007520331851853598, 0.005638257777777585, \ 0.6820240497777759, 0.002377386666666608, \ 0.36019518577777554, 0.5946657754074057, \ 0.008099650370369561, 0.0884906666666671, \ 0.2519674121481454, 0.05528063999999922] self.assertEquals(p100, exp_p100) exp_p101 = [0.11059199999999907, 0.011288575999999958, \ 0.2045196515555538, 0.022858107259259554, \ 0.005190200888888931, 0.12775879111111194, \ 0.5847411674074044, 0.044262551703702906, \ 0.3928974222222245, 0.2988259555555563, \ 0.09396224000000072, 0.05492440177777706, \ 0.20342783999999997, 0.0054580337777778275, \ 0.29154607407407424, 0.0037316077037033123, \ 0.10659157333333487, 0.4021180491851807, \ 0.48356966399999857, 0.10311566222222283, \ 0.0046089102222222865, 0.11683839999999726, \ 0.04380518399999974, 0.00731659377777701, \ 0.19746884266666664, 0.045293567999999985, \ 0.6327352130370342, 0.014396681481481769, \ 0.10125653333333291, 0.07303111111111188, \ 0.010673777777778011, 0.19108598518518363, \ 0.012656640000002016, 0.18871955911110633, \ 0.2556177066666673, 0.05285205333333443, \ 0.46216897422222053, 0.14535111111111115, \ 0.00030663111111114483, 0.14025418903703818, \ 0.11873507555555546, 0.03238661688888772, \ 0.12498261333333217, 0.07835414755555593, \ 0.18505333570370552, 0.0005047940740740295, \ 0.019953777777778015, 0.01344769896296225, \ 0.0013593600000000336] self.assertEquals(p101, exp_p101) exp_p110 = [0.3793919999999994, 0.1733507982222229, \ 0.09220676266666863, 0.09402610725925796, \ 0.24439375644444714, 0.11137479111111008, \ 0.028652278518519068, 0.4415603294814827, \ 0.019564088888889355, 0.009830399999999769, \ 0.0434449066666672, 0.03760173511111153, \ 0.021027839999999878, 0.006240256000000077, \ 0.04976829629629663, 0.1709849410370347, \ 0.04660224000000018, 0.09927004918518634, \ 0.012529664000000305, 0.00853788444444448, \ 0.12674935466666779, 0.09219840000000003, \ 0.19580518400000008, 0.16686148266666403, \ 0.1696928426666671, 0.3979335679999997, \ 0.0328063241481483, 0.14936557037037024, \ 0.0018858666666666348, 0.0, 0.07998577777777786, \ 0.07588598518518534, 0.09867263999999876, \ 0.0016120035555556883, 0.18694570666666555, \ 0.4650120533333325, 0.022012529777778147, \ 0.007395555555555644, 0.7508559644444464, \ 0.0003715223703704551, 0.007659519999999756, \ 0.012973283555556579, 0.0021026133333332956, \ 0.3779097031111094, 0.12935911348148255, \ 0.29563723851852247, 0.18350933333333447, \ 0.5100308100740788, 0.01499135999999991] self.assertEquals(p110, exp_p110) exp_p111 = [0.3502080000000001, 0.07011942400000036, \ 0.45664301511111166, 0.2450103371851844, \ 0.04471557688888963, 0.2026518755555568, \ 0.07772994370370429, 0.08244322607407237, \ 0.020969244444445232, 0.03568071111111079, \ 0.1262617600000014, 0.12263293155555516, \ 0.05001215999999986, 0.002207744000000023, \ 0.05334281481481515, 0.0018435034074071772, \ 0.08284842666666718, 0.20838506192592499, \ 0.02868633600000042, 0.0034087822222222453, \ 0.009442645333333338, 0.01756159999999956, \ 0.1641308159999974, 0.2421127395555576, \ 0.23305915733333074, 0.4265144319999994, \ 0.16887189807407502, 0.5254788740740721, \ 0.025314133333333114, 0.13763555555555645, \ 0.039992888888889355, 0.19006957037037026, \ 0.0027033600000004004, 0.048763107555553936, \ 0.26534229333333104, 0.19802794666666879, \ 0.02741680355555594, 0.10353777777777645, \ 0.02269070222222112, 0.06928892207407435, \ 0.16130048000000022, 0.0006160497777778058, \ 0.11053738666666636, 0.08220763022222277, \ 0.040255108740741584, 0.018424983703704163, \ 0.041379555555556106, 0.027220745481480586, \ 0.0003686400000000121] self.assertEquals(p111, exp_p111)