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
## Corey Chivers, 2012 ## | |
sim_bayes<-function(p=0.5,N=100,y_lim=20,a_a=2,a_b=10,b_a=8,b_b=3) | |
{ | |
## Simulate outcomes in advance | |
outcomes<-sample(1:0,N,prob=c(p,1-p),replace=TRUE) | |
success<-cumsum(outcomes) | |
for(frame in 1:N) | |
{ | |
png(paste("plots/",1000+frame,".png",sep="")) |
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
#http://samtools.sourceforge.net/mpileup.shtml | |
SAMDIR=/usr/local/package/samtools-0.1.18 | |
SAMTOOLS=$(SAMDIR)/samtools | |
BCFTOOLS=$(SAMDIR)/bcftools/bcftools | |
BWA=/usr/local/package/bwa-0.6.1/bwa | |
REF=chr22.fa | |
.INTERMEDIATE : align.sam random_1.sai random_2.sai align.bam variations.bcf |
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
fh293@newt:~$ sudo -u postgres psql | |
psql (9.1.6) | |
Type "help" for help. | |
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0'; | |
UPDATE 1 | |
postgres=# \c template0 | |
You are now connected to database "template0" as user "postgres". | |
template0=# update pg_database set datistemplate = FALSE where datname = 'template1'; | |
UPDATE 1 |
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
# Generate a Monte Carlo sample using Sobol' low-discrepancy quasi-random sequences | |
# James Keirstead | |
# 3 February 2012 | |
# | |
# Random sampling with R's standard methods is inefficient for Monte Carlo analysis as | |
# the sampled values do not cover the parameter space evenly. This Gist allows users | |
# to create parameter samples using Sobol' sequences to get around this problem. | |
# makeMCSample | |
# Makes a Monte Carlo sample using Sobol' sequences |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 41 columns, instead of 39. in line 2.
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
"","X","Lake.ID","Name","treatment","shorline","sizehectars","elevation","UTM.zone","northing","easting","BUBO.breeding","BUBO.breeding2","PSRE.breeding.Y.N","RACA.y.n","veg.extent","X..of.transects.with.veg","bank.slope","silt.0.1.","silt.total","X10cm.area","vegetated.area","RACA.1K","lakes.1k","dist.ave","ls","raca.basin","fish.basin","lakes.basin","co.lakes.basin","ls2","woody","herbacious","unveg","total","woodyprop","herbprop","unvegprop","logveg","archerb","arcsilt" | |
"1",1,531,"Mill Creek",0,377.96,0.713,2008.9368,10,518882,4565085,"y",1,"n","y",0.691,0.682,0.308095216,0.6818,0.71212,111.5,261.17,3,4,0.5538,0.75,3,0,3,0,1,6082255.229,54367.17182,1399749.194,7536371.595,0.807053521,0.007213972,0.185732508,2.41692328905509,0.0850375574910141,1.00445938904933 | |
"2",2,533,"East Boulder",1,1356.4,11.4,2034.8448,10,518069,4564441,"y",1,"y","y",2.28,0.292,0.092475736,0.376,0.3472,980.56,3092.59,5,10,0.8268,0.5,4,4,8,2,0.5,5699686.549,1302747.189,1470012.242,8472445.979,0.67273212,0.15376282,0.173505059,3.4903223 |
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
## Simulate Grime Dice ## | |
red<-c(4,4,4,4,4,9) | |
blue<-c(2,2,2,7,7,7) | |
olive<-c(0,5,5,5,5,5) | |
yellow<-c(3,3,3,3,8,8) | |
magenta<-c(1,1,6,6,6,6) | |
## Play n match-ups between d1 and d2 |
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
#initialize | |
library(datasets) | |
library(ggplot2) | |
#helper function (convert vector to named list) | |
namel<-function (vec){ | |
tmp<-as.list(vec) | |
names(tmp)<-as.character(unlist(vec)) | |
tmp | |
} |
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
[[PageOutline]] | |
The following items should be tested before each release. Be sure to vary the following: | |
* super | regular user | |
* logged in | out | |
* Firefox, IE 7/9, Chrome, Safari | |
* new | old user | |
= ACCOUNT = |
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 | |
PREFIX=$(dirname $0) | |
java -Xmx500m -jar $PREFIX/GenomeAnalysisTK.jar $* |
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/env python | |
''' | |
Automatically estimate insert size of the paired-end reads for a given SAM/BAM file. | |
Usage: getinsertsize.py <SAM file> or samtools view <BAM file> | getinsertsize.py - | |
Author: Wei Li | |
''' | |
from __future__ import print_function | |
import sys; |
OlderNewer