annotate plot_from_lda.xml @ 1:d096b6d081e5 draft default tip

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