File: ctc.Rnw

package info (click to toggle)
r-bioc-ctc 1.72.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 288 kB
  • sloc: php: 52; makefile: 2
file content (151 lines) | stat: -rw-r--r-- 3,793 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
% -*- mode: noweb; noweb-default-code-mode: R-mode; -*-
% building this document: (in R) Sweave ("ctc.Rnw")
\documentclass[a4paper]{article}

\title{Ctc Package}
\author{Antoine Lucas}

\SweaveOpts{echo=FALSE}
%\usepackage{a4wide}
%\VignetteIndexEntry{Introduction to ctc}
%\VignettePackage{ctc}
\usepackage{url}

\begin{document}

\maketitle

\tableofcontents

\section{Overview}

{\tt Ctc} package provides several functions for 
conversion. Specially to export and import data from
Xcluster\footnote{\url{http://genome-www.stanford.edu/~sherlock/cluster.html}} 
 or Cluster\footnote{http://rana.lbl.gov/EisenSoftware.htm} 
 software (very used for Gene's expression
analysis), and to export clusters to TreeView or Freeview visualization
software.

\section{Aim} 

\begin{itemize}
\item To explore clusters made by Xcluster and Cluster . 

\item To cluster data with Xcluster (it requires very low memory usage) 
and analyze the results with R. Warning: results are not exactly the same
as hclust results with R. 
\end{itemize}              
       
\section{Usage}

Standard way of building a hierarchical clustering with R
is with this command:
%<<echo=TRUE,fig=TRUE>>=
<<echo=TRUE>>=
data(USArrests)
h = hclust(dist(USArrests))
plot(h)
@ 
Or for the ``heatmap'':
<<echo=TRUE,fig=TRUE>>=
heatmap(as.matrix(USArrests))
@ 


\subsection{Building hierarchical clustering with another software}

We made these tools
\begin{description}
\item[r2xcluster] Write data table to Xcluster file format 
<<echo=TRUE>>=
library(ctc)
r2xcluster(USArrests,file='USArrests_xcluster.txt')
@ 
 \item[r2cluster] Write data table to Cluster file format 
<<echo=TRUE>>=
r2cluster(USArrests,file='USArrests_xcluster.txt')
@ 
\item[xcluster] Hierarchical clustering (need Xcluster tool  by Gavin Sherlock) 
\begin{verbatim}
> h.xcl=xcluster(USArrests)
> plot(h.xcl)
\end{verbatim}
 
It is roughtly the same as
\begin{verbatim}
> r2xcluster(USArrests,file='USArrests_xcluster.txt')
> system('Xcluster -f USArrests_xcluster.txt -e 0 -p 0 -s 0 -l 0')
> h.xcl=xcluster2r('USArrests_xcluster.gtr',labels=TRUE)
\end{verbatim}


\item[xcluster2r] Importing Xcluster/Cluster output 

\end{description}                 

\subsection{Using other visualization softwares}

We now consider that we have an object of the type produced by 'hclust'
(or a hierarchical cluster imported with previous functions) like:

<<echo=TRUE>>=
hr = hclust(dist(USArrests))
hc = hclust(dist(t(USArrests)))
@ 



\begin{description}
\item[hc2Newick] Export hclust objects to Newick format files
<<echo=TRUE>>=
write(hc2Newick(hr),file='hclust.newick')
@ 
\item[r2gtr,r2atr,r2cdt] Export hclust objects to Freeview or Treeview
visualization softwares
<<echo=TRUE>>=
r2atr(hc,file="cluster.atr")
r2gtr(hr,file="cluster.gtr")
r2cdt(hr,hc,USArrests ,file="cluster.cdt")
@ 
\item[hclust2treeview] Clustering and Export hclust objects to Freeview or Treeview
visualization softwares 
<<echo=TRUE>>=
hclust2treeview(USArrests,file="cluster.cdt")
@ 
\end{description}

    
\section{See Also}

Theses examples can be tested with command
{\tt demo(ctc)}.\\


\noindent
All functions has got man pages, try 
{\tt help.start()}.\\

\noindent
Ctc aims to interact with other softwares, some of them:
\begin{description}
\item[xcluster]
made  by Gavin Scherlock, http://genome-www.stanford.edu/\~\/sherlock/cluster.html
\item[Cluster, Treeview]
made  by Michael Eisen, http://rana.lbl.gov/EisenSoftware.htm
\item[Freeview]
made by Marco Kavcic and Blaz Zupan,
http://magix.fri.uni-lj.si/freeview
\end{description}                 


\noindent
If you want to cite amap or ctc in a publication, use~:

Antoine Lucas and Sylvain Jasson, \emph{Using amap and ctc Packages
  for Huge Clustering}, R News, 2006, vol 6, issue 5 pages 58-60.


\end{document}