Twitter

Tuesday, February 19, 2008

Tiling Arrays

Here are some references on this technology for my own use.

  1. Global Identification of Human Transcribed Sequences with Genome Tiling Arrays
    Science 24 December 2004:Vol. 306. no. 5705, pp. 2242 - 2246
    DOI: 10.1126/science.1103388
    Paul Bertone,1* Viktor Stolc,1,2* Thomas E. Royce,3 Joel S. Rozowsky,3 Alexander E. Urban,1 Xiaowei Zhu,1 John L. Rinn,3 Waraporn Tongprasit,4 Manoj Samanta,2 Sherman Weissman,5 Mark Gerstein,3 Michael Snyder1,3
  2. Array of hope
    Nature Genetics 21, 3 - 4 (1999)
    E. S. Lander
  3. Model-based analysis of tiling-arrays for ChIP-chip
    PNAS August 15, 2006 vol. 103 no. 33 12457-12462
    W. Evan Johnson*,,, Wei Li*,,, Clifford A. Meyer*,,, Raphael Gottardo, Jason S. Carroll¶, Myles Brown¶, and X. Shirley Liu*,,

Standard Deviation Function in R

I always thought there was no function for standard deviation in R. Since in Splus, it was stdev() if I remember correctly. I never help.seached it. I only found out that there was one: sd().

Tuesday, November 13, 2007

Temp Directory and Working Director of R

For a while, I have been using the setwd() command at the beginning of a project's code. This allows one to save data, graph, output easily to a project's result folder without typing long path names.

Yesterday, I was using a contributed package in R that requires the access to R's temp directory. The exact location of this folder can be found out using the command tempdir(). It just happened that my current location of this folder was not ideal for the task at hand and I needed to change it. There was no command in R to change it. I figured out a way to do it: add an entry to the environmental variable list of the system as TMPDIR and specify the desired folder name.

Monday, November 12, 2007

Useful websites for graphics in R

R graphical manuals (a nice collection of examples and codes)
http://cged.genes.nig.ac.jp/RGM2/index.php?clear=all

Codes from the book "R graphics"
http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html

Friday, November 02, 2007

Fast permuting r by c two-way tables

Today, I need to permute many two-way tables of the same dimension (say 2 by 3) to carry out a test of independence. My data looks like a big matrix with each row corresponding to a two-way table (arranged by row). The permutation is just to draw a random 2 by 3 table given independence between the two dimensions, conditioning on the observed marginal distributions. I didn't find (or didn't have time to find) a function to do that in R. Therefore I wrote the following codes:

f.perm.tab<-function(x){

x.r<-rep(1:nrow(x), times=rowSums(x))

x.c<-rep(1:ncol(x), times=colSums(x))

temp.mat<-expand.grid(1:nrow(x), 1:ncol(x))

return(table(c(x.r, temp.mat[,1]), c(sample(x.c),temp.mat[,2])) -matrix(1, nrow(x), ncol(x)))

}


I also made a function to do the permutation for each line of my huge
matrix and used the apply() function to speed up things. It works pretty well
for me.