This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from msmbuilder import io | |
from msmbuilder import MSMLib | |
ass = io.loadh("~/dat/redesign/NTL9/Ward-2500/Assignments.Fixed.h5")["Data"] | |
c = MSMLib.get_count_matrix_from_assignments(ass) | |
m = MSMLib.reversible_MLE_estimator(c) | |
u = m.optimize() | |
c0 = c + c.transpose() | |
c.data[:] = 1. | |
c3 = MSMLib.mle_reversible_count_matrix(c,initial_guess=c0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
LH5reporter.py: Output a trajectory in MSMBuilder LH5 format. | |
This class is for use with the Python OpenMM App. This class allows OpenMM to directly write an MSMBuilder2 LH5 Trajectory. | |
Example: After preparing a simulation in OpenMM, the following code allows OpenMM to directly write to a *h5 file. | |
R1=Trajectory.Trajectory.LoadFromPDB('native.pdb') | |
simulation.reporters.append(LH5Reporter.LH5Reporter('Trajectories/trj0.lh5', 2000,R1)) | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import scipy.cluster | |
import numpy as np | |
import fastcluster | |
num_samples = 1000 | |
similarities = np.loadtxt("./TanimotoMatrix0-1998") | |
distances0 = -1 * np.log(similarities / 1000.) | |
distances = scipy.cluster.hierarchy.distance.squareform(distances0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODEL 1 | |
ATOM 1 N ARG A 1 4.346 7.563 -9.808 1.00 0.00 N | |
ATOM 2 CA ARG A 1 4.638 6.110 -9.659 1.00 0.00 C | |
ATOM 3 C ARG A 1 5.735 5.902 -8.620 1.00 0.00 C | |
ATOM 4 O ARG A 1 6.406 4.889 -8.593 1.00 0.00 O | |
ATOM 5 CB ARG A 1 5.074 5.498 -11.002 1.00 0.00 C | |
ATOM 6 CG ARG A 1 6.311 6.214 -11.563 1.00 0.00 C | |
ATOM 7 CD ARG A 1 6.633 5.650 -12.951 1.00 0.00 C | |
ATOM 8 NE ARG A 1 5.490 5.938 -13.863 1.00 0.00 N | |
ATOM 9 CZ ARG A 1 5.575 5.623 -15.127 1.00 0.00 C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import stdout | |
import simtk.openmm as mm | |
import simtk.openmm.app as app | |
import simtk.unit as u | |
import urllib | |
def write_pdb(pdb_id): | |
url = 'http://www.rcsb.org/pdb/files/%s.pdb' % pdb_id | |
pdb_text = urllib.urlopen(url).read() | |
file_handle = open("%s.pdb" % pdb_id, 'w') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ATOM 1 N GLY A 1 -11.791 0.397 -6.281 1.00 0.00 N | |
ATOM 2 CA GLY A 1 -10.447 1.020 -6.222 1.00 0.00 C | |
ATOM 3 C GLY A 1 -9.768 0.819 -4.872 1.00 0.00 C | |
ATOM 4 O GLY A 1 -10.326 0.200 -3.964 1.00 0.00 O | |
ATOM 5 H1 GLY A 1 -11.723 -0.596 -6.123 1.00 0.00 H | |
ATOM 6 H2 GLY A 1 -12.393 0.795 -5.577 1.00 0.00 H | |
ATOM 7 H3 GLY A 1 -12.205 0.552 -7.186 1.00 0.00 H | |
ATOM 8 HA2 GLY A 1 -9.814 0.587 -6.997 1.00 0.00 H | |
ATOM 9 HA3 GLY A 1 -10.539 2.092 -6.405 1.00 0.00 H | |
ATOM 10 N CYS A 2 -8.548 1.349 -4.721 1.00 0.00 N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mdtraj, mdtraj.geometry | |
import pandas as pd | |
import numpy as np | |
r = mdtraj.load(filename) | |
data = [] | |
for atom in r.top.atoms: | |
data.append((atom.index, atom.name, atom.residue.index, atom.residue.name, atom.residue.chain.index)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import mdtraj, mdtraj.geometry | |
import pandas as pd | |
traj = mdtraj.load("./traj.xtc", top="native.pdb") | |
top, bonds = traj.top.to_dataframe() | |
atoms = np.array(["H", "HA", "N", "CA", "C", "CB"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mdtraj, mdtraj.geometry | |
import pandas as pd | |
traj = mdtraj.load("./traj.xtc", top="native.pdb") | |
atom_names = ["H", "N", "CA", "HA"] | |
resid, atom_indices = mdtraj.geometry.dihedral.atom_sequence_finder(traj, atom_names) | |
dih = mdtraj.geometry.compute_dihedrals(traj, atom_indices) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
import os | |
import tarfile | |
import tempfile | |
import mdtraj | |
import itertools | |
import pandas as pd | |
min_num_gen = 50 |
OlderNewer