Skip to content

Instantly share code, notes, and snippets.

@arraytools
arraytools / build-R-based-on-git
Last active August 29, 2015 14:20
build-R-base-on-git
# sudo apt-get update
# sudo apt-get install git
# sudo apt-get build-dep r-base
# about 350MB as of R 3.2.0
git clone https://github.com/wch/r-source.git
cd r-source
R_PAPERSIZE=letter \
R_BATCHSAVE="--no-save --no-restore" \
@arraytools
arraytools / Home_sapiens_UCSC_hg19
Created May 21, 2015 20:37
Content obtained from the command "tar -tzvf Homo_sapiens_UCSC_hg19.tar.gz"
10228584083 Homo_sapiens/UCSC/hg19/Annotation/Archives/archive-2014-06-02-13-47-56/Variation/snp137.txt
12318134451 Homo_sapiens/UCSC/hg19/Annotation/Archives/archive-2014-06-02-13-47-56/Variation/snp138.txt
0 Homo_sapiens/UCSC/hg19/
0 Homo_sapiens/UCSC/hg19/Annotation/
0 Homo_sapiens/UCSC/hg19/Annotation/Genes -> Archives/archive-current/Genes
0 Homo_sapiens/UCSC/hg19/Annotation/README.txt -> Archives/archive-current/README.txt
0 Homo_sapiens/UCSC/hg19/Annotation/SmallRNA -> Archives/archive-current/SmallRNA
0 Homo_sapiens/UCSC/hg19/Annotation/Variation -> Archives/archive-current/Variation
0 Homo_sapiens/UCSC/hg19/Annotation/Archives/
0 Homo_sapiens/UCSC/hg19/Annotation/Archives/archive-2011-08-30-21-45-18/
@arraytools
arraytools / tophat2_Lesson
Last active August 29, 2015 14:22
tophat2 with -G and --transcriptome-index options
If no fasta file is found alongside the other index files, tophat will use the bowtie index you give
to build this file and save it to the output directory. This step can take up to an hour for a
human-sized genome.
############################################################################################################
#!/bin/bash
export PATH=$PATH:/opt/RNA-Seq/bin/bowtie2-2.2.1:/opt/RNA-Seq/bin/tophat-2.0.11.Linux_x86_64
export PATH=$PATH:/opt/RNA-Seq/bin/tophat-2.0.11.Linux_x86_64
export PATH=$PATH:/opt/RNA-Seq/bin/samtools-0.1.19/:/opt/RNA-Seq/bin/samtools-0.1.19/bcftools:/opt/RNA-Seq/bin/samtools-0.1.19/misc
cd /home/brb/Anders2013
ExpId title reference_ch1 time point_ch2 replicate_ch2 agent_ch2 description
GSM561077 F11_FSK2h_rep1 F11 cells, no forskolin 2hrs 1 10µM forskolin gene expression data of regenerating dorsal root ganglion neurons
GSM561078 F11_FSK2h_rep2 F11 cells, no forskolin 2hrs 2 10µM forskolin gene expression data of regenerating dorsal root ganglion neurons
GSM561079 F11_FSK2h_rep3 F11 cells, no forskolin 2hrs 3 10µM forskolin gene expression data of regenerating dorsal root ganglion neurons
GSM561080 F11_FSK4h_rep1 F11 cells, no forskolin 4hrs 1 10µM forskolin gene expression data of regenerating dorsal root ganglion neurons
GSM561081 F11_FSK4h_rep2 F11 cells, no forskolin 4hrs 2 10µM forskolin gene expression data of regenerating dorsal root ganglion neurons
GSM561082 F11_FSK4h_rep3 F11 cells, no forskolin 4hrs 3 10µM forskolin gene expression data of regenerating dorsal root ganglion neurons
GSM561083 F11_FSK24h_rep1 F11 cells, no forskolin 24hrs 1 10µM forskolin gene expression data of regenerating dorsal r
@arraytools
arraytools / qt5.5_configure_output_on_Windows 10
Last active November 4, 2015 15:35
qt5.5 configure output on Windows 10
c:\qt\qt-everywhere-5.5.1>configure -release -static -confirm-license -nomake examples -opensource
+ cd qtbase
+ c:\Qt\qt-everywhere-5.5.1\qtbase\configure.bat -top-level -release -static -confirm-license -nomake examples -opensource
Please wait while bootstrapping configure ...
<srcbase> = c:/Qt/qt-everywhere-5.5.1/qtbase
<outbase> = c:/Qt/qt-everywhere-5.5.1/qtbase
jom 1.1.0 - empower your cores
cl -c -Yc -nologo -Zc:wchar_t -W3 -GR -EHsc -w34100 -w34189 -DUNICODE -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE -I"..\..\include" -I"..\..\include\QtCore" -I"..\..\include\QtCore\5.5.1" -I"..\..\include\QtCore\5.5.1\QtCore" -I"c:\Qt\qt-everywhere-5.5.1\qtbase\tools\shared" -I"c:\Qt\qt-everywhere-5.5.1\qtbase\mkspecs\win32-msvc2008" -Fpconfigure_pch.pch -Foconfigure_pch.obj -TP c:\Qt\qt-everywhere-5.5.1\qtbase\tools\configure\configure_pch.
@arraytools
arraytools / foo.R
Created December 26, 2012 19:34
test gist
x <- read.delim("toy.txt", header=TRUE)
summary(x)
@arraytools
arraytools / server.R
Last active December 10, 2015 04:38
Interactive heatmap using sequential data. Note the Google Chrome browser works fine, and Firefox may or may not. The Microsoft IE does not work at all.
library(shiny)
library(gplots) # Just for redgreen() function. Will be replaced sol.
lr2 <- as.matrix(read.delim("toy.txt", header = TRUE)) # 3 genes, 20 arrays, sequential data.
sigma <- apply(lr2, 1, sd); sigma <- sigma/max(sigma)
# Define server logic required to generate and plot a random distribution
shinyServer(function(input, output) {
datainput <- reactive(function() {
@arraytools
arraytools / server.R
Last active December 10, 2015 04:48
heatmap using leukemia data (22282 genes, 58 arrays). Assume 'shiny' package is available. We can run shiny:::runGist("https://gist.github.com/4383351")
# shiny:::runApp("hello")
#
# To-Do-List:
# missing value case
#
library(shiny)
# library(gplots) # Just for redgreen() function. Will be replaced sol.
source(url("http://dl.dropbox.com/u/1014272/heatmapr.r"))
source(url("http://dl.dropbox.com/u/1014272/colorpanel.r"))
@arraytools
arraytools / server.R
Last active December 10, 2015 12:39
Heatmap using Pomeroy dataset
# shiny:::runApp("hello")
#
# To-Do-List:
# missing value case
#
library(shiny)
# library(gplots) # Just for redgreen() function. Will be replaced sol.
source(url("http://dl.dropbox.com/u/1014272/heatmapr.r"))
source(url("http://dl.dropbox.com/u/1014272/colorpanel.r"))
@arraytools
arraytools / biocLite.R
Last active December 10, 2015 19:48
Understand how *source("http://www.bioconductor.org/biocLite.R")* works. 1. After source("http://www.bioconductor.org/biocLite.R"), it checks R version and bioc version. 2. If it satisfies the condition (vers > "2.13" && biocVers > "2.8"), it will try to load *BiocInstaller* package. If loading BiocInstaller package is successful, then *biocLite…
## Mirrors: uncomment the following and change to your favorite CRAN mirror
## if you don't want to use the default (cran.fhcrc.org, Seattle, USA).
## options("repos" = "http://cran.fhcrc.org")
## Mirrors: uncomment the following and change to your favorite Bioconductor
## mirror, if you don't want to use the default (www.bioconductor.org,
## Seattle, USA)
## options("BioC_mirror" = "http://www.bioconductor.org")
local({