Open terminal and type:
1. Create a directory at ~/bin:
mkdir ~/bin
2. Copy sublime executable to your ~/bin directory:
| library(maptools) | |
| library(ggplot2) | |
| library(gridExtra) | |
| library(scales) | |
| # adapted from http://r.789695.n4.nabble.com/maptools-sunrise-sunset-function-td874148.html | |
| ephemeris <- function(lat, lon, date, span=1, tz="UTC") { | |
| lon.lat <- matrix(c(lon, lat), nrow=1) |
| ############################################################################### | |
| # pca rnaseq (edgeR) cpm data based on Stephen Turner's alternative PCA | |
| # https://gist.github.com/stephenturner/f60c1934405c127f09a6 | |
| ############################################################################### | |
| ## 'edge' below is from tidyData.R - tidy and reshaping of data sets | |
| # matrix of array rma values | |
| edge.mat <- as.matrix(edge[,-1]) | |
| # add V1 row names | |
| row.names(edge.mat) <- edge$V1 | |
| # meta data |
| ############################################################################## | |
| # title : InstallPackages.R; | |
| # purpose : install R packages commonly used by Adam H.Sparks when upgrading or installing R; | |
| # producer : prepared by A. H. Sparks; | |
| # last update : in Los Baños, Laguna, PHL, May 2015; | |
| # inputs : none; | |
| # outputs : none; | |
| # remarks 1 : in order to download any packages, you need to be on-line, of course; | |
| # remarks 2 : for country outlines and the like see http://www.gadm.org/ to download Rdata packages; | |
| ############################################################################## |
| #Option 1 - install openblas with homebrew and link to CRAN installed R | |
| brew tap homebrew/science | |
| brew install openblas | |
| ln -sf /usr/local/Cellar/openblas/0.2.12/lib/libopenblas.dylib /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib | |
| #Option 2 - install r with openblas through homebrew | |
| brew tap homebrew/science | |
| brew install r --with-openblas |
I think the two most important messages that people can get from a short course are:
a) the material is important and worthwhile to learn (even if it's challenging), and b) it's possible to learn it!
For those reasons, I usually start by diving as quickly as possible into visualisation. I think it's a bad idea to start by explicitly teaching programming concepts (like data structures), because the pay off isn't obvious. If you start with visualisation, the pay off is really obvious and people are more motivated to push past any initial teething problems. In stat405, I used to start with some very basic templates that got people up and running with scatterplots and histograms - they wouldn't necessary understand the code, but they'd know which bits could be varied for different effects.
Apart from visualisation, I think the two most important topics to cover are tidy data (i.e. http://www.jstatsoft.org/v59/i10/ + tidyr) and data manipulation (dplyr). These are both important for when people go off and apply
| ghelp <- function(topic, in_cran=TRUE) { | |
| require(htmltools) # for getting HTML to the viewer | |
| require(rvest) # for scraping & munging HTML | |
| # github search URL base | |
| base_ext_url <- "https://github.com/search?utf8=%%E2%%9C%%93&q=%s+extension%%3AR" | |
| ext_url <- sprintf(base_ext_url, topic) | |
| # if searching with user:cran (the default) add that to the URL |
| ### Title: Back to basics: High quality plots using base R graphics | |
| ### An interactive tutorial for the Davis R Users Group meeting on April 24, 2015 | |
| ### | |
| ### Date created: 20150418 | |
| ### Last updated: 20150423 | |
| ### | |
| ### Author: Michael Koontz | |
| ### Email: mikoontz@gmail.com | |
| ### Twitter: @michaeljkoontz | |
| ### |
| # RNA-seq: differential gene expression analysis | |
| *[back to course contents](..)* | |
| This is an introduction to RNAseq analysis involving reading in count data from an RNAseq experiment, exploring the data using base R functions and then analysis with the DESeq2 package. | |
| ## Install and load packages | |
| First, we'll need to install some add-on packages. Most generic R packages are hosted on the Comprehensive R Archive Network (CRAN, <http://cran.us.r-project.org/>). To install one of these packages, you would use `install.packages("packagename")`. You only need to install a package once, then load it each time using `library(packagename)`. Let's install the **gplots** and **calibrate** packages. |
| ## RNA-seq analysis with DESeq2 | |
| ## Stephen Turner, @genetics_blog | |
| # RNA-seq data from GSE52202 | |
| # http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with | |
| # ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl") | |
| # Import & pre-process ---------------------------------------------------- | |
| # Import data from featureCounts |