User Tools

Site Tools


mkatari-bioinformatics-august-2013-clustering

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
mkatari-bioinformatics-august-2013-clustering [2013/08/29 09:29] – created mkatarimkatari-bioinformatics-august-2013-clustering [2013/10/11 14:59] mkatari
Line 2: Line 2:
  
  
-Clustering rna-seq datacontinuation from [[mkatari-bioinformatics-august-2013-deseq|DESeq]]+====== Clustering rna-seq data ====== 
 +continuation from [[mkatari-bioinformatics-august-2013-deseq|DESeq]]
  
 Get the significant genes Get the significant genes
Line 35: Line 36:
 <code> <code>
 sigGenes.hclust.k2<-cutree(sigGenes.normalized.hclust, k=2) sigGenes.hclust.k2<-cutree(sigGenes.normalized.hclust, k=2)
 +</code>
 +
 +Now to get all the genes that are in cluster 2 simply type.
 +
 +<code>
 +hclust.k2.cluster2=names(which(sigGenes.hclust.k2==2))
 +</code>
 +
 +Now we can create a new matrix/data frame with just these genes. This new matrix can be used to plot a heatmap to make it easier to see a expression profile of the cluster (see below).
 +
 +<code>
 +hclust.k2.cluster2.normalized = sigGenes.normalized[hclust.k2.cluster2,]
 </code> </code>
  
Line 44: Line 57:
 Calculate silhouette values Calculate silhouette values
 <code> <code>
-sigGenes.hclust.k2.sil<-silhouette(sigGenes.hclust.k2, sigGenes.normalized.dist)+sigGenes.hclust.k2.sil<-silhouette(sigGenes.hclust.k2,  
 +                                   sigGenes.normalized.dist)
 </code> </code>
  
Line 52: Line 66:
 </code> </code>
  
-Heatmap+====== Heatmap ====== 
  
 <code> <code>
Line 60: Line 75:
 These functions will make it easy for us to specify how we want the clustering to be performed in the heatmap function These functions will make it easy for us to specify how we want the clustering to be performed in the heatmap function
  
-</code>+<code>
 hclust2 <- function(x, method="average", ...) { hclust2 <- function(x, method="average", ...) {
   hclust(x, method=method, ...)   hclust(x, method=method, ...)
Line 90: Line 105:
 dev.off() dev.off()
 </code> </code>
- 
mkatari-bioinformatics-august-2013-clustering.txt · Last modified: 2015/06/17 13:26 by mkatari