Skip to content

Instantly share code, notes, and snippets.

View adamwespiser's full-sized avatar

Adam Wespiser adamwespiser

View GitHub Profile
@adamwespiser
adamwespiser / patchFinder
Created January 26, 2012 18:58
java file for HPCC
#!/bin/bash
PFAATHOME=/home/wespisea/work/workspace/pfaat
export PFAATHOME
#$JAVA="java";
/share/bin/java/bin/java -Xmx6144m -Djava.awt.headless=true -Dpfaat.home=$PFAATHOME -classpath $PFAATHOME/lib/jakarta-oro-2.0.jar:$PFAATHOME/lib/pls/JSAP-2.0.jar:$PFAATHOME/lib/commons-collections-3.2.jar:$PFAATHOME/lib/commons-math-1.0.jar:$PFAATHOME/lib/csr/csrApi.jar:$PFAATHOME/lib/csr/GLUE.jar:$PFAATHOME/lib/csr/GLUE-STD_2.1.jar:$PFAATHOME/lib/csr/jacorb.jar:$PFAATHOME/lib/csr/csrServer.jar:$PFAATHOME/lib/colorschemes.jar:$PFAATHOME/lib/pfaat.properties.jar:$PFAATHOME/lib/data.jar:$PFAATHOME/lib/Jmol4pfaat.jar:$PFAATHOME/examples/input.jar:$PFAATHOME/lib/looks-1.3.1.jar:$PFAATHOME/lib/pfaat.jar:$PFAATHOME/lib/pls/Jama-1.0.1.jar com.neogenesis.pfaat.commandline.GetPatches "$@" &
@adamwespiser
adamwespiser / ruby-fmt.clj
Created January 26, 2012 18:58 — forked from blacktaxi/ruby-fmt.clj
Ruby-like string interpolation in Clojure
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))
@adamwespiser
adamwespiser / 4c_p44.clj
Created January 26, 2012 20:32
4clojure problem 44: rotate a sequence
; rotate a sequence
(fn [index col]
(letfn [(rotate [index col]
(nth (iterate #(concat (rest %) (list (first %))) col) index))]
(if (> index 0)
(rotate index col)
(reverse (rotate (* -1 index) (reverse col))))))
@adamwespiser
adamwespiser / 4c_p79.clj
Created January 26, 2012 21:13
4clojure problem 79 Triangle Minimum Path
(fn [col]
(first
(reduce #(map +
(map min (butlast %1)
(rest %1 ))
%2)
(reverse col))))
@adamwespiser
adamwespiser / bwt_unOptimized
Last active January 8, 2016 08:39
Burrows Wheeler Tranformation
(ns bwt.lib)
(defn pTest [ys]
(sort-by #(second %) (map vector (range) ys)))
(defn p [ys]
(map second (sort-by #(first %)
(map list ys (range)))))
(defn recon[s index]
(let [l (vec (map first (sort-by #(second %) (map conj (bwt.lib/pTest s)(range)))))
@adamwespiser
adamwespiser / ceeLow.pl
Created April 3, 2012 21:42
cee low dice game
#!/usr/bin/perl
use strict;
sub rollThree(){
my @array;
foreach my $num (0..2){
$array[$num] = 1 + int(rand(5));
}
return \@array;
}
@adamwespiser
adamwespiser / runJob.pl
Created April 19, 2012 19:53
hpcc automated job running
#!/usr/bin/perl
use warnings;
use Getopt::Long;
=begin comment <runJob.pl notes>
The purpose of this script is to make it very easy to run single use jobs on the
cluster by generating a one time use script that is submitted after creation.
Options:
-i input command e.g. "muscle -in ensemblSeqs.fa -out ensembl.aln (required)
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=/home/wespisea/bin/hmmer/binaries:$PATH:/share/bin:/home/wespisea/bin/blast/bin
alias anto="ssh [email protected]"
# User specific aliases and functions
alias pf="cd /home/wespisea/work/research/researchProjects/proteins/patchFinder"
@adamwespiser
adamwespiser / .bashrc
Created May 2, 2012 19:02
bashrcAndVimRC
PS1="\!@local:\W$ "
export CLICOLOR=true
export PATH=$PATH:/Users/dcaffrey/bin:/usr/local/mysql-5.1.41-osx10.5-x86/bin:/Users/dcaffrey/programs/muscle3.6_src:/Users/dcaffrey/programs/ViennaRNA-1.8.3/bin:/Users/dcaffrey/programs/blast-2.2.14/bin:/Users/dcaffrey/programs/hmmer-3.0-macosx-intel/binaries:/Users/dcaffrey/programs/wise2.2.0/src/bin:/Users/dcaffrey/programs/clustalw-2.0.12-macosx/:/Users/dcaffrey/programs/scwrl4:/Users/dcaffrey/programs/meme/bin:/usr/local/mysql/bin/:/Users/dcaffrey/programs/mrbayes/mrbayes-3.1.2:/Users/dcaffrey/programs/usr/local/bin:/Users/dcaffrey/programs/ligplot/hbplus:/Users/dcaffrey/programs/glam-src:/Users/dcaffrey/programs/rosetta3.1Bundles/rosetta_source/bin:/Users/adam/work/scripts/other:/Users/adam/work/scripts/ensembl/modules/:/Users/adam/bin:/Users/adam/work/scripts/other/modules
#PERL5LIB=${PERL5LIB}:/Users/dcaffrey/programs/bioPerl/bioperl-live:/Users/dcaffrey/programs/ensemblApi/ensembl/modules:/Users/dcaffrey/programs/ensemblApi/ensembl-compara/modules:/Users/dcaff
@adamwespiser
adamwespiser / joshua.py
Last active October 16, 2023 03:08
A basic python script that plays a human player in a game of tic tac toe
#!/usr/bin/python
# Copyright Adam Wespiser, 2012
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of