Skip to content

Instantly share code, notes, and snippets.

@jhjensen2
jhjensen2 / gist:4701339
Created February 3, 2013 11:13
A simple JSmol example The page can be found at http://propka.ki.ku.dk/~jhjensen/jsmoltest.html JSmol can be found at http://chemapps.stolaf.edu/jmol/jsmol/test2.htm
DOCTYPE html>
<html>
<title>A simple Jsmol example</title>
<head>
<script type="text/javascript" src="jsmol/JSmoljQuery.js"></script>
<script type="text/javascript" src="jsmol/JSmolCore.js"></script>
<script type="text/javascript" src="jsmol/JSmolApplet.js"></script>
<script type="text/javascript" src="jsmol/JSmolApi.js"></script>
<script type="text/javascript" src="jsmol/j2s/j2sjmol.js"></script>
<script type="text/javascript" src="jsmol/JSmol.js"></script>
background white;
load /Users/jan/Dropbox/presentation/BBL/1L2Y.pdb;
reset;
center {-1.231 1.8259997 0.04649973};rotate z 2.0; zoom 84.74; translate x 0.04; translate y 0.07;
spin y;delay 10;spin off;delay 1;
select all;color atoms amino;delay 1;spin y;delay 10;spin off;delay 3;
display 1;delay 5;
display 2;delay 1;
display 3;delay 1;
display 4;delay 1;
@jhjensen2
jhjensen2 / Emin.py
Last active December 20, 2015 02:59
A simple energy minimization program that uses steepest descent and a force field to minimize the energy of water in internal coordinates
# A simple energy minimization program that uses steepest descent
# and a force field to minimize the energy of water in internal coordinates
# Written by Jan H. Jensen, 2013, released in the the GNU GPL license
kOH = 50.0
rOHe = 0.95
kHOH = 50.0
thetaHOHe = 104.5
c = 0.005
@jhjensen2
jhjensen2 / opt.py
Last active August 5, 2021 18:43
This python program extracts coordinates and gradients from a GAMESS output file and creates a .xyz+vib file. Note that the sign of the gradient is changed to produce the force To use it type (assuming opt.py and the output file is in the same directory): python opt.py x xx > xxx.xyz where x is the number of atoms in the molecule and xx is the n…
"""\
This python program extracts coordinates and gradients from a GAMESS output
file and creates a .xzy+vib file. Note that the sign of the gradient is chaged to produce the force
To use it type (assuming opt.py and the output file is in the same directory):
python opt.py x xx > xxx.xyz
where x is the number of atoms in the molecule and xx is the name of the GAMESS output file. xxx is whatever you want to call your xyz file.
@jhjensen2
jhjensen2 / read.py
Last active September 27, 2015 11:42
This program finds the last heat of formation in all GAMESS log files for semiempirical geometry optimizations
"""
type "python read.py" to use
This program finds the last heat of formation in all GAMESS log files
for semiempirical geometry optimizations
"""
import string
from glob import glob
@jhjensen2
jhjensen2 / readv2.py
Created October 3, 2015 09:56
This program finds the last heat of formation in all GAMESS log files for semiempirical geometry optimizations
"""
type "python readv2.py *.log" to use
This program finds the last heat of formation in all GAMESS log files
for semiempirical geometry optimizations
"""
import sys
for filename in sys.argv[1:]:
#!/bin/csh
# Molget: cshell script to get coordinates from chemical name using Babel and Cactus
# usage: ./molget methane
# (remember to "chmod 755 molget)
#
set molecule = $argv[1]
curl https://cactus.nci.nih.gov/chemical/structure/$molecule/smiles -o $molecule.smi
babel -ismi $molecule.smi -oxyz $molecule.xyz --gen3D
@jhjensen2
jhjensen2 / montage.spt
Created April 16, 2016 08:45
Jmol script for the computational chemistry movie
cd /Applications/jmol-11.7.26/models/
background white
frank off
hide all
delay 2
display atomno=8; delay 2
display atomno=8,atomno=4; delay 2
display atomno=8,atomno=4,atomno=2; delay 1
display atomno=8,atomno=4,atomno=2; delay 1
display atomno=8,atomno=4,atomno=2,atomno=1; delay 1
smiles = "CCCC"
subst = ["F","Cl"]
l = list(smiles)
print l
s = ""
print l[1]+l[2]+l[3]
for i in range(len(subst)):
import subprocess
file = open("names", "r+")
for line in file:
name = line.split()
subprocess.call(['./name2smiles', name[0]])
subprocess.call(['echo'])