Tuesday, March 31, 2009

Heatmaps

There are several functions you may employ to get heatmaps:
default heatmap, image

heatmap.2 in gplots package
heatplot in made4 Bioconductor package
heatmap_2, heatmap_plus in Heatplus Bioconductor package

So far heatmap.2 in gplots works best. If you want to plot some covariates use heatmap_plus

The easiest way to define a custom colorPalette is

colorRamPalette(colors)(num_of_interpretation)

Monday, March 30, 2009

Granger Test of Causality

Test whether one time series can predict another
Here's the R link:

R Link

P.S.
notes: sometimes i hate the nomenclature differences in different programming languages:

in R, converting a form into string is the function as.character(), i was looking for a function like toString, string... blah, never got any luck. This reminds me of a simple function of getting the length of an array:

Java: arrayObject.length
Javascript: arrayObject.length
R: length(arrayObject)
Perl: scalar arrayObject
PHP: sizeof(arrayObject)
...

Sunday, March 29, 2009

Thursday, March 26, 2009

Adding Counter to your blog

Blogspot doesn't support page counter, so it's still pretty hard to track how many people have read your blog. However, yo can track with the 3rd party scripts.

Here's a tutorial, but it's not very detailed. What you can to do is here:

Link to tutorial

But before you get started, you need to register a free account on sitemeter:


sitemeter


Then you will have your own page counter! :)

Google web visualization api

If you have a small dataset and you want to put it into visualization and shared on the web, the most handy way is the Google chart api. Although the data requests are via http get so you probably can't visualize thousands of data points, but it's very handy to make simple plots to work, in a realtime manner.

And everyone can make up to 250,000 calls per day! Wow! Which means you can do some really cool web data services. This is not entirely new, actually some libs like Ext they do have extension gadgets specifically aimed at Google Charts.

Nevertheless, it took me like only 40 min to read the API and added a little working hours tracking gadget on this blog. It's actually dynamic; i will add some navigation buttons later. It's just another incentive to keep reminding myself do not waste time on forums, and concentrate on the work =)

Google Chart Link

Tuesday, March 24, 2009

R libraries [Clustering, Classification, LM]

Nice functions to quickly manipulate Rmetrics: fUtilities package


Basic libs:

cluster
class
stat

Model based:
mclust

Linear Models:
MASS
lmtest
car

This post will be updated.

Monday, March 23, 2009

WGCNA Package

A package for weighted correlation network analysis. It would be interesting to look at how this method can do for network analysis.

Resource Link

Paper Link

GeneNet Package

To do data transformations, there's a package named GeneNet; designed to analyze gene expression (time series) with the focus on gene networks.

they have handy transformation functions:

z.transform and hotelling.transform.

Note that these two transformations only work on correlation coefficients, with the range from -1 to 1.

Link

Sunday, March 22, 2009

Bagged Clustering

A given partitioning clustering algorithm is run repeatedly on bootstrapped data, the cluster centers then merged by hierarchical cluster algorithm. This is good for noisy data / small sample size.

From R library e1071, function bclust

R Doc Link

Also here's an online powerpoint that demonstrates the application on simulated metabolomics data:

Bagged K-means Metabolomics PPT