## Matrix to adjacency list in R

An adjacency list is simply an unordered list that describes connections between vertices. It’s a commonly used input format for graphs. In this post, I use the melt() function from the reshape2 package to create an adjacency list from a correlation matrix. I use the geneData dataset, which consists of real but anonymised microarray expression…

## Plotting error bars with R

Updated 2018 May 20th Error bars may show confidence intervals, standard errors, and standard deviations. Each feature conveys a different message and this paper on error bars in experimental biology explains it very nicely. For this post I will demonstrate how to plot error bars that show the standard error (SE) or standard error of…

## Markov clustering

The Markov Cluster (MCL) Algorithm is an unsupervised cluster algorithm for graphs based on simulation of stochastic flow in graphs. Markov clustering was the work of Stijn van Dongen and you can read his thesis on the Markov Cluster Algorithm. The work is based on the graph clustering paradigm, which postulates that natural groups in…

## Creating plots using the xkcd package in R

xkcd styled graphs using the xkcd package in R. Steps done on R version 3.0.1 (2013-05-16) and on Windows, i386-w64-mingw32/i386 (32-bit). Steps followed are from the xkcd-intro.pdf file i.e. the xkcd vignette. install.packages("xkcd") library(xkcd) library(extrafont) library(ggplot2) #do you have xkcd fonts? if( "xkcd" %in% fonts()) { p <- ggplot() + geom_point(aes(x=mpg, y=wt), data=mtcars) + theme(text…

## Making a line graph to depict timecourse data

From this helpful thread in the bioconductor mailing list. Just to see what it is doing, I made a simpler example Column 5 of the matrix “two” can most easily be seen as the dotted aqua line (from -2.6879801 to -0.5859938). This plot could be useful if you wanted to depict the gene expression of…

## Making a line chart with non-numerical x axis

Basic example of creating a line chart with user defined x axis values using R.