Skip to content

Instantly share code, notes, and snippets.

View stevekm's full-sized avatar

Stephen Kelly stevekm

View GitHub Profile
@stevekm
stevekm / index.html
Created January 11, 2018 01:03 — forked from pathunstrom/index.html
Dual Movement
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box {
height: 100px;
width: 100px;
top: 100px;
stat_smooth_func <- function(mapping = NULL, data = NULL,
geom = "smooth", position = "identity",
...,
method = "auto",
formula = y ~ x,
se = TRUE,
n = 80,
span = 0.75,
fullrange = FALSE,
level = 0.95,
@stevekm
stevekm / gist:c29344cd1b66b422b907e2f4cdf41756
Created February 3, 2017 01:30 — forked from brentp/gist:819611
install annovar and use it to annotate a vcf with hg19
wget http://www.openbioinformatics.org/annovar/download/annovar.latest.tar.gz.mirror
tar xzvf annovar.tar.gz
cd annovar
# download databases (goes to UCSC)
./annotate_variation.pl -buildver hg19 -downdb 1000g2010nov humandb
./annotate_variation.pl -buildver hg19 -downdb avsift humandb
./annotate_variation.pl -buildver hg19 -downdb refGene humandb
./annotate_variation.pl -buildver hg19 -downdb mce46way humandb/
./annotate_variation.pl -buildver hg19 -downdb snp131 humandb/
@stevekm
stevekm / .bashrc
Created December 4, 2015 22:09 — forked from pcbulai/.bashrc
.bashrc file with some useful aliases and functions
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
### autocorrects cd misspellings, 'cd /sur/src/linus' >> 'cd /usr/src/linux' ###
@stevekm
stevekm / plotPCAWithSampleNames.R
Created October 29, 2015 18:34 — forked from igordot/plotPCAWithSampleNames.R
Modified DESeq2 plotPCA function with sample names and proportion of variance added. Sample names will be shown underneath each dot. The axis will display proportion of variance for each principal component. Tested using DESeq2 1.2.8, 1.6.2, and 1.8.1. The DESeq2 plotPCA function switched from lattice to ggplot2 in version 1.5.11.
plotPCAWithSampleNames = function(x, intgroup="condition", ntop=500)
{
library(RColorBrewer)
library(genefilter)
library(lattice)
# pca
rv = rowVars(assay(x))
select = order(rv, decreasing=TRUE)[seq_len(min(ntop, length(rv)))]
pca = prcomp(t(assay(x)[select,]))