Skip to content

Instantly share code, notes, and snippets.

View stephenturner's full-sized avatar

Stephen Turner stephenturner

View GitHub Profile
@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).

@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:

@ilevantis
ilevantis / bedtools_cheatsheet.md
Last active April 10, 2024 19:12
Bedtools cheatsheet

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.
@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:
@stephenturner
stephenturner / install-gcc48-linuxbrew-centos6.md
Last active March 6, 2022 02:49
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.

Resources:

@stephenturner
stephenturner / build-install-bcftools-home.sh
Last active November 24, 2021 13:14
Install htslib, bcftools, samtools to home directory
# Compile and install htslib, bcftools, samtools 1.9 to home directory
# Set up dirs where stuff will be installed
mkdir -p ${HOME}/bin/htslib
mkdir -p ${HOME}/bin/bcftools
mkdir -p ${HOME}/bin/samtools
# Make a dir to build
mkdir -p ${HOME}/tmp
@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) {
@jennybc
jennybc / r-fcsn-in-wild-search.md
Last active January 6, 2020 08:09
Search for "natural" usage of a function across all CRAN packages

What if a function in a package has no examples? Or is poorly exampled? Wouldn't it be nice to find functioning instances of it "in the wild"?

Via Twitter, Noam Ross taught me a clever way to do such searches on GitHub. Put this into the GitHub search box to see people using the llply() function from plyr:

"llply" user:cran language:R

Or just click here.