PC-ORD:nMDS and R:heatmaps

PC-ORD Non-metric Multidimensional Scaling and Correlations

  1. Imported Main Matrix “MM” sheet from “PCORD_only_Base.xlsx”
  2. Imported Environmental “EM” sheet from “PCORD_only_Base.xlsx”
  3. Ran analysis: Ordination|NMS|autopilot/Slow & thorough
  4. Took about 20 min. No option to “Graph Ordination”.
  5. Graphed NMS Scree Plot. Not exactly sure what this represents.
  6. Ran another analysis: Ordination|NMS|autopilot/Medium
  7. Graphed NMS Scree Plot again. No visible changes.
  8. Graphed 2D ordination: Graph|2D. Does not appear to be same as graph in demo with Dr. Lamendella which had an issue with outliers. (There is a way to delete outliers in PC-ORD. Look at the manual)
  9. Ran Pearson & Kendall Correlations with Ordination Axes: (in Graph window) Statistics|Correlations with Second Matrix.  Nothing seems to be strongly correlated.

Heatmaps using R

Install specific packages to plot enhanced heatmaps.

install.packages("gplots")
install.packages("RColorBrewer")
library(RColorBrewer)
library(gplots)

Save .xls as .csv. Read .csv into R.

dietdata = read.csv("c:/moni_files/Dropbox/Lamendella/analysis/OTUforR.csv",
header=TRUE,row.names=1, colClasses="character",comment="", sep=",")

Created a heatmap using first 50 patients reads and first 50 OTUS

d3 = dietdata[1:50,1:50]
d3matrix = data.matrix(d3)
d3_heatmap = heatmap.2(d3matrix,Rowv=NA,
Colv=NA, scale="column", trace="none", col=redgreen(75), xlab="patient", ylab="OTU")

Created a heatmap with a dendrogram and color key.

Export file:

png(filename="your/file/location/name.png")
heatmap.2(d3matrix,Rowv=NA,Colv=NA, scale="column", trace="none", col=redgreen(75), xlab="patient", ylab="OTU")
dev.off()

Things to figure out

  • How to graph the output from a “Slow & Thorough” Ordination Analysis
  • What exactly is the dendrogram representing? Edit. Apply to OTU.
  • Group patients by visit.
  • Change patient codes.
  • Add bar to represent the different visits similar to the bar for clustering the patients in (http://genomebiology.com/2004/5/10/r80/figure/F2)
  • Change settings so that it can show all or most of the the OTUs

Later down the road…

  • Indicator Species Analysis
  • Network Analysis & Cytoscape
  • Procrustes Analysis
This entry was posted in Keiko and tagged , , , , . Bookmark the permalink.

One Response to PC-ORD:nMDS and R:heatmaps

  1. Pingback: from OTU table to HEATMAP! | Learning Omics

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s