当前位置: 首页>>代码示例>>Python>>正文


Python Protool.ligand方法代码示例

本文整理汇总了Python中Protool.ligand方法的典型用法代码示例。如果您正苦于以下问题:Python Protool.ligand方法的具体用法?Python Protool.ligand怎么用?Python Protool.ligand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Protool的用法示例。


在下文中一共展示了Protool.ligand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Model_Mutations_old

# 需要导入模块: import Protool [as 别名]
# 或者: from Protool import ligand [as 别名]
def Model_Mutations_old(pdbfile,mol2files,mutations,max_overlap=0.5,return_score=False):
    """Model a number of mutations in a pdbfile when one or more ligands are present"""
    #
    # Initialise mutate routines
    #
    MUT=Mutate(max_bump=max_overlap)
    #
    # Read PDB file
    #
    import Protool
    P=Protool.structureIO()
    P.readpdb(pdbfile)
    P.remove_all_hydrogens()
    #
    # Read mol2 file
    #
    L=Protool.ligand(P)
    for mol2file in mol2files:
        print "Added %s with tag 'LIGAND'" %mol2file
        L.readmol2(mol2file,tag='LIGAND')
    #
    # Pass combined pdb file to mutate routines and mutate
    #
    MUT.new_PDB(P)
    import pKa.pKD_tools as pKD_tools
    total_bump=0.0
    #
    # Model
    #
    for mutation in mutations:
        #
        # Get info
        #
        resid=pKD_tools.get_resid_from_mut(mutation)
        newres=pKD_tools.get_newrestyp_from_mut(mutation)
        oldres=pKD_tools.get_oldrestyp_from_mut(mutation)
        bump_score=MUT.mutate(resid,newres,orgtype=oldres)
        if bump_score is None or bump_score is False or bump_score>max_overlap:
            print 'Cannot model this set of mutations - too many bumps'
            return False,20.0
        print 'Bump score for %s: %5.3f' %(mutation,bump_score)
        total_bump=total_bump+bump_score
    print 'Total bump score for all mutations: %5.3f' %(bump_score)
    if return_score:
        return MUT,bump_score
    return MUT
开发者ID:yongwangCPH,项目名称:peat,代码行数:48,代码来源:mutate.py

示例2:

# 需要导入模块: import Protool [as 别名]
# 或者: from Protool import ligand [as 别名]
    # Build hydrogens
    import Protool.hydrogens
    H=Protool.hydrogens.Hydrogens(P)
    H.build_all_HNs()
    #
    # Assign charges
    #
    import Protool.assign_parameters
    PQR=Protool.assign_parameters.assign_parameters(P)
    PQR.clear_all_charges_and_radii()
    PQR.set_all_radii()
    #
    # Try loading a ligand
    #
    import Protool.ligand
    L=Protool.ligand(P)
    L.readmol2('substrate_natural.mol2') # Charges are already set
    PQR.set_all_radii()
    tot=0.0
    for residue in P.chains['L']:
        for atom in P.residues[residue]:
            tot=tot+P.atoms[atom]['CHARGE']
    print 'Total charge on ligand before any modification; %5.1f' %tot
    BEFORE=APBS_calc(P,pdie=2.0)
    #
    # Now change the charge
    #
    charge_atom='L:0001:C1'
    P.atoms[charge_atom]['CHARGE']=1.0
    AFTER=APBS_calc(P,pdie=2.0)
开发者ID:yongwangCPH,项目名称:peat,代码行数:32,代码来源:APBS_interface.py

示例3: Model_Mutations

# 需要导入模块: import Protool [as 别名]
# 或者: from Protool import ligand [as 别名]
def Model_Mutations(pdbfile,mol2files,mutations,max_overlap=0.5,max_totalbump=1.0,return_score=False,store_mutation_operations=False):
    """Model a number of mutations in a pdbfile when one or more ligands are present"""
    #
    # Check for stupidity
    #
    if max_overlap>max_totalbump:
        max_totalbump=max_overlap
        print 'Adjusted total bump cutoff to %5.2f' %max_totalbump
    #
    # Read PDB file
    #
    import Protool
    P=Protool.structureIO()
    P.readpdb(pdbfile)
    P.remove_all_hydrogens()
    #
    # Read mol2 file
    #
    L=Protool.ligand(P)
    for mol2file in mol2files:
        print "Added %s with tag 'LIGAND'" %mol2file
        L.readmol2(mol2file,tag='LIGAND')
    #
    # Get the pdb lines
    #
    pdblines=P.writepdb('junk.pdb',nowrite=True)
    #
    # Pass the lines to FFF
    #
    import FFF.FFFcontrol
    myFFF=FFF.FFFcontrol.FFF()
    myFFF.parse_lines(pdblines)
    #myFFF.soup_stat()
    Model=FFF.FFFcontrol.model_class(myFFF,Rotamerlib,FFFaadef_dir)
    #
    # Store the wild type PDB file
    #
    if store_mutation_operations:
        wt_lines=myFFF.make_pdblines('PDB')
    #
    import pKa.pKD_tools as pKD_tools
    total_bump=0.0
    for mutation in mutations:
        resid=pKD_tools.get_resid_from_mut(mutation)
        chainid=resid.split(':')[0]
        resid=resid.split(':')[1]
        #
        # Get rid of the leading zeros
        #
        done=False
        while not done:
            if resid[0]=='0' and len(resid)>1:
                resid=resid[1:]
            else:
                done=True
        #
        newres=pKD_tools.get_newrestyp_from_mut(mutation)
        oldres=pKD_tools.get_oldrestyp_from_mut(mutation)
        opttype=3 # Rotamer library
        energies=Model.Mutate(chainid,resid,newres,opttype,max_overlap)
        bump_score=energies[0]
        Sum=energies[1]
        Coulomb=energies[2]
        #
        total_bump=total_bump+bump_score
        print 'Bump score: %5.2f, total bump: %5.2f' %(bump_score,total_bump)
        if bump_score>max_overlap or total_bump>max_totalbump:
            print 'Cannot model this set of mutations - too many bumps'
            if return_score:
                return False, total_bump
            else:
                return False
        print 'Bump score for %s: %5.3f' %(mutation,bump_score)
    print 'Total bump score for all mutations: %5.3f' %(total_bump)
    class FFF_fix:

        def __init__(self,FFF):
            self.PI=FFF
            return
    #
    # Create the instance
    #
    FFF_instance=FFF_fix(myFFF)
    #
    # Keep track of the changes that were made to the PDB file
    #
    if store_mutation_operations:
        mut_lines=FFF_instance.PI.make_pdblines('PDB')
        import Protool
        WT=Protool.structureIO()
        WT.parsepdb(wt_lines)
        wt_atoms=sorted(WT.atoms.keys())
        #
        MUT=Protool.structureIO()
        MUT.parsepdb(mut_lines)
        #
        mut_atoms=sorted(MUT.atoms.keys())
        wt_count=0
        mutcount=0
        
#.........这里部分代码省略.........
开发者ID:yongwangCPH,项目名称:peat,代码行数:103,代码来源:mutate.py


注:本文中的Protool.ligand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。