コード例 #1
0
    ligand = hf.getLines(argv[1])
    name = os.path.basename(argv[1])
    name = os.path.splitext(name)[0]

    try:
        if argv[2] =='-d':
            DEBUG=True
    except:
        pass

    lig_atoms = hf.getAtoms(ligand)
    ligand_rings = searchPiGroupsLig(lig_atoms)
    if not ligand_rings:
        print "No rings in the ligand"
        exit()
    else:
        outname = name+"_vector.pdb"
        print "Writing out centroid and normals [ %s ]" % outname

        out = open(outname, 'w')
        for i in ligand_rings:
            print "RING", i
            res = ligand_rings[i]
            for n in res['normal']:
                v = hf.vecSum( res['centroid'], n )
                out.write( hf.makePdb(coord=v)+'\n' )
            out.write( hf.makePdb(coord=res['centroid'])+'\n' )
        out.close()