This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
library("animation") | |
# reformat a directory full of R source files | |
tidy.all <- function(inDir = NULL, outDir = NULL, ...) { | |
if (is.null(inDir) || is.na(outDir)) | |
stop("inDir can't be null or NA") | |
if (!file.info(inDir)$isdir) | |
stop("inDir must be a directory") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
################################################################################ | |
# Created By: Keith Sheppard ([email protected]) | |
# Modification History: | |
# July 7, 2008: Initial revision created to run the liftover utility on | |
# the CGD (cgd.jax.org) imputed SNP data in comma-separated format | |
# | |
# This is a ruby script for running liftover to map SNPs in a source | |
# comma-separated file to a destination file using a different NCBI genome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $status_output = `svn status @ARGV`; | |
my @split_status_lines = split(/\n/, $status_output); | |
foreach(@split_status_lines) | |
{ | |
if($_ =~ /^M.{5}\s+(.*)$/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "input directory: $1" | |
echo "output directory: $2" | |
for i in `ls $1` ; do echo "striping N and H calls from: $i" && egrep -v '(,N,)|(,N$)|(,H,)|(,H$)|(,n,)|(,n$)|(,h,)|(,h$)' $1/$i > $2/$i; done | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The liftover web app and command line download: | |
http://genome.ucsc.edu/cgi-bin/hgLiftOver | |
mapping from build # to dates and version numbers: | |
http://genome.ucsc.edu/FAQ/FAQreleases | |
chain files for converting from one build to another: | |
http://hgdownload.cse.ucsc.edu/downloads.html#mouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# attach and detach a package: | |
library("MouseDivGeno") | |
detach(package:MouseDivGeno) | |
# start in 64 bit mode: | |
R --arch x86_64 | |
# Stack-trace in R: | |
traceback() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("RHmm") | |
sunProb <- c(0.6, 0.2, 0.15, 0.05) | |
cloudProb <- c(0.25, 0.25, 0.25, 0.25) | |
rainProb <- c(0.05, 0.10, 0.35, 0.50) | |
weatherDist <- distributionSet(dis="DISCRETE", proba=list(sunProb, cloudProb, rainProb), labels =c("DRY", "DRYISH", "DAMP", "SOGGY")) | |
weatherTransitions <- rbind(c(0.5, 0.375, 0.125), c(0.25, 0.125, 0.625), c(0.25, 0.375, 0.375)) | |
weatherHmm <- HMMSet(initProb=c(0.63, 0.17, 0.20), transMat=weatherTransitions, distribution=weatherDist) | |
weatherPath <- viterbi(HMM=weatherHmm, obs=c("DRY", "DAMP", "SOGGY", "SOGGY", "DRYISH")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To get rid of shadows in screen captures: | |
defaults write com.apple.screencapture disable-shadow -bool true | |
To manipulate file attributes use xattr: | |
usage: xattr [-l] file [file ...] | |
xattr -p [-l] attr_name file [file ...] | |
xattr -w attr_name attr_value file [file ...] | |
xattr -d attr_name file [file ...] | |
The first form lists the names of all xattrs on the given file(s). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# exit on error and don't allow the use of unset variables | |
set -o errexit | |
set -o nounset | |
#NOTE: you can find a list of special variables at http://tldp.org/LDP/abs/html/internalvariables.html | |
# quietly execute GUI applications | |
function quietly() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# grep through git history | |
for i in {1..20} | |
do | |
echo "### check master~$((i - 1)) vs master~${i} diff ###" | |
git diff "master~$((i - 1))" "master~${i}" | grep -i 'sample-index' | |
done | |
# merge logs across several projects | |
(echo "commit time,author,project,message"; \ | |
(for i in `"ls" -d */`; do (cd $i; git log "--pretty=tformat:%ai,%an,$i,%s") 2>/dev/null; done \ |
OlderNewer