コード例 #1
0
def load_complex_from_string(pdb_string, lig_id):
    complex = PDBComplex()  # plip molecule
    complex.load_pdb(pdb_string, as_string=True)
    lig_pdb_string = []
    for line in pdb_string.split('\n'):
        if line[17:20] == lig_id or line[:6] == 'CONECT':
            lig_pdb_string.append(line)
    lig_pdb_string = '\n'.join(lig_pdb_string)
    lig = pybel.readstring('pdb', lig_pdb_string)  # openbabel molecule
    # lig = Chem.MolFromPDBBlock(lig_pdb_string, removeHs=False)  # rdkit molecule
    return complex, lig
コード例 #2
0
 def test_dna_rna(self):
     """Test if DNA and RNA is correctly processed as ligands"""
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1tf6.pdb')
     bsid = 'DA:B:1'
     # DNA ligand four times consisting of 31 parts (composite)
     self.assertEqual([len(ligand.members) for ligand in tmpmol.ligands].count(31), 4)
     for ligset in [set((x[0] for x in ligand.members)) for ligand in tmpmol.ligands]:
         if len(ligset) == 4:
             # DNA only contains four bases
             self.assertEqual(ligset, set(['DG', 'DC', 'DA', 'DT']))
コード例 #3
0
def plip_analysis(pdbpath, pdb_id):
    ''' run PLIP analysis for pdb file '''

    mol = PDBComplex()
    mol.load_pdb(pdbpath)
    chain_id = pdb_id.split('_')[-1]
    ligand_interactions_dict = {}

    # invastigate only proteins with following ligands
    ligand_whitelist = set([
        'NAD', 'FAD', 'NDP', 'NAP', 'NAI', 'ADP', 'AMP', 'ATP', 'FMN', 'GTP',
        'ADN', 'SAH', 'GDP', '5GP', 'ADX', 'LSS', '1ZZ', 'COA', 'ACO', '01A',
        'HMG', 'SAI', 'GRA', 'ST9', 'MCA', 'SAM', 'HEM', 'CLA', 'BCB', 'BCL',
        'HEA', 'HEC', 'HEB', 'HAS'
    ])

    # plip analysis
    ligand_list_from_mol = [x.hetid for x in mol.ligands]
    print('=> ' + str(len(ligand_list_from_mol)) + ' ligands to process')

    # if any ligand of interest present
    #     if not ligand_whitelist.intersection(set(ligand_list_from_mol)):
    #         print('=> No ligands of interest found')
    #         #print(ligand_list_from_mol)
    #         return ligand_interactions_dict

    mol.analyze()
    full_data_mol[pdb_id] = mol

    for bsid in [
            ":".join([x.hetid, x.chain, str(x.position)]) for x in mol.ligands
    ]:
        # for every ligand encountered in pdb
        print bsid
        #print '|',

        interactions = mol.interaction_sets[
            bsid]  # Contains all interaction data
        print interactions.interacting_res
        interacting_residues = [
            int(res[:-1]) for res in interactions.interacting_res
            if res[-1] == chain_id
        ]

        if interacting_residues:
            ligand_interactions_dict[bsid] = interacting_residues
    print '=> ' + str(
        len(ligand_interactions_dict
            )) + ' ligands interacting with chain ' + chain_id + ' found'
    print

    return ligand_interactions_dict
コード例 #4
0
 def test_4alw(self):
     """Binding of benzofuropyrimidinones compound 3 to PIM-1 (4alw)
     Reference:  Tsuhako et al. The design, synthesis, and biological evaluation of PIM kinase inhibitors.(2012)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/4alw.pdb')
     s = tmpmol.interaction_sets['HY7-A-1308']
     # Hydrogen bonds to Asp186
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({186}.issubset(hbonds))
     # Saltbridge to A186 and Glu171
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_pneg}
     self.assertTrue({186, 171}.issubset(saltb))
コード例 #5
0
 def test_1eve(self):
     """Binding of anti-Alzheimer drug E2020 to acetylcholinesterase from Torpedo californica (1eve)
     Reference: Chakrabarti et al. Geometry of nonbonded interactions involving planar groups in proteins. (2007)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1eve.pdb')
     s = tmpmol.interaction_sets['E20-A-2001']
     # Aromatic stacking with Trp84 and Trp279
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({84, 279}.issubset(pistackres))
     # Pi-Cation interaction of Phe330 with ligand
     pication = {pication.resnr for pication in s.pication_paro}
     self.assertTrue({330}.issubset(pication))
コード例 #6
0
 def test_4qnb(self):
     """Binding of (4qnb)
     Reference:  Bhattacharya et al. Structural basis of HIV-1 capsid recognition by PF74 and CPSF6(2014)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/4qnb.pdb')
     s = tmpmol.interaction_sets['1B0-A-301']
     # Hydrogen bonds to Asn57 and Lys70
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({57, 70}.issubset(hbonds))
     # Cation-pi interactions with Lys70
     picat = {pication.resnr for pication in s.pication_laro}
     self.assertEqual({70}, picat)
コード例 #7
0
 def test_1osn(self):
     """Binding of VZV-tk to BVDU-MP (2reg)
     Reference: Bird et al. Crystal structures of Varicella Zoster Virus Thyrimidine Kinase. (2003)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1osn.pdb')
     s = tmpmol.interaction_sets['BVP-A-500']
     # Sandwiched pi-stacking involving Phe93 and Phe139
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({93, 139}.issubset(pistackres))
     # Hydrogen bonding of Gln90
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({90}.issubset(hbonds))
コード例 #8
0
 def test_3thy(self):
     """Binding of ADP tp MutS(3thy)
     Reference:  Shikha et al. Mechanism of mismatch recognition revealed by human MutSβ bound to unpaired DNA loops.(2012)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/3thy.pdb')
     s = tmpmol.interaction_sets['ADP-A-935']
     # Saltbridge to His295 and Lys675
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_lneg}
     self.assertTrue({675}.issubset(saltb))
     # pi-stacking interaction with Tyr815
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({815}.issubset(pistackres))
コード例 #9
0
 def test_3OG7(self):
     """Inhibitor PLX4032 binding to B-RAF(V600E) (3og7)
     Reference: Clinical efficacy of a RAF inhibitor needs broad target blockade in BRAF-mutant
     melanoma (2010)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/3og7.pdb')
     s = tmpmol.interaction_sets['032-A-1']
     # Hydrogen bonds
     hbonds = {
         str(hbond.resnr) + hbond.reschain
         for hbond in s.hbonds_pdon + s.hbonds_ldon
     }
     self.assertTrue({'594A', '530A'}.issubset(hbonds))
コード例 #10
0
 def test_2efj(self):
     """Binding of teobromine to 1,7 dimethylxanthine methyltransferase(2efj)
     Reference:  McCarthy et al. The Structure of Two N-Methyltransferases from the Caffeine Biosynthetic
     Pathway.(2007)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/2efj.pdb')
     s = tmpmol.interaction_sets['37T-A-502']
     # Hydrogen bonds to Trp161, Ser237
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({161, 237}.issubset(hbonds))
     # pi-stacking interaction with Tyr157
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({157}.issubset(pistackres))
コード例 #11
0
 def test_1p5e(self):
     """Binding of TBS to CDK2(1p5e)
     Reference: De Moliner et al. Alternative binding modes of an inhibitor to two different kinases. (2003)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1p5e.pdb')
     bsid = 'TBS:A:301'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Halogen Bonding of Ile10 and Leu83
     halogens = {halogen.resnr for halogen in s.halogen_bonds}
     self.assertTrue({10, 83}.issubset(halogens))
コード例 #12
0
 def test_2reg(self):
     """Binding of choline to ChoX (2reg)
     Reference: Oswald et al. Crystal structures of the choline/acetylcholine substrate-binding protein ChoX
     from Sinorhizobium meliloti in the liganded and unliganded-closed states. (2008)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/2reg.pdb')
     s = tmpmol.interaction_sets['CHT-A-1']
     # Cation-pi interactions with Trp43, Trp90, Trp205, and Tyr119
     picat = {pication.resnr for pication in s.pication_paro}
     self.assertEqual({43, 90, 205, 119}, picat)
     # Saltbridge to Asp45
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_pneg}
     self.assertEqual({45}, saltb)
コード例 #13
0
 def test_4pjt(self):
     """Binding of BMN 673 to catPARP1(4pj7)
     Reference:  Aoyagi-Scharber et al. Structural basis for the inhibition of poly(ADP-ribose) polymerases 1 and 2 by BMN
     673, a potent inhibitor derived from dihydropyridophthalazinone.(2014)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/4pjt.pdb')
     s = tmpmol.interaction_sets['2YQ-D-1104']
     # Hydrogen bonds to Gly863
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({863}.issubset(hbonds))
     # pi-stacking interaction with Tyr889 and Tyr907
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({889, 907}.issubset(pistackres))
コード例 #14
0
 def test_1vsn(self):
     """Binding of NFT to Cathepsin K (1vsn)
     Reference: Li et al. Identification of a potent and selective non-basic cathepsin K inhibitor. (2006)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1vsn.pdb')
     bsid = 'NFT:A:283'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Hydrogen bonding to Gly66
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({66}.issubset(hbonds))
コード例 #15
0
 def test_3o1h(self):
     """Binding of TMAO to TorT-TorS system(3o1h)
     Reference:  Hendrickson et al. An Asymmetry-to-Symmetry Switch in Signal Transmission by the Histidine Kinase Receptor
     for TMAO.(2013)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/3o1h.pdb')
     s = tmpmol.interaction_sets['TMO-B-1']
     # Hydrogen bonds to Trp45
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({45}.issubset(hbonds))
     # Water bridges to Trp45 not detected due to priorization of hydrogen bonds
     # Cation-pi interactions with Tyr44
     picat = {pication.resnr for pication in s.pication_paro}
     self.assertEqual({44}, picat)
コード例 #16
0
 def test_3tah(self):
     """Binding of BGO to an an N11A mutant of the G-protein domain of FeoB.(3tah)
     Reference:  Ash et al. The structure of an N11A mutant of the G-protein domain of FeoB.(2011)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/3tah.pdb')
     s = tmpmol.interaction_sets['BGO-A-300']
     # Hydrogen bonds to Ala11, Lys14, Thr15, Ser16, Asp113, Met114, Ala143 and Asp113
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({11, 13, 14, 15, 16, 113, 114, 143,
                      113}.issubset(hbonds))
     # Water bridges to Ala11 not detected due to prioritization of hydrogen bonds
     # Saltbridge to Asp116
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_pneg}
     self.assertTrue({116}.issubset(saltb))
コード例 #17
0
 def test_3OG7(self):
     """Inhibitor PLX4032 binding to B-RAF(V600E) (3og7)
     Reference: Clinical efficacy of a RAF inhibitor needs broad target blockade in BRAF-mutant
     melanoma (2010)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/3og7.pdb')
     bsid = '032:A:1'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Hydrogen bonds
     hbonds = {str(hbond.resnr)+hbond.reschain for hbond in s.hbonds_pdon+s.hbonds_ldon}
     self.assertTrue({'594A', '530A'}.issubset(hbonds))
コード例 #18
0
 def test_1acj(self):
     """Binding of Tacrine (THA) to active-site gorge of acetylcholinesterase (1acj)
     Reference: Harel et al. Quaternary ligand binding to aromatic residues in the active-site gorge of
     acetylcholinesterase.. (1993)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1acj.pdb')
     bsid = 'THA:A:999'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # pi-stacking interaction with Phe330 and Trp84
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({330, 84}.issubset(pistackres))
コード例 #19
0
    def test_2pvb(self):
        """Pike parvalbumin binding calcium (2pvb)
        Reference: Harding. The architecture of metal coordination groups in proteins. (2004), Fig. 6
        """

        tmpmol = PDBComplex()
        tmpmol.load_pdb('./pdb/2pvb.pdb')
        bsid = 'CA:A:110'
        for ligand in tmpmol.ligands:
            if ':'.join([ligand.hetid, ligand.chain,
                         str(ligand.position)]) == bsid:
                tmpmol.characterize_complex(ligand)
        s = tmpmol.interaction_sets[bsid]
        # Ca atom with square pyramidal geometry (coordination number 5)
        self.assertEqual(s.metal_complexes[0].coordination_num, 5)
        self.assertEqual(s.metal_complexes[0].geometry, 'square.pyramidal')
コード例 #20
0
 def test_1h2t(self):
     """Binding of methylated guanosine to heterodimeric nuclear-cap binding complex (1h2t)
     Reference: Chakrabarti et al. Geometry of nonbonded interactions involving planar groups in proteins. (2007)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1h2t.pdb')
     s = tmpmol.interaction_sets['7MG-Z-1152']
     # Sandwiched pi-stacking involving Tyr20 and Tyr43
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({20, 43}.issubset(pistackres))
     # Hydrogen bond with R112
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({112}.issubset(hbonds))
     # Salt bridge with D116
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_pneg}
     self.assertTrue({116}.issubset(saltb))
コード例 #21
0
ファイル: plifinder.py プロジェクト: rhara/plifinder
    def __init__(self, protein, ligand, within=7.5):
        self.protein = protein
        self.ligand = ligand

        genASite = GenActiveSite(within=within)

        self.asite = genASite(self.protein, self.ligand)
        renumberResidues(self.asite)

        log(f'nAtoms of asite {self.asite.GetNumAtoms()}')

        complex = Chem.CombineMols(self.asite, self.ligand)
        self.pmol = PDBComplex()
        cont = Chem.MolToPDBBlock(complex).replace('UNL     1', 'MOL     1')
        self.pmol.load_pdb(cont, as_string=True)
        self.pmol.analyze()
コード例 #22
0
 def test_3thy(self):
     """Binding of ADP tp MutS(3thy)
     Reference:  Shikha et al. Mechanism of mismatch recognition revealed by human MutSβ bound to unpaired DNA loops.(2012)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/3thy.pdb')
     bsid = 'ADP:A:935'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Saltbridge to His295 and Lys675
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_lneg}
     self.assertTrue({675}.issubset(saltb))
     # pi-stacking interaction with Tyr815
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({815}.issubset(pistackres))
コード例 #23
0
 def test_4alw(self):
     """Binding of benzofuropyrimidinones compound 3 to PIM-1 (4alw)
     Reference:  Tsuhako et al. The design, synthesis, and biological evaluation of PIM kinase inhibitors.(2012)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/4alw.pdb')
     bsid = 'HY7:A:1308'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Hydrogen bonds to Asp186
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({186}.issubset(hbonds))
     # Saltbridge to A186 and Glu171
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_pneg}
     self.assertTrue({186, 171}.issubset(saltb))
コード例 #24
0
 def test_1eve(self):
     """Binding of anti-Alzheimer drug E2020 to acetylcholinesterase from Torpedo californica (1eve)
     Reference: Chakrabarti et al. Geometry of nonbonded interactions involving planar groups in proteins. (2007)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1eve.pdb')
     bsid = 'E20:A:2001'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Aromatic stacking with Trp84 and Trp279
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({84, 279}.issubset(pistackres))
     # Pi-Cation interaction of Phe330 with ligand
     pication = {pication.resnr for pication in s.pication_paro}
     self.assertTrue({330}.issubset(pication))
コード例 #25
0
 def test_4qnb(self):
     """Binding of (4qnb)
     Reference:  Bhattacharya et al. Structural basis of HIV-1 capsid recognition by PF74 and CPSF6(2014)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/4qnb.pdb')
     bsid = '1B0:A:301'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Hydrogen bonds to Asn57 and Lys70
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({57, 70}.issubset(hbonds))
     # Cation-pi interactions with Lys70
     picat = {pication.resnr for pication in s.pication_laro}
     self.assertEqual({70}, picat)
コード例 #26
0
 def test_1osn(self):
     """Binding of VZV-tk to BVDU-MP (2reg)
     Reference: Bird et al. Crystal structures of Varicella Zoster Virus Thyrimidine Kinase. (2003)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1osn.pdb')
     bsid = 'BVP:A:500'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Sandwiched pi-stacking involving Phe93 and Phe139
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({93, 139}.issubset(pistackres))
     # Hydrogen bonding of Gln90
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({90}.issubset(hbonds))
コード例 #27
0
 def test_1ay8(self):
     """Binding of PLP to aromatic amino acid aminotransferase(1ay8)
     Reference:  Okamoto et al. Crystal structures of Paracoccus denitrificans aromatic amino acid aminotransferase: a
     substrate recognition site constructed by rearrangement of hydrogen bond network..(1998)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1ay8.pdb')
     s = tmpmol.interaction_sets['PLP-A-413']
     # Hydrogen bonds to Gly108, Thr109, Asn194 and Ser257
     hbonds = {hbond.resnr for hbond in s.hbonds_pdon}
     self.assertTrue({108, 109, 194, 257}.issubset(hbonds))
     # Saltbridge to Ly258 and Arg266
     saltb = {saltbridge.resnr for saltbridge in s.saltbridge_lneg}
     self.assertTrue({258, 266}.issubset(saltb))
     # pi-stacking interaction with Trp140
     pistackres = {pistack.resnr for pistack in s.pistacking}
     self.assertTrue({140}.issubset(pistackres))
コード例 #28
0
def plip_analysis_targets(pdbpath, pdb_id, pi_helix_pdb_ids):

    mol = PDBComplex()
    mol.load_pdb(pdbpath)
    chain_id = pdb_id.split('_')[-1]
    ligand_interactions = []

    # plip analysis
    ligand_list_from_mol = [x.hetid for x in mol.ligands]
    print('=> ' + str(len(ligand_list_from_mol)) + ' ligands to process')

    mol.analyze()
    full_data_mol[pdb_id] = mol

    print(target_pdb_plip_data[pdb_id])

    for bsid in [
            ":".join([x.hetid, x.chain, str(x.position)]) for x in mol.ligands
    ]:
        # for every ligand encountered in pdb

        print bsid

        if bsid.split(':')[0] not in target_pdb_plip_data[pdb_id].keys():
            print 'BSID not in PLIP data', bsid
            continue

        if (not target_pdb_plip_data[pdb_id][bsid.split(':')[0]]
                or bsid.split(':')[1] != chain_id):
            continue
        print 'passed filters:', bsid
        #print '|',

        interactions = mol.interaction_sets[
            bsid]  # Contains all interaction data

        pi_helix_pdb_ids_all = [res for reg in pi_helix_pdb_ids for res in reg]
        #print pi_helix_pdb_ids
        #print pi_helix_pdb_ids_all
        for inter in interactions.all_itypes:
            if inter.resnr in pi_helix_pdb_ids_all:
                inter_type = str(type(inter)).strip('<>\'').split('.')[-1]
                print inter_type, inter.resnr, inter.restype, inter.restype_l
                ligand_interactions.append(inter)

    return ligand_interactions
コード例 #29
0
def process_pdb(pdbfile, outpath, as_string=False, outputprefix='report'):
    """Analysis of a single PDB file. Can generate textual reports XML, PyMOL session files and images as output."""
    if not as_string:
        startmessage = '\nStarting analysis of %s\n' % pdbfile.split('/')[-1]
    else:
        startmessage = "Starting analysis from stdin.\n"
    write_message(startmessage)
    write_message('='*len(startmessage)+'\n')
    mol = PDBComplex()
    mol.output_path = outpath
    mol.load_pdb(pdbfile, as_string=as_string)
    # #@todo Offers possibility for filter function from command line (by ligand chain, position, hetid)
    for ligand in mol.ligands:
        mol.characterize_complex(ligand)

    create_folder_if_not_exists(outpath)

    # Generate the report files
    streport = StructureReport(mol, outputprefix=outputprefix)

    config.MAXTHREADS = min(config.MAXTHREADS, len(mol.interaction_sets))

    ######################################
    # PyMOL Visualization (parallelized) #
    ######################################

    if config.PYMOL or config.PICS:
        try:
            from plip.modules.visualize import visualize_in_pymol
        except ImportError:
            from modules.visualize import visualize_in_pymol
        complexes = [VisualizerData(mol, site) for site in sorted(mol.interaction_sets)
                     if not len(mol.interaction_sets[site].interacting_res) == 0]
        if config.MAXTHREADS > 1:
            write_message('\nGenerating visualizations in parallel on %i cores ...' % config.MAXTHREADS)
            parfn = parallel_fn(visualize_in_pymol)
            parfn(complexes, processes=config.MAXTHREADS)
        else:
            [visualize_in_pymol(plcomplex) for plcomplex in complexes]

    if config.XML:  # Generate report in xml format
        streport.write_xml(as_string=config.STDOUT)

    if config.TXT:  # Generate report in txt (rst) format
        streport.write_txt(as_string=config.STDOUT)
コード例 #30
0
 def test_1hii(self):
     """HIV-2 protease in complex with novel inhibitor CGP 53820 (1hii)
     Reference:  Comparative analysis of the X-ray structures of HIV-1 and HIV-2 proteases in complex
     with CGP 53820, a novel pseudosymmetric inhibitor (1995)
     """
     tmpmol = PDBComplex()
     tmpmol.load_pdb('./pdb/1hii.pdb')
     bsid = 'C20:B:101'
     for ligand in tmpmol.ligands:
         if ':'.join([ligand.hetid, ligand.chain, str(ligand.position)]) == bsid:
             tmpmol.characterize_complex(ligand)
     s = tmpmol.interaction_sets[bsid]
     # Water bridges
     waterbridges = {str(wb.resnr)+wb.reschain for wb in s.water_bridges}
     self.assertTrue({'50A', '50B'}.issubset(waterbridges))  # Bridging Ile-B50 and Ile-A50 with ligand
     # Hydrogen bonds
     hbonds = {str(hbond.resnr)+hbond.reschain for hbond in s.hbonds_pdon+s.hbonds_ldon}
     self.assertTrue({'27A', '27B', '29A', '48A', '48B'}.issubset(hbonds))