Skip to content

Instantly share code, notes, and snippets.

@amackey
amackey / post-commit
Created September 18, 2013 20:46
Subversion post-commit hook that talks to JIRA
#!/usr/bin/perl
use warnings;
use strict;
use SVN::Hooks;
use SVN::Hooks::CheckJira;
use WWW::Mechanize;
@amackey
amackey / GOrilla.pl
Last active June 20, 2020 14:57
command line utility to upload gene lists to GOrilla, and download results table(s).
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
use Getopt::Long;
my $GOrillaURL = "http://cbl-gorilla.cs.technion.ac.il/";
@amackey
amackey / lca.R
Created November 26, 2012 16:24
simple LCA in R
# Copyright 2012 Aaron J. Mackey
# 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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@amackey
amackey / gist:1771011
Created February 8, 2012 16:48
ftable example
ftable(xtabs(~., mergedSigGeneInfo[sub, fdrs[1:9]] <= 0.01, drop.unused=T), col.vars=c(7,8,9))
#!/usr/bin/perl
use strict;
use warnings;
use WordPress::API::MediaObject;
use WordPress::API::Post;
use YAML qw(LoadFile);
use Getopt::Long qw(GetOptions);
model {
# fracs[1:10] ~ ddirch(alpha[1:10])
# for (k in 1:10) {
# fracs[k] <- delta[k]/sum(delta[1:10]);
# delta[k] ~ dgamma(alpha[k], 1)
# }
a2[1] <- sum(alpha[2:10]);
fracs[1] ~ dbeta(alpha[1], a2[1]);
@amackey
amackey / ncbi_decrypt
Created January 9, 2011 14:16
ncbi_decrypt: utility script to submit decryption jobs to PBS cluster
#!/usr/bin/perl
use strict;
use warnings;
my $path = shift @ARGV;
$path ||= $ENV{PWD};
unless ($path =~ m/^\//) {
$path = "$ENV{PWD}/$path";
@amackey
amackey / elevator.R
Created January 5, 2011 14:59
elevator simulation code
nmin <- 120;
time <- nmin * 60;
lambda <- 10/60; # 10 passengers every minute, on average
arrivals <- rpois(time, lambda);
population <- sum(arrivals);
nelev <- 4; # number of elevators
nfloor <- 7; # number of floors
elevators <- matrix(1, ncol=nelev, nrow=time)