Advertisement
ProzacR

Edita2013_specifiskumo_QSAR_nd

Nov 27th, 2015
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 15.71 KB | None | 0 0
  1. library(cvq2)
  2. #library(leaps)
  3.  
  4. #Q2TEST f-ja kaip ir PHASE Q2 lygiai tokia pati
  5. q2test<-function(activity, predicted_activity) {
  6.                 prediction_error_sq<-(predicted_activity-activity)^2
  7.                 avg_activity<-mean(activity)
  8.                 sigma_y_sq<-(activity-avg_activity)^2
  9.                 q2test_val<-1-sum(prediction_error_sq)/sum(sigma_y_sq)
  10.                 return(q2test_val)
  11. }
  12.  
  13.  
  14. # cia is karto jau pKd skirtumas imtas:
  15. selectivity<-read.table("selectivityCA12.csv", sep=",", header=TRUE)
  16. qsar12_1<-data.frame(K<-selectivity$CA12.1)
  17. qsar12_1$x<-as.matrix(read.table("edragon_descriptors_fix4.csv", sep=",", skip=1))
  18.  
  19.  
  20. #random numbers:
  21. #> test <- sort(round(runif(10, 1, 40)))
  22. #> test
  23. test <- c(2, 3, 8, 9, 10, 16, 18, 19, 29, 35)
  24. #tada:
  25. train <- c(1, 4, 5, 6, 7, 11, 12, 13, 14, 15, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40)
  26.  
  27. r2=NULL
  28. r2good=NULL
  29. for (i in 1:1317 ) {
  30. fit.single<-lm(qsar12_1$K[train]~qsar12_1$x[train,i])
  31. r2[i]<-summary(fit.single)$r.squared
  32. if(r2[i]>0.25) {
  33. r2good[i]<-r2[i]
  34. }
  35. }
  36.  
  37. good_deskr_nr<-NULL
  38. for (i in 1:1317 ) {
  39.                  if(r2[i]>0.25) {
  40.                                            good_deskr_nr<-c(good_deskr_nr, i)
  41.  }
  42. }
  43.  
  44. #leaps<-regsubsets(qsar12_1$K[train]~qsar12_1$x[train,good_deskr_nr], data=qsar12_1, nvmax=3)
  45. #plot(leaps, scale="r2")
  46. CA12_1_geri_deskr<-c(105, 333, 1205)
  47.  
  48. qsar_12_1_train<-lm(qsar12_1$K[train] ~ qsar12_1$x[train, CA12_1_geri_deskr[1]] + qsar12_1$x[train, CA12_1_geri_deskr[2]] + qsar12_1$x[train, CA12_1_geri_deskr[3]])
  49. print(summary(qsar_12_1_train))
  50. qsar_12_1_test_pred_values<-coef(qsar_12_1_train)[1]+coef(qsar_12_1_train)[2]*qsar12_1$x[test, CA12_1_geri_deskr[1]]+coef(qsar_12_1_train)[3]*qsar12_1$x[test, CA12_1_geri_deskr[2]]+coef(qsar_12_1_train)[4]*qsar12_1$x[test, CA12_1_geri_deskr[3]]
  51. qsar_12_1_test<-lm(qsar_12_1_test_pred_values ~ qsar12_1$K[test])
  52. print(summary(qsar_12_1_test))
  53. x<-cbind(qsar12_1$x[train,c(CA12_1_geri_deskr[1], CA12_1_geri_deskr[2], CA12_1_geri_deskr[3])], qsar12_1$K[train])
  54. colnames(x)[4]<-"y"
  55. qsar_12_1_q2<-cvq2(x)
  56. print(qsar_12_1_q2)
  57.  
  58. #==========================================
  59.  
  60. qsar12_2<-data.frame(K<-selectivity$CA12.2)
  61. qsar12_2$x<-as.matrix(read.table("edragon_descriptors_fix4.csv", sep=",", skip=1))
  62.  
  63. r2=NULL
  64. r2good=NULL
  65. for (i in 1:1317 ) {
  66. fit.single<-lm(qsar12_2$K[train]~qsar12_2$x[train,i])
  67. r2[i]<-summary(fit.single)$r.squared
  68. if(r2[i]>0.25) {
  69. r2good[i]<-r2[i]
  70. }
  71. }
  72.  
  73. good_deskr_nr<-NULL
  74. for (i in 1:1317 ) {
  75.                  if(r2[i]>0.25) {
  76.                                            good_deskr_nr<-c(good_deskr_nr, i)
  77.  }
  78. }
  79.  
  80. #kaip ir be leaps variantas:
  81. #tada imti didziausia is r2good ir salinti koreliacijas su kitais, rasti kuris nekoreliuoja
  82. #r2very_good istrintos koreliacijos su 1231 kuris labai geras  sitame....
  83.  
  84. ##leaps<-regsubsets(qsar12_2$K[train]~qsar12_2$x[train,good_deskr_nr], data=qsar12_2, nvmax=3)
  85. #plot(leaps, scale="r2")
  86. CA12_2_geri_deskr<-c(292, 308, 311)
  87.  
  88.  
  89. qsar_12_2_train<-lm(qsar12_2$K[train] ~ qsar12_2$x[train, CA12_2_geri_deskr[1]] + qsar12_2$x[train, CA12_2_geri_deskr[2]] + qsar12_2$x[train, CA12_2_geri_deskr[3]])
  90. print(summary(qsar_12_2_train))
  91. qsar_12_2_test_pred_values<-coef(qsar_12_2_train)[1]+coef(qsar_12_2_train)[2]*qsar12_2$x[test, CA12_2_geri_deskr[1]]+coef(qsar_12_2_train)[3]*qsar12_2$x[test, CA12_2_geri_deskr[2]]+coef(qsar_12_2_train)[4]*qsar12_2$x[test, CA12_2_geri_deskr[3]]
  92. qsar_12_2_test<-lm(qsar_12_2_test_pred_values ~ qsar12_2$K[test])
  93. print(summary(qsar_12_2_test))
  94. x<-cbind(qsar12_2$x[train,c(CA12_2_geri_deskr[1], CA12_2_geri_deskr[2], CA12_2_geri_deskr[3])], qsar12_2$K[train])
  95. colnames(x)[4]<-"y"
  96. qsar_12_2_q2<-cvq2(x)
  97. print(qsar_12_2_q2)
  98.  
  99. #=============================================
  100.  
  101. qsar12_6<-data.frame(K<-selectivity$CA12.6)
  102. qsar12_6$x<-as.matrix(read.table("edragon_descriptors_fix4.csv", sep=",", skip=1))
  103.  
  104. r2=NULL
  105. r2good=NULL
  106. for (i in 1:1317 ) {
  107. fit.single<-lm(qsar12_6$K[train]~qsar12_6$x[train,i])
  108. r2[i]<-summary(fit.single)$r.squared
  109. if(r2[i]>0.25) {
  110. r2good[i]<-r2[i]
  111. }
  112. }
  113.  
  114. good_deskr_nr<-NULL
  115. for (i in 1:1317 ) {
  116.  if(r2[i]>0.25) {
  117.  good_deskr_nr<-c(good_deskr_nr, i)
  118.  }
  119. }
  120. #leaps<-regsubsets(qsar12_6$K[train]~qsar12_6$x[train,good_deskr_nr], data=qsar12_6, nvmax=3)
  121. #plot(leaps, scale="r2")
  122. CA12_6_geri_deskr<-c(38, 283, 299)
  123.  
  124. qsar_12_6_train<-lm(qsar12_6$K[train] ~ qsar12_6$x[train, CA12_6_geri_deskr[1]] + qsar12_6$x[train, CA12_6_geri_deskr[2]] + qsar12_6$x[train, CA12_6_geri_deskr[3]])
  125. print(summary(qsar_12_6_train))
  126. qsar_12_6_test_pred_values<-coef(qsar_12_6_train)[1]+coef(qsar_12_6_train)[2]*qsar12_6$x[test, CA12_6_geri_deskr[1]]+coef(qsar_12_6_train)[3]*qsar12_6$x[test, CA12_6_geri_deskr[2]]+coef(qsar_12_6_train)[4]*qsar12_6$x[test, CA12_6_geri_deskr[3]]
  127. qsar_12_6_test<-lm(qsar_12_6_test_pred_values ~ qsar12_6$K[test])
  128. print(summary(qsar_12_6_test))
  129. x<-cbind(qsar12_6$x[train,c(CA12_6_geri_deskr[1], CA12_6_geri_deskr[2], CA12_6_geri_deskr[3])], qsar12_6$K[train])
  130. colnames(x)[4]<-"y"
  131. qsar_12_6_q2<-cvq2(x)
  132. print(qsar_12_6_q2)
  133.  
  134. #===============================================
  135.  
  136. qsar12_7<-data.frame(K<-selectivity$CA12.7)
  137. qsar12_7$x<-as.matrix(read.table("edragon_descriptors_fix4.csv", sep=",", skip=1))
  138.  
  139. r2=NULL
  140. r2good=NULL
  141. for (i in 1:1317 ) {
  142. fit.single<-lm(qsar12_7$K[train]~qsar12_7$x[train,i])
  143. r2[i]<-summary(fit.single)$r.squared
  144. if(r2[i]>0.25) {
  145. r2good[i]<-r2[i]
  146. }
  147. }
  148.  
  149. good_deskr_nr<-NULL
  150. for (i in 1:1317 ) {
  151.  if(r2[i]>0.25) {
  152.  good_deskr_nr<-c(good_deskr_nr, i)
  153.  }
  154. }
  155. #leaps<-regsubsets(qsar12_7$K[train]~qsar12_7$x[train,good_deskr_nr], data=qsar12_7, nvmax=3)
  156. #plot(leaps, scale="r2")
  157. CA12_7_geri_deskr<-c(300, 463, 841)
  158.  
  159. qsar_12_7_train<-lm(qsar12_7$K[train] ~ qsar12_7$x[train, CA12_7_geri_deskr[1]] + qsar12_7$x[train, CA12_7_geri_deskr[2]] + qsar12_7$x[train, CA12_7_geri_deskr[3]])
  160. print(summary(qsar_12_7_train))
  161. qsar_12_7_test_pred_values<-coef(qsar_12_7_train)[1]+coef(qsar_12_7_train)[2]*qsar12_7$x[test, CA12_7_geri_deskr[1]]+coef(qsar_12_7_train)[3]*qsar12_7$x[test, CA12_7_geri_deskr[2]]+coef(qsar_12_7_train)[4]*qsar12_7$x[test, CA12_7_geri_deskr[3]]
  162. qsar_12_7_test<-lm(qsar_12_7_test_pred_values ~ qsar12_7$K[test])
  163. print(summary(qsar_12_7_test))
  164. x<-cbind(qsar12_7$x[train,c(CA12_7_geri_deskr[1], CA12_7_geri_deskr[2], CA12_7_geri_deskr[3])], qsar12_7$K[train])
  165. colnames(x)[4]<-"y"
  166. qsar_12_7_q2<-cvq2(x)
  167. print(qsar_12_7_q2)
  168.  
  169. #===============================================
  170. qsar12_13<-data.frame(K<-selectivity$CA12.13)
  171. qsar12_13$x<-as.matrix(read.table("edragon_descriptors_fix4.csv", sep=",", skip=1))
  172.  
  173. r2=NULL
  174. r2good=NULL
  175. for (i in 1:1317 ) {
  176. fit.single<-lm(qsar12_13$K[train]~qsar12_13$x[train,i])
  177. r2[i]<-summary(fit.single)$r.squared
  178. if(r2[i]>0.25) {
  179. r2good[i]<-r2[i]
  180. }
  181. }
  182.  
  183. good_deskr_nr<-NULL
  184. for (i in 1:1317 ) {
  185.  if(r2[i]>0.25) {
  186.  good_deskr_nr<-c(good_deskr_nr, i)
  187.  }
  188. }
  189. #leaps<-regsubsets(qsar12_13$K[train]~qsar12_13$x[train,good_deskr_nr], data=qsar12_13, nvmax=3)
  190. #plot(leaps, scale="r2")
  191. CA12_13_geri_deskr<-c(278, 300, 1153)
  192.  
  193. qsar_12_13_train<-lm(qsar12_13$K[train] ~ qsar12_13$x[train, CA12_13_geri_deskr[1]] + qsar12_13$x[train, CA12_13_geri_deskr[2]] + qsar12_13$x[train, CA12_13_geri_deskr[3]])
  194. print(summary(qsar_12_13_train))
  195. qsar_12_13_test_pred_values<-coef(qsar_12_13_train)[1]+coef(qsar_12_13_train)[2]*qsar12_13$x[test, CA12_13_geri_deskr[1]]+coef(qsar_12_13_train)[3]*qsar12_13$x[test, CA12_13_geri_deskr[2]]+coef(qsar_12_13_train)[4]*qsar12_13$x[test, CA12_13_geri_deskr[3]]
  196. qsar_12_13_test<-lm(qsar_12_13_test_pred_values ~ qsar12_13$K[test])
  197. print(summary(qsar_12_13_test))
  198. x<-cbind(qsar12_13$x[train,c(CA12_13_geri_deskr[1], CA12_13_geri_deskr[2], CA12_13_geri_deskr[3])], qsar12_13$K[train])
  199. colnames(x)[4]<-"y"
  200. qsar_12_13_q2<-cvq2(x)
  201. print(qsar_12_13_q2)
  202.  
  203. #===============================================
  204. qsarSUM<-data.frame(K<-selectivity$SUMsCA12)
  205. qsarSUM$x<-as.matrix(read.table("edragon_descriptors_fix4.csv", sep=",", skip=1))
  206.  
  207. r2=NULL
  208. r2good=NULL
  209. for (i in 1:1317 ) {
  210. fit.single<-lm(qsarSUM$K[train]~qsarSUM$x[train,i])
  211. r2[i]<-summary(fit.single)$r.squared
  212. if(r2[i]>0.25) {
  213. r2good[i]<-r2[i]
  214. }
  215. }
  216.  
  217. good_deskr_nr<-NULL
  218. for (i in 1:1317 ) {
  219.  if(r2[i]>0.25) {
  220.  good_deskr_nr<-c(good_deskr_nr, i)
  221.  }
  222. }
  223. #leaps<-regsubsets(qsarSUM$K[train]~qsarSUM$x[train,good_deskr_nr], data=qsarSUM, nvmax=3)
  224. #plot(leaps, scale="r2")
  225. SUM_geri_deskr<-c(292, 695, 1167)
  226.  
  227. qsar_SUM_train<-lm(qsarSUM$K[train] ~ qsarSUM$x[train, SUM_geri_deskr[1]] + qsarSUM$x[train, SUM_geri_deskr[2]] + qsarSUM$x[train, SUM_geri_deskr[3]])
  228. print(summary(qsar_SUM_train))
  229. qsar_SUM_test_pred_values<-coef(qsar_SUM_train)[1]+coef(qsar_SUM_train)[2]*qsarSUM$x[test, SUM_geri_deskr[1]]+coef(qsar_SUM_train)[3]*qsarSUM$x[test, SUM_geri_deskr[2]]+coef(qsar_SUM_train)[4]*qsarSUM$x[test, SUM_geri_deskr[3]]
  230. qsar_SUM_test<-lm(qsar_SUM_test_pred_values ~ qsarSUM$K[test])
  231. print(summary(qsar_SUM_test))
  232. x<-cbind(qsarSUM$x[train,c(SUM_geri_deskr[1], SUM_geri_deskr[2], SUM_geri_deskr[3])], qsarSUM$K[train])
  233. colnames(x)[4]<-"y"
  234. qsar_SUM_q2<-cvq2(x)
  235. print(qsar_SUM_q2)
  236.  
  237. #===============================================
  238.  
  239.  
  240.  
  241.  
  242. #grafiko asys nuo/iki:
  243. minK<--7.4
  244. maxK<-1.8
  245.  
  246. qsar12_1_sv<-coef(qsar_12_1_train)[1]+coef(qsar_12_1_train)[2]*qsar12_1$x[, CA12_1_geri_deskr[1]]+coef(qsar_12_1_train)[3]*qsar12_1$x[, CA12_1_geri_deskr[2]]+coef(qsar_12_1_train)[4]*qsar12_1$x[, CA12_1_geri_deskr[3]]
  247. qsar12_2_sv<-coef(qsar_12_2_train)[1]+coef(qsar_12_2_train)[2]*qsar12_2$x[, CA12_2_geri_deskr[1]]+coef(qsar_12_2_train)[3]*qsar12_2$x[, CA12_2_geri_deskr[2]]+coef(qsar_12_2_train)[4]*qsar12_2$x[, CA12_2_geri_deskr[3]]
  248. qsar12_6_sv<-coef(qsar_12_6_train)[1]+coef(qsar_12_6_train)[2]*qsar12_6$x[, CA12_6_geri_deskr[1]]+coef(qsar_12_6_train)[3]*qsar12_6$x[, CA12_6_geri_deskr[2]]+coef(qsar_12_6_train)[4]*qsar12_6$x[, CA12_6_geri_deskr[3]]
  249. qsar12_7_sv<-coef(qsar_12_7_train)[1]+coef(qsar_12_7_train)[2]*qsar12_7$x[, CA12_7_geri_deskr[1]]+coef(qsar_12_7_train)[3]*qsar12_7$x[, CA12_7_geri_deskr[2]]+coef(qsar_12_7_train)[4]*qsar12_7$x[, CA12_7_geri_deskr[3]]
  250. qsar12_13_sv<-coef(qsar_12_13_train)[1]+coef(qsar_12_13_train)[2]*qsar12_13$x[, CA12_13_geri_deskr[1]]+coef(qsar_12_13_train)[3]*qsar12_13$x[, CA12_13_geri_deskr[2]]+coef(qsar_12_13_train)[4]*qsar12_13$x[, CA12_13_geri_deskr[3]]
  251. qsarSUM_sv<-coef(qsar_SUM_train)[1]+coef(qsar_SUM_train)[2]*qsarSUM$x[, SUM_geri_deskr[1]]+coef(qsar_SUM_train)[3]*qsarSUM$x[, SUM_geri_deskr]+coef(qsar_SUM_train)[4]*qsarSUM$x[, SUM_geri_deskr[3]]
  252.  
  253.  
  254.  
  255. #grafikui<-cbind(qsar$K, qsar1, qsar2, qsar3)
  256. #colnames(grafikui)[1]<-"pKd"
  257. mod_qsar12_1<-lm(qsar12_1_sv[train]~qsar12_1$K[train])
  258. mod_qsar12_2<-lm(qsar12_2_sv[train]~qsar12_2$K[train])
  259. mod_qsar12_6<-lm(qsar12_6_sv[train]~qsar12_6$K[train])
  260. mod_qsar12_7<-lm(qsar12_7_sv[train]~qsar12_7$K[train])
  261. mod_qsar12_13<-lm(qsar12_13_sv[train]~qsar12_13$K[train])
  262. mod_qsarSUM<-lm(qsarSUM_sv[train]~qsarSUM$K[train])
  263.  
  264. mod_qsar12_1t<-lm(qsar12_1_sv[test]~qsar12_1$K[test])
  265. mod_qsar12_2t<-lm(qsar12_2_sv[test]~qsar12_2$K[test])
  266. mod_qsar12_6t<-lm(qsar12_6_sv[test]~qsar12_6$K[test])
  267. mod_qsar12_7t<-lm(qsar12_7_sv[test]~qsar12_7$K[test])
  268. mod_qsar12_13t<-lm(qsar12_13_sv[test]~qsar12_13$K[test])
  269. mod_qsarSUMt<-lm(qsarSUM_sv[test]~qsarSUM$K[test])
  270.  
  271.  
  272. png("Edita2013_specifiskumo_grafikas_train.png", width=600, height=900)
  273. par(mfrow=c(3,2), mar=c(1,1,0,0), oma=c(6,6,0,0), cex.axis=2)
  274. plot(qsar12_1$K[train], qsar12_1_sv[train], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE, xaxt="n")
  275. abline(mod_qsar12_1)
  276. title(bquote(atop("CA XII vs CA I", R^2==0.84)), line = -3, cex.main=3)
  277. #title('QSAR 12 vs 1 train set', line = -3, cex.main=3)
  278. axis(1,col.axis = "transparent", tck = 0.02)
  279.  
  280. plot(qsar12_2$K[train], qsar12_2_sv[train], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), xlab=NA, ylab=NA, xaxt="n", yaxt="n")
  281. abline(mod_qsar12_2)
  282. title(bquote(atop("CA XII vs CA II", R^2==0.81)), line = -3, cex.main=3)
  283. #title('QSAR 12 vs 2 train set', line = -3, cex.main=3)
  284. axis(1,col.axis = "transparent", tck = 0.02)
  285. axis(2,col.axis = "transparent", tck = 0.02)
  286.  
  287. plot(qsar12_6$K[train], qsar12_6_sv[train], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE, xaxt="n")
  288. abline(mod_qsar12_6)
  289. title(bquote(atop("CA XII vs CA VI", R^2==0.82)), line = -3, cex.main=3)
  290. #title('QSAR 12 vs 6 train set', line = -3, cex.main=3)
  291.  
  292. plot(qsar12_7$K[train], qsar12_7_sv[train], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE, xaxt="n", yaxt="n")
  293. abline(mod_qsar12_7)
  294. title(bquote(atop("CA XII vs CA VII", R^2==0.83)), line = -3, cex.main=3)
  295. #title('QSAR 12 vs 7 train set', line = -3, cex.main=3)
  296. axis(1,col.axis = "transparent", tck = 0.02)
  297. axis(2,col.axis = "transparent", tck = 0.02)
  298.  
  299. plot(qsar12_13$K[train], qsar12_13_sv[train], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE)
  300. abline(mod_qsar12_13)
  301. title(bquote(atop("CA XII vs CA XIII", R^2==0.78)), line = -3, cex.main=3)
  302. #title('QSAR 12 vs 13 train set', line = -3, cex.main=3)
  303.  
  304. plot(qsarSUM$K[train], qsarSUM_sv[train], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), yaxt="n", cex.lab=3)
  305. abline(mod_qsarSUM)
  306. title(expression(paste(sum(), "CA XII, ", R^2==0.78)), line = -3, cex.main=3)
  307. #title('QSAR sum train set', line = -3, cex.main=3)
  308. axis(2,col.axis = "transparent", tck = 0.02)
  309.  
  310. mtext(expression(paste(pK[d], ' difference (experimental)')), SOUTH<-1, line=2.5, cex=2, outer=TRUE)
  311. mtext(expression(paste(pK[d], ' difference (calculated)')), WEST<-2, line=2.5, cex=2, outer=TRUE)
  312.  
  313. dev.off()
  314.  
  315.  
  316. png("Edita2013_specifiskumo_grafikas_test.png", width=600, height=900)
  317. par(mfrow=c(3,2), mar=c(1,1,0,0), oma=c(6,6,0,0), cex.axis=2)
  318. plot(qsar12_1$K[test], qsar12_1_sv[test], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE, xaxt="n")
  319. abline(mod_qsar12_1t)
  320. title(bquote(atop("CA XII vs CA I", R^2==0.79)), line = -3, cex.main=3)
  321. #title('QSAR 12 vs 1 test set', line = -3, cex.main=3)
  322. axis(1,col.axis = "transparent", tck = 0.02)
  323.  
  324. plot(qsar12_2$K[test], qsar12_2_sv[test], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), xlab=NA, ylab=NA, xaxt="n", yaxt="n")
  325. abline(mod_qsar12_2t)
  326. title(bquote(atop("CA XII vs CA II", R^2==0.58)), line = -3, cex.main=3)
  327. #title('QSAR 12 vs 2 test set', line = -3, cex.main=3)
  328. axis(1,col.axis = "transparent", tck = 0.02)
  329. axis(2,col.axis = "transparent", tck = 0.02)
  330.  
  331. plot(qsar12_6$K[test], qsar12_6_sv[test], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE, xaxt="n")
  332. abline(mod_qsar12_6t)
  333. title(bquote(atop("CA XII vs CA VI", R^2==0.42)), line = -3, cex.main=3)
  334. #title('QSAR 12 vs 6 test set', line = -3, cex.main=3)
  335.  
  336. plot(qsar12_7$K[test], qsar12_7_sv[test], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE, xaxt="n", yaxt="n")
  337. abline(mod_qsar12_7t)
  338. title(bquote(atop("CA XII vs CA VII", R^2==0.49)), line = -3, cex.main=3)
  339. #title('QSAR 12 vs 7 test set', line = -3, cex.main=3)
  340. axis(1,col.axis = "transparent", tck = 0.02)
  341. axis(2,col.axis = "transparent", tck = 0.02)
  342.  
  343. plot(qsar12_13$K[test], qsar12_13_sv[test], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), ann=FALSE)
  344. abline(mod_qsar12_13t)
  345. title(bquote(atop("CA XII vs CA XIII", R^2==0.71)), line = -3, cex.main=3)
  346. #title('QSAR 12 vs 13 test set', line = -3, cex.main=3)
  347.  
  348. plot(qsarSUM$K[test], qsarSUM_sv[test], tck = 0.02, pch=15, cex=3, xlim=c(minK, maxK), ylim=c(minK, maxK), yaxt="n", cex.lab=3)
  349. abline(mod_qsarSUMt)
  350. title(expression(paste(sum(), "CA XII, ", R^2==0.58)), line = -3, cex.main=3)
  351. #title('QSAR sum test set', line = -3, cex.main=3)
  352. axis(2,col.axis = "transparent", tck = 0.02)
  353.  
  354. mtext(expression(paste(pK[d], ' difference (experimental)')), SOUTH<-1, line=2.5, cex=2, outer=TRUE)
  355. mtext(expression(paste(pK[d], ' difference (calculated)')), WEST<-2, line=2.5, cex=2, outer=TRUE)
  356.  
  357. dev.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement