コード例 #1
0
def main():
    """
	performs a simple clash check (hard spheres)
	"""

    parser = OptionParser()
    parser.add_option("-p", dest="pdbfile", help="pdbfile")
    parser.add_option("-P", dest="pdblist", help="pdblist")
    parser.add_option("-s", dest="scale", help="scale (0.60)", default=0.60)
    parser.add_option("-S", dest="sele", help="selection")
    parser.set_description(main.__doc__)
    (options, args) = parser.parse_args()

    pdbfiles = []
    if options.pdbfile:
        pdbfiles.append(options.pdbfile)
    elif options.pdblist:
        pdbfiles = files_from_list(options.pdblist)
    else:
        parser.print_help()
        sys.exit()

    myscale = float(options.scale)
    mymol = Enzyme()

    sele = None
    if options.sele:
        sele = Selection()
        sele.makeSelection(options.sele)

    for pdbfile in pdbfiles:
        mymol.readPDB(pdbfile)
        if options.sele:
            reslist = sele.apply_selection(mymol).residueList()
        else:
            reslist = mymol.residueList()

        nres = len(reslist)
        bFail = False
        for i in range(nres):
            for j in range(i + 1, nres):
                if (bResidue_Residue_clash_check(reslist[i], reslist[j],
                                                 myscale)):
                    print pdbfile, reslist[i].file_id, reslist[
                        j].file_id, "FAIL"
                    bFail = True
                    break

            if bFail:
                break

        mymol.clear()
コード例 #2
0
def main():
    """
checks for hydrogen bonds to ligands.  Ligands differ because we don't know
the acceptor antecedants
	"""

    parser = OptionParser()
    parser.add_option("-p", dest="pdbfile", help="pdbfile")
    parser.add_option("-P", dest="pdblist", help="pdblist")
    parser.add_option("-a", dest="acceptors", help="ligand acceptors")
    parser.add_option("-d", dest="donors", help="ligand donors")
    parser.add_option("-c", dest="catalytic", help="catalytic")
    parser.add_option("-x", dest="cutoff", help="cutoff", default=-0.3)
    parser.set_description(main.__doc__)
    (options, args) = parser.parse_args()

    pdbfiles = []
    if options.pdblist:
        pdbfiles = files_from_list(options.pdblist)
    elif options.pdbfile:
        pdbfiles.append(options.pdbfile)
    else:
        parser.print_help()
        sys.exit()

    protein = Enzyme()
    HBN = HBnetwork()

    if options.donors:
        donor_sel = Selection()
        donor_sel.makeSelection(options.donors)

    if options.acceptors:
        acceptor_sel = Selection()
        acceptor_sel.makeSelection(options.acceptors)

    for pdbfile in pdbfiles:
        protein.readPDB(pdbfile)

        ligands = protein.getHeteroAtoms()
        lig = ligands[0]

        residues = []
        if options.catalytic:
            cres = protein.catalytic[int(options.catalytic) - 1]
            #cres = getCatalyticResidue(protein,int(options.catalytic))
            if cres == None:
                print "unable to find catalytic residue!"
                sys.exit()
            residues.append(cres)
        else:
            residues = protein.residueList()

        HBN.createNetwork(reslist=residues)
        if options.donors:
            donors = donor_sel.apply_selection(protein).atomList()

        if options.acceptors:
            acceptors = acceptor_sel.apply_selection(protein).atomList()
            if len(acceptors) == 0:
                print "unable to find acceptors"
                sys.exit()
            for a in acceptors:
                HBN.newAcceptor(A=a, res=lig)

        HBN.findHbonds(cutoff=float(options.cutoff), function=1)

        hblist = HBN.getHbondsToResidue(lig)
        if len(hblist) > 0:
            for Hb in hblist:
                print pdbfile, Hb
        else:
            print pdbfile, " none"

        HBN.clear()
        protein.clear()