Skip to content

Instantly share code, notes, and snippets.

View stephenturner's full-sized avatar

Stephen Turner stephenturner

View GitHub Profile
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@nickloman
nickloman / rsync_ecoli.sh
Created October 29, 2012 15:14
Retrieve all Escherichia sequences from Genbank with rsync
rsync -av rsync://ftp.ncbi.nlm.nih.gov/genomes/Bacteria --include "*/" --include "Bacteria/Escherichia*/*.fna" --exclude=* .
# bonus script - concatenate chromosomes and plasmids into single fasta file, make sure the files don't already exist
find . -mindepth 1 -type d | xargs -L 1 -I '{}' find {} -name "*.fna" | while read i ; do cat "$i" >> `dirname "$i"`.fasta ; done
@cobyism
cobyism / gh-pages-deploy.md
Last active May 3, 2024 19:07
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).

@stephenturner
stephenturner / .Rprofile.r
Last active July 19, 2021 22:05
My .Rprofile
## See http://gettinggeneticsdone.blogspot.com/2013/06/customize-rprofile.html
## Load packages
library(BiocInstaller)
## Don't show those silly significanct stars
options(show.signif.stars=FALSE)
## Do you want to automatically convert strings to factor variables in a data.frame?
## WARNING!!! This makes your code less portable/reproducible.
@seandavi
seandavi / idat2lumibatch.R
Last active December 3, 2020 03:00
A simple function to read illumina iDAT files into a Bioconductor data structure
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) {
@arunsrinivasan
arunsrinivasan / CologneR.R
Last active December 30, 2015 14:09
Script used to generate results for CologneR user group meet (for reproducibility)
require(reshape2)
# data.table commit (1048)
require(data.table)
# Loading required package: data.table
# data.table 1.8.11 For help type: help("data.table")
set.seed(1)
N <- 2e7 # size of DT
@arq5x
arq5x / cell-line-workflow.sh
Last active December 31, 2015 21:39
Ovarian cancer chemoresistance.
export SAMPLES="2484-AJ-0001 2484-AJ-0002 2484-AJ-0003"
######################################
# Make FASTQ
######################################
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-cell-lines
export STEPNAME=ovc-fastq
for sample in `echo $SAMPLES`
do
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=1 -N $STEPNAME -m bea -M arq5x@virginia.edu";
@seandavi
seandavi / README.md
Last active December 28, 2023 02:46
snpEff on the NIH Biowulf cluster

Usage

To use these scripts:

  • Clone this repository: git clone https://gist.github.com/95a4b2ab3b90f6f0bfd9.git snpEffScript
  • cd snpEffScript
  • make appropriate changes to setup.sh
  • call snpEff.sh like so:
# A quick function to save a PBM (http://en.wikipedia.org/wiki/Netpbm_format)
# visualize *a lot* of missing data pretty quickly (outside of R).
writeMissingPBM <- function(x, file) {
dims <- dim(x)
x[] <- as.integer(is.na(x))
con <- file(file, open="wt")
writeLines(sprintf("P1\n%d %d", ncol(x), nrow(x)), con)
write.table(x, file=con, sep=" ", col.names=FALSE, row.names=FALSE, quote=FALSE)
close(con)