예제 #1
0
                path = os.path.join(drug, "ca_%s_%s.pdb" % (protein, drug))
                print "Working with", path
                pdb = parsePDB(path, subset="ca", csets=range(1000))
                print "Loaded"
                for motif in ordered_motifs:
                    if motif in motifs[protein]:
                        cas = pdb.select("name CA")
                        motif_cas = pdb.select(
                            "resid %d to %d" % (motifs[protein][motif][0], motifs[protein][motif][1])
                        )
                        calculator = RMSDCalculator(
                            calculatorType="QCP_OMP_CALCULATOR",
                            fittingCoordsets=cas.getCoordsets(),
                            calculationCoordsets=motif_cas.getCoordsets(),
                        )
                        rmsds = calculator.oneVsFollowing(0)
                        rmsd_results[protein]["RMSD"].extend(rmsds)
                        rmsd_results[protein]["Drug"].extend([drug] * len(rmsds))
                        rmsd_results[protein]["Motif"].extend([motif] * len(rmsds))
                        del cas
                        del motif_cas
                del pdb

        pickle.dump(rmsd_results, open(os.path.join(options.results, "rmsd_results.pickle"), "w"))
    else:
        rmsd_results = pickle.load(open(options.data))

    f, axes = plt.subplots(3, 2, sharey="row")
    f.subplots_adjust(hspace=0.4, wspace=0.1)
    f.set_size_inches(10, 18, forward=True)