annotate tools/stats/plot_from_lda.xml @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 <tool id="plot_for_lda_output1" name="Draw ROC plot" version="1.0.1">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 <description>on "Perform LDA" output</description>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 <command interpreter="sh">r_wrapper.sh $script_file</command>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 <inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 <param format="txt" name="input" type="data" label="Source file"> </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 <param name="my_title" size="30" type="text" value="My Figure" label="Title of your plot" help="See syntax below"> </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 <param name="X_axis" size="30" type="text" value="Text for X axis" label="Legend of X axis in your plot" help="See syntax below"> </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9 <param name="Y_axis" size="30" type="text" value="Text for Y axis" label="Legend of Y axis in your plot" help="See syntax below"> </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 </inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 <outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 <data format="pdf" name="pdf_output" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 </outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 <tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 <param name="input" value="lda_analy_output.txt"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 <param name="my_title" value="Test Plot1"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 <param name="X_axis" value="Test Plot2"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 <param name="Y_axis" value="Test Plot3"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 <output name="pdf_output" file="plot_for_lda_output.pdf"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 </tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 <configfiles>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26 <configfile name="script_file">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28 rm(list = objects() )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30 ############# FORMAT X DATA #########################
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 format&lt;-function(data) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32 ind=NULL
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 for(i in 1 : ncol(data)){
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 if (is.na(data[nrow(data),i])) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35 ind&lt;-c(ind,i)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 #print(is.null(ind))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39 if (!is.null(ind)) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 data&lt;-data[,-c(ind)]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
41 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
42
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
43 data
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
44 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
45
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
46 ########GET RESPONSES ###############################
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
47 get_resp&lt;- function(data) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
48 resp1&lt;-as.vector(data[,ncol(data)])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
49 resp=numeric(length(resp1))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
50 for (i in 1:length(resp1)) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
51 if (resp1[i]=="Control ") {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
52 resp[i] = 0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
53 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
54 if (resp1[i]=="XLMR ") {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
55 resp[i] = 1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
56 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
57 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
58 return(resp)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
59 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
60
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
61 ######## CHARS TO NUMBERS ###########################
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
62 f_to_numbers&lt;- function(F) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
63 ind&lt;-NULL
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
64 G&lt;-matrix(0,nrow(F), ncol(F))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
65 for (i in 1:nrow(F)) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
66 for (j in 1:ncol(F)) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
67 G[i,j]&lt;-as.integer(F[i,j])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
68 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
69 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
70 return(G)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
71 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
72
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
73 ###################NORMALIZING#########################
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
74 norm &lt;- function(M, a=NULL, b=NULL) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
75 C&lt;-NULL
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
76 ind&lt;-NULL
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
77
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
78 for (i in 1: ncol(M)) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
79 if (sd(M[,i])!=0) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
80 M[,i]&lt;-(M[,i]-mean(M[,i]))/sd(M[,i])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
81 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
82 # else {print(mean(M[,i]))}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
83 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
84 return(M)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
85 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
86
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
87 ##### LDA DIRECTIONS #################################
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
88 lda_dec &lt;- function(data, k){
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
89 priors=numeric(k)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
90 grandmean&lt;-numeric(ncol(data)-1)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
91 means=matrix(0,k,ncol(data)-1)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
92 B = matrix(0, ncol(data)-1, ncol(data)-1)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
93 N=nrow(data)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
94 for (i in 1:k){
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
95 priors[i]=sum(data[,1]==i)/N
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
96 grp=subset(data,data\$group==i)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
97 means[i,]=mean(grp[,2:ncol(data)])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
98 #print(means[i,])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
99 #print(priors[i])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
100 #print(priors[i]*means[i,])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
101 grandmean = priors[i]*means[i,] + grandmean
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
102 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
103
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
104 for (i in 1:k) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
105 B= B + priors[i]*((means[i,]-grandmean)%*%t(means[i,]-grandmean))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
106 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
107
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
108 W = var(data[,2:ncol(data)])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
109 svdW = svd(W)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
110 inv_sqrtW =solve(svdW\$v %*% diag(sqrt(svdW\$d)) %*% t(svdW\$v))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
111 B_star= t(inv_sqrtW)%*%B%*%inv_sqrtW
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
112 B_star_decomp = svd(B_star)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
113 directions = inv_sqrtW%*%B_star_decomp\$v
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
114 return( list(directions, B_star_decomp\$d) )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
115 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
116
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
117 ################ NAIVE BAYES FOR 1D SIR OR LDA ##############
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
118 naive_bayes_classifier &lt;- function(resp, tr_data, test_data, k=2, tau) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
119 tr_data=data.frame(resp=resp, dir=tr_data)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
120 means=numeric(k)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
121 #print(k)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
122 cl=numeric(k)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
123 predclass=numeric(length(test_data))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
124 for (i in 1:k) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
125 grp = subset(tr_data, resp==i)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
126 means[i] = mean(grp\$dir)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
127 #print(i, means[i])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
128 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
129 cutoff = tau*means[1]+(1-tau)*means[2]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
130 #print(tau)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
131 #print(means)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
132 #print(cutoff)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
133 if (cutoff&gt;means[1]) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
134 cl[1]=1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
135 cl[2]=2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
136 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
137 else {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
138 cl[1]=2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
139 cl[2]=1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
140 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
141
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
142 for (i in 1:length(test_data)) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
143
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
144 if (test_data[i] &lt;= cutoff) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
145 predclass[i] = cl[1]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
146 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
147 else {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
148 predclass[i] = cl[2]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
149 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
150 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
151 #print(means)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
152 #print(mean(means))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
153 #X11()
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
154 #plot(test_data,pch=predclass, col=resp)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
155 predclass
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
156 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
157
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
158 ################# EXTENDED ERROR RATES #################
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
159 ext_error_rate &lt;- function(predclass, actualclass,msg=c("you forgot the message"), pr=1) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
160 er=sum(predclass != actualclass)/length(predclass)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
161
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
162 matr&lt;-data.frame(predclass=predclass,actualclass=actualclass)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
163 escapes = subset(matr, actualclass==1)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
164 subjects = subset(matr, actualclass==2)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
165 er_esc=sum(escapes\$predclass != escapes\$actualclass)/length(escapes\$predclass)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
166 er_subj=sum(subjects\$predclass != subjects\$actualclass)/length(subjects\$predclass)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
167
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
168 if (pr==1) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
169 # print(paste(c(msg, 'overall : ', (1-er)*100, "%."),collapse=" "))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
170 # print(paste(c(msg, 'within escapes : ', (1-er_esc)*100, "%."),collapse=" "))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
171 # print(paste(c(msg, 'within subjects: ', (1-er_subj)*100, "%."),collapse=" "))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
172 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
173 return(c((1-er)*100, (1-er_esc)*100, (1-er_subj)*100))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
174 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
175
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
176 ## Main Function ##
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
177
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
178 files_alias&lt;-c("${my_title}")
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
179 tau=seq(0,1,by=0.005)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
180 nfiles=1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
181 f = c("${input}")
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
182
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
183 rez_ext&lt;-list()
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
184 for (i in 1:nfiles) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
185 rez_ext[[i]]&lt;-dget(paste(f[i], sep="",collapse=""))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
186 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
187
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
188 tau&lt;-tau[1:(length(tau)-1)]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
189 for (i in 1:nfiles) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
190 rez_ext[[i]]&lt;-rez_ext[[i]][,1:(length(tau)-1)]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
191 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
192
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
193 ######## OPTIMAIL TAU ###########################
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
194
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
195 #rez_ext
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
196
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
197 rate&lt;-c("Optimal tau","Tr total", "Tr Y", "Tr X")
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
198
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
199 m_tr&lt;-numeric(nfiles)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
200 m_xp22&lt;-numeric(nfiles)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
201 m_x&lt;-numeric(nfiles)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
202
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
203 for (i in 1:nfiles) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
204 r&lt;-rez_ext[[i]]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
205 #tr
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
206 # rate&lt;-rbind(rate, c(files_alias[i]," "," "," ") )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
207 mm&lt;-which((r[3,])==max(r[3,]))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
208
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
209 m_tr[i]&lt;-mm[1]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
210 rate&lt;-rbind(rate,c(tau[m_tr[i]],r[,m_tr[i]]))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
211 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
212 print(rate)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
213
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
214 pdf(file= paste("${pdf_output}"))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
215
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
216 plot(rez_ext[[i]][2,]~rez_ext[[i]][3,], xlim=c(0,100), ylim=c(0,100), xlab="${X_axis} [1-FP(False Positive)]", ylab="${Y_axis} [1-FP(False Positive)]", type="l", lty=1, col="blue", xaxt='n', yaxt='n')
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
217 for (i in 1:nfiles) {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
218 lines(rez_ext[[i]][2,]~rez_ext[[i]][3,], xlab="${X_axis} [1-FP(False Positive)]", ylab="${Y_axis} [1-FP(False Positive)]", type="l", lty=1, col=i)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
219 # pt=c(r,)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
220 points(x=rez_ext[[i]][3,m_tr[i]],y=rez_ext[[i]][2,m_tr[i]], pch=16, col=i)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
221 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
222
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
223
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
224 title(main="${my_title}", adj=0, cex.main=1.1)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
225 axis(2, at=c(0,20,40,60,80,100), labels=c('0','20','40','60','80','100%'))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
226 axis(1, at=c(0,20,40,60,80,100), labels=c('0','20','40','60','80','100%'))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
227
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
228 #leg=c("10 kb","50 kb","100 kb")
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
229 #legend("bottomleft",legend=leg , col=c(1,2,3), lty=c(1,1,1))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
230
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
231 #dev.off()
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
232
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
233 </configfile>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
234 </configfiles>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
235
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
236
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
237 <help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
238 .. class:: infomark
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
239
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
240 **What it does**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
241
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
242 This tool generates a Receiver Operating Characteristic (ROC) plot that shows LDA classification success rates for different values of the tuning parameter tau as Figure 3 in Carrel et al., 2006 (PMID: 17009873).
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
243
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
244 *Carrel L, Park C, Tyekucheva S, Dunn J, Chiaromonte F, et al. (2006) Genomic Environment Predicts Expression Patterns on the Human Inactive X Chromosome. PLoS Genet 2(9): e151. doi:10.1371/journal.pgen.0020151*
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
245
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
246 -----
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
247
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
248 .. class:: warningmark
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
249
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
250 **Note**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
251
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
252 - Output from "Perform LDA" tool is used as input file for this tool.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
253
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
254 </help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
255
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
256
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
257
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
258 </tool>