<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Create a heatmap with R]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/34043/create-a-heatmap-with-r?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/34043/create-a-heatmap-with-r?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/34043/create-a-heatmap-with-r</guid>
	<pubDate>Mon, 31 Jul 2017 08:45:58 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/34043/create-a-heatmap-with-r</link>
	<title><![CDATA[Create a heatmap with R]]></title>
	<description><![CDATA[<code>bio &lt;- read.csv(&quot;ppg2008.csv&quot;, sep=&quot;,&quot;)

bio &lt;- bio[order(bio$PTS),]
row.names(bio) &lt;- bio$Name
bio &lt;- bio[,2:20]

bio_matrix &lt;- data.matrix(bio)
bio_heatmap &lt;- heatmap(bio_matrix, Rowv=NA, Colv=NA, col = brewer.pal(9, &quot;Blues&quot;), scale=&quot;column&quot;, margins=c(5,10))


##
#Sample DATA
#Name  ,G,MIN,PTS,FGM,FGA,FGP,FTM,FTA,FTP,3PM,3PA,3PP,ORB,DRB,TRB,AST,STL,BLK,TO,PF
#Genome1 ,79,38.6,30.2,10.8,22,0.491,7.5,9.8,0.765,1.1,3.5,0.317,1.1,3.9,5,7.5,2.2,1.3,3.4,2.3
#Genome2 ,81,37.7,28.4,9.7,19.9,0.489,7.3,9.4,0.78,1.6,4.7,0.344,1.3,6.3,7.6,7.2,1.7,1.1,3,1.7
#Genome3,82,36.2,26.8,9.8,20.9,0.467,5.9,6.9,0.856,1.4,4.1,0.351,1.1,4.1,5.2,4.9,1.5,0.5,2.6,2.3


library(ggplot2)
bio &lt;- read.csv(&quot;seeTNF_Final&quot;, sep=&quot;\t&quot;)
row.names(bio) &lt;- bio$Contig
bio &lt;- bio[,2:256]
data=as.matrix(bio)
head(data)
#Rcolorbrewer palette
library(RColorBrewer)
coul = colorRampPalette(brewer.pal(8, &quot;PiYG&quot;))(25)
#heatmap(data)

# Use &#039;scale&#039; to normalize (right)
heatmap(data, scale=&quot;column&quot;)
#heatmap(data, scale=&quot;column&quot;, col = coul)</code>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>

</channel>
</rss>