Skip to content

Instantly share code, notes, and snippets.

View brentp's full-sized avatar

Brent Pedersen brentp

View GitHub Profile
sudo apt-get install libtool
git clone git://dnaa.git.sourceforge.net/gitroot/dnaa/dnaa dnaa-git
cd dnaa-git
# bfast required. see above gist
cp -r ../bfast-git ./bfast
# samtools require. see above gist.
cp -r ../samtools-svn/ ./samtools
sh autogen.sh && ./configure && make && sudo make install
@brentp
brentp / ucsc.simple.sh
Created May 23, 2011 17:50
mirror essential tables from UCSC to a local mysql database. (change $ORG to mm8/hg18/dm3 or your organism of choice.)
ORG=hg19
USER=brentp
# from: http://nsaunders.wordpress.com/2011/05/18/how-to-create-a-partial-ucsc-genome-mysql-database/
# create database
mysql -u $USER -e "CREATE DATABASE $ORG";
mkdir -p ucsc-data/$ORG
cd ucsc-data/$ORG
for table in knownGene refGene ensGene kgXref chromInfo cpgIslandExt cytoBand
@brentp
brentp / gist:1049884
Created June 27, 2011 21:28
incantation to build vim in such a way that pyflakes works
# NOTE the /Modules/
./configure --prefix=/vol1/home/brentp/installed/ \
--with-python-config-dir=/vol1/home/brentp/src/python/Python-2.7.2/Modules/ \
--enable-pythoninterp=yes --with-features=huge
@ogrisel
ogrisel / emi_out.txt
Created October 23, 2011 09:05
Expected Mutual Information profiling
Line # Hits Time Per Hit % Time Line Contents
==============================================================
627 def expected_mutual_information(contingency, n_samples):
628 """Calculate the expected mutual information for two labelings."""
629 25 82 3.3 0.0 R, C = contingency.shape
630 25 53 2.1 0.0 N = n_samples
631 25 1059 42.4 0.0 a = np.sum(contingency, axis=1, dtype='int')
632 25 932 37.3 0.0 b = np.sum(contingency, axis=0, dtype='int')
633 25 58 2.3 0.0 emi = 0
634 1839 4005 2.2 0.0 for i in range(R):
@taoliu
taoliu / wrapToSGE
Created January 6, 2012 21:20
SGE script wrapper
#!/usr/bin/env python
import subprocess
import sys
import os
import time
#time_stamp=time.strftime("%y-%m-%d_%H-%M-%S")
time_stamp=str(time.time())
@arq5x
arq5x / basic-exome-outline.sh
Created June 15, 2012 13:35
Exome pipeline for Charles
##########################################
# Step 0. setup a list of sample names.
# Assume that each of your gzipped
# FASTQ files is named as follows:
# sample1.1.fq.gz
# sample1.2.fq.gz
# sample2.1.fq.gz
# sample2.2.fq.gz
# ...
# sampleN.1.fq.gz
@arq5x
arq5x / bioch5080.md
Last active December 15, 2015 07:09

Genome arithmetic for data exploration

The goal of today's practical session is to get your hands dirty with bedtools. We will be studying ChiP-seq data from three different cell types. Each cell type was assayed for H3K27ac. Our research goal is to understand and explore the similarities and differences between the ChIP peaks observed in the 3 different cell types.

@brentp
brentp / kin.R
Created November 4, 2013 20:04
calculate probability of single rare snps using a binomial test and adjusting observed counts such that 2 members from the same family will contribute a number less that 2, depending on their relatedness. This allows us to use family information, but not to over-count rare-alleles due to their presence in families.
library(SNPRelate)
library(FDb.UCSC.snp137common.hg19)
library(hash)
args = commandArgs(TRUE)
vcf.fn = args[1]
gds.fn = paste0(args[1], ".gds")
@17twenty
17twenty / GoWithC.go
Last active July 11, 2016 04:29
Cross Compiling and Language Interop oh my!
package main
import (
"./binding"
"fmt"
)
func main() {
binding.PrintHello()
binding.Seed(1)
fmt.Println(binding.Random())
@bsima
bsima / clojure-resources.md
Last active October 25, 2016 15:35
As I'm learning Clojure, I'm finding all kinds of awesome resources for learning, tools for building and testing, etc. Here's what I'm finding.

For most of the tools on here, if you follow the GitHub repos back to the user that owns the repo, they usually have other cool Clojure tools they build. Just a general observation about the Clojure community.

Learnings

  • Clojure home - There's a ton of good stuff here, like the rationale behind the design and explanations of the best features of Clojure.
  • Clojure.github.io - The core Clojure documentation. Useful for looking up functions and such.
  • Clojuredoc - Community written Clojure documentation and articles
  • Clojure Koans - Learn Clojure with Koans
  • 4Clojure - Solve simple problems to stretch your Clojure skills