def heatmap(self, plotfile):
        # to do: add option to parse design file and add coloured row for
        # variable specified in design file.

        plotHeatmap = R('''
        function(df){

        library("Biobase")
        library("RColorBrewer")
        library("gplots")

        hmcol <- colorRampPalette(brewer.pal(9, "GnBu"))(100)
        png("%(plotfile)s", width=1000, height=1000, units="px")
        write.table(df, file="%(plotfile)s.tsv", sep="\t")
        heatmap.2(as.matrix(df),
                  col = hmcol, scale="none", trace="none", margin=c(18, 10),
                  dendrogram="column", cexCol=2,
                  labRow = "",
                  hclustfun = function(x) hclust(x, method = 'average'),
                  distfun = function(x) as.dist(1 - cor(t(x), method="spearman")))
        dev.off()
        }''' % locals())

        r_counts = pandas2ri.py2ri(self.table)

        plotHeatmap(r_counts)
Parse a query given as a string argument.
dataset/ETHPy150Open CGATOxford/cgat/CGAT/Counts.py/Counts.heatmap--crossover with--dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/urlparse.py/parse_qsl