14
|
1 ImportedSubstrateList<- read.csv("input1", stringsAsFactors=FALSE)
|
|
2 NegativeSubstrateList<- read.csv("input2", stringsAsFactors=FALSE)
|
17
|
3 SubstrateBackgroundFrequency<- read.csv("input3", stringsAsFactors=FALSE, header = FALSE)
|
14
|
4
|
|
5 ScreenerFilename<-"screener"
|
|
6
|
|
7
|
|
8
|
16
|
9 FILENAME<-"output1"
|
|
10 FILENAME2<-"output2"
|
|
11 FILENAME3<-"output3"
|
14
|
12
|
|
13
|
|
14
|
17
|
15 SubstrateBackgroundFrequency<-t(SubstrateBackgroundFrequency)
|
|
16 # number<-nrow(SubstrateBackgroundFrequency)-1
|
|
17 SubstrateBackgroundFrequency<-SubstrateBackgroundFrequency[2:nrow(SubstrateBackgroundFrequency),]
|
|
18 Sub<-na.omit(SubstrateBackgroundFrequency)
|
|
19 SubstrateBackgroundFrequency<-Sub
|
14
|
20
|
17
|
21 args = commandArgs(trailingOnly=TRUE)
|
18
|
22 TodaysKinase<-as.character(args[1])
|
14
|
23
|
|
24
|
|
25
|
|
26
|
|
27
|
|
28
|
|
29 OutputMatrix<-"KinaseMatrix.csv"
|
|
30 CharacterizationTable<-"CharacterizationTableForThisKinase.csv"
|
|
31 SDtable<-"SDtableforthisKinase"
|
|
32 SiteSelectivityTable<-"SiteSelectivityForThisKinase"
|
|
33
|
|
34
|
|
35
|
|
36 substrates<-matrix(rep("A",times=((nrow(ImportedSubstrateList)-1)*15)),ncol = 15)
|
|
37 #SeqsToBeScored<-"asdasd"
|
|
38
|
|
39 for (i in 2:nrow(ImportedSubstrateList))
|
|
40 {
|
|
41 substratemotif<-ImportedSubstrateList[i,4:18]
|
|
42 substratemotif[8]<-"Y"
|
|
43 #substratemotif<-paste(substratemotif,sep = "",collapse = "")
|
|
44 j=i-1
|
|
45 substratemotif<-unlist(substratemotif)
|
|
46 substrates[j,1:15]<-substratemotif
|
|
47 }
|
|
48
|
|
49 # SpacesToOs<-c(""="O",)
|
|
50 # substrates<-SpacesToOs[substrates]
|
|
51
|
|
52 SubstrateBackgroundFrequency[nrow(SubstrateBackgroundFrequency),2]
|
|
53
|
|
54 if(2==2){
|
|
55 Amean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),2]), na.rm=TRUE)
|
|
56 Cmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),3]), na.rm=TRUE)
|
|
57 Dmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),4]), na.rm=TRUE)
|
|
58 Emean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),5]), na.rm=TRUE)
|
|
59 Fmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),6]), na.rm=TRUE)
|
|
60 Gmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),7]), na.rm=TRUE)
|
|
61 Hmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),8]), na.rm=TRUE)
|
|
62 Imean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),9]), na.rm=TRUE)
|
|
63 Kmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),10]), na.rm=TRUE)
|
|
64 Lmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),11]), na.rm=TRUE)
|
|
65 Mmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),12]), na.rm=TRUE)
|
|
66 Nmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),13]), na.rm=TRUE)
|
|
67 Pmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),14]), na.rm=TRUE)
|
|
68 Qmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),15]), na.rm=TRUE)
|
|
69 Rmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),16]), na.rm=TRUE)
|
|
70 Smean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),17]), na.rm=TRUE)
|
|
71 Tmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),18]), na.rm=TRUE)
|
|
72 Vmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),19]), na.rm=TRUE)
|
|
73 Wmean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),20]), na.rm=TRUE)
|
|
74 Ymean<-mean(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),21]), na.rm=TRUE)
|
|
75
|
|
76 AllMeans<-c(Amean,Cmean,Dmean,Emean,Fmean,Gmean,Hmean,Imean,Kmean,Lmean,Mmean,Nmean,Pmean,Qmean,Rmean,Smean,Tmean,Vmean,Wmean,Ymean)
|
|
77
|
|
78 Asd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),2]), na.rm=TRUE)
|
|
79 Csd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),3]), na.rm=TRUE)
|
|
80 Dsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),4]), na.rm=TRUE)
|
|
81 Esd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),5]), na.rm=TRUE)
|
|
82 Fsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),6]), na.rm=TRUE)
|
|
83 Gsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),7]), na.rm=TRUE)
|
|
84 Hsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),8]), na.rm=TRUE)
|
|
85 Isd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),9]), na.rm=TRUE)
|
|
86 Ksd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),10]), na.rm=TRUE)
|
|
87 Lsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),11]), na.rm=TRUE)
|
|
88 Msd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),12]), na.rm=TRUE)
|
|
89 Nsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),13]), na.rm=TRUE)
|
|
90 Psd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),14]), na.rm=TRUE)
|
|
91 Qsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),15]), na.rm=TRUE)
|
|
92 Rsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),16]), na.rm=TRUE)
|
|
93 Ssd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),17]), na.rm=TRUE)
|
|
94 Tsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),18]), na.rm=TRUE)
|
|
95 Vsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),19]), na.rm=TRUE)
|
|
96 Wsd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),20]), na.rm=TRUE)
|
|
97 Ysd<-sd(as.numeric(SubstrateBackgroundFrequency[1:(nrow(SubstrateBackgroundFrequency)),21]), na.rm=TRUE)
|
|
98 }
|
|
99 AllSDs<-c(Asd,Csd,Dsd,Esd,Fsd,Gsd,Hsd,Isd,Ksd,Lsd,Msd,Nsd,Psd,Qsd,Rsd,Ssd,Tsd,Vsd,Wsd,Ysd)
|
|
100 #this is subbackfreq SDs
|
|
101
|
|
102 SBF_statisticalvalues<-cbind(AllMeans,AllSDs)
|
|
103
|
|
104 #create the percent table
|
|
105 if (1==1){
|
|
106 Column1<-substrates[,1]
|
|
107 Column2<-substrates[,2]
|
|
108 Column3<-substrates[,3]
|
|
109 Column4<-substrates[,4]
|
|
110 Column5<-substrates[,5]
|
|
111 Column6<-substrates[,6]
|
|
112 Column7<-substrates[,7]
|
|
113 Column8<-substrates[,8]
|
|
114 Column9<-substrates[,9]
|
|
115 Column10<-substrates[,10]
|
|
116 Column11<-substrates[,11]
|
|
117 Column12<-substrates[,12]
|
|
118 Column13<-substrates[,13]
|
|
119 Column14<-substrates[,14]
|
|
120 Column15<-substrates[,15]
|
|
121
|
|
122 spaces1<-sum((Column1%in% ""))
|
|
123 spaces2<-sum(Column2%in% "")
|
|
124 spaces3<-sum(Column3%in% "")
|
|
125 spaces4<-sum(Column4%in% "")
|
|
126 spaces5<-sum(Column5%in% "")
|
|
127 spaces6<-sum(Column6%in% "")
|
|
128 spaces7<-sum(Column7%in% "")
|
|
129 spaces8<-sum(Column8%in% "")
|
|
130 spaces9<-sum(Column9%in% "")
|
|
131 spaces10<-sum(Column10%in% "")
|
|
132 spaces11<-sum(Column11%in% "")
|
|
133 spaces12<-sum(Column12%in% "")
|
|
134 spaces13<-sum(Column13%in% "")
|
|
135 spaces14<-sum(Column14%in% "")
|
|
136 spaces15<-sum(Column15%in% "")
|
|
137
|
|
138 A1<-sum(Column1 %in% "A")/(length(Column1)-spaces1)
|
|
139 A2<-sum(Column2 %in% "A")/(length(Column2)-spaces2)
|
|
140 A3<-sum(Column3 %in% "A")/(length(Column3)-spaces3)
|
|
141 A4<-sum(Column4 %in% "A")/(length(Column4)-spaces4)
|
|
142 A5<-sum(Column5 %in% "A")/(length(Column5)-spaces5)
|
|
143 A6<-sum(Column6 %in% "A")/(length(Column6)-spaces6)
|
|
144 A7<-sum(Column7 %in% "A")/(length(Column7)-spaces7)
|
|
145 A8<-sum(Column8 %in% "A")/(length(Column8)-spaces8)
|
|
146 A9<-sum(Column9 %in% "A")/(length(Column9)-spaces9)
|
|
147 A10<-sum(Column10 %in% "A")/(length(Column10)-spaces10)
|
|
148 A11<-sum(Column11 %in% "A")/(length(Column11)-spaces11)
|
|
149 A12<-sum(Column12 %in% "A")/(length(Column12)-spaces12)
|
|
150 A13<-sum(Column13 %in% "A")/(length(Column13)-spaces13)
|
|
151 A14<-sum(Column14 %in% "A")/(length(Column14)-spaces14)
|
|
152 A15<-sum(Column15 %in% "A")/(length(Column15)-spaces15)
|
|
153 AllAs<-cbind(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)
|
|
154
|
|
155 C1<-sum(Column1 %in% "C")/(length(Column1)-spaces1)
|
|
156 C2<-sum(Column2 %in% "C")/(length(Column2)-spaces2)
|
|
157 C3<-sum(Column3 %in% "C")/(length(Column3)-spaces3)
|
|
158 C4<-sum(Column4 %in% "C")/(length(Column4)-spaces4)
|
|
159 C5<-sum(Column5 %in% "C")/(length(Column5)-spaces5)
|
|
160 C6<-sum(Column6 %in% "C")/(length(Column6)-spaces6)
|
|
161 C7<-sum(Column7 %in% "C")/(length(Column7)-spaces7)
|
|
162 C8<-sum(Column8 %in% "C")/(length(Column8)-spaces8)
|
|
163 C9<-sum(Column9 %in% "C")/(length(Column9)-spaces9)
|
|
164 C10<-sum(Column10 %in% "C")/(length(Column10)-spaces10)
|
|
165 C11<-sum(Column11 %in% "C")/(length(Column11)-spaces11)
|
|
166 C12<-sum(Column12 %in% "C")/(length(Column12)-spaces12)
|
|
167 C13<-sum(Column13 %in% "C")/(length(Column13)-spaces13)
|
|
168 C14<-sum(Column14 %in% "C")/(length(Column14)-spaces14)
|
|
169 C15<-sum(Column15 %in% "C")/(length(Column15)-spaces15)
|
|
170 CllCs<-cbind(C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15)
|
|
171
|
|
172 D1<-sum(Column1 %in% "D")/(length(Column1)-spaces1)
|
|
173 D2<-sum(Column2 %in% "D")/(length(Column2)-spaces2)
|
|
174 D3<-sum(Column3 %in% "D")/(length(Column3)-spaces3)
|
|
175 D4<-sum(Column4 %in% "D")/(length(Column4)-spaces4)
|
|
176 D5<-sum(Column5 %in% "D")/(length(Column5)-spaces5)
|
|
177 D6<-sum(Column6 %in% "D")/(length(Column6)-spaces6)
|
|
178 D7<-sum(Column7 %in% "D")/(length(Column7)-spaces7)
|
|
179 D8<-sum(Column8 %in% "D")/(length(Column8)-spaces8)
|
|
180 D9<-sum(Column9 %in% "D")/(length(Column9)-spaces9)
|
|
181 D10<-sum(Column10 %in% "D")/(length(Column10)-spaces10)
|
|
182 D11<-sum(Column11 %in% "D")/(length(Column11)-spaces11)
|
|
183 D12<-sum(Column12 %in% "D")/(length(Column12)-spaces12)
|
|
184 D13<-sum(Column13 %in% "D")/(length(Column13)-spaces13)
|
|
185 D14<-sum(Column14 %in% "D")/(length(Column14)-spaces14)
|
|
186 D15<-sum(Column15 %in% "D")/(length(Column15)-spaces15)
|
|
187 DllDs<-cbind(D1,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12,D13,D14,D15)
|
|
188
|
|
189 E1<-sum(Column1 %in% "E")/(length(Column1)-spaces1)
|
|
190 E2<-sum(Column2 %in% "E")/(length(Column2)-spaces2)
|
|
191 E3<-sum(Column3 %in% "E")/(length(Column3)-spaces3)
|
|
192 E4<-sum(Column4 %in% "E")/(length(Column4)-spaces4)
|
|
193 E5<-sum(Column5 %in% "E")/(length(Column5)-spaces5)
|
|
194 E6<-sum(Column6 %in% "E")/(length(Column6)-spaces6)
|
|
195 E7<-sum(Column7 %in% "E")/(length(Column7)-spaces7)
|
|
196 E8<-sum(Column8 %in% "E")/(length(Column8)-spaces8)
|
|
197 E9<-sum(Column9 %in% "E")/(length(Column9)-spaces9)
|
|
198 E10<-sum(Column10 %in% "E")/(length(Column10)-spaces10)
|
|
199 E11<-sum(Column11 %in% "E")/(length(Column11)-spaces11)
|
|
200 E12<-sum(Column12 %in% "E")/(length(Column12)-spaces12)
|
|
201 E13<-sum(Column13 %in% "E")/(length(Column13)-spaces13)
|
|
202 E14<-sum(Column14 %in% "E")/(length(Column14)-spaces14)
|
|
203 E15<-sum(Column15 %in% "E")/(length(Column15)-spaces15)
|
|
204 EllEs<-cbind(E1,E2,E3,E4,E5,E6,E7,E8,E9,E10,E11,E12,E13,E14,E15)
|
|
205
|
|
206
|
|
207 F1<-sum(Column1 %in% "F")/(length(Column1)-spaces1)
|
|
208 F2<-sum(Column2 %in% "F")/(length(Column2)-spaces2)
|
|
209 F3<-sum(Column3 %in% "F")/(length(Column3)-spaces3)
|
|
210 F4<-sum(Column4 %in% "F")/(length(Column4)-spaces4)
|
|
211 F5<-sum(Column5 %in% "F")/(length(Column5)-spaces5)
|
|
212 F6<-sum(Column6 %in% "F")/(length(Column6)-spaces6)
|
|
213 F7<-sum(Column7 %in% "F")/(length(Column7)-spaces7)
|
|
214 F8<-sum(Column8 %in% "F")/(length(Column8)-spaces8)
|
|
215 F9<-sum(Column9 %in% "F")/(length(Column9)-spaces9)
|
|
216 F10<-sum(Column10 %in% "F")/(length(Column10)-spaces10)
|
|
217 F11<-sum(Column11 %in% "F")/(length(Column11)-spaces11)
|
|
218 F12<-sum(Column12 %in% "F")/(length(Column12)-spaces12)
|
|
219 F13<-sum(Column13 %in% "F")/(length(Column13)-spaces13)
|
|
220 F14<-sum(Column14 %in% "F")/(length(Column14)-spaces14)
|
|
221 F15<-sum(Column15 %in% "F")/(length(Column15)-spaces15)
|
|
222 FllFs<-cbind(F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15)
|
|
223
|
|
224
|
|
225 G1<-sum(Column1 %in% "G")/(length(Column1)-spaces1)
|
|
226 G2<-sum(Column2 %in% "G")/(length(Column2)-spaces2)
|
|
227 G3<-sum(Column3 %in% "G")/(length(Column3)-spaces3)
|
|
228 G4<-sum(Column4 %in% "G")/(length(Column4)-spaces4)
|
|
229 G5<-sum(Column5 %in% "G")/(length(Column5)-spaces5)
|
|
230 G6<-sum(Column6 %in% "G")/(length(Column6)-spaces6)
|
|
231 G7<-sum(Column7 %in% "G")/(length(Column7)-spaces7)
|
|
232 G8<-sum(Column8 %in% "G")/(length(Column8)-spaces8)
|
|
233 G9<-sum(Column9 %in% "G")/(length(Column9)-spaces9)
|
|
234 G10<-sum(Column10 %in% "G")/(length(Column10)-spaces10)
|
|
235 G11<-sum(Column11 %in% "G")/(length(Column11)-spaces11)
|
|
236 G12<-sum(Column12 %in% "G")/(length(Column12)-spaces12)
|
|
237 G13<-sum(Column13 %in% "G")/(length(Column13)-spaces13)
|
|
238 G14<-sum(Column14 %in% "G")/(length(Column14)-spaces14)
|
|
239 G15<-sum(Column15 %in% "G")/(length(Column15)-spaces15)
|
|
240 GllGs<-cbind(G1,G2,G3,G4,G5,G6,G7,G8,G9,G10,G11,G12,G13,G14,G15)
|
|
241
|
|
242
|
|
243 H1<-sum(Column1 %in% "H")/(length(Column1)-spaces1)
|
|
244 H2<-sum(Column2 %in% "H")/(length(Column2)-spaces2)
|
|
245 H3<-sum(Column3 %in% "H")/(length(Column3)-spaces3)
|
|
246 H4<-sum(Column4 %in% "H")/(length(Column4)-spaces4)
|
|
247 H5<-sum(Column5 %in% "H")/(length(Column5)-spaces5)
|
|
248 H6<-sum(Column6 %in% "H")/(length(Column6)-spaces6)
|
|
249 H7<-sum(Column7 %in% "H")/(length(Column7)-spaces7)
|
|
250 H8<-sum(Column8 %in% "H")/(length(Column8)-spaces8)
|
|
251 H9<-sum(Column9 %in% "H")/(length(Column9)-spaces9)
|
|
252 H10<-sum(Column10 %in% "H")/(length(Column10)-spaces10)
|
|
253 H11<-sum(Column11 %in% "H")/(length(Column11)-spaces11)
|
|
254 H12<-sum(Column12 %in% "H")/(length(Column12)-spaces12)
|
|
255 H13<-sum(Column13 %in% "H")/(length(Column13)-spaces13)
|
|
256 H14<-sum(Column14 %in% "H")/(length(Column14)-spaces14)
|
|
257 H15<-sum(Column15 %in% "H")/(length(Column15)-spaces15)
|
|
258 HllHs<-cbind(H1,H2,H3,H4,H5,H6,H7,H8,H9,H10,H11,H12,H13,H14,H15)
|
|
259
|
|
260
|
|
261 I1<-sum(Column1 %in% "I")/(length(Column1)-spaces1)
|
|
262 I2<-sum(Column2 %in% "I")/(length(Column2)-spaces2)
|
|
263 I3<-sum(Column3 %in% "I")/(length(Column3)-spaces3)
|
|
264 I4<-sum(Column4 %in% "I")/(length(Column4)-spaces4)
|
|
265 I5<-sum(Column5 %in% "I")/(length(Column5)-spaces5)
|
|
266 I6<-sum(Column6 %in% "I")/(length(Column6)-spaces6)
|
|
267 I7<-sum(Column7 %in% "I")/(length(Column7)-spaces7)
|
|
268 I8<-sum(Column8 %in% "I")/(length(Column8)-spaces8)
|
|
269 I9<-sum(Column9 %in% "I")/(length(Column9)-spaces9)
|
|
270 I10<-sum(Column10 %in% "I")/(length(Column10)-spaces10)
|
|
271 I11<-sum(Column11 %in% "I")/(length(Column11)-spaces11)
|
|
272 I12<-sum(Column12 %in% "I")/(length(Column12)-spaces12)
|
|
273 I13<-sum(Column13 %in% "I")/(length(Column13)-spaces13)
|
|
274 I14<-sum(Column14 %in% "I")/(length(Column14)-spaces14)
|
|
275 I15<-sum(Column15 %in% "I")/(length(Column15)-spaces15)
|
|
276 IllIs<-cbind(I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14,I15)
|
|
277
|
|
278
|
|
279 K1<-sum(Column1 %in% "K")/(length(Column1)-spaces1)
|
|
280 K2<-sum(Column2 %in% "K")/(length(Column2)-spaces2)
|
|
281 K3<-sum(Column3 %in% "K")/(length(Column3)-spaces3)
|
|
282 K4<-sum(Column4 %in% "K")/(length(Column4)-spaces4)
|
|
283 K5<-sum(Column5 %in% "K")/(length(Column5)-spaces5)
|
|
284 K6<-sum(Column6 %in% "K")/(length(Column6)-spaces6)
|
|
285 K7<-sum(Column7 %in% "K")/(length(Column7)-spaces7)
|
|
286 K8<-sum(Column8 %in% "K")/(length(Column8)-spaces8)
|
|
287 K9<-sum(Column9 %in% "K")/(length(Column9)-spaces9)
|
|
288 K10<-sum(Column10 %in% "K")/(length(Column10)-spaces10)
|
|
289 K11<-sum(Column11 %in% "K")/(length(Column11)-spaces11)
|
|
290 K12<-sum(Column12 %in% "K")/(length(Column12)-spaces12)
|
|
291 K13<-sum(Column13 %in% "K")/(length(Column13)-spaces13)
|
|
292 K14<-sum(Column14 %in% "K")/(length(Column14)-spaces14)
|
|
293 K15<-sum(Column15 %in% "K")/(length(Column15)-spaces15)
|
|
294 KllKs<-cbind(K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15)
|
|
295
|
|
296
|
|
297 L1<-sum(Column1 %in% "L")/(length(Column1)-spaces1)
|
|
298 L2<-sum(Column2 %in% "L")/(length(Column2)-spaces2)
|
|
299 L3<-sum(Column3 %in% "L")/(length(Column3)-spaces3)
|
|
300 L4<-sum(Column4 %in% "L")/(length(Column4)-spaces4)
|
|
301 L5<-sum(Column5 %in% "L")/(length(Column5)-spaces5)
|
|
302 L6<-sum(Column6 %in% "L")/(length(Column6)-spaces6)
|
|
303 L7<-sum(Column7 %in% "L")/(length(Column7)-spaces7)
|
|
304 L8<-sum(Column8 %in% "L")/(length(Column8)-spaces8)
|
|
305 L9<-sum(Column9 %in% "L")/(length(Column9)-spaces9)
|
|
306 L10<-sum(Column10 %in% "L")/(length(Column10)-spaces10)
|
|
307 L11<-sum(Column11 %in% "L")/(length(Column11)-spaces11)
|
|
308 L12<-sum(Column12 %in% "L")/(length(Column12)-spaces12)
|
|
309 L13<-sum(Column13 %in% "L")/(length(Column13)-spaces13)
|
|
310 L14<-sum(Column14 %in% "L")/(length(Column14)-spaces14)
|
|
311 L15<-sum(Column15 %in% "L")/(length(Column15)-spaces15)
|
|
312 LllLs<-cbind(L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14,L15)
|
|
313
|
|
314
|
|
315 M1<-sum(Column1 %in% "M")/(length(Column1)-spaces1)
|
|
316 M2<-sum(Column2 %in% "M")/(length(Column2)-spaces2)
|
|
317 M3<-sum(Column3 %in% "M")/(length(Column3)-spaces3)
|
|
318 M4<-sum(Column4 %in% "M")/(length(Column4)-spaces4)
|
|
319 M5<-sum(Column5 %in% "M")/(length(Column5)-spaces5)
|
|
320 M6<-sum(Column6 %in% "M")/(length(Column6)-spaces6)
|
|
321 M7<-sum(Column7 %in% "M")/(length(Column7)-spaces7)
|
|
322 M8<-sum(Column8 %in% "M")/(length(Column8)-spaces8)
|
|
323 M9<-sum(Column9 %in% "M")/(length(Column9)-spaces9)
|
|
324 M10<-sum(Column10 %in% "M")/(length(Column10)-spaces10)
|
|
325 M11<-sum(Column11 %in% "M")/(length(Column11)-spaces11)
|
|
326 M12<-sum(Column12 %in% "M")/(length(Column12)-spaces12)
|
|
327 M13<-sum(Column13 %in% "M")/(length(Column13)-spaces13)
|
|
328 M14<-sum(Column14 %in% "M")/(length(Column14)-spaces14)
|
|
329 M15<-sum(Column15 %in% "M")/(length(Column15)-spaces15)
|
|
330 MllMs<-cbind(M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15)
|
|
331
|
|
332
|
|
333 N1<-sum(Column1 %in% "N")/(length(Column1)-spaces1)
|
|
334 N2<-sum(Column2 %in% "N")/(length(Column2)-spaces2)
|
|
335 N3<-sum(Column3 %in% "N")/(length(Column3)-spaces3)
|
|
336 N4<-sum(Column4 %in% "N")/(length(Column4)-spaces4)
|
|
337 N5<-sum(Column5 %in% "N")/(length(Column5)-spaces5)
|
|
338 N6<-sum(Column6 %in% "N")/(length(Column6)-spaces6)
|
|
339 N7<-sum(Column7 %in% "N")/(length(Column7)-spaces7)
|
|
340 N8<-sum(Column8 %in% "N")/(length(Column8)-spaces8)
|
|
341 N9<-sum(Column9 %in% "N")/(length(Column9)-spaces9)
|
|
342 N10<-sum(Column10 %in% "N")/(length(Column10)-spaces10)
|
|
343 N11<-sum(Column11 %in% "N")/(length(Column11)-spaces11)
|
|
344 N12<-sum(Column12 %in% "N")/(length(Column12)-spaces12)
|
|
345 N13<-sum(Column13 %in% "N")/(length(Column13)-spaces13)
|
|
346 N14<-sum(Column14 %in% "N")/(length(Column14)-spaces14)
|
|
347 N15<-sum(Column15 %in% "N")/(length(Column15)-spaces15)
|
|
348 NllNs<-cbind(N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,N12,N13,N14,N15)
|
|
349
|
|
350
|
|
351 P1<-sum(Column1 %in% "P")/(length(Column1)-spaces1)
|
|
352 P2<-sum(Column2 %in% "P")/(length(Column2)-spaces2)
|
|
353 P3<-sum(Column3 %in% "P")/(length(Column3)-spaces3)
|
|
354 P4<-sum(Column4 %in% "P")/(length(Column4)-spaces4)
|
|
355 P5<-sum(Column5 %in% "P")/(length(Column5)-spaces5)
|
|
356 P6<-sum(Column6 %in% "P")/(length(Column6)-spaces6)
|
|
357 P7<-sum(Column7 %in% "P")/(length(Column7)-spaces7)
|
|
358 P8<-sum(Column8 %in% "P")/(length(Column8)-spaces8)
|
|
359 P9<-sum(Column9 %in% "P")/(length(Column9)-spaces9)
|
|
360 P10<-sum(Column10 %in% "P")/(length(Column10)-spaces10)
|
|
361 P11<-sum(Column11 %in% "P")/(length(Column11)-spaces11)
|
|
362 P12<-sum(Column12 %in% "P")/(length(Column12)-spaces12)
|
|
363 P13<-sum(Column13 %in% "P")/(length(Column13)-spaces13)
|
|
364 P14<-sum(Column14 %in% "P")/(length(Column14)-spaces14)
|
|
365 P15<-sum(Column15 %in% "P")/(length(Column15)-spaces15)
|
|
366 PllPs<-cbind(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)
|
|
367
|
|
368
|
|
369 Q1<-sum(Column1 %in% "Q")/(length(Column1)-spaces1)
|
|
370 Q2<-sum(Column2 %in% "Q")/(length(Column2)-spaces2)
|
|
371 Q3<-sum(Column3 %in% "Q")/(length(Column3)-spaces3)
|
|
372 Q4<-sum(Column4 %in% "Q")/(length(Column4)-spaces4)
|
|
373 Q5<-sum(Column5 %in% "Q")/(length(Column5)-spaces5)
|
|
374 Q6<-sum(Column6 %in% "Q")/(length(Column6)-spaces6)
|
|
375 Q7<-sum(Column7 %in% "Q")/(length(Column7)-spaces7)
|
|
376 Q8<-sum(Column8 %in% "Q")/(length(Column8)-spaces8)
|
|
377 Q9<-sum(Column9 %in% "Q")/(length(Column9)-spaces9)
|
|
378 Q10<-sum(Column10 %in% "Q")/(length(Column10)-spaces10)
|
|
379 Q11<-sum(Column11 %in% "Q")/(length(Column11)-spaces11)
|
|
380 Q12<-sum(Column12 %in% "Q")/(length(Column12)-spaces12)
|
|
381 Q13<-sum(Column13 %in% "Q")/(length(Column13)-spaces13)
|
|
382 Q14<-sum(Column14 %in% "Q")/(length(Column14)-spaces14)
|
|
383 Q15<-sum(Column15 %in% "Q")/(length(Column15)-spaces15)
|
|
384 QllQs<-cbind(Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q14,Q15)
|
|
385
|
|
386
|
|
387 R1<-sum(Column1 %in% "R")/(length(Column1)-spaces1)
|
|
388 R2<-sum(Column2 %in% "R")/(length(Column2)-spaces2)
|
|
389 R3<-sum(Column3 %in% "R")/(length(Column3)-spaces3)
|
|
390 R4<-sum(Column4 %in% "R")/(length(Column4)-spaces4)
|
|
391 R5<-sum(Column5 %in% "R")/(length(Column5)-spaces5)
|
|
392 R6<-sum(Column6 %in% "R")/(length(Column6)-spaces6)
|
|
393 R7<-sum(Column7 %in% "R")/(length(Column7)-spaces7)
|
|
394 R8<-sum(Column8 %in% "R")/(length(Column8)-spaces8)
|
|
395 R9<-sum(Column9 %in% "R")/(length(Column9)-spaces9)
|
|
396 R10<-sum(Column10 %in% "R")/(length(Column10)-spaces10)
|
|
397 R11<-sum(Column11 %in% "R")/(length(Column11)-spaces11)
|
|
398 R12<-sum(Column12 %in% "R")/(length(Column12)-spaces12)
|
|
399 R13<-sum(Column13 %in% "R")/(length(Column13)-spaces13)
|
|
400 R14<-sum(Column14 %in% "R")/(length(Column14)-spaces14)
|
|
401 R15<-sum(Column15 %in% "R")/(length(Column15)-spaces15)
|
|
402 RllRs<-cbind(R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15)
|
|
403
|
|
404
|
|
405 S1<-sum(Column1 %in% "S")/(length(Column1)-spaces1)
|
|
406 S2<-sum(Column2 %in% "S")/(length(Column2)-spaces2)
|
|
407 S3<-sum(Column3 %in% "S")/(length(Column3)-spaces3)
|
|
408 S4<-sum(Column4 %in% "S")/(length(Column4)-spaces4)
|
|
409 S5<-sum(Column5 %in% "S")/(length(Column5)-spaces5)
|
|
410 S6<-sum(Column6 %in% "S")/(length(Column6)-spaces6)
|
|
411 S7<-sum(Column7 %in% "S")/(length(Column7)-spaces7)
|
|
412 S8<-sum(Column8 %in% "S")/(length(Column8)-spaces8)
|
|
413 S9<-sum(Column9 %in% "S")/(length(Column9)-spaces9)
|
|
414 S10<-sum(Column10 %in% "S")/(length(Column10)-spaces10)
|
|
415 S11<-sum(Column11 %in% "S")/(length(Column11)-spaces11)
|
|
416 S12<-sum(Column12 %in% "S")/(length(Column12)-spaces12)
|
|
417 S13<-sum(Column13 %in% "S")/(length(Column13)-spaces13)
|
|
418 S14<-sum(Column14 %in% "S")/(length(Column14)-spaces14)
|
|
419 S15<-sum(Column15 %in% "S")/(length(Column15)-spaces15)
|
|
420 SllSs<-cbind(S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15)
|
|
421
|
|
422
|
|
423 T1<-sum(Column1 %in% "T")/(length(Column1)-spaces1)
|
|
424 T2<-sum(Column2 %in% "T")/(length(Column2)-spaces2)
|
|
425 T3<-sum(Column3 %in% "T")/(length(Column3)-spaces3)
|
|
426 T4<-sum(Column4 %in% "T")/(length(Column4)-spaces4)
|
|
427 T5<-sum(Column5 %in% "T")/(length(Column5)-spaces5)
|
|
428 T6<-sum(Column6 %in% "T")/(length(Column6)-spaces6)
|
|
429 T7<-sum(Column7 %in% "T")/(length(Column7)-spaces7)
|
|
430 T8<-sum(Column8 %in% "T")/(length(Column8)-spaces8)
|
|
431 T9<-sum(Column9 %in% "T")/(length(Column9)-spaces9)
|
|
432 T10<-sum(Column10 %in% "T")/(length(Column10)-spaces10)
|
|
433 T11<-sum(Column11 %in% "T")/(length(Column11)-spaces11)
|
|
434 T12<-sum(Column12 %in% "T")/(length(Column12)-spaces12)
|
|
435 T13<-sum(Column13 %in% "T")/(length(Column13)-spaces13)
|
|
436 T14<-sum(Column14 %in% "T")/(length(Column14)-spaces14)
|
|
437 T15<-sum(Column15 %in% "T")/(length(Column15)-spaces15)
|
|
438 TllTs<-cbind(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)
|
|
439
|
|
440
|
|
441 V1<-sum(Column1 %in% "V")/(length(Column1)-spaces1)
|
|
442 V2<-sum(Column2 %in% "V")/(length(Column2)-spaces2)
|
|
443 V3<-sum(Column3 %in% "V")/(length(Column3)-spaces3)
|
|
444 V4<-sum(Column4 %in% "V")/(length(Column4)-spaces4)
|
|
445 V5<-sum(Column5 %in% "V")/(length(Column5)-spaces5)
|
|
446 V6<-sum(Column6 %in% "V")/(length(Column6)-spaces6)
|
|
447 V7<-sum(Column7 %in% "V")/(length(Column7)-spaces7)
|
|
448 V8<-sum(Column8 %in% "V")/(length(Column8)-spaces8)
|
|
449 V9<-sum(Column9 %in% "V")/(length(Column9)-spaces9)
|
|
450 V10<-sum(Column10 %in% "V")/(length(Column10)-spaces10)
|
|
451 V11<-sum(Column11 %in% "V")/(length(Column11)-spaces11)
|
|
452 V12<-sum(Column12 %in% "V")/(length(Column12)-spaces12)
|
|
453 V13<-sum(Column13 %in% "V")/(length(Column13)-spaces13)
|
|
454 V14<-sum(Column14 %in% "V")/(length(Column14)-spaces14)
|
|
455 V15<-sum(Column15 %in% "V")/(length(Column15)-spaces15)
|
|
456 VllVs<-cbind(V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15)
|
|
457
|
|
458
|
|
459 W1<-sum(Column1 %in% "W")/(length(Column1)-spaces1)
|
|
460 W2<-sum(Column2 %in% "W")/(length(Column2)-spaces2)
|
|
461 W3<-sum(Column3 %in% "W")/(length(Column3)-spaces3)
|
|
462 W4<-sum(Column4 %in% "W")/(length(Column4)-spaces4)
|
|
463 W5<-sum(Column5 %in% "W")/(length(Column5)-spaces5)
|
|
464 W6<-sum(Column6 %in% "W")/(length(Column6)-spaces6)
|
|
465 W7<-sum(Column7 %in% "W")/(length(Column7)-spaces7)
|
|
466 W8<-sum(Column8 %in% "W")/(length(Column8)-spaces8)
|
|
467 W9<-sum(Column9 %in% "W")/(length(Column9)-spaces9)
|
|
468 W10<-sum(Column10 %in% "W")/(length(Column10)-spaces10)
|
|
469 W11<-sum(Column11 %in% "W")/(length(Column11)-spaces11)
|
|
470 W12<-sum(Column12 %in% "W")/(length(Column12)-spaces12)
|
|
471 W13<-sum(Column13 %in% "W")/(length(Column13)-spaces13)
|
|
472 W14<-sum(Column14 %in% "W")/(length(Column14)-spaces14)
|
|
473 W15<-sum(Column15 %in% "W")/(length(Column15)-spaces15)
|
|
474 WllWs<-cbind(W1,W2,W3,W4,W5,W6,W7,W8,W9,W10,W11,W12,W13,W14,W15)
|
|
475
|
|
476
|
|
477 Y1<-sum(Column1 %in% "Y")/(length(Column1)-spaces1)
|
|
478 Y2<-sum(Column2 %in% "Y")/(length(Column2)-spaces2)
|
|
479 Y3<-sum(Column3 %in% "Y")/(length(Column3)-spaces3)
|
|
480 Y4<-sum(Column4 %in% "Y")/(length(Column4)-spaces4)
|
|
481 Y5<-sum(Column5 %in% "Y")/(length(Column5)-spaces5)
|
|
482 Y6<-sum(Column6 %in% "Y")/(length(Column6)-spaces6)
|
|
483 Y7<-sum(Column7 %in% "Y")/(length(Column7)-spaces7)
|
|
484 Y8<-sum(Column8 %in% "Y")/(length(Column8)-spaces8)
|
|
485 Y9<-sum(Column9 %in% "Y")/(length(Column9)-spaces9)
|
|
486 Y10<-sum(Column10 %in% "Y")/(length(Column10)-spaces10)
|
|
487 Y11<-sum(Column11 %in% "Y")/(length(Column11)-spaces11)
|
|
488 Y12<-sum(Column12 %in% "Y")/(length(Column12)-spaces12)
|
|
489 Y13<-sum(Column13 %in% "Y")/(length(Column13)-spaces13)
|
|
490 Y14<-sum(Column14 %in% "Y")/(length(Column14)-spaces14)
|
|
491 Y15<-sum(Column15 %in% "Y")/(length(Column15)-spaces15)
|
|
492 YllYs<-cbind(Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Y10,Y11,Y12,Y13,Y14,Y15)
|
|
493 }
|
|
494 #this is substrate percents
|
|
495
|
|
496 #A C D E F G H I K L N P Q R S T V W Y
|
|
497
|
|
498 PercentTable<-rbind(AllAs,CllCs,DllDs,EllEs,FllFs,GllGs,HllHs,IllIs,KllKs,LllLs,MllMs,NllNs,PllPs,QllQs,RllRs,SllSs,TllTs,VllVs,WllWs,YllYs)
|
|
499 PercentTable<-PercentTable*100
|
|
500
|
|
501 #create the SD table
|
|
502 SDtable<-matrix(data = rep(1,times=(nrow(PercentTable)*ncol(PercentTable))),nrow = nrow(PercentTable),ncol = ncol(PercentTable))
|
|
503 #for every row, a percertage minus the same mean over the same SD
|
|
504 if(1==1){
|
|
505 SDtable[1,]<-(PercentTable[1,]-Amean)/Asd
|
|
506 SDtable[2,]<-(PercentTable[2,]-Cmean)/Csd
|
|
507 SDtable[3,]<-(PercentTable[3,]-Dmean)/Dsd
|
|
508 SDtable[4,]<-(PercentTable[4,]-Emean)/Esd
|
|
509 SDtable[5,]<-(PercentTable[5,]-Fmean)/Fsd
|
|
510 SDtable[6,]<-(PercentTable[6,]-Gmean)/Gsd
|
|
511 SDtable[7,]<-(PercentTable[7,]-Hmean)/Hsd
|
|
512 SDtable[8,]<-(PercentTable[8,]-Imean)/Isd
|
|
513 SDtable[9,]<-(PercentTable[9,]-Kmean)/Ksd
|
|
514 SDtable[10,]<-(PercentTable[10,]-Lmean)/Lsd
|
|
515 SDtable[11,]<-(PercentTable[11,]-Mmean)/Msd
|
|
516 SDtable[12,]<-(PercentTable[12,]-Nmean)/Nsd
|
|
517 SDtable[13,]<-(PercentTable[13,]-Pmean)/Psd
|
|
518 SDtable[14,]<-(PercentTable[14,]-Qmean)/Qsd
|
|
519 SDtable[15,]<-(PercentTable[15,]-Rmean)/Rsd
|
|
520 SDtable[16,]<-(PercentTable[16,]-Smean)/Ssd
|
|
521 SDtable[17,]<-(PercentTable[17,]-Tmean)/Tsd
|
|
522 SDtable[18,]<-(PercentTable[18,]-Vmean)/Vsd
|
|
523 SDtable[19,]<-(PercentTable[19,]-Wmean)/Wsd
|
|
524 SDtable[20,]<-(PercentTable[20,]-Ymean)/Ysd
|
|
525 }
|
|
526
|
|
527
|
|
528 SetOfAAs<-c("Letter","A","C","D","E","F","G","H","I","K","L","M","N","P","Q","R","S","T","V","W","Y")
|
|
529
|
19
|
530 SumOfSigmaAAs<-c(1:15)
|
14
|
531
|
19
|
532 for (i in 1:15){
|
14
|
533 SumOfSigmasValue<-0
|
|
534 for (j in 1:20){
|
18
|
535 value<-0
|
14
|
536 if (SDtable[j,i]>2){
|
18
|
537 q=j+1
|
|
538 value<-sum(substrates[,i]==SetOfAAs[q])
|
14
|
539 }
|
|
540 SumOfSigmasValue<-SumOfSigmasValue+value
|
|
541 }
|
|
542 SumOfSigmaAAs[i]<-SumOfSigmasValue
|
|
543 }
|
|
544
|
18
|
545 AAs1<-length(substrates[,1])-sum(substrates[,1]=="")
|
|
546 AAs2<-length(substrates[,2])-sum(substrates[,2]=="")
|
|
547 AAs3<-length(substrates[,3])-sum(substrates[,3]=="")
|
|
548 AAs4<-length(substrates[,4])-sum(substrates[,4]=="")
|
|
549 AAs5<-length(substrates[,5])-sum(substrates[,5]=="")
|
|
550 AAs6<-length(substrates[,6])-sum(substrates[,6]=="")
|
|
551 AAs7<-length(substrates[,7])-sum(substrates[,7]=="")
|
|
552 AAs8<-length(substrates[,8])-sum(substrates[,8]=="")
|
|
553 AAs9<-length(substrates[,9])-sum(substrates[,9]=="")
|
|
554 AAsAtPositions<-c(AAs1,AAs2,AAs3,AAs4,AAs5,AAs6,AAs7,AAs8,AAs9)
|
14
|
555 # AAsAtPositions<-c(length(substrates[,1]),length(substrates[,2]),length(substrates[,3]),length(substrates[,4]),
|
|
556 # length(substrates[,5]),length(substrates[,6]),length(substrates[,7]),length(substrates[,8]),
|
|
557 # length(substrates[,9]))
|
|
558
|
19
|
559 SumOfExpectedSigmaAAs<-c(1:15)
|
|
560 for (i in 1:15){
|
14
|
561 ExpectedValue<-0
|
|
562 for (j in 1:20){
|
18
|
563 value<-0
|
14
|
564 if (SDtable[j,i]>2){
|
|
565 value<-AllMeans[j]
|
|
566 }
|
|
567 ExpectedValue<-ExpectedValue+value
|
|
568 }
|
|
569 SumOfExpectedSigmaAAs[i]<-ExpectedValue*(length(substrates[,i])-sum(substrates[,i]%in% ""))/100
|
|
570 }
|
|
571
|
18
|
572 #SelectivityRow<-SumOfSigmaAAs/SumOfExpectedSigmaAAs
|
|
573
|
19
|
574 SelectivityRow<-rep(0,times=15)
|
18
|
575
|
19
|
576 for (q in 1:15) {
|
18
|
577 SelectivityRow[q]<-(SumOfSigmaAAs[q]/SumOfExpectedSigmaAAs[q])*(SumOfSigmaAAs[q]/AAsAtPositions[q])
|
|
578 }
|
|
579
|
14
|
580 SelectivitySheet<-rbind(SumOfSigmaAAs,SumOfExpectedSigmaAAs,SelectivityRow)
|
|
581
|
|
582 SetOfAAs<-matrix(data = SetOfAAs,ncol = 1)
|
|
583 SDtableu<-SDtable
|
|
584 HeaderSD<-c(-7:7)
|
|
585 SDtable<-rbind(HeaderSD,SDtableu)
|
|
586 row.names(SDtable)<-NULL
|
|
587 SDtable<-data.frame(SetOfAAs,SDtable)
|
|
588
|
|
589 PercentTable<-rbind(HeaderSD,PercentTable)
|
|
590 row.names(PercentTable)<-NULL
|
|
591 PercentTable<-data.frame(SetOfAAs,PercentTable)
|
17
|
592 numberofY<-as.numeric(SubstrateBackgroundFrequency[,34])
|
14
|
593 numberofY<-numberofY[!is.na(numberofY)]
|
|
594
|
17
|
595 numberofPY<-as.numeric(SubstrateBackgroundFrequency[,35])
|
14
|
596 numberofPY<-numberofPY[!is.na(numberofPY)]
|
|
597
|
|
598 NormalizationScore<-sum(numberofPY)/sum(numberofY)
|
|
599
|
|
600 # positions<-matrix(data = NA, nrow=20,ncol = 15)
|
|
601 #
|
|
602 # #column1
|
|
603 #
|
|
604 # for (q in 1:15) {
|
|
605 # sA<-sum(substrates[,i]=="A")
|
|
606 # positions[1,i]<-sA
|
|
607 # sC<-sum(substrates[,i]=="C")
|
|
608 # positions[2,i]<-sC
|
|
609 # sD<-sum(substrates[,i]=="D")
|
|
610 # positions[3,i]<-sD
|
|
611 # sE<-sum(substrates[,i]=="E")
|
|
612 # positions[4,i]<-sE
|
|
613 # sF<-sum(substrates[,i]=="F")
|
|
614 # sG<-sum(substrates[,i]=="G")
|
|
615 # sH<-sum(substrates[,i]=="H")
|
|
616 # sI<-sum(substrates[,i]=="I")
|
|
617 # sK<-sum(substrates[,i]=="K")
|
|
618 # sL<-sum(substrates[,i]=="L")
|
|
619 # sM<-sum(substrates[,i]=="M")
|
|
620 # sN<-sum(substrates[,i]=="N")
|
|
621 # sP<-sum(substrates[,i]=="P")
|
|
622 # sQ<-sum(substrates[,i]=="Q")
|
|
623 # sR<-sum(substrates[,i]=="R")
|
|
624 # sS<-sum(substrates[,i]=="S")
|
|
625 # sT<-sum(substrates[,i]=="T")
|
|
626 # sV<-sum(substrates[,i]=="V")
|
|
627 # sW<-sum(substrates[,i]=="W")
|
|
628 # sY<-sum(substrates[,i]=="Y")
|
|
629 # positions[5,i]<-sF
|
|
630 # positions[6,i]<-sG
|
|
631 # positions[7,i]<-sH
|
|
632 # positions[8,i]<-sI
|
|
633 # positions[9,i]<-sK
|
|
634 # positions[10,i]<-sL
|
|
635 # positions[11,i]<-sM
|
|
636 # positions[12,i]<-sN
|
|
637 # positions[13,i]<-sP
|
|
638 # positions[14,i]<-sQ
|
|
639 # positions[15,i]<-sR
|
|
640 # positions[16,i]<-sS
|
|
641 # positions[17,i]<-sT
|
|
642 # positions[18,i]<-sV
|
|
643 # positions[19,i]<-sW
|
|
644 # positions[20,i]<-sY
|
|
645 # }
|
|
646
|
|
647 #here I create the positions table which is needed for the endogenous prob matrix and is simply "how many times did an AA show up in this spot?
|
|
648 if (6==6){
|
|
649 Column1<-substrates[,1]
|
|
650 Column2<-substrates[,2]
|
|
651 Column3<-substrates[,3]
|
|
652 Column4<-substrates[,4]
|
|
653 Column5<-substrates[,5]
|
|
654 Column6<-substrates[,6]
|
|
655 Column7<-substrates[,7]
|
|
656 Column8<-substrates[,8]
|
|
657 Column9<-substrates[,9]
|
|
658 Column10<-substrates[,10]
|
|
659 Column11<-substrates[,11]
|
|
660 Column12<-substrates[,12]
|
|
661 Column13<-substrates[,13]
|
|
662 Column14<-substrates[,14]
|
|
663 Column15<-substrates[,15]
|
|
664
|
|
665 spaces1<-sum((Column1%in% ""))
|
|
666 spaces2<-sum(Column2%in% "")
|
|
667 spaces3<-sum(Column3%in% "")
|
|
668 spaces4<-sum(Column4%in% "")
|
|
669 spaces5<-sum(Column5%in% "")
|
|
670 spaces6<-sum(Column6%in% "")
|
|
671 spaces7<-sum(Column7%in% "")
|
|
672 spaces8<-sum(Column8%in% "")
|
|
673 spaces9<-sum(Column9%in% "")
|
|
674 spaces10<-sum(Column10%in% "")
|
|
675 spaces11<-sum(Column11%in% "")
|
|
676 spaces12<-sum(Column12%in% "")
|
|
677 spaces13<-sum(Column13%in% "")
|
|
678 spaces14<-sum(Column14%in% "")
|
|
679 spaces15<-sum(Column15%in% "")
|
|
680
|
|
681 A1<-sum(Column1 %in% "A")
|
|
682 A2<-sum(Column2 %in% "A")
|
|
683 A3<-sum(Column3 %in% "A")
|
|
684 A4<-sum(Column4 %in% "A")
|
|
685 A5<-sum(Column5 %in% "A")
|
|
686 A6<-sum(Column6 %in% "A")
|
|
687 A7<-sum(Column7 %in% "A")
|
|
688 A8<-sum(Column8 %in% "A")
|
|
689 A9<-sum(Column9 %in% "A")
|
|
690 A10<-sum(Column10 %in% "A")
|
|
691 A11<-sum(Column11 %in% "A")
|
|
692 A12<-sum(Column12 %in% "A")
|
|
693 A13<-sum(Column13 %in% "A")
|
|
694 A14<-sum(Column14 %in% "A")
|
|
695 A15<-sum(Column15 %in% "A")
|
|
696 AllAs<-cbind(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)
|
|
697
|
|
698 C1<-sum(Column1 %in% "C")
|
|
699 C2<-sum(Column2 %in% "C")
|
|
700 C3<-sum(Column3 %in% "C")
|
|
701 C4<-sum(Column4 %in% "C")
|
|
702 C5<-sum(Column5 %in% "C")
|
|
703 C6<-sum(Column6 %in% "C")
|
|
704 C7<-sum(Column7 %in% "C")
|
|
705 C8<-sum(Column8 %in% "C")
|
|
706 C9<-sum(Column9 %in% "C")
|
|
707 C10<-sum(Column10 %in% "C")
|
|
708 C11<-sum(Column11 %in% "C")
|
|
709 C12<-sum(Column12 %in% "C")
|
|
710 C13<-sum(Column13 %in% "C")
|
|
711 C14<-sum(Column14 %in% "C")
|
|
712 C15<-sum(Column15 %in% "C")
|
|
713 CllCs<-cbind(C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15)
|
|
714
|
|
715 D1<-sum(Column1 %in% "D")
|
|
716 D2<-sum(Column2 %in% "D")
|
|
717 D3<-sum(Column3 %in% "D")
|
|
718 D4<-sum(Column4 %in% "D")
|
|
719 D5<-sum(Column5 %in% "D")
|
|
720 D6<-sum(Column6 %in% "D")
|
|
721 D7<-sum(Column7 %in% "D")
|
|
722 D8<-sum(Column8 %in% "D")
|
|
723 D9<-sum(Column9 %in% "D")
|
|
724 D10<-sum(Column10 %in% "D")
|
|
725 D11<-sum(Column11 %in% "D")
|
|
726 D12<-sum(Column12 %in% "D")
|
|
727 D13<-sum(Column13 %in% "D")
|
|
728 D14<-sum(Column14 %in% "D")
|
|
729 D15<-sum(Column15 %in% "D")
|
|
730 DllDs<-cbind(D1,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12,D13,D14,D15)
|
|
731
|
|
732 E1<-sum(Column1 %in% "E")
|
|
733 E2<-sum(Column2 %in% "E")
|
|
734 E3<-sum(Column3 %in% "E")
|
|
735 E4<-sum(Column4 %in% "E")
|
|
736 E5<-sum(Column5 %in% "E")
|
|
737 E6<-sum(Column6 %in% "E")
|
|
738 E7<-sum(Column7 %in% "E")
|
|
739 E8<-sum(Column8 %in% "E")
|
|
740 E9<-sum(Column9 %in% "E")
|
|
741 E10<-sum(Column10 %in% "E")
|
|
742 E11<-sum(Column11 %in% "E")
|
|
743 E12<-sum(Column12 %in% "E")
|
|
744 E13<-sum(Column13 %in% "E")
|
|
745 E14<-sum(Column14 %in% "E")
|
|
746 E15<-sum(Column15 %in% "E")
|
|
747 EllEs<-cbind(E1,E2,E3,E4,E5,E6,E7,E8,E9,E10,E11,E12,E13,E14,E15)
|
|
748
|
|
749 F1<-sum(Column1 %in% "F")
|
|
750 F2<-sum(Column2 %in% "F")
|
|
751 F3<-sum(Column3 %in% "F")
|
|
752 F4<-sum(Column4 %in% "F")
|
|
753 F5<-sum(Column5 %in% "F")
|
|
754 F6<-sum(Column6 %in% "F")
|
|
755 F7<-sum(Column7 %in% "F")
|
|
756 F8<-sum(Column8 %in% "F")
|
|
757 F9<-sum(Column9 %in% "F")
|
|
758 F10<-sum(Column10 %in% "F")
|
|
759 F11<-sum(Column11 %in% "F")
|
|
760 F12<-sum(Column12 %in% "F")
|
|
761 F13<-sum(Column13 %in% "F")
|
|
762 F14<-sum(Column14 %in% "F")
|
|
763 F15<-sum(Column15 %in% "F")
|
|
764 FllFs<-cbind(F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15)
|
|
765
|
|
766 G1<-sum(Column1 %in% "G")
|
|
767 G2<-sum(Column2 %in% "G")
|
|
768 G3<-sum(Column3 %in% "G")
|
|
769 G4<-sum(Column4 %in% "G")
|
|
770 G5<-sum(Column5 %in% "G")
|
|
771 G6<-sum(Column6 %in% "G")
|
|
772 G7<-sum(Column7 %in% "G")
|
|
773 G8<-sum(Column8 %in% "G")
|
|
774 G9<-sum(Column9 %in% "G")
|
|
775 G10<-sum(Column10 %in% "G")
|
|
776 G11<-sum(Column11 %in% "G")
|
|
777 G12<-sum(Column12 %in% "G")
|
|
778 G13<-sum(Column13 %in% "G")
|
|
779 G14<-sum(Column14 %in% "G")
|
|
780 G15<-sum(Column15 %in% "G")
|
|
781 GllGs<-cbind(G1,G2,G3,G4,G5,G6,G7,G8,G9,G10,G11,G12,G13,G14,G15)
|
|
782
|
|
783 H1<-sum(Column1 %in% "H")
|
|
784 H2<-sum(Column2 %in% "H")
|
|
785 H3<-sum(Column3 %in% "H")
|
|
786 H4<-sum(Column4 %in% "H")
|
|
787 H5<-sum(Column5 %in% "H")
|
|
788 H6<-sum(Column6 %in% "H")
|
|
789 H7<-sum(Column7 %in% "H")
|
|
790 H8<-sum(Column8 %in% "H")
|
|
791 H9<-sum(Column9 %in% "H")
|
|
792 H10<-sum(Column10 %in% "H")
|
|
793 H11<-sum(Column11 %in% "H")
|
|
794 H12<-sum(Column12 %in% "H")
|
|
795 H13<-sum(Column13 %in% "H")
|
|
796 H14<-sum(Column14 %in% "H")
|
|
797 H15<-sum(Column15 %in% "H")
|
|
798 HllHs<-cbind(H1,H2,H3,H4,H5,H6,H7,H8,H9,H10,H11,H12,H13,H14,H15)
|
|
799
|
|
800 I1<-sum(Column1 %in% "I")
|
|
801 I2<-sum(Column2 %in% "I")
|
|
802 I3<-sum(Column3 %in% "I")
|
|
803 I4<-sum(Column4 %in% "I")
|
|
804 I5<-sum(Column5 %in% "I")
|
|
805 I6<-sum(Column6 %in% "I")
|
|
806 I7<-sum(Column7 %in% "I")
|
|
807 I8<-sum(Column8 %in% "I")
|
|
808 I9<-sum(Column9 %in% "I")
|
|
809 I10<-sum(Column10 %in% "I")
|
|
810 I11<-sum(Column11 %in% "I")
|
|
811 I12<-sum(Column12 %in% "I")
|
|
812 I13<-sum(Column13 %in% "I")
|
|
813 I14<-sum(Column14 %in% "I")
|
|
814 I15<-sum(Column15 %in% "I")
|
|
815 IllIs<-cbind(I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14,I15)
|
|
816
|
|
817 K1<-sum(Column1 %in% "K")
|
|
818 K2<-sum(Column2 %in% "K")
|
|
819 K3<-sum(Column3 %in% "K")
|
|
820 K4<-sum(Column4 %in% "K")
|
|
821 K5<-sum(Column5 %in% "K")
|
|
822 K6<-sum(Column6 %in% "K")
|
|
823 K7<-sum(Column7 %in% "K")
|
|
824 K8<-sum(Column8 %in% "K")
|
|
825 K9<-sum(Column9 %in% "K")
|
|
826 K10<-sum(Column10 %in% "K")
|
|
827 K11<-sum(Column11 %in% "K")
|
|
828 K12<-sum(Column12 %in% "K")
|
|
829 K13<-sum(Column13 %in% "K")
|
|
830 K14<-sum(Column14 %in% "K")
|
|
831 K15<-sum(Column15 %in% "K")
|
|
832 KllKs<-cbind(K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15)
|
|
833
|
|
834 L1<-sum(Column1 %in% "L")
|
|
835 L2<-sum(Column2 %in% "L")
|
|
836 L3<-sum(Column3 %in% "L")
|
|
837 L4<-sum(Column4 %in% "L")
|
|
838 L5<-sum(Column5 %in% "L")
|
|
839 L6<-sum(Column6 %in% "L")
|
|
840 L7<-sum(Column7 %in% "L")
|
|
841 L8<-sum(Column8 %in% "L")
|
|
842 L9<-sum(Column9 %in% "L")
|
|
843 L10<-sum(Column10 %in% "L")
|
|
844 L11<-sum(Column11 %in% "L")
|
|
845 L12<-sum(Column12 %in% "L")
|
|
846 L13<-sum(Column13 %in% "L")
|
|
847 L14<-sum(Column14 %in% "L")
|
|
848 L15<-sum(Column15 %in% "L")
|
|
849 LllLs<-cbind(L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14,L15)
|
|
850
|
|
851 M1<-sum(Column1 %in% "M")
|
|
852 M2<-sum(Column2 %in% "M")
|
|
853 M3<-sum(Column3 %in% "M")
|
|
854 M4<-sum(Column4 %in% "M")
|
|
855 M5<-sum(Column5 %in% "M")
|
|
856 M6<-sum(Column6 %in% "M")
|
|
857 M7<-sum(Column7 %in% "M")
|
|
858 M8<-sum(Column8 %in% "M")
|
|
859 M9<-sum(Column9 %in% "M")
|
|
860 M10<-sum(Column10 %in% "M")
|
|
861 M11<-sum(Column11 %in% "M")
|
|
862 M12<-sum(Column12 %in% "M")
|
|
863 M13<-sum(Column13 %in% "M")
|
|
864 M14<-sum(Column14 %in% "M")
|
|
865 M15<-sum(Column15 %in% "M")
|
|
866 MllMs<-cbind(M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15)
|
|
867
|
|
868 N1<-sum(Column1 %in% "N")
|
|
869 N2<-sum(Column2 %in% "N")
|
|
870 N3<-sum(Column3 %in% "N")
|
|
871 N4<-sum(Column4 %in% "N")
|
|
872 N5<-sum(Column5 %in% "N")
|
|
873 N6<-sum(Column6 %in% "N")
|
|
874 N7<-sum(Column7 %in% "N")
|
|
875 N8<-sum(Column8 %in% "N")
|
|
876 N9<-sum(Column9 %in% "N")
|
|
877 N10<-sum(Column10 %in% "N")
|
|
878 N11<-sum(Column11 %in% "N")
|
|
879 N12<-sum(Column12 %in% "N")
|
|
880 N13<-sum(Column13 %in% "N")
|
|
881 N14<-sum(Column14 %in% "N")
|
|
882 N15<-sum(Column15 %in% "N")
|
|
883 NllNs<-cbind(N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,N12,N13,N14,N15)
|
|
884
|
|
885 P1<-sum(Column1 %in% "P")
|
|
886 P2<-sum(Column2 %in% "P")
|
|
887 P3<-sum(Column3 %in% "P")
|
|
888 P4<-sum(Column4 %in% "P")
|
|
889 P5<-sum(Column5 %in% "P")
|
|
890 P6<-sum(Column6 %in% "P")
|
|
891 P7<-sum(Column7 %in% "P")
|
|
892 P8<-sum(Column8 %in% "P")
|
|
893 P9<-sum(Column9 %in% "P")
|
|
894 P10<-sum(Column10 %in% "P")
|
|
895 P11<-sum(Column11 %in% "P")
|
|
896 P12<-sum(Column12 %in% "P")
|
|
897 P13<-sum(Column13 %in% "P")
|
|
898 P14<-sum(Column14 %in% "P")
|
|
899 P15<-sum(Column15 %in% "P")
|
|
900 PllPs<-cbind(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)
|
|
901
|
|
902 Q1<-sum(Column1 %in% "Q")
|
|
903 Q2<-sum(Column2 %in% "Q")
|
|
904 Q3<-sum(Column3 %in% "Q")
|
|
905 Q4<-sum(Column4 %in% "Q")
|
|
906 Q5<-sum(Column5 %in% "Q")
|
|
907 Q6<-sum(Column6 %in% "Q")
|
|
908 Q7<-sum(Column7 %in% "Q")
|
|
909 Q8<-sum(Column8 %in% "Q")
|
|
910 Q9<-sum(Column9 %in% "Q")
|
|
911 Q10<-sum(Column10 %in% "Q")
|
|
912 Q11<-sum(Column11 %in% "Q")
|
|
913 Q12<-sum(Column12 %in% "Q")
|
|
914 Q13<-sum(Column13 %in% "Q")
|
|
915 Q14<-sum(Column14 %in% "Q")
|
|
916 Q15<-sum(Column15 %in% "Q")
|
|
917 QllQs<-cbind(Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q14,Q15)
|
|
918
|
|
919 R1<-sum(Column1 %in% "R")
|
|
920 R2<-sum(Column2 %in% "R")
|
|
921 R3<-sum(Column3 %in% "R")
|
|
922 R4<-sum(Column4 %in% "R")
|
|
923 R5<-sum(Column5 %in% "R")
|
|
924 R6<-sum(Column6 %in% "R")
|
|
925 R7<-sum(Column7 %in% "R")
|
|
926 R8<-sum(Column8 %in% "R")
|
|
927 R9<-sum(Column9 %in% "R")
|
|
928 R10<-sum(Column10 %in% "R")
|
|
929 R11<-sum(Column11 %in% "R")
|
|
930 R12<-sum(Column12 %in% "R")
|
|
931 R13<-sum(Column13 %in% "R")
|
|
932 R14<-sum(Column14 %in% "R")
|
|
933 R15<-sum(Column15 %in% "R")
|
|
934 RllRs<-cbind(R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15)
|
|
935
|
|
936 S1<-sum(Column1 %in% "S")
|
|
937 S2<-sum(Column2 %in% "S")
|
|
938 S3<-sum(Column3 %in% "S")
|
|
939 S4<-sum(Column4 %in% "S")
|
|
940 S5<-sum(Column5 %in% "S")
|
|
941 S6<-sum(Column6 %in% "S")
|
|
942 S7<-sum(Column7 %in% "S")
|
|
943 S8<-sum(Column8 %in% "S")
|
|
944 S9<-sum(Column9 %in% "S")
|
|
945 S10<-sum(Column10 %in% "S")
|
|
946 S11<-sum(Column11 %in% "S")
|
|
947 S12<-sum(Column12 %in% "S")
|
|
948 S13<-sum(Column13 %in% "S")
|
|
949 S14<-sum(Column14 %in% "S")
|
|
950 S15<-sum(Column15 %in% "S")
|
|
951 SllSs<-cbind(S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15)
|
|
952
|
|
953 T1<-sum(Column1 %in% "T")
|
|
954 T2<-sum(Column2 %in% "T")
|
|
955 T3<-sum(Column3 %in% "T")
|
|
956 T4<-sum(Column4 %in% "T")
|
|
957 T5<-sum(Column5 %in% "T")
|
|
958 T6<-sum(Column6 %in% "T")
|
|
959 T7<-sum(Column7 %in% "T")
|
|
960 T8<-sum(Column8 %in% "T")
|
|
961 T9<-sum(Column9 %in% "T")
|
|
962 T10<-sum(Column10 %in% "T")
|
|
963 T11<-sum(Column11 %in% "T")
|
|
964 T12<-sum(Column12 %in% "T")
|
|
965 T13<-sum(Column13 %in% "T")
|
|
966 T14<-sum(Column14 %in% "T")
|
|
967 T15<-sum(Column15 %in% "T")
|
|
968 TllTs<-cbind(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)
|
|
969
|
|
970 V1<-sum(Column1 %in% "V")
|
|
971 V2<-sum(Column2 %in% "V")
|
|
972 V3<-sum(Column3 %in% "V")
|
|
973 V4<-sum(Column4 %in% "V")
|
|
974 V5<-sum(Column5 %in% "V")
|
|
975 V6<-sum(Column6 %in% "V")
|
|
976 V7<-sum(Column7 %in% "V")
|
|
977 V8<-sum(Column8 %in% "V")
|
|
978 V9<-sum(Column9 %in% "V")
|
|
979 V10<-sum(Column10 %in% "V")
|
|
980 V11<-sum(Column11 %in% "V")
|
|
981 V12<-sum(Column12 %in% "V")
|
|
982 V13<-sum(Column13 %in% "V")
|
|
983 V14<-sum(Column14 %in% "V")
|
|
984 V15<-sum(Column15 %in% "V")
|
|
985 VllVs<-cbind(V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15)
|
|
986
|
|
987 W1<-sum(Column1 %in% "W")
|
|
988 W2<-sum(Column2 %in% "W")
|
|
989 W3<-sum(Column3 %in% "W")
|
|
990 W4<-sum(Column4 %in% "W")
|
|
991 W5<-sum(Column5 %in% "W")
|
|
992 W6<-sum(Column6 %in% "W")
|
|
993 W7<-sum(Column7 %in% "W")
|
|
994 W8<-sum(Column8 %in% "W")
|
|
995 W9<-sum(Column9 %in% "W")
|
|
996 W10<-sum(Column10 %in% "W")
|
|
997 W11<-sum(Column11 %in% "W")
|
|
998 W12<-sum(Column12 %in% "W")
|
|
999 W13<-sum(Column13 %in% "W")
|
|
1000 W14<-sum(Column14 %in% "W")
|
|
1001 W15<-sum(Column15 %in% "W")
|
|
1002 WllWs<-cbind(W1,W2,W3,W4,W5,W6,W7,W8,W9,W10,W11,W12,W13,W14,W15)
|
|
1003
|
|
1004 Y1<-sum(Column1 %in% "Y")
|
|
1005 Y2<-sum(Column2 %in% "Y")
|
|
1006 Y3<-sum(Column3 %in% "Y")
|
|
1007 Y4<-sum(Column4 %in% "Y")
|
|
1008 Y5<-sum(Column5 %in% "Y")
|
|
1009 Y6<-sum(Column6 %in% "Y")
|
|
1010 Y7<-sum(Column7 %in% "Y")
|
|
1011 Y8<-sum(Column8 %in% "Y")
|
|
1012 Y9<-sum(Column9 %in% "Y")
|
|
1013 Y10<-sum(Column10 %in% "Y")
|
|
1014 Y11<-sum(Column11 %in% "Y")
|
|
1015 Y12<-sum(Column12 %in% "Y")
|
|
1016 Y13<-sum(Column13 %in% "Y")
|
|
1017 Y14<-sum(Column14 %in% "Y")
|
|
1018 Y15<-sum(Column15 %in% "Y")
|
|
1019 YllYs<-cbind(Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Y10,Y11,Y12,Y13,Y14,Y15)
|
|
1020 PositionTable<-rbind(AllAs,CllCs,DllDs,EllEs,FllFs,GllGs,HllHs,IllIs,KllKs,LllLs,MllMs,NllNs,PllPs,QllQs,RllRs,SllSs,TllTs,VllVs,WllWs,YllYs)
|
|
1021 }
|
|
1022 #endogenous prob matrix is AA position over subbackfreqmean
|
|
1023 dim(PositionTable)
|
|
1024 EPMtable<-PositionTable
|
|
1025 # EPMtable[1,]<-(PositionTable[1,]/(PositionTable[1,]*.01*Amean))
|
|
1026 # EPMtable[2,]<-(PositionTable[2,]/(PositionTable[2,]*.01*Cmean))
|
|
1027 # EPMtable[3,]<-(PositionTable[3,]/(PositionTable[3,]*.01*Dmean))
|
|
1028 # EPMtable[4,]<-(PositionTable[4,]/(PositionTable[4,]*.01*Emean))
|
|
1029 # EPMtable[5,]<-(PositionTable[5,]/(PositionTable[5,]*.01*Fmean))
|
|
1030 # EPMtable[6,]<-(PositionTable[6,]/(PositionTable[6,]*.01*Gmean))
|
|
1031 # EPMtable[7,]<-(PositionTable[7,]/(PositionTable[7,]*.01*Hmean))
|
|
1032 # EPMtable[8,]<-(PositionTable[8,]/(PositionTable[8,]*.01*Imean))
|
|
1033 # EPMtable[9,]<-(PositionTable[9,]/(PositionTable[9,]*.01*Kmean))
|
|
1034 # EPMtable[10,]<-(PositionTable[10,]/(PositionTable[10,]*.01*Lmean))
|
|
1035 # EPMtable[11,]<-(PositionTable[11,]/(PositionTable[11,]*.01*Mmean))
|
|
1036 # EPMtable[12,]<-(PositionTable[12,]/(PositionTable[12,]*.01*Nmean))
|
|
1037 # EPMtable[13,]<-(PositionTable[13,]/(PositionTable[13,]*.01*Pmean))
|
|
1038 # EPMtable[14,]<-(PositionTable[14,]/(PositionTable[14,]*.01*Qmean))
|
|
1039 # EPMtable[15,]<-(PositionTable[15,]/(PositionTable[15,]*.01*Rmean))
|
|
1040 # EPMtable[16,]<-(PositionTable[16,]/(PositionTable[16,]*.01*Smean))
|
|
1041 # EPMtable[17,]<-(PositionTable[17,]/(PositionTable[17,]*.01*Tmean))
|
|
1042 # EPMtable[18,]<-(PositionTable[18,]/(PositionTable[18,]*.01*Vmean))
|
|
1043 # EPMtable[19,]<-(PositionTable[19,]/(PositionTable[19,]*.01*Wmean))
|
|
1044 # EPMtable[20,]<-(PositionTable[20,]/(PositionTable[20,]*.01*Ymean))
|
|
1045
|
|
1046 columns<-c(length(Column1)-sum(Column1==""),
|
|
1047 length(Column2)-sum(Column2==""),
|
|
1048 length(Column3)-sum(Column3==""),
|
|
1049 length(Column4)-sum(Column4==""),
|
|
1050 length(Column5)-sum(Column5==""),
|
|
1051 length(Column6)-sum(Column6==""),
|
|
1052 length(Column7)-sum(Column7==""),
|
|
1053 length(Column8)-sum(Column8==""),
|
|
1054 length(Column9)-sum(Column9==""),
|
|
1055 length(Column10)-sum(Column10==""),
|
|
1056 length(Column11)-sum(Column11==""),
|
|
1057 length(Column12)-sum(Column12==""),
|
|
1058 length(Column13)-sum(Column13==""),
|
|
1059 length(Column14)-sum(Column14==""),
|
|
1060 length(Column15)-sum(Column15==""))
|
|
1061
|
|
1062 for (z in 1:15) {
|
|
1063 for (y in 1:20) {
|
|
1064 if (PositionTable[y,z]>0){
|
|
1065 EPMtable[y,z]<-PositionTable[y,z]/((columns[z]*.01*AllMeans[y]))
|
|
1066 }
|
|
1067 if (PositionTable[y,z]==0){
|
|
1068 EPMtable[y,z]<-(1/columns[z])/((columns[z]*.01*AllMeans[y]))
|
|
1069 }
|
|
1070 }
|
|
1071 }
|
|
1072 #here I created the endogenous probability matrix
|
|
1073 #now all I need to do is make the program automatically determine which SDs are >2, and then make it perform screener and sorter on those SDs
|
|
1074
|
|
1075
|
|
1076
|
|
1077
|
|
1078
|
|
1079 # write.xlsx(SDtable,file=FILENAME, sheetName = "Standard Deviation Table",col.names = FALSE,row.names = FALSE,append = TRUE)
|
|
1080 # write.xlsx(PercentTable,file = FILENAME,sheetName = "Percent Table",col.names = FALSE,row.names = FALSE,append = TRUE)
|
|
1081 # write.xlsx(SelectivitySheet,file = FILENAME,sheetName = "Site Selectivity",col.names = FALSE,row.names = FALSE,append = TRUE)
|
|
1082 # write.xlsx(EPMtable,file=FILENAME,sheetName = "Endogenous Probability Matrix",col.names = FALSE,row.names = FALSE,append = TRUE)
|
|
1083 # write.xlsx(NormalizationScore,file = FILENAME,sheetName = "Normalization Score",col.names = FALSE,row.names = FALSE,append = TRUE)
|
|
1084
|
|
1085 NormalizationScore<-c("Normalization Score",NormalizationScore)
|
|
1086
|
|
1087 write.table(x=c("SD Table"),file=FILENAME,append = TRUE,sep=",", row.names = FALSE, col.names = FALSE)
|
|
1088 write.table(SDtable,file=FILENAME,append = TRUE,sep=",", row.names = FALSE, col.names = FALSE)
|
|
1089 write.table(x=c("Percent Table"),file=FILENAME,append = TRUE,sep=",", row.names = FALSE, col.names = FALSE)
|
|
1090 write.table(PercentTable,file=FILENAME, append = TRUE,sep=",",row.names = FALSE, col.names = FALSE)
|
|
1091
|
|
1092 EPMtableu<-EPMtable
|
|
1093 HeaderSD<-c(-7:7)
|
|
1094 EPMtableu<-rbind(HeaderSD,EPMtableu)
|
|
1095 row.names(EPMtableu)<-NULL
|
|
1096 EPMtableu<-data.frame(SetOfAAs,EPMtableu)
|
|
1097
|
|
1098 write.table("Site Selectivity Matrix", file = FILENAME2, append = TRUE, sep = ",", row.names = FALSE, col.names = FALSE)
|
|
1099 SelectivityHeader=matrix(data = c("Position",-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7),nrow = 1)
|
|
1100 head<-matrix(data=rep(" ",times=16),nrow = 1)
|
|
1101 SelectivityHeader<-rbind(head,SelectivityHeader)
|
|
1102
|
|
1103 write.table(SelectivityHeader, file = FILENAME2, append = TRUE, sep = ",", row.names = FALSE, col.names = FALSE)
|
|
1104 #colnames(SelectivitySheet)<-c("-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7")
|
|
1105 write.table(SelectivitySheet,file = FILENAME2, append = TRUE,sep = ",",row.names = TRUE, col.names = FALSE)
|
|
1106 write.table(x=c("Endogenous Probability Matrix"),file=FILENAME2,append = TRUE,sep=",", row.names = FALSE, col.names = FALSE)
|
|
1107 write.table(EPMtableu,file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE)
|
|
1108 write.table(NormalizationScore, file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE)
|
|
1109
|
|
1110
|
|
1111
|
|
1112
|
|
1113
|
|
1114
|
|
1115
|
|
1116
|
|
1117
|
|
1118
|
|
1119
|
|
1120
|
|
1121
|
|
1122
|
|
1123
|
|
1124
|
|
1125
|
|
1126
|
|
1127
|
|
1128
|
|
1129
|
|
1130
|
|
1131
|
|
1132
|
|
1133
|
|
1134
|
|
1135
|
|
1136
|
|
1137
|
|
1138
|
|
1139
|
|
1140
|
|
1141
|
|
1142
|
|
1143 #test myself: this script should take in amino acids for each of the 9 positions and give out every single combination of those AAs
|
|
1144
|
|
1145 #need to do following: fix it so that the accession numbers stay with the substrates,
|
|
1146 #also the neg false constant is totaly unphos'd Ys found by FASTA-2-CSV system# uniprot
|
|
1147
|
|
1148 #HOW MANY: IF THERE'S two aas in each position you get 2^9, so I assume the numbers are:
|
|
1149 #(number in position-4)*(number in position -3)*(number in position -2)...=total
|
|
1150 # require(rJava)
|
|
1151 # require(xlsxjars)
|
|
1152 # require(xlsx)
|
|
1153 # # require(readxl)
|
|
1154
|
|
1155 #View(SDtable)
|
|
1156 bareSDs<-SDtable[2:21,2:16]
|
|
1157 goodones<-bareSDs>2
|
|
1158
|
17
|
1159 # Positionm7<-which(goodones[,1] %in% TRUE)
|
|
1160 # if (length(Positionm7)<1){Positionm7<-which(bareSDs[,1]==max(bareSDs[,1]))}
|
|
1161 # Positionm6<-which(goodones[,2] %in% TRUE)
|
|
1162 # if (length(Positionm6)<1){Positionm6<-which(bareSDs[,2]==max(bareSDs[,2]))}
|
|
1163 # Positionm5<-which(goodones[,3] %in% TRUE)
|
|
1164 # if (length(Positionm5)<1){Positionm5<-which(bareSDs[,3]==max(bareSDs[,3]))}
|
|
1165 # Positionm4<-which(goodones[,4] %in% TRUE)
|
|
1166 # if (length(Positionm4)<2){Positionm4<-bareSDs[,4][order(bareSDs[,4])[1:2]]}
|
|
1167 # Positionm3<-which(goodones[,5] %in% TRUE)
|
|
1168 # if (length(Positionm3)<2){Positionm3<-bareSDs[,5][order(bareSDs[,5])[1:2]]}
|
|
1169 # Positionm2<-which(goodones[,6] %in% TRUE)
|
|
1170 # if (length(Positionm2)<2){Positionm2<-bareSDs[,6][order(bareSDs[,6])[1:2]]}
|
|
1171 # Positionm1<-which(goodones[,7] %in% TRUE)
|
|
1172 # if (length(Positionm1)<2){Positionm1<-bareSDs[,7][order(bareSDs[,7])[1:2]]}
|
|
1173 #
|
|
1174 # Positiond0<-which(goodones[,8] %in% TRUE)
|
|
1175 # if (length(Positiond0)<1){Positiond0<-which(bareSDs[,8]==max(bareSDs[,8]))}
|
|
1176 #
|
|
1177 # Positionp1<-which(goodones[,9] %in% TRUE)
|
|
1178 # if (length(Positionp1)<2){Positionp1<-bareSDs[,9][order(bareSDs[,9])[1:2]]}
|
|
1179 # Positionp2<-which(goodones[,10] %in% TRUE)
|
|
1180 # if (length(Positionp2)<2){Positionp2<-bareSDs[,10][order(bareSDs[,10])[1:2]]}
|
|
1181 # Positionp3<-which(goodones[,11] %in% TRUE)
|
|
1182 # if (length(Positionp3)<2){Positionp3<-bareSDs[,11][order(bareSDs[,11])[1:2]]}
|
|
1183 # Positionp4<-which(goodones[,12] %in% TRUE)
|
|
1184 # if (length(Positionp4)<2){Positionp4<-bareSDs[,12][order(bareSDs[,12])[1:2]]}
|
|
1185 # Positionp5<-which(goodones[,13] %in% TRUE)
|
|
1186 # if (length(Positionp5)<1){Positionp5<-which(bareSDs[,13]==max(bareSDs[,13]))}
|
|
1187 # Positionp6<-which(goodones[,14] %in% TRUE)
|
|
1188 # if (length(Positionp6)<1){Positionp6<-which(bareSDs[,14]==max(bareSDs[,14]))}
|
|
1189 # Positionp7<-which(goodones[,15] %in% TRUE)
|
|
1190 # if (length(Positionp7)<1){Positionp7<-which(bareSDs[,15]==max(bareSDs[,15]))}
|
|
1191
|
|
1192
|
|
1193
|
|
1194
|
|
1195 # Positionm7<-which(goodones[,1] %in% TRUE)
|
|
1196 # if (length(Positionm7)<1){Positionm7<-which(bareSDs[,1]==max(bareSDs[,1]))}
|
|
1197 # Positionm6<-which(goodones[,2] %in% TRUE)
|
|
1198 # if (length(Positionm6)<1){Positionm6<-which(bareSDs[,2]==max(bareSDs[,2]))}
|
|
1199 # Positionm5<-which(goodones[,3] %in% TRUE)
|
|
1200 # if (length(Positionm5)<1){Positionm5<-which(bareSDs[,3]==max(bareSDs[,3]))}
|
|
1201 # Positionm4<-which(goodones[,4] %in% TRUE)
|
|
1202 # if (length(Positionm4)<1){Positionm4<-which(bareSDs[,4]==max(bareSDs[,4]))}
|
|
1203 # Positionm3<-which(goodones[,5] %in% TRUE)
|
|
1204 # if (length(Positionm3)<1){Positionm3<-which(bareSDs[,5]==max(bareSDs[,5]))}
|
|
1205 # Positionm2<-which(goodones[,6] %in% TRUE)
|
|
1206 # if (length(Positionm2)<1){Positionm2<-which(bareSDs[,6]==max(bareSDs[,6]))}
|
|
1207 # Positionm1<-which(goodones[,7] %in% TRUE)
|
|
1208 # if (length(Positionm1)<1){Positionm1<-which(bareSDs[,7]==max(bareSDs[,7]))}
|
|
1209 #
|
|
1210 # Positiond0<-which(goodones[,8] %in% TRUE)
|
|
1211 # if (length(Positiond0)<1){Positiond0<-which(bareSDs[,8]==max(bareSDs[,8]))}
|
|
1212 #
|
|
1213 # Positionp1<-which(goodones[,9] %in% TRUE)
|
|
1214 # if (length(Positionp1)<1){Positionp1<-which(bareSDs[,9]==max(bareSDs[,9]))}
|
|
1215 # Positionp2<-which(goodones[,10] %in% TRUE)
|
|
1216 # if (length(Positionp2)<1){Positionp2<-which(bareSDs[,10]==max(bareSDs[,10]))}
|
|
1217 # Positionp3<-which(goodones[,11] %in% TRUE)
|
|
1218 # if (length(Positionp3)<1){Positionp3<-which(bareSDs[,11]==max(bareSDs[,11]))}
|
|
1219 # Positionp4<-which(goodones[,12] %in% TRUE)
|
|
1220 # if (length(Positionp4)<1){Positionp4<-which(bareSDs[,12]==max(bareSDs[,12]))}
|
|
1221 # Positionp5<-which(goodones[,13] %in% TRUE)
|
|
1222 # if (length(Positionp5)<1){Positionp5<-which(bareSDs[,13]==max(bareSDs[,13]))}
|
|
1223 # Positionp6<-which(goodones[,14] %in% TRUE)
|
|
1224 # if (length(Positionp6)<1){Positionp6<-which(bareSDs[,14]==max(bareSDs[,14]))}
|
|
1225 # Positionp7<-which(goodones[,15] %in% TRUE)
|
|
1226 # if (length(Positionp7)<1){Positionp7<-which(bareSDs[,15]==max(bareSDs[,15]))}
|
|
1227
|
|
1228 match(c(bareSDs[,2][order(bareSDs[,2])[1:2]]),bareSDs[,2])
|
|
1229
|
14
|
1230 Positionm7<-which(goodones[,1] %in% TRUE)
|
17
|
1231 if (length(Positionm7)<3){Positionm7<-match(c(bareSDs[,1][order(bareSDs[,1])[19:20]]),bareSDs[,1])}
|
14
|
1232 Positionm6<-which(goodones[,2] %in% TRUE)
|
17
|
1233 if (length(Positionm6)<3){Positionm6<-match(c(bareSDs[,2][order(bareSDs[,2])[19:20]]),bareSDs[,2])}
|
14
|
1234 Positionm5<-which(goodones[,3] %in% TRUE)
|
17
|
1235 if (length(Positionm5)<3){Positionm5<-match(c(bareSDs[,3][order(bareSDs[,3])[19:20]]),bareSDs[,3])}
|
14
|
1236 Positionm4<-which(goodones[,4] %in% TRUE)
|
17
|
1237 if (length(Positionm4)<3){Positionm4<-match(c(bareSDs[,4][order(bareSDs[,4])[19:20]]),bareSDs[,4])}
|
14
|
1238 Positionm3<-which(goodones[,5] %in% TRUE)
|
17
|
1239 if (length(Positionm3)<3){Positionm3<-match(c(bareSDs[,5][order(bareSDs[,5])[19:20]]),bareSDs[,5])}
|
14
|
1240 Positionm2<-which(goodones[,6] %in% TRUE)
|
17
|
1241 if (length(Positionm2)<3){Positionm2<-match(c(bareSDs[,6][order(bareSDs[,6])[19:20]]),bareSDs[,6])}
|
14
|
1242 Positionm1<-which(goodones[,7] %in% TRUE)
|
17
|
1243 if (length(Positionm1)<3){Positionm1<-match(c(bareSDs[,7][order(bareSDs[,7])[19:20]]),bareSDs[,7])}
|
14
|
1244
|
|
1245 Positiond0<-which(goodones[,8] %in% TRUE)
|
17
|
1246 #if (length(Positiond0)<3){Positiond0<-bareSDs[,8][order(bareSDs[,8])[1:2]]}
|
14
|
1247
|
|
1248 Positionp1<-which(goodones[,9] %in% TRUE)
|
17
|
1249 if (length(Positionp1)<3){Positionp1<-match(c(bareSDs[,9][order(bareSDs[,9])[19:20]]),bareSDs[,9])}
|
14
|
1250 Positionp2<-which(goodones[,10] %in% TRUE)
|
17
|
1251 if (length(Positionp2)<3){Positionp2<-match(c(bareSDs[,10][order(bareSDs[,10])[19:20]]),bareSDs[,10])}
|
14
|
1252 Positionp3<-which(goodones[,11] %in% TRUE)
|
17
|
1253 if (length(Positionp3)<3){Positionp3<-match(c(bareSDs[,11][order(bareSDs[,11])[19:20]]),bareSDs[,11])}
|
14
|
1254 Positionp4<-which(goodones[,12] %in% TRUE)
|
17
|
1255 if (length(Positionp4)<3){Positionp4<-match(c(bareSDs[,12][order(bareSDs[,12])[19:20]]),bareSDs[,12])}
|
14
|
1256 Positionp5<-which(goodones[,13] %in% TRUE)
|
17
|
1257 if (length(Positionp5)<3){Positionp5<-match(c(bareSDs[,13][order(bareSDs[,13])[19:20]]),bareSDs[,13])}
|
14
|
1258 Positionp6<-which(goodones[,14] %in% TRUE)
|
17
|
1259 if (length(Positionp6)<3){Positionp6<-match(c(bareSDs[,14][order(bareSDs[,14])[19:20]]),bareSDs[,14])}
|
14
|
1260 Positionp7<-which(goodones[,15] %in% TRUE)
|
17
|
1261 if (length(Positionp7)<3){Positionp7<-match(c(bareSDs[,15][order(bareSDs[,15])[19:20]]),bareSDs[,15])}
|
|
1262
|
14
|
1263
|
|
1264 aa_props2 <- c("1"="A", "2"="C", "3"="D", "4"="E", "5"="F", "6"="G", "7"="H", "8"="I", "9"="K", "10"="L", "11"="M", "12"="N",
|
|
1265 "13"="P", "14"="Q", "15"="R", "16"="S", "17"="T", "18"="V", "19"="W", "20"="Y")
|
|
1266
|
|
1267 Positionm7<-sapply(Positionm7, function (x) aa_props2[x])
|
|
1268 Positionm6<-sapply(Positionm6, function (x) aa_props2[x])
|
|
1269 Positionm5<-sapply(Positionm5, function (x) aa_props2[x])
|
|
1270 Positionm4<-sapply(Positionm4, function (x) aa_props2[x])
|
|
1271 Positionm3<-sapply(Positionm3, function (x) aa_props2[x])
|
|
1272 Positionm2<-sapply(Positionm2, function (x) aa_props2[x])
|
|
1273 Positionm1<-sapply(Positionm1, function (x) aa_props2[x])
|
|
1274 Positiond0<-sapply(Positiond0, function (x) aa_props2[x])
|
|
1275 Positionp1<-sapply(Positionp1, function (x) aa_props2[x])
|
|
1276 Positionp2<-sapply(Positionp2, function (x) aa_props2[x])
|
|
1277 Positionp3<-sapply(Positionp3, function (x) aa_props2[x])
|
|
1278 Positionp4<-sapply(Positionp4, function (x) aa_props2[x])
|
|
1279 Positionp5<-sapply(Positionp5, function (x) aa_props2[x])
|
|
1280 Positionp6<-sapply(Positionp6, function (x) aa_props2[x])
|
|
1281 Positionp7<-sapply(Positionp7, function (x) aa_props2[x])
|
|
1282
|
|
1283
|
|
1284 # Positionm7<-c("D","H","N","V")
|
|
1285 # Positionm6<-c("E","V")
|
|
1286 # Positionm5<-c("D","H")
|
|
1287 # Positionm4<-c("D","N")
|
|
1288 # Positionm3<-c("D","E","F","Q")
|
|
1289 # Positionm2<-c("D","N","Q","S")
|
|
1290 # Positionm1<-c("F","I","L")
|
|
1291 # Positiond0<-c("Y")
|
|
1292 # Positionp1<-c("A","E")
|
|
1293 # Positionp2<-c("T","S","Q","E")
|
|
1294 # Positionp3<-c("V")
|
|
1295 # Positionp4<-c("K")
|
|
1296 # Positionp5<-c("K")
|
|
1297 # Positionp6<-c("K")
|
|
1298 # Positionp7<-c("R")
|
|
1299 #this is where the amino acids for each position are given. m means minus, p mean plus
|
|
1300 ########################################
|
|
1301 # ScreenerFilename<-"C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls"
|
|
1302
|
|
1303
|
|
1304
|
|
1305
|
|
1306
|
|
1307
|
|
1308
|
|
1309
|
|
1310
|
|
1311
|
|
1312
|
|
1313 screaner<-read.csv(ScreenerFilename, header = FALSE, stringsAsFactors = FALSE)
|
|
1314
|
|
1315
|
|
1316 Abl<-screaner[2:25,]
|
|
1317 Arg<-screaner[27:50,]
|
|
1318 Btk<-screaner[52:75,]
|
|
1319 Csk<-screaner[77:100,]
|
|
1320 Fyn<-screaner[102:125,]
|
|
1321 Hck<-screaner[127:150,]
|
|
1322 JAK2<-screaner[152:175,]
|
|
1323 Lck<-screaner[177:200,]
|
|
1324 Lyn<-screaner[202:225,]
|
|
1325 Pyk2<-screaner[227:250,]
|
|
1326 Src<-screaner[252:275,]
|
|
1327 Syk<-screaner[277:300,]
|
|
1328 Yes<-screaner[302:325,]
|
|
1329
|
|
1330 #two questions: why are we doing BTK when we already have a bioninformatics page about it?
|
|
1331 #two I reran everything and only get 96 positions of interest in the SD table
|
|
1332
|
|
1333
|
|
1334
|
|
1335
|
|
1336
|
|
1337
|
|
1338
|
|
1339
|
|
1340
|
|
1341 #Do_You_want_An_Excel_Output_Questionmark<-"NO"
|
|
1342 GeneratedPeptidesFile<-"GeneratedPeptidesFile.csv"
|
|
1343
|
|
1344
|
|
1345 # Abl<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 4)
|
|
1346 # Arg<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 5)
|
|
1347 # Btk<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 6)
|
|
1348 # Csk<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 7)
|
|
1349 # Fyn<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 8)
|
|
1350 # Hck<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 9)
|
|
1351 # JAK2<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 10)
|
|
1352 # Lck<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 11)
|
|
1353 # Lyn<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 12)
|
|
1354 # Pyk2<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 13)
|
|
1355 # Src<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 14)
|
|
1356 # Syk<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 15)
|
|
1357 # Yes<-read.xlsx("C:/Users/User Name/Desktop/UMN 2017 Spring/Parker Lab/Kinatest ID/Screener.xls", sheetIndex = 16)
|
|
1358 #
|
|
1359
|
|
1360
|
|
1361 "A"=1
|
|
1362 "C"=2
|
|
1363 "D"=3
|
|
1364 "E"=4
|
|
1365 "F"=5
|
|
1366 "G"=6
|
|
1367 "H"=7
|
|
1368 "I"=8
|
|
1369 "K"=9
|
|
1370 "L"=10
|
|
1371 "M"=11
|
|
1372 "N"=12
|
|
1373 "P"=13
|
|
1374 "Q"=14
|
|
1375 "R"=15
|
|
1376 "S"=16
|
|
1377 "T"=17
|
|
1378 "V"=18
|
|
1379 "W"=19
|
|
1380 "Y"=20
|
|
1381
|
|
1382 aa_props <- c("A"=A, "C"=C, "D"=D, "E"=E, "F"=F,"G"=G,"H"=H,"I"=I,"K"=K,"L"=L,"M"=M,"N"=N,"P"=P,"Q"=Q,"R"=R,
|
|
1383 "S"=S,"T"=T,"V"=V,"W"=W,"Y"=Y,"xY"=Y,"O"=21)
|
|
1384
|
|
1385 number15<-sapply(Positionm7, function (x) aa_props[x])
|
|
1386 number14<-sapply(Positionm6, function (x) aa_props[x])
|
|
1387 number13<-sapply(Positionm5, function (x) aa_props[x])
|
|
1388 number1 <- sapply(Positionm4, function (x) aa_props[x])
|
|
1389 number2 <- sapply(Positionm3, function (x) aa_props[x])
|
|
1390 number3 <- sapply(Positionm2, function (x) aa_props[x])
|
|
1391 number4 <- sapply(Positionm1, function (x) aa_props[x])
|
|
1392 number5 <- sapply(Positiond0, function (x) aa_props[x])
|
|
1393 number6 <- sapply(Positionp1, function (x) aa_props[x])
|
|
1394 number7 <- sapply(Positionp2, function (x) aa_props[x])
|
|
1395 number8 <- sapply(Positionp3, function (x) aa_props[x])
|
|
1396 number9 <- sapply(Positionp4, function (x) aa_props[x])
|
|
1397 number10<-sapply(Positionp5, function (x) aa_props[x])
|
|
1398 number11<-sapply(Positionp6, function (x) aa_props[x])
|
|
1399 number12<-sapply(Positionp7, function (x) aa_props[x])
|
|
1400
|
|
1401 # number1<-Positionm4
|
|
1402 # number2<-Positionm3
|
|
1403 # number3<-Positionm2
|
|
1404 # number4<-Positionm1
|
|
1405 # number5<-Positiond0
|
|
1406 # number6<-Positionp1
|
|
1407 # number7<-Positionp2
|
|
1408 # number8<-Positionp3
|
|
1409 # number9<-Positionp4
|
|
1410
|
|
1411 #############################
|
|
1412 #here I create the Abl seqs with proper value for each number
|
|
1413 if (1==0){
|
|
1414 Ablnumber1<- gsub("A",A,Ablnumber1,perl = TRUE)
|
|
1415 Ablnumber1<- gsub("C",C,Ablnumber1,perl = TRUE)
|
|
1416 Ablnumber1<- gsub("D",D,Ablnumber1,perl = TRUE)
|
|
1417 Ablnumber1<- gsub("E",E,Ablnumber1,perl = TRUE)
|
|
1418 Ablnumber1<- gsub("F",F,Ablnumber1,perl = TRUE)
|
|
1419 Ablnumber1<- gsub("G",G,Ablnumber1,perl = TRUE)
|
|
1420 Ablnumber1<- gsub("H",H,Ablnumber1,perl = TRUE)
|
|
1421 Ablnumber1<- gsub("I",I,Ablnumber1,perl = TRUE)
|
|
1422 Ablnumber1<- gsub("K",K,Ablnumber1,perl = TRUE)
|
|
1423 Ablnumber1<- gsub("L",L,Ablnumber1,perl = TRUE)
|
|
1424 Ablnumber1<- gsub("M",M,Ablnumber1,perl = TRUE)
|
|
1425 Ablnumber1<- gsub("N",N,Ablnumber1,perl = TRUE)
|
|
1426 Ablnumber1<- gsub("P",P,Ablnumber1,perl = TRUE)
|
|
1427 Ablnumber1<- gsub("Q",Q,Ablnumber1,perl = TRUE)
|
|
1428 Ablnumber1<- gsub("R",R,Ablnumber1,perl = TRUE)
|
|
1429 Ablnumber1<- gsub("S",S,Ablnumber1,perl = TRUE)
|
|
1430 Ablnumber1<- gsub("T",T,Ablnumber1,perl = TRUE)
|
|
1431 Ablnumber1<- gsub("V",V,Ablnumber1,perl = TRUE)
|
|
1432 Ablnumber1<- gsub("W",W,Ablnumber1,perl = TRUE)
|
|
1433 Ablnumber1<- gsub("Y",Y,Ablnumber1,perl = TRUE)
|
|
1434
|
|
1435 Ablnumber2<- gsub("A",A,Ablnumber2,perl = TRUE)
|
|
1436 Ablnumber2<- gsub("C",C,Ablnumber2,perl = TRUE)
|
|
1437 Ablnumber2<- gsub("D",D,Ablnumber2,perl = TRUE)
|
|
1438 Ablnumber2<- gsub("E",E,Ablnumber2,perl = TRUE)
|
|
1439 Ablnumber2<- gsub("F",F,Ablnumber2,perl = TRUE)
|
|
1440 Ablnumber2<- gsub("G",G,Ablnumber2,perl = TRUE)
|
|
1441 Ablnumber2<- gsub("H",H,Ablnumber2,perl = TRUE)
|
|
1442 Ablnumber2<- gsub("I",I,Ablnumber2,perl = TRUE)
|
|
1443 Ablnumber2<- gsub("K",K,Ablnumber2,perl = TRUE)
|
|
1444 Ablnumber2<- gsub("L",L,Ablnumber2,perl = TRUE)
|
|
1445 Ablnumber2<- gsub("M",M,Ablnumber2,perl = TRUE)
|
|
1446 Ablnumber2<- gsub("N",N,Ablnumber2,perl = TRUE)
|
|
1447 Ablnumber2<- gsub("P",P,Ablnumber2,perl = TRUE)
|
|
1448 Ablnumber2<- gsub("Q",Q,Ablnumber2,perl = TRUE)
|
|
1449 Ablnumber2<- gsub("R",R,Ablnumber2,perl = TRUE)
|
|
1450 Ablnumber2<- gsub("S",S,Ablnumber2,perl = TRUE)
|
|
1451 Ablnumber2<- gsub("T",T,Ablnumber2,perl = TRUE)
|
|
1452 Ablnumber2<- gsub("V",V,Ablnumber2,perl = TRUE)
|
|
1453 Ablnumber2<- gsub("W",W,Ablnumber2,perl = TRUE)
|
|
1454 Ablnumber2<- gsub("Y",Y,Ablnumber2,perl = TRUE)
|
|
1455
|
|
1456 Ablnumber3<- gsub("A",A,Ablnumber3,perl = TRUE)
|
|
1457 Ablnumber3<- gsub("C",C,Ablnumber3,perl = TRUE)
|
|
1458 Ablnumber3<- gsub("D",D,Ablnumber3,perl = TRUE)
|
|
1459 Ablnumber3<- gsub("E",E,Ablnumber3,perl = TRUE)
|
|
1460 Ablnumber3<- gsub("F",F,Ablnumber3,perl = TRUE)
|
|
1461 Ablnumber3<- gsub("G",G,Ablnumber3,perl = TRUE)
|
|
1462 Ablnumber3<- gsub("H",H,Ablnumber3,perl = TRUE)
|
|
1463 Ablnumber3<- gsub("I",I,Ablnumber3,perl = TRUE)
|
|
1464 Ablnumber3<- gsub("K",K,Ablnumber3,perl = TRUE)
|
|
1465 Ablnumber3<- gsub("L",L,Ablnumber3,perl = TRUE)
|
|
1466 Ablnumber3<- gsub("M",M,Ablnumber3,perl = TRUE)
|
|
1467 Ablnumber3<- gsub("N",N,Ablnumber3,perl = TRUE)
|
|
1468 Ablnumber3<- gsub("P",P,Ablnumber3,perl = TRUE)
|
|
1469 Ablnumber3<- gsub("Q",Q,Ablnumber3,perl = TRUE)
|
|
1470 Ablnumber3<- gsub("R",R,Ablnumber3,perl = TRUE)
|
|
1471 Ablnumber3<- gsub("S",S,Ablnumber3,perl = TRUE)
|
|
1472 Ablnumber3<- gsub("T",T,Ablnumber3,perl = TRUE)
|
|
1473 Ablnumber3<- gsub("V",V,Ablnumber3,perl = TRUE)
|
|
1474 Ablnumber3<- gsub("W",W,Ablnumber3,perl = TRUE)
|
|
1475 Ablnumber3<- gsub("Y",Y,Ablnumber3,perl = TRUE)
|
|
1476
|
|
1477 Ablnumber4<- gsub("A",A,Ablnumber4,perl = TRUE)
|
|
1478 Ablnumber4<- gsub("C",C,Ablnumber4,perl = TRUE)
|
|
1479 Ablnumber4<- gsub("D",D,Ablnumber4,perl = TRUE)
|
|
1480 Ablnumber4<- gsub("E",E,Ablnumber4,perl = TRUE)
|
|
1481 Ablnumber4<- gsub("F",F,Ablnumber4,perl = TRUE)
|
|
1482 Ablnumber4<- gsub("G",G,Ablnumber4,perl = TRUE)
|
|
1483 Ablnumber4<- gsub("H",H,Ablnumber4,perl = TRUE)
|
|
1484 Ablnumber4<- gsub("I",I,Ablnumber4,perl = TRUE)
|
|
1485 Ablnumber4<- gsub("K",K,Ablnumber4,perl = TRUE)
|
|
1486 Ablnumber4<- gsub("L",L,Ablnumber4,perl = TRUE)
|
|
1487 Ablnumber4<- gsub("M",M,Ablnumber4,perl = TRUE)
|
|
1488 Ablnumber4<- gsub("N",N,Ablnumber4,perl = TRUE)
|
|
1489 Ablnumber4<- gsub("P",P,Ablnumber4,perl = TRUE)
|
|
1490 Ablnumber4<- gsub("Q",Q,Ablnumber4,perl = TRUE)
|
|
1491 Ablnumber4<- gsub("R",R,Ablnumber4,perl = TRUE)
|
|
1492 Ablnumber4<- gsub("S",S,Ablnumber4,perl = TRUE)
|
|
1493 Ablnumber4<- gsub("T",T,Ablnumber4,perl = TRUE)
|
|
1494 Ablnumber4<- gsub("V",V,Ablnumber4,perl = TRUE)
|
|
1495 Ablnumber4<- gsub("W",W,Ablnumber4,perl = TRUE)
|
|
1496 Ablnumber4<- gsub("Y",Y,Ablnumber4,perl = TRUE)
|
|
1497
|
|
1498 Ablnumber5<- gsub("A",A,Ablnumber5,perl = TRUE)
|
|
1499 Ablnumber5<- gsub("C",C,Ablnumber5,perl = TRUE)
|
|
1500 Ablnumber5<- gsub("D",D,Ablnumber5,perl = TRUE)
|
|
1501 Ablnumber5<- gsub("E",E,Ablnumber5,perl = TRUE)
|
|
1502 Ablnumber5<- gsub("F",F,Ablnumber5,perl = TRUE)
|
|
1503 Ablnumber5<- gsub("G",G,Ablnumber5,perl = TRUE)
|
|
1504 Ablnumber5<- gsub("H",H,Ablnumber5,perl = TRUE)
|
|
1505 Ablnumber5<- gsub("I",I,Ablnumber5,perl = TRUE)
|
|
1506 Ablnumber5<- gsub("K",K,Ablnumber5,perl = TRUE)
|
|
1507 Ablnumber5<- gsub("L",L,Ablnumber5,perl = TRUE)
|
|
1508 Ablnumber5<- gsub("M",M,Ablnumber5,perl = TRUE)
|
|
1509 Ablnumber5<- gsub("N",N,Ablnumber5,perl = TRUE)
|
|
1510 Ablnumber5<- gsub("P",P,Ablnumber5,perl = TRUE)
|
|
1511 Ablnumber5<- gsub("Q",Q,Ablnumber5,perl = TRUE)
|
|
1512 Ablnumber5<- gsub("R",R,Ablnumber5,perl = TRUE)
|
|
1513 Ablnumber5<- gsub("S",S,Ablnumber5,perl = TRUE)
|
|
1514 Ablnumber5<- gsub("T",T,Ablnumber5,perl = TRUE)
|
|
1515 Ablnumber5<- gsub("V",V,Ablnumber5,perl = TRUE)
|
|
1516 Ablnumber5<- gsub("W",W,Ablnumber5,perl = TRUE)
|
|
1517 Ablnumber5<- gsub("Y",Y,Ablnumber5,perl = TRUE)
|
|
1518
|
|
1519 Ablnumber6<- gsub("A",A,Ablnumber6,perl = TRUE)
|
|
1520 Ablnumber6<- gsub("C",C,Ablnumber6,perl = TRUE)
|
|
1521 Ablnumber6<- gsub("D",D,Ablnumber6,perl = TRUE)
|
|
1522 Ablnumber6<- gsub("E",E,Ablnumber6,perl = TRUE)
|
|
1523 Ablnumber6<- gsub("F",F,Ablnumber6,perl = TRUE)
|
|
1524 Ablnumber6<- gsub("G",G,Ablnumber6,perl = TRUE)
|
|
1525 Ablnumber6<- gsub("H",H,Ablnumber6,perl = TRUE)
|
|
1526 Ablnumber6<- gsub("I",I,Ablnumber6,perl = TRUE)
|
|
1527 Ablnumber6<- gsub("K",K,Ablnumber6,perl = TRUE)
|
|
1528 Ablnumber6<- gsub("L",L,Ablnumber6,perl = TRUE)
|
|
1529 Ablnumber6<- gsub("M",M,Ablnumber6,perl = TRUE)
|
|
1530 Ablnumber6<- gsub("N",N,Ablnumber6,perl = TRUE)
|
|
1531 Ablnumber6<- gsub("P",P,Ablnumber6,perl = TRUE)
|
|
1532 Ablnumber6<- gsub("Q",Q,Ablnumber6,perl = TRUE)
|
|
1533 Ablnumber6<- gsub("R",R,Ablnumber6,perl = TRUE)
|
|
1534 Ablnumber6<- gsub("S",S,Ablnumber6,perl = TRUE)
|
|
1535 Ablnumber6<- gsub("T",T,Ablnumber6,perl = TRUE)
|
|
1536 Ablnumber6<- gsub("V",V,Ablnumber6,perl = TRUE)
|
|
1537 Ablnumber6<- gsub("W",W,Ablnumber6,perl = TRUE)
|
|
1538 Ablnumber6<- gsub("Y",Y,Ablnumber6,perl = TRUE)
|
|
1539
|
|
1540 Ablnumber7<- gsub("A",A,Ablnumber7,perl = TRUE)
|
|
1541 Ablnumber7<- gsub("C",C,Ablnumber7,perl = TRUE)
|
|
1542 Ablnumber7<- gsub("D",D,Ablnumber7,perl = TRUE)
|
|
1543 Ablnumber7<- gsub("E",E,Ablnumber7,perl = TRUE)
|
|
1544 Ablnumber7<- gsub("F",F,Ablnumber7,perl = TRUE)
|
|
1545 Ablnumber7<- gsub("G",G,Ablnumber7,perl = TRUE)
|
|
1546 Ablnumber7<- gsub("H",H,Ablnumber7,perl = TRUE)
|
|
1547 Ablnumber7<- gsub("I",I,Ablnumber7,perl = TRUE)
|
|
1548 Ablnumber7<- gsub("K",K,Ablnumber7,perl = TRUE)
|
|
1549 Ablnumber7<- gsub("L",L,Ablnumber7,perl = TRUE)
|
|
1550 Ablnumber7<- gsub("M",M,Ablnumber7,perl = TRUE)
|
|
1551 Ablnumber7<- gsub("N",N,Ablnumber7,perl = TRUE)
|
|
1552 Ablnumber7<- gsub("P",P,Ablnumber7,perl = TRUE)
|
|
1553 Ablnumber7<- gsub("Q",Q,Ablnumber7,perl = TRUE)
|
|
1554 Ablnumber7<- gsub("R",R,Ablnumber7,perl = TRUE)
|
|
1555 Ablnumber7<- gsub("S",S,Ablnumber7,perl = TRUE)
|
|
1556 Ablnumber7<- gsub("T",T,Ablnumber7,perl = TRUE)
|
|
1557 Ablnumber7<- gsub("V",V,Ablnumber7,perl = TRUE)
|
|
1558 Ablnumber7<- gsub("W",W,Ablnumber7,perl = TRUE)
|
|
1559 Ablnumber7<- gsub("Y",Y,Ablnumber7,perl = TRUE)
|
|
1560
|
|
1561 Ablnumber8<- gsub("A",A,Ablnumber8,perl = TRUE)
|
|
1562 Ablnumber8<- gsub("C",C,Ablnumber8,perl = TRUE)
|
|
1563 Ablnumber8<- gsub("D",D,Ablnumber8,perl = TRUE)
|
|
1564 Ablnumber8<- gsub("E",E,Ablnumber8,perl = TRUE)
|
|
1565 Ablnumber8<- gsub("F",F,Ablnumber8,perl = TRUE)
|
|
1566 Ablnumber8<- gsub("G",G,Ablnumber8,perl = TRUE)
|
|
1567 Ablnumber8<- gsub("H",H,Ablnumber8,perl = TRUE)
|
|
1568 Ablnumber8<- gsub("I",I,Ablnumber8,perl = TRUE)
|
|
1569 Ablnumber8<- gsub("K",K,Ablnumber8,perl = TRUE)
|
|
1570 Ablnumber8<- gsub("L",L,Ablnumber8,perl = TRUE)
|
|
1571 Ablnumber8<- gsub("M",M,Ablnumber8,perl = TRUE)
|
|
1572 Ablnumber8<- gsub("N",N,Ablnumber8,perl = TRUE)
|
|
1573 Ablnumber8<- gsub("P",P,Ablnumber8,perl = TRUE)
|
|
1574 Ablnumber8<- gsub("Q",Q,Ablnumber8,perl = TRUE)
|
|
1575 Ablnumber8<- gsub("R",R,Ablnumber8,perl = TRUE)
|
|
1576 Ablnumber8<- gsub("S",S,Ablnumber8,perl = TRUE)
|
|
1577 Ablnumber8<- gsub("T",T,Ablnumber8,perl = TRUE)
|
|
1578 Ablnumber8<- gsub("V",V,Ablnumber8,perl = TRUE)
|
|
1579 Ablnumber8<- gsub("W",W,Ablnumber8,perl = TRUE)
|
|
1580 Ablnumber8<- gsub("Y",Y,Ablnumber8,perl = TRUE)
|
|
1581
|
|
1582 Ablnumber9<- gsub("A",A,Ablnumber9,perl = TRUE)
|
|
1583 Ablnumber9<- gsub("C",C,Ablnumber9,perl = TRUE)
|
|
1584 Ablnumber9<- gsub("D",D,Ablnumber9,perl = TRUE)
|
|
1585 Ablnumber9<- gsub("E",E,Ablnumber9,perl = TRUE)
|
|
1586 Ablnumber9<- gsub("F",F,Ablnumber9,perl = TRUE)
|
|
1587 Ablnumber9<- gsub("G",G,Ablnumber9,perl = TRUE)
|
|
1588 Ablnumber9<- gsub("H",H,Ablnumber9,perl = TRUE)
|
|
1589 Ablnumber9<- gsub("I",I,Ablnumber9,perl = TRUE)
|
|
1590 Ablnumber9<- gsub("K",K,Ablnumber9,perl = TRUE)
|
|
1591 Ablnumber9<- gsub("L",L,Ablnumber9,perl = TRUE)
|
|
1592 Ablnumber9<- gsub("M",M,Ablnumber9,perl = TRUE)
|
|
1593 Ablnumber9<- gsub("N",N,Ablnumber9,perl = TRUE)
|
|
1594 Ablnumber9<- gsub("P",P,Ablnumber9,perl = TRUE)
|
|
1595 Ablnumber9<- gsub("Q",Q,Ablnumber9,perl = TRUE)
|
|
1596 Ablnumber9<- gsub("R",R,Ablnumber9,perl = TRUE)
|
|
1597 Ablnumber9<- gsub("S",S,Ablnumber9,perl = TRUE)
|
|
1598 Ablnumber9<- gsub("T",T,Ablnumber9,perl = TRUE)
|
|
1599 Ablnumber9<- gsub("V",V,Ablnumber9,perl = TRUE)
|
|
1600 Ablnumber9<- gsub("W",W,Ablnumber9,perl = TRUE)
|
|
1601 Ablnumber9<- gsub("Y",Y,Ablnumber9,perl = TRUE)
|
|
1602 }
|
|
1603 ########################################
|
|
1604
|
|
1605
|
|
1606 total=length(Positionp7)*length(Positionp6)*length(Positionp5)*length(Positionp4)*length(Positionp3)*(length(Positionp2))*length(Positionp1)*
|
|
1607 length(Positiond0)*length(Positionm1)*length(Positionm2)*length(Positionm3)*length(Positionm4)*length(Positionm5)*length(Positionm6)*length(Positionm7)
|
|
1608 #this is just a way to doublecheck that the length of the generated peptides vector is correct
|
|
1609
|
|
1610 GeneratedPeptides<-rep(NA, times=total*15)
|
|
1611 GeneratedPeptides<-matrix(data = GeneratedPeptides,ncol = 15)
|
|
1612
|
|
1613 NumeratedPeptides<-GeneratedPeptides
|
|
1614 #create an empty vector of correct length by finding the number of each AAs per position and multiplying them
|
|
1615 count<-0
|
|
1616 for (t in 1:length(Positionm7)) {
|
|
1617 for (s in 1:length(Positionm6)) {
|
|
1618 for (r in 1:length(Positionm5)) {
|
|
1619 for (i in 1:length(Positionm4)) {
|
|
1620 for (j in 1:length(Positionm3)) {
|
|
1621 for (k in 1:length(Positionm2)) {
|
|
1622 for (l in 1:length(Positionm1)) {
|
|
1623 for (m in 1:length(Positiond0)) {
|
|
1624 for (n in 1:length(Positionp1)) {
|
|
1625 for (o in 1:length(Positionp2)) {
|
|
1626 for (p in 1:length(Positionp3)) {
|
|
1627 for (q in 1:length(Positionp4)) {
|
|
1628 for (u in 1:length(Positionp5)) {
|
|
1629 for (v in 1:length(Positionp6)) {
|
|
1630 for (w in 1:length(Positionp7)) {
|
|
1631 # i=1
|
|
1632 # j=1
|
|
1633 # k=1
|
|
1634 # l=1
|
|
1635 # m=1
|
|
1636 # n=1
|
|
1637 # o=1
|
|
1638 # p=1
|
|
1639 # q=1
|
|
1640 #
|
|
1641 #for every single position, increment the count number, create a peptide using the AAs at that position
|
|
1642 #then put them together into the generated peptides sequencex
|
|
1643 count<-count+1
|
|
1644 tabulation<-c(Positionm7[t],Positionm6[s],Positionm5[r],Positionm4[i],Positionm3[j],Positionm2[k],Positionm1[l],Positiond0[m],Positionp1[n],
|
|
1645 Positionp2[o],Positionp3[p],Positionp4[q],Positionp5[u],Positionp6[v],Positionp7[w])
|
|
1646 numeration<-c(number15[t],number14[s],number13[r],number1[i],number2[j],number3[k],number4[l],number5[m],number6[n],number7[o],number8[p],number9[q],number10[u],number11[v],
|
|
1647 number12[w])
|
|
1648 #tabulation<-paste(tabulation, sep="", collapse="")
|
|
1649 GeneratedPeptides[count,1:15]<-tabulation
|
|
1650 NumeratedPeptides[count,1:15]<-numeration
|
|
1651 }
|
|
1652 }
|
|
1653 }
|
|
1654 }
|
|
1655 }
|
|
1656 }
|
|
1657 }
|
|
1658 }
|
|
1659 }
|
|
1660 }
|
|
1661 }
|
|
1662 }
|
|
1663 }
|
|
1664 }
|
|
1665 }
|
|
1666 ####################################################################
|
|
1667 #now here I use the Endogenous Probabilty matrix from the previous script, which is called EMPtable
|
|
1668 #to score the created peptides
|
|
1669 ThisKinTable<-EPMtableu#[1:nrow(SDtable),]
|
|
1670 TKTcolumn<-c(data=rep(1,times=21))
|
|
1671 TKTcolumn<-as.matrix(TKTcolumn,ncol=1)
|
|
1672 ThisKinTable<-cbind(TKTcolumn,ThisKinTable)
|
|
1673
|
|
1674 ThisKinGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1675 ThisKinGenWeirdScore<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1676
|
|
1677 for (x in 1:nrow(GeneratedPeptides)){
|
|
1678 Scoringpeptide<-NumeratedPeptides[x,1:15]
|
|
1679 Scoringpeptide<-Scoringpeptide+1
|
|
1680 ThisKinTableScore<-as.numeric(ThisKinTable[Scoringpeptide[1],3])*ThisKinTable[as.numeric(Scoringpeptide[2]),4]*ThisKinTable[as.numeric(Scoringpeptide[3]),5]*
|
|
1681 ThisKinTable[as.numeric(Scoringpeptide[4]),6]*ThisKinTable[as.numeric(Scoringpeptide[5]),7]*ThisKinTable[as.numeric(Scoringpeptide[6]),8]*ThisKinTable[as.numeric(Scoringpeptide[7]),9]*
|
|
1682 #ThisKinTable[as.numeric(Scoringpeptide[8]),10]*
|
|
1683 ThisKinTable[as.numeric(Scoringpeptide[9]),11]*ThisKinTable[as.numeric(Scoringpeptide[10]),12]*ThisKinTable[as.numeric(Scoringpeptide[11]),13]*
|
|
1684 ThisKinTable[as.numeric(Scoringpeptide[12]),14]*ThisKinTable[as.numeric(Scoringpeptide[13]),15]*ThisKinTable[as.numeric(Scoringpeptide[14]),16]*ThisKinTable[as.numeric(Scoringpeptide[15]),17]
|
|
1685 ThisKinGeneratedScores[x]<-ThisKinTableScore
|
|
1686 ThisKinTableScore<-(ThisKinTableScore/(ThisKinTableScore+1/as.numeric(NormalizationScore[2])))
|
|
1687 ThisKinGenWeirdScore[x]<-ThisKinTableScore
|
|
1688 }
|
|
1689
|
|
1690 AblGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1691 ArgGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1692 BtkGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1693 CskGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1694 FynGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1695 HckGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1696 JAK2GeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1697 LckGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1698 LynGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1699 Pyk2GeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1700 SrcGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1701 SykGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1702 YesGeneratedScores<-rep(NA,times=nrow(GeneratedPeptides))
|
|
1703
|
|
1704
|
|
1705 for (x in 1:nrow(GeneratedPeptides)){
|
|
1706 Scoringpeptide<-NumeratedPeptides[x,1:15]
|
|
1707 AblScore<-Abl[Scoringpeptide[1],2]*Abl[Scoringpeptide[2],3]*Abl[Scoringpeptide[3],4]*Abl[Scoringpeptide[4],5]*Abl[Scoringpeptide[5],6]*Abl[Scoringpeptide[6],7]*
|
|
1708 Abl[Scoringpeptide[7],8]*Abl[Scoringpeptide[9],10]*Abl[Scoringpeptide[10],11]*Abl[Scoringpeptide[11],12]*Abl[Scoringpeptide[12],13]*
|
|
1709 Abl[Scoringpeptide[13],14]*Abl[Scoringpeptide[14],15]*Abl[Scoringpeptide[15],16]
|
|
1710 AblGeneratedScores[x]<-AblScore
|
|
1711
|
|
1712 ArgScore<-Arg[Scoringpeptide[1],2]*Arg[Scoringpeptide[2],3]*Arg[Scoringpeptide[3],4]*Arg[Scoringpeptide[4],5]*Arg[Scoringpeptide[5],6]*Arg[Scoringpeptide[6],7]*
|
|
1713 Arg[Scoringpeptide[7],8]*Arg[Scoringpeptide[9],10]*Arg[Scoringpeptide[10],11]*Arg[Scoringpeptide[11],12]*Arg[Scoringpeptide[12],13]*
|
|
1714 Arg[Scoringpeptide[13],14]*Arg[Scoringpeptide[14],15]*Arg[Scoringpeptide[15],16]
|
|
1715 ArgGeneratedScores[x]<-ArgScore
|
|
1716
|
|
1717 BtkScore<-Btk[Scoringpeptide[1],2]*Btk[Scoringpeptide[2],3]*Btk[Scoringpeptide[3],4]*Btk[Scoringpeptide[4],5]*Btk[Scoringpeptide[5],6]*Btk[Scoringpeptide[6],7]*
|
|
1718 Btk[Scoringpeptide[7],8]*Btk[Scoringpeptide[9],10]*Btk[Scoringpeptide[10],11]*Btk[Scoringpeptide[11],12]*Btk[Scoringpeptide[12],13]*
|
|
1719 Btk[Scoringpeptide[13],14]*Btk[Scoringpeptide[14],15]*Btk[Scoringpeptide[15],16]
|
|
1720 BtkGeneratedScores[x]<-BtkScore
|
|
1721
|
|
1722 CskScore<-Csk[Scoringpeptide[1],2]*Csk[Scoringpeptide[2],3]*Csk[Scoringpeptide[3],4]*Csk[Scoringpeptide[4],5]*Csk[Scoringpeptide[5],6]*Csk[Scoringpeptide[6],7]*
|
|
1723 Csk[Scoringpeptide[7],8]*Csk[Scoringpeptide[9],10]*Csk[Scoringpeptide[10],11]*Csk[Scoringpeptide[11],12]*Csk[Scoringpeptide[12],13]*
|
|
1724 Csk[Scoringpeptide[13],14]*Csk[Scoringpeptide[14],15]*Csk[Scoringpeptide[15],16]
|
|
1725 CskGeneratedScores[x]<-CskScore
|
|
1726
|
|
1727 FynScore<-Fyn[Scoringpeptide[1],2]*Fyn[Scoringpeptide[2],3]*Fyn[Scoringpeptide[3],4]*Fyn[Scoringpeptide[4],5]*Fyn[Scoringpeptide[5],6]*Fyn[Scoringpeptide[6],7]*
|
|
1728 Fyn[Scoringpeptide[7],8]*Fyn[Scoringpeptide[9],10]*Fyn[Scoringpeptide[10],11]*Fyn[Scoringpeptide[11],12]*Fyn[Scoringpeptide[12],13]*
|
|
1729 Fyn[Scoringpeptide[13],14]*Fyn[Scoringpeptide[14],15]*Fyn[Scoringpeptide[15],16]
|
|
1730 FynGeneratedScores[x]<-FynScore
|
|
1731
|
|
1732 HckScore<-Hck[Scoringpeptide[1],2]*Hck[Scoringpeptide[2],3]*Hck[Scoringpeptide[3],4]*Hck[Scoringpeptide[4],5]*Hck[Scoringpeptide[5],6]*Hck[Scoringpeptide[6],7]*
|
|
1733 Hck[Scoringpeptide[7],8]*Hck[Scoringpeptide[9],10]*Hck[Scoringpeptide[10],11]*Hck[Scoringpeptide[11],12]*Hck[Scoringpeptide[12],13]*
|
|
1734 Hck[Scoringpeptide[13],14]*Hck[Scoringpeptide[14],15]*Hck[Scoringpeptide[15],16]
|
|
1735 HckGeneratedScores[x]<-HckScore
|
|
1736
|
|
1737 JAK2Score<-JAK2[Scoringpeptide[1],2]*JAK2[Scoringpeptide[2],3]*JAK2[Scoringpeptide[3],4]*JAK2[Scoringpeptide[4],5]*JAK2[Scoringpeptide[5],6]*JAK2[Scoringpeptide[6],7]*
|
|
1738 JAK2[Scoringpeptide[7],8]*JAK2[Scoringpeptide[9],10]*JAK2[Scoringpeptide[10],11]*JAK2[Scoringpeptide[11],12]*JAK2[Scoringpeptide[12],13]*
|
|
1739 JAK2[Scoringpeptide[13],14]*JAK2[Scoringpeptide[14],15]*JAK2[Scoringpeptide[15],16]
|
|
1740 JAK2GeneratedScores[x]<-JAK2Score
|
|
1741
|
|
1742 LckScore<-Lck[Scoringpeptide[1],2]*Lck[Scoringpeptide[2],3]*Lck[Scoringpeptide[3],4]*Lck[Scoringpeptide[4],5]*Lck[Scoringpeptide[5],6]*Lck[Scoringpeptide[6],7]*
|
|
1743 Lck[Scoringpeptide[7],8]*Lck[Scoringpeptide[9],10]*Lck[Scoringpeptide[10],11]*Lck[Scoringpeptide[11],12]*Lck[Scoringpeptide[12],13]*
|
|
1744 Lck[Scoringpeptide[13],14]*Lck[Scoringpeptide[14],15]*Lck[Scoringpeptide[15],16]
|
|
1745 LckGeneratedScores[x]<-LckScore
|
|
1746
|
|
1747 LynScore<-Lyn[Scoringpeptide[1],2]*Lyn[Scoringpeptide[2],3]*Lyn[Scoringpeptide[3],4]*Lyn[Scoringpeptide[4],5]*Lyn[Scoringpeptide[5],6]*Lyn[Scoringpeptide[6],7]*
|
|
1748 Lyn[Scoringpeptide[7],8]*Lyn[Scoringpeptide[9],10]*Lyn[Scoringpeptide[10],11]*Lyn[Scoringpeptide[11],12]*Lyn[Scoringpeptide[12],13]*
|
|
1749 Lyn[Scoringpeptide[13],14]*Lyn[Scoringpeptide[14],15]*Lyn[Scoringpeptide[15],16]
|
|
1750 LynGeneratedScores[x]<-LynScore
|
|
1751
|
|
1752 Pyk2Score<-Pyk2[Scoringpeptide[1],2]*Pyk2[Scoringpeptide[2],3]*Pyk2[Scoringpeptide[3],4]*Pyk2[Scoringpeptide[4],5]*Pyk2[Scoringpeptide[5],6]*Pyk2[Scoringpeptide[6],7]*
|
|
1753 Pyk2[Scoringpeptide[7],8]*Pyk2[Scoringpeptide[9],10]*Pyk2[Scoringpeptide[10],11]*Pyk2[Scoringpeptide[11],12]*Pyk2[Scoringpeptide[12],13]*
|
|
1754 Pyk2[Scoringpeptide[13],14]*Pyk2[Scoringpeptide[14],15]*Pyk2[Scoringpeptide[15],16]
|
|
1755 Pyk2GeneratedScores[x]<-Pyk2Score
|
|
1756
|
|
1757 SrcScore<-Src[Scoringpeptide[1],2]*Src[Scoringpeptide[2],3]*Src[Scoringpeptide[3],4]*Src[Scoringpeptide[4],5]*Src[Scoringpeptide[5],6]*Src[Scoringpeptide[6],7]*
|
|
1758 Src[Scoringpeptide[7],8]*Src[Scoringpeptide[9],10]*Src[Scoringpeptide[10],11]*Src[Scoringpeptide[11],12]*Src[Scoringpeptide[12],13]*
|
|
1759 Src[Scoringpeptide[13],14]*Src[Scoringpeptide[14],15]*Src[Scoringpeptide[15],16]
|
|
1760 SrcGeneratedScores[x]<-SrcScore
|
|
1761
|
|
1762 SykScore<-Syk[Scoringpeptide[1],2]*Syk[Scoringpeptide[2],3]*Syk[Scoringpeptide[3],4]*Syk[Scoringpeptide[4],5]*Syk[Scoringpeptide[5],6]*Syk[Scoringpeptide[6],7]*
|
|
1763 Syk[Scoringpeptide[7],8]*Syk[Scoringpeptide[9],10]*Syk[Scoringpeptide[10],11]*Syk[Scoringpeptide[11],12]*Syk[Scoringpeptide[12],13]*
|
|
1764 Syk[Scoringpeptide[13],14]*Syk[Scoringpeptide[14],15]*Syk[Scoringpeptide[15],16]
|
|
1765 SykGeneratedScores[x]<-SykScore
|
|
1766
|
|
1767 YesScore<-Yes[Scoringpeptide[1],2]*Yes[Scoringpeptide[2],3]*Yes[Scoringpeptide[3],4]*Yes[Scoringpeptide[4],5]*Yes[Scoringpeptide[5],6]*Yes[Scoringpeptide[6],7]*
|
|
1768 Yes[Scoringpeptide[7],8]*Yes[Scoringpeptide[9],10]*Yes[Scoringpeptide[10],11]*Yes[Scoringpeptide[11],12]*Yes[Scoringpeptide[12],13]*
|
|
1769 Yes[Scoringpeptide[13],14]*Yes[Scoringpeptide[14],15]*Yes[Scoringpeptide[15],16]
|
|
1770 YesGeneratedScores[x]<-YesScore
|
|
1771
|
|
1772 # ThisKinTableScore<-ThisKinTable[as.numeric(Scoringpeptide[1]),3]*ThisKinTable[as.numeric(Scoringpeptide[2]),4]*ThisKinTable[as.numeric(Scoringpeptide[3]),5]*
|
|
1773 # ThisKinTable[as.numeric(Scoringpeptide[4]),6]*ThisKinTable[as.numeric(Scoringpeptide[6]),8]*
|
|
1774 # ThisKinTable[as.numeric(Scoringpeptide[7]),9]*ThisKinTable[as.numeric(Scoringpeptide[8]),10]*ThisKinTable[as.numeric(Scoringpeptide[9]),11]
|
|
1775 # ThisKinGeneratedScores[x]<-ThisKinTableScore
|
|
1776 }
|
|
1777
|
|
1778
|
|
1779
|
|
1780 AblNorm<-1/as.numeric(Abl[22,1])
|
|
1781 AblThresh<-as.numeric(Abl[24,1])
|
|
1782 AblTrueThresh<-((AblThresh*AblNorm)/(100-AblThresh))
|
|
1783 AblActive<-unlist(AblGeneratedScores)>AblTrueThresh
|
17
|
1784 if (TodaysKinase=="ABL"){AblActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1785
|
|
1786 ArgNorm<-1/as.numeric(Arg[22,1])
|
|
1787 ArgThresh<-as.numeric(Arg[24,1])
|
|
1788 ArgTrueThresh<-((ArgThresh*ArgNorm)/(100-ArgThresh))
|
|
1789 ArgActive<-unlist(ArgGeneratedScores)>ArgTrueThresh
|
17
|
1790 if (TodaysKinase=="ARG"){ArgActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1791
|
|
1792 BtkNorm<-1/as.numeric(Btk[22,1])
|
|
1793 BtkThresh<-as.numeric(Btk[24,1])
|
|
1794 BtkTrueThresh<-((BtkThresh*BtkNorm)/(100-BtkThresh))
|
|
1795 BtkActive<-unlist(BtkGeneratedScores)>BtkTrueThresh
|
17
|
1796 if (TodaysKinase=="BTK"){BtkActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1797
|
|
1798 CskNorm<-1/as.numeric(Csk[22,1])
|
|
1799 CskThresh<-as.numeric(Csk[24,1])
|
|
1800 CskTrueThresh<-((CskThresh*CskNorm)/(100-CskThresh))
|
|
1801 CskActive<-(CskGeneratedScores)>CskTrueThresh
|
17
|
1802 if (TodaysKinase=="CSK"){CskActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1803
|
|
1804 FynNorm<-1/as.numeric(Fyn[22,1])
|
|
1805 FynThresh<-as.numeric(Fyn[24,1])
|
|
1806 FynTrueThresh<-((FynThresh*FynNorm)/(100-FynThresh))
|
|
1807 FynActive<-unlist(FynGeneratedScores)>FynTrueThresh
|
17
|
1808 if (TodaysKinase=="FYN"){FynActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1809
|
|
1810 HckNorm<-1/as.numeric(Hck[22,1])
|
|
1811 HckThresh<-as.numeric(Hck[24,1])
|
|
1812 HckTrueThresh<-((HckThresh*HckNorm)/(100-HckThresh))
|
|
1813 HckActive<-unlist(HckGeneratedScores)>HckTrueThresh
|
17
|
1814 if (TodaysKinase=="HCK"){HckActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1815
|
|
1816 JAK2Norm<-1/as.numeric(JAK2[22,1])
|
|
1817 JAK2Thresh<-as.numeric(JAK2[24,1])
|
|
1818 JAK2TrueThresh<-((JAK2Thresh*JAK2Norm)/(100-JAK2Thresh))
|
|
1819 JAk2Active<-unlist(JAK2GeneratedScores)>JAK2TrueThresh
|
17
|
1820 if (TodaysKinase=="JAK2"){JAk2Active<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1821
|
|
1822 LckNorm<-1/as.numeric(Lck[22,1])
|
|
1823 LckThresh<-as.numeric(Lck[24,1])
|
|
1824 LckTrueThresh<-((LckThresh*LckNorm)/(100-LckThresh))
|
|
1825 LckActive<-unlist(LckGeneratedScores)>LckTrueThresh
|
17
|
1826 if (TodaysKinase=="LCK"){LckActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1827
|
|
1828 LynNorm<-1/as.numeric(Lyn[22,1])
|
|
1829 LynThresh<-as.numeric(Lyn[24,1])
|
|
1830 LynTrueThresh<-((LynThresh*LynNorm)/(100-LynThresh))
|
|
1831 LynActive<-unlist(LynGeneratedScores)>LynTrueThresh
|
17
|
1832 if (TodaysKinase=="LYN"){LynActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1833
|
|
1834 Pyk2Norm<-1/as.numeric(Pyk2[22,1])
|
|
1835 Pyk2Thresh<-as.numeric(Pyk2[24,1])
|
|
1836 Pyk2TrueThresh<-((Pyk2Thresh*Pyk2Norm)/(100-Pyk2Thresh))
|
|
1837 Pyk2Active<-unlist(Pyk2GeneratedScores)>Pyk2TrueThresh
|
17
|
1838 if (TodaysKinase=="PYK2"){Pyk2Active<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1839
|
|
1840 SrcNorm<-1/as.numeric(Src[22,1])
|
|
1841 SrcThresh<-as.numeric(Src[24,1])
|
|
1842 SrcTrueThresh<-((SrcThresh*SrcNorm)/(100-SrcThresh))
|
|
1843 SrcActive<-unlist(SrcGeneratedScores)>SrcTrueThresh
|
17
|
1844 if (TodaysKinase=="SRC"){SrcActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1845
|
|
1846 SykNorm<-1/as.numeric(Syk[22,1])
|
|
1847 SykThresh<-as.numeric(Syk[24,1])
|
|
1848 SykTrueThresh<-((SykThresh*SykNorm)/(100-SykThresh))
|
|
1849 SykActive<-unlist(SykGeneratedScores)>SykTrueThresh
|
17
|
1850 if (TodaysKinase=="SYK"){SykActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1851
|
|
1852 YesNorm<-1/as.numeric(Yes[22,1])
|
|
1853 YesThresh<-as.numeric(Yes[24,1])
|
|
1854 YesTrueThresh<-((YesThresh*YesNorm)/(100-YesThresh))
|
|
1855 YesActive<-unlist(YesGeneratedScores)>YesTrueThresh
|
17
|
1856 if (TodaysKinase=="YES"){YesActive<-rep(0,times=nrow(GeneratedPeptides))}
|
14
|
1857
|
|
1858 AllActive<-AblActive+ArgActive+BtkActive+CskActive+FynActive+HckActive+JAk2Active+LckActive+LynActive+Pyk2Active+SrcActive+SykActive+YesActive
|
|
1859 #Btkactive+
|
|
1860
|
|
1861 Scores<-ThisKinGeneratedScores
|
|
1862 ThresholdValues<-ThisKinGenWeirdScore
|
|
1863
|
|
1864 FullMotifs<-rep("Z",times=nrow(GeneratedPeptides))
|
|
1865 for (i in 1:nrow(GeneratedPeptides)) {
|
|
1866 motif<-GeneratedPeptides[i,1:15]
|
|
1867 motif<-paste(motif,sep = "", collapse = "")
|
|
1868 FullMotifs[i]<-motif
|
|
1869 }
|
|
1870
|
|
1871 PeptidesWithRanks<-cbind.data.frame(FullMotifs,GeneratedPeptides,Scores,ThresholdValues)
|
|
1872 PeptidesWithRanks<-cbind.data.frame(PeptidesWithRanks,AllActive,AblActive,ArgActive,BtkActive,CskActive,FynActive,HckActive,JAk2Active,LckActive,LynActive,Pyk2Active,SrcActive,SykActive,YesActive)
|
|
1873 RanksPeptides<-PeptidesWithRanks[order(PeptidesWithRanks$AllActive,decreasing = FALSE),]
|
|
1874 # PepRankHead<-c(1:9,"Sequence","RPMS","PMS")
|
|
1875 # RanksPeptides<-rbind.data.frame(PepRankHead,PeptidesWithRanks)
|
|
1876 #head(RanksPeptides)
|
|
1877
|
|
1878
|
|
1879 #now I have to score the negative sequences... for some reason
|
|
1880 #write up how we transfect with lipofectamine
|
|
1881 #3,4,5 questions
|
|
1882
|
|
1883 #PAUSED EHRE AT 4:50, HOPING THAT FIXING MINERVOTHING SO THAT LEFT SPACES WORKS FIXES A THING. OTHERWISE
|
|
1884 #I FUCKED WITH THE MCC TABLE AND NEED TO FINISH IT
|
|
1885
|
|
1886 ThisKinBlanks<-rep(1,times=17)
|
|
1887 #indx <- sapply(breast, is.factor)
|
|
1888 #ThisKinTable[indx] <- lapply(ThisKinTable[indx], function(x) as.character(x))
|
|
1889 ThisKinTable$SetOfAAs<-as.character(ThisKinTable$SetOfAAs)
|
|
1890
|
|
1891 #ThisKinTest<-rbind.data.frame(ThisKinTable,ThisKinBlanks)
|
|
1892 ThisKinTable<-rbind.data.frame(ThisKinTable,ThisKinBlanks)
|
|
1893
|
|
1894 NegativeScores<-rep(NA,times=nrow(NegativeSubstrateList))
|
|
1895 NegativeWeirdScores<-rep(NA,times=nrow(NegativeSubstrateList))
|
|
1896 for (v in 1:nrow(NegativeSubstrateList)) {
|
|
1897 motif<-NegativeSubstrateList[v,2]
|
|
1898 motif<-unlist(strsplit(motif,""))
|
|
1899 #if (length(motif)<9){print(v)}}
|
|
1900 # motif[1] <- sapply(motif[1], function (x) aa_props[x])
|
|
1901 # motif[2] <- sapply(motif[2], function (x) aa_props[x])
|
|
1902 # motif[3] <- sapply(motif[3], function (x) aa_props[x])
|
|
1903 # motif[4] <- sapply(motif[4], function (x) aa_props[x])
|
|
1904 # motif[5] <- sapply(motif[5], function (x) aa_props[x])
|
|
1905 # motif[6] <- sapply(motif[6], function (x) aa_props[x])
|
|
1906 # motif[7] <- sapply(motif[7], function (x) aa_props[x])
|
|
1907 # motif[8] <- sapply(motif[8], function (x) aa_props[x])
|
|
1908 # motif[9] <- sapply(motif[9], function (x) aa_props[x])
|
|
1909 motif<- gsub(" ","O",motif)
|
|
1910 motif <- sapply(motif, function (x) aa_props[x])
|
|
1911 Scoringpeptide<-motif
|
|
1912 Scoringpeptide<-Scoringpeptide+1
|
|
1913 ThisKinTableScore<-as.numeric(ThisKinTable[Scoringpeptide[1],3])*ThisKinTable[as.numeric(Scoringpeptide[2]),4]*ThisKinTable[as.numeric(Scoringpeptide[3]),5]*
|
|
1914 ThisKinTable[as.numeric(Scoringpeptide[4]),6]*ThisKinTable[as.numeric(Scoringpeptide[5]),7]*ThisKinTable[as.numeric(Scoringpeptide[6]),8]*ThisKinTable[as.numeric(Scoringpeptide[7]),9]*
|
|
1915 #ThisKinTable[as.numeric(Scoringpeptide[8]),10]*
|
|
1916 ThisKinTable[as.numeric(Scoringpeptide[9]),11]*ThisKinTable[as.numeric(Scoringpeptide[10]),12]*ThisKinTable[as.numeric(Scoringpeptide[11]),13]*
|
|
1917 ThisKinTable[as.numeric(Scoringpeptide[12]),14]*ThisKinTable[as.numeric(Scoringpeptide[13]),15]*ThisKinTable[as.numeric(Scoringpeptide[14]),16]*ThisKinTable[as.numeric(Scoringpeptide[15]),17]
|
|
1918 NegativeScores[v]<-ThisKinTableScore
|
|
1919 ThisKinTableScore<-(ThisKinTableScore/(ThisKinTableScore+1/as.numeric(NormalizationScore[2])))
|
|
1920 NegativeWeirdScores[v]<-ThisKinTableScore*100
|
|
1921 }
|
|
1922
|
|
1923 negativesubstrates<-NegativeSubstrateList[,2]
|
|
1924 NegativeWithScores<-cbind(negativesubstrates,as.character(NegativeScores),as.character(NegativeWeirdScores))
|
|
1925
|
|
1926
|
|
1927 #NEED TO HAVE THE NEGATIVE SUBSTRATES BE OUTPUTTED
|
|
1928
|
|
1929 PositiveScores<-rep(NA,times=nrow(ImportedSubstrateList))
|
|
1930 PositiveWeirdScores<-rep(NA,times=nrow(ImportedSubstrateList))
|
|
1931
|
|
1932 for (v in 1:nrow(ImportedSubstrateList)) {
|
|
1933 motif<-ImportedSubstrateList[v,4:18]
|
|
1934 motif<-unlist(motif)
|
|
1935 motif<- gsub("^$","O",motif)
|
|
1936 motif <- sapply(motif, function (x) aa_props[x])
|
|
1937 Scoringpeptide<-motif
|
|
1938 Scoringpeptide<-Scoringpeptide+1
|
|
1939 ThisKinTableScore<-as.numeric(ThisKinTable[Scoringpeptide[1],3])*ThisKinTable[as.numeric(Scoringpeptide[2]),4]*ThisKinTable[as.numeric(Scoringpeptide[3]),5]*
|
|
1940 ThisKinTable[as.numeric(Scoringpeptide[4]),6]*ThisKinTable[as.numeric(Scoringpeptide[5]),7]*ThisKinTable[as.numeric(Scoringpeptide[6]),8]*ThisKinTable[as.numeric(Scoringpeptide[7]),9]*
|
|
1941 #ThisKinTable[as.numeric(Scoringpeptide[8]),10]*
|
|
1942 ThisKinTable[as.numeric(Scoringpeptide[9]),11]*ThisKinTable[as.numeric(Scoringpeptide[10]),12]*ThisKinTable[as.numeric(Scoringpeptide[11]),13]*
|
|
1943 ThisKinTable[as.numeric(Scoringpeptide[12]),14]*ThisKinTable[as.numeric(Scoringpeptide[13]),15]*ThisKinTable[as.numeric(Scoringpeptide[14]),16]*ThisKinTable[as.numeric(Scoringpeptide[15]),17]
|
|
1944
|
|
1945 PositiveScores[v]<-ThisKinTableScore
|
|
1946 ThisKinTableScore<-(ThisKinTableScore/(ThisKinTableScore+1/as.numeric(NormalizationScore[2])))
|
|
1947 PositiveWeirdScores[v]<-ThisKinTableScore*100
|
|
1948 }
|
|
1949
|
|
1950 positivesubstrates<-ImportedSubstrateList[,4:18]
|
|
1951 positivewithscores<-cbind.data.frame(positivesubstrates,PositiveScores,PositiveWeirdScores)
|
|
1952
|
|
1953
|
|
1954 #write down the transient transfection SOP and what we will be doing with them
|
|
1955 #write down the vector names I will be using
|
|
1956 #write down something about transforming bacteria and with what
|
|
1957
|
|
1958 #90% whatevernness
|
|
1959 # TPninetyone<-length(PositiveWeirdScores[PositiveWeirdScores>=0.91])
|
|
1960 # Senseninetyone<-TPninetyone/nrow(positivesubstrates)
|
|
1961 #
|
|
1962 # TNninetyone<-length(NegativeWeirdScores[NegativeWeirdScores<91])
|
|
1963 # Specninetyone<-TNninetyone/100
|
|
1964
|
|
1965 #create the MCC table
|
|
1966
|
17
|
1967 threshold<-c(1:100,(1:9)/10,(1:9)/100,0,-.1)
|
|
1968 threshold<-threshold[order(threshold,decreasing = TRUE)]
|
|
1969 threshold
|
14
|
1970
|
17
|
1971 Truepositives<-c(1:120)
|
|
1972 Falsenegatives<-c(1:120)
|
|
1973 Sensitivity<-c(1:120)
|
|
1974 TrueNegatives<-c(1:120)
|
|
1975 FalsePositives<-c(1:120)
|
|
1976 Specificity<-c(1:120)
|
|
1977 Accuracy<-c(1:120)
|
|
1978 MCC<-c(1:120)
|
|
1979 EER<-c(1:120)
|
14
|
1980
|
|
1981 #MAKE DAMN SURE THAT THE ACCESSION NUMBERS FOLLOW THE MOTIFS
|
|
1982
|
17
|
1983 for (z in 1:120) {
|
|
1984 thres<-threshold[z]
|
14
|
1985 Truepositives[z]<-length(PositiveWeirdScores[PositiveWeirdScores>=(thres)])
|
|
1986 Falsenegatives[z]<-nrow(positivesubstrates)-Truepositives[z]
|
|
1987 Sensitivity[z]<-Truepositives[z]/(Falsenegatives[z]+Truepositives[z])
|
|
1988 TrueNegatives[z]<-length(NegativeWeirdScores[NegativeWeirdScores<(thres)])
|
|
1989 # at thresh 100 this should be 0, because it is total minus true negatives
|
|
1990 FalsePositives[z]<-nrow(NegativeSubstrateList)-TrueNegatives[z]
|
|
1991 Specificity[z]<-1-(TrueNegatives[z]/(FalsePositives[z]+TrueNegatives[z]))
|
|
1992 Accuracy[z]<-100*(Truepositives[z]+TrueNegatives[z])/(Falsenegatives[z]+FalsePositives[z]+TrueNegatives[z]+Truepositives[z])
|
17
|
1993 MCC[z]<-((Truepositives[z]*TrueNegatives[z])-(Falsenegatives[z]*FalsePositives[z]))/sqrt(round(round(Truepositives[z]+Falsenegatives[z])*round(TrueNegatives[z]+FalsePositives[z])*round(Truepositives[z]+FalsePositives[z])*round(TrueNegatives[z]+Falsenegatives[z])))
|
14
|
1994 EER[z]<-.01*(((1-(Sensitivity[z]))*(Truepositives[z]+Falsenegatives[z]))+(Specificity[z]*(1-(Truepositives[z]+Falsenegatives[z]))))
|
|
1995 }
|
17
|
1996 Characterization<-cbind.data.frame(threshold,Truepositives,Falsenegatives,Sensitivity,TrueNegatives,FalsePositives,Specificity,MCC,EER)
|
14
|
1997
|
|
1998 positiveheader<-c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,"RPMS","PMS")
|
|
1999 positivewithscores<-rbind.data.frame(positiveheader,positivewithscores)
|
|
2000
|
|
2001 negativeheader<-c("Substrate","RPMS","PMS")
|
|
2002 colnames(NegativeWithScores)<-negativeheader
|
|
2003
|
|
2004 # write.xlsx(NegativeWithScores,file = FILENAME, sheetName = "Negative Sequences Scored",col.names = TRUE,row.names = FALSE,append = TRUE)
|
|
2005 # write.xlsx(Characterization,file = FILENAME,sheetName = "Characterization Table",col.names = TRUE,row.names = FALSE,append = TRUE)
|
|
2006 # write.xlsx(RanksPeptides,file = FILENAME,sheetName = "Ranked Generated Peptides",col.names = FALSE,row.names = FALSE,append = TRUE)
|
|
2007 # write.xlsx(positivewithscores,file = FILENAME, sheetName = "Positive Sequences Scored",col.names = FALSE,row.names = FALSE,append = TRUE)
|
|
2008 write.table(x=c("Characterzation Table"),file = FILENAME2, col.names = FALSE,row.names = FALSE, append = TRUE,sep = ",")
|
|
2009 header<-colnames(Characterization)
|
|
2010 Characterization<-rbind.data.frame(header,Characterization)
|
|
2011 write.table(Characterization,file = FILENAME2, col.names = FALSE,row.names = FALSE, append = TRUE,sep = ",")
|
|
2012
|
|
2013 # header<-colnames(RanksPeptides)
|
|
2014 # RanksPeptides<-rbind.data.frame(header,RanksPeptides)
|
17
|
2015 write.table(x="Off Target Kinase activity (your kinase of interest should have zeros here because it is ON-target)",file = FILENAME3,append = FALSE,row.names = FALSE,col.names = TRUE,sep = ",")
|
14
|
2016 write.table(RanksPeptides,file = FILENAME3,append = FALSE,row.names = FALSE,col.names = TRUE,sep = ",")
|
20
|
2017
|
|
2018 PositivesWithScores<-as.data.frame(ImportedSubstrateList)
|
|
2019 PositiveOutput<-cbind(PositivesWithScores,PositiveWeirdScores)
|
|
2020 write.table(PositiveOutput,file = FILENAME4, sep = ",", na="",row.names = FALSE, append = FALSE)
|
|
2021
|
|
2022 NegativeOutput<-as.data.frame(NegativeSubstrateList)
|
|
2023 NegativeOutput<-cbind(NegativeOutput,NegativeWeirdScores)
|
|
2024 write.table(NegativeOutput,file = FILENAME5,sep = ",",na="",row.names = FALSE, append = FALSE)
|