Skip to content

Instantly share code, notes, and snippets.

View kyleabeauchamp's full-sized avatar

Kyle Beauchamp kyleabeauchamp

View GitHub Profile
@kyleabeauchamp
kyleabeauchamp / ExperimentalData.ipynb
Last active August 29, 2015 13:57
Examples for EXPT data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
<?xml version="1.0" ?>
<State time="0" type="State" version="1">
<PeriodicBoxVectors>
<A x="8.294880307685814" y="0" z="0" />
<B x="0" y="8.294880307685814" z="0" />
<C x="0" y="0" z="8.294880307685814" />
</PeriodicBoxVectors>
<Parameters MonteCarloPressure="1.01325" />
<Energies KineticEnergy="143998.28275239374" PotentialEnergy="23807.646244278643" />
<Positions>
@kyleabeauchamp
kyleabeauchamp / dipole.py
Created July 2, 2014 22:15
calculate dipole moment
import mdtraj as md
import numpy as np
def dipole_moment(traj, charges):
"""Compute the dipole moment of an MDTraj object."""
xyz = md.compute_displacements(traj, np.array([[0, i] for i in range(traj.n_atoms)])).astype('float')
return xyz.transpose(0, 2, 1).dot(charges)
@kyleabeauchamp
kyleabeauchamp / bench.py
Last active August 29, 2015 14:05
MBAR benchmark with lots of empty states
import pandas as pd
import numpy as np
import pymbar
samples_per_state = 250
n_states = 100
rates = np.linspace(1, 3, n_states)
N_k = np.ones(n_states, 'int') * samples_per_state
n_samples = n_states * samples_per_state
@kyleabeauchamp
kyleabeauchamp / test_mdtraj_on_pdb.py
Last active August 29, 2015 14:05
Test MDTraj on PDB
import os
import mdtraj as md
import gzip
import tempfile
import glob
directories = glob.glob("./all_pdb/*")
for directory in directories:
filenames = glob.glob("%s/*.gz" % directory)
for filename in filenames:
@kyleabeauchamp
kyleabeauchamp / out.txt
Last active August 29, 2015 14:06
MPI Tests
-bash-4.1$ cat mpitest.o2365443
3,2,1
3,2,1
3,2,1
3,2,1
gpu-1-4.local
gpu-1-4.local
gpu-1-4.local
gpu-1-5.local
grep: /var/spool/torque/aux/2365443.mskcc-fe1.localgpu: No such file or directory
@kyleabeauchamp
kyleabeauchamp / selection.py
Created November 16, 2014 15:59
mdtraj selection
import mdtraj as md
import simtk.openmm.app as app
import pdbfixer
fixer = pdbfixer.PDBFixer(pdbid='4fmu')
fixer.findMissingResidues()
fixer.findNonstandardResidues()
fixer.replaceNonstandardResidues()
fixer.findMissingAtoms()
fixer.addMissingAtoms()
@kyleabeauchamp
kyleabeauchamp / script
Created November 19, 2014 21:29
script.sh
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
import simtk.openmm.app as app
import numpy as np
import simtk.openmm as mm
from simtk import unit as u
from openmmtools import integrators, testsystems
temperature = 300 * u.kelvin
testsystem = testsystems.WaterBox()
@kyleabeauchamp
kyleabeauchamp / mle_test.py
Created November 1, 2012 04:25
Test driver for new mle_code
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)