Skip to content

Instantly share code, notes, and snippets.

View ctokheim's full-sized avatar

Collin Tokheim ctokheim

  • Dana-Farber Cancer Institute
  • Boston, MA
View GitHub Profile
@ctokheim
ctokheim / figure_1.png
Created March 9, 2016 16:34 — forked from daler/LICENSE
Plot chromosome ideograms along with other genomic data
figure_1.png
@ctokheim
ctokheim / refexp.r
Last active August 29, 2015 14:23 — forked from emhart/refexp.r
library(lme4)
library(ggplot2)
#create some levels
levs <- as.factor(c("l1","l2","l3","l4","l5"))
#set the factor means
f_means <- c(6,16,2,10,13)
# set individual as a factor

Background

Last week when trying to generate some awsome summary graphic, I came across the painful ordeal of trying to combine ggplot elements with a number of regular R graphic elements.

First things first, I had used grid.arrange module from gridExtra package to juxtapose ggplot elements in a panel figure. Furthermore, I had combined regular R [read non-ggplot] figures thru the good old par functionality.

Brief summary:

We will be making calls to viewport module from the gridBase package to generate---guess what---view ports into which ggplot objects are plotted. Interestingly, ggplot elements need not be a single simple ggplot object, but could be an arrangement of multiple objects bundled together using arrangeGrob module from gridExtra.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ctokheim
ctokheim / matplotlibrc
Last active December 16, 2015 13:09 — forked from huyng/matplotlibrc
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@ctokheim
ctokheim / tmux_local_install.sh
Last active December 11, 2015 05:19 — forked from ryin/tmux_local_install.sh
Bash (shell): install tmux locally
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# PATH variable will need to be updated with $HOME/local/bin and the
# LD_LIBRARY_PATH variable will need $HOME/local/lib
# exit on error
set -e