Skip to content

Instantly share code, notes, and snippets.

View bryan-lunt's full-sized avatar

Bryan Lunt bryan-lunt

  • Department of Computer Science, UC San Diego
  • Urbana, Illinois
View GitHub Profile
'''
Created on Jun 29, 2010
@author: [email protected]
'''
from Bio.Seq import Seq
import Bio.PDB as PDB
import Bio.PDB.Polypeptide as PP
from itertools import izip, count
@bryan-lunt
bryan-lunt / matrixDisplay.py
Created September 12, 2012 20:07
Display A Matrix in Pylab, with custom tics.
'''
Created on Jun 1, 2012
@author: lunt
SOME CODE TAKEN FROM: http://stackoverflow.com/questions/3529666/matplotlib-matshow-labels
'''
import pylab
#!/usr/bin/env python
'''
Created on Jan 18, 2013
@author: lunt
'''
import sys
import Bio.pairwise2 as PW
@bryan-lunt
bryan-lunt / gist:5695194
Created June 2, 2013 22:33
Patch to fix bad printf strings in jnet.c
diff --git a/src/jnet.c b/src/jnet.c
index e0cd13e..81df7a9 100644
--- a/src/jnet.c
+++ b/src/jnet.c
@@ -1144,7 +1144,7 @@ void dopred(alldata *data[],int count,int printsty)
if (nohmm == 1 && nopsi == 1){
- fprintf (stderr, "\nWARNING!: Only using the sequence alignment\n Accuracy will average 71.6%\n\n");
+ fprintf (stderr, "\nWARNING!: Only using the sequence alignment\n Accuracy will average 71.6%%\n\n");
@bryan-lunt
bryan-lunt / privatemodules
Last active January 4, 2016 01:19
A replacement for the "use.own" module that allows one to separate their private modules by cluster. The advantage of using this instead of just making a conditional "module use --append $CLUSTER_SPECIFIC_PATH" in your .profile is that you can turn this off and on with "module load privatemodules" and "module unload privatemodules" INSTALLATION:…
#%Module1.0#####################################################################
##
## privatemodules modulefile
##
## An alternative to use.own that lets you have a per-cluster private module directory,
## and automatically loads the appropriate one.
##
## Expects to be installed in ~/.privatemodules/base/privatemodules
##
proc ModulesHelp { } {
set style data lines
set term aqua 1
set title "absolute speed"
plot "data" u 3
set term aqua 2
set title "absolute windspeed"
plot "data" u 4
@bryan-lunt
bryan-lunt / probabilities_female_speakers.py
Created May 8, 2014 22:22
Calculate and graph the probabilities of only N (or fewer) female speakers at a conference of M, at various compositions of female/male for the field.
#!/usr/bin/env python
import scipy as S
import scipy.misc as MISC
import pylab
ticks=100
KP = 26
@bryan-lunt
bryan-lunt / TelescopeFocus
Last active August 29, 2015 14:02
Electric focus for my telescope
#include <Servo.h>
/*
The buttons switch in a voltage divider so that the left and right buttons both use the same pin.
The speed controller is a potentiometer.
/*
@bryan-lunt
bryan-lunt / xephem.rb
Last active August 29, 2015 14:05
Homebrew formula for Xephem : http://www.clearskyinstitute.com/xephem/ SEE TERMS THERE.
require "formula"
# Documentation: https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook
# /usr/local/Library/Contributions/example-formula.rb
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Xephem < Formula
homepage ""
url "http://97.74.56.125/free/xephem-3.7.6.tar.gz"
sha1 "2b07e05b7ea1fe72f5f52983a15b34c7f7b2d75b"
@bryan-lunt
bryan-lunt / telescope_resolution
Created December 22, 2014 18:04
Calculate Telescope properties
import scipy as S
import pylab
#My Cheap Telescope
APPERTURE = 0.114
FOCAL_LENGTH= 0.910
#http://en.wikipedia.org/wiki/Visible_spectrum
min_visible = 380e-9