Skip to content

Instantly share code, notes, and snippets.

View stephenturner's full-sized avatar

Stephen Turner stephenturner

View GitHub Profile
@stephenturner
stephenturner / clickable-imgs.js
Created September 29, 2016 15:06 — forked from bearloga/clickable-imgs.js
Make the figures click-able in your RMarkdown=>HTML reports.
<script language="JavaScript">
$(function() {
/* Lets the user click on the images to view them in full resolution. */
$("div.figure img").wrap(function() {
var link = $('<a/>');
link.attr('href', $(this).attr('src'));
link.attr('title', $(this).attr('alt'));
link.attr('target', '_blank');
return link;
});
## devtools::install_github("stephenturner/msigdf")
library(msigdf)
library(dplyr)
library(clusterProfiler)
c2 <- msigdf.human %>%
filter(collection == "c2") %>% select(geneset, entrez) %>% as.data.frame
data(geneList)
de <- names(geneList)[1:100]
@stephenturner
stephenturner / deploy.sh
Created June 9, 2016 17:51 — forked from klmr/deploy.sh
Deploy a generated GitHub page (`_site` subfolder)
#!/usr/bin/env bash
# Configuration
remote_target=master
destination=_site
get-working-branch() {
git status | head -n 1 | awk '{ print $NF }'
}
@stephenturner
stephenturner / gh-pages-deploy.md
Created June 9, 2016 17:44 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

idat2lumibatch <- function(filenames) {
# filenames is a character vector of iDAT filenames
require(illuminaio)
require(lumi)
idatlist = lapply(filenames,readIDAT)
exprs = sapply(idatlist,function(x) {
return(x$Quants$MeanBinData)})
se.exprs = sapply(idatlist,function(x) {
return(x$Quants$DevBinData/sqrt(x$Quants$NumGoodBeadsBinData))})
beadNum = sapply(idatlist,function(x) {
@stephenturner
stephenturner / archiveTwitter.py
Created July 15, 2012 23:34 — forked from mjbommar/archiveTwitter.py
Archive tweets from a search term going backwards through search.
'''
@author Michael J Bommarito II
@date Feb 26, 2011
@license Simplified BSD, (C) 2011.
This script demonstrates how to use Python to archive historical tweets.
'''
import codecs
import csv
@stephenturner
stephenturner / basic-exome-outline.sh
Created June 19, 2012 11:52 — forked from arq5x/basic-exome-outline.sh
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
@stephenturner
stephenturner / SPIA_KEGG.color.input.R
Created May 17, 2012 16:17 — forked from friveroll/SPIA_KEGG.color.input.R
Get an input file for color-KEGG-pathways
##This script get an input file for color-KEGG-pathways
##https://github.com/ajmazurie/color-KEGG-pathways/
##Based from SPIA results at these gists
##https://gist.github.com/1945349
##https://gist.github.com/1950232
#Load a library needed for text manipulation
#for install run
#install.packages("stringr")
library("stringr")