Skip to content

Instantly share code, notes, and snippets.

View adamwespiser's full-sized avatar

Adam Wespiser adamwespiser

View GitHub Profile
@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 adam@anto.umassmed.edu"
# 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 / core.clj
Created May 21, 2012 04:16
Turing Machine Implementation in Clojure
(ns turing.core)
;; define moves
;; delta(state, symbol) -> (new state, new symbol, direction of movement)
(def m {[:q0 1] [:q0 1 1],
[:q0 0] [:q1 1 1],
[:q1 1] [:q1 1 1],
[:q1 :B] [:q2 :B -1],
[:q2 1] [:q3 0 -1],
[:q3 1] [:q3 1 -1],
@adamwespiser
adamwespiser / backUpDir.pl
Created September 12, 2012 02:57
perl script to recursively copy a folder data information(kinect project)
#!/usr/bin/perl
use strict;
use warnings;
my $initials = "AW";
my $src = $ARGV[0];
my $trg = $ARGV[1];
$trg =~ s/\/$//g;
@adamwespiser
adamwespiser / Fasta.py
Created November 13, 2012 12:36
Fasta module for python
class Dna:
''' Object representing a FASTA record. '''
def __init__(self, header, sequence):
self.head = header
self.seq = sequence
def __repr__(self):
return '[HTML]' % (self.head)
def __str__(self, separator=''):
return '>%s\n%s' % (self.head, separator.join(self.seq))
def __len__(self):
@adamwespiser
adamwespiser / awSeqLib.py
Created November 13, 2012 12:37
Solution to rosalind's 'GRPH' problem
class Dna:
''' Object representing a FASTA record. '''
def __init__(self, header, sequence):
self.head = header
self.seq = sequence
def __str__(self, separator=''):
return ">{0}\n{1}".format(self.head, separator.join(self.seq))
def __len__(self):
return len(''.join(self.seq))
@adamwespiser
adamwespiser / README
Created November 17, 2012 09:14
Solution to rosalind.info's 'long' problem
Problem: Given a set of string, find the shortest common superstring such that every string is a subset of the superstring.
http://rosalind.info/problems/long/ is the location of the problem
http://www.cs.hunter.cuny.edu/~saad/courses/compbio/lectures/lecture15.pdf is a good resource on how to solve the problem, also
"Approximation Algorithms" by Vazirani.
Usage: python long.py --file [input seq file]
@adamwespiser
adamwespiser / README
Created November 18, 2012 08:37
Solution to rosalind's "corr" problem
Solution to rosalind's "CORR" problem.
http://rosalind.info/problems/corr/
The problem is:
Given a collection of reads(same size), a read is either:
1) Correct, and is the same as another read or its reverse trans
2) Incorrect by a point mutation, and the thus one base pair difference between the read and a correct read. (Hamming distance = 1)
report incorrect reads and their correct counterparts.
There is a strong assumption that a read must be either correct or incorrect, and that all incorrect reads map to at least one correct read.
@adamwespiser
adamwespiser / sample output
Created December 26, 2012 03:43
attempt at random.shuffle using mergesort with random comparison
# Copyright (c) 2012 the authors listed at the following URL, and/or
# the authors of referenced articles or incorporated external code:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions: