示例#1
0
def test_align_ligands_autodock4():
    from rdkit.rdBase import DisableLog
    DisableLog('rdApp.*')

    ligands_dict = {
        'FXR_10': 'test_data/align_ligands_autodock4/FXR_10.dlg',
        'FXR_12': 'test_data/align_ligands_autodock4/FXR_12.dlg'
    }

    align_data = align_ligands(
        pybel.readfile(
            'pdb',
            'test_data/align_ligands_autodock4/1dvwb_altered.pdb').__next__(),
        ligands_dict,
        poses_reference_structure=
        'test_data/align_ligands_autodock4/FXR_receptor.pdbqt',
        pose_loader='autodock4',
        cluster_docking_data={'FXR_12': 2},
        verbosity=-1)

    with open('test_data/align_ligands_autodock4/results_autodock4.pkl',
              'rb') as fh:
        reference_position = pickle.load(fh)

    for each_name, each_mol in align_data.items():
        assert (extract_coordinates(each_mol) -
                reference_position[each_name]).sum() < dist_tolerance
示例#2
0
def test_align_ligands_superimpose1():
    from rdkit.rdBase import DisableLog
    DisableLog('rdApp.*')

    from mol_util import adjust_query_properties
    from rdkit.Chem.rdMolAlign import GetBestRMS

    ligands_dict = {
        'FXR_10': 'test_data/align_ligands_superimpose/FXR_10.mol2',
        'FXR_12': 'test_data/align_ligands_superimpose/FXR_12.mol2'
    }
    result_file = 'test_data/align_ligands_superimpose/FXR_10_result.pdb'

    align_data = align_ligands(
        pybel.readfile(
            'pdb', 'test_data/align_ligands_pdb/1dvwb_altered.pdb').__next__(),
        ligands_dict,
        reference_pose_superimpose=
        'test_data/align_ligands_superimpose/FXR_10_ref.mol2',
        poses_reference_structure='test_data/align_ligands_pdb/1dvwb.pdb',
        pose_loader='superimpose',
        verbosity=-1)

    resultmol = adjust_query_properties(rdkit.Chem.MolFromPDBFile(result_file))
    assert (GetBestRMS(resultmol, align_data['FXR_10'])) < 0.1
    fxr12rms = GetBestRMS(resultmol,
                          align_data['FXR_12'],
                          map=[[(30, 0), (11, 1), (23, 2), (20, 3), (26, 35),
                                (32, 34), (28, 6), (12, 7), (1, 8), (2, 9),
                                (16, 10), (3, 11), (8, 12), (18, 13), (7, 14),
                                (19, 15), (9, 16), (0, 17), (14, 18), (13, 19),
                                (4, 27), (17, 28), (27, 29),
                                (33, 30), (29, 31), (15, 32), (5, 33), (31, 5),
                                (25, 4)]])
    assert fxr12rms < 1
示例#3
0
def test_align_ligands_pdb1():
    ligands_dict = {
        'FXR_10': 'test_data/align_ligands_pdb/FXR_10.pdb',
        'FXR_12': 'test_data/align_ligands_pdb/FXR_12.pdb'
    }

    align_data = align_ligands(
        pybel.readfile('pdb',
                       'test_data/align_ligands_pdb/1dvwb.pdb').__next__(),
        ligands_dict,
        poses_reference_structure='test_data/align_ligands_pdb/1dvwb.pdb',
        pose_loader='pdb',
        ligand_residue_name='LIG',
        verbosity=-1)

    with open('test_data/align_ligands_pdb/results_pdb1.pkl', 'rb') as fh:
        reference_position = pickle.load(fh)
    for each_name, each_mol in align_data.items():
        assert (extract_coordinates(each_mol) -
                reference_position[each_name]).sum() < dist_tolerance