Search in sources :

Example 56 with Rotamer

use of ffx.potential.bonded.Rotamer in project ffx by mjschnie.

the class RosenbluthChiAllMove method boltzmannTorsionSet.

private TrialSet boltzmannTorsionSet(Torsion tors, int chiIndex, int setSize, String snapSuffix) {
    report.append(String.format("    TrialSet for Chi%d\t\t(Theta uDep uExt)\n", chiIndex));
    TrialSet trialSet = new TrialSet(setSize);
    double[] origChi = RotamerLibrary.measureRotamer(target, false);
    int i = 0;
    while (i < setSize) {
        double theta = rand.nextDouble(360.0) - 180;
        double[] newChi = new double[origChi.length];
        System.arraycopy(origChi, 0, newChi, 0, origChi.length);
        newChi[chiIndex] = theta;
        Rotamer newState = createRotamer(target, newChi);
        RotamerLibrary.applyRotamer(target, newState);
        double uBond = tors.energy(false);
        double criterion = FastMath.exp(-beta * uBond);
        double rng = rand.nextDouble();
        if (rng < criterion) {
            trialSet.theta[i] = theta;
            trialSet.rotamer[i] = newState;
            trialSet.uDep[i] = uBond;
            trialSet.uExt[i] = totalEnergy() - uBond;
            i++;
            writeSnapshot(snapSuffix, true);
            report.append(String.format("       %3s %d:      %5.2f\t%5.2f\t%5.2f\n", snapSuffix, i, theta, trialSet.uDep[i - 1], trialSet.uExt[i - 1]));
        }
    }
    target.revertState(origState);
    updateAll();
    return trialSet;
}
Also used : Rotamer(ffx.potential.bonded.Rotamer)

Aggregations

Rotamer (ffx.potential.bonded.Rotamer)56 Residue (ffx.potential.bonded.Residue)44 MultiResidue (ffx.potential.bonded.MultiResidue)42 RotamerLibrary.applyRotamer (ffx.potential.bonded.RotamerLibrary.applyRotamer)40 IOException (java.io.IOException)12 NACorrectionException (ffx.potential.bonded.NACorrectionException)10 Atom (ffx.potential.bonded.Atom)8 ResidueState (ffx.potential.bonded.ResidueState)8 ArrayList (java.util.ArrayList)7 File (java.io.File)6 PDBFilter (ffx.potential.parsers.PDBFilter)4 BufferedWriter (java.io.BufferedWriter)4 FileWriter (java.io.FileWriter)4 Polymer (ffx.potential.bonded.Polymer)3 TitrationUtils.inactivateResidue (ffx.potential.extended.TitrationUtils.inactivateResidue)3 AminoAcid3 (ffx.potential.bonded.ResidueEnumerations.AminoAcid3)2 RotamerLibrary (ffx.potential.bonded.RotamerLibrary)2 Torsion (ffx.potential.bonded.Torsion)2 Test (org.junit.Test)2 BooleanBuf (edu.rit.mp.BooleanBuf)1