Chemistry Reference
In-Depth Information
count = sqlQuery(channel,sql,max=0);
m = matrix(count$matches, nrow=ntrain)
# fit the experimental logP values to the matched fragment counts
logpfit = lm(data.frame(logpval, m));
summary(logpfit);
plot(fitted(logpfit), logpval[[1]], main="simplex smarts",
ylab='experimental value', xlab='predicted value');
# create data frame of smarts and coefficients and store in a table
dt = data.frame(c(NA,as.vector(smarts$smarts)), coef(logpfit), summ
ary(logpfit)$coefficients[,2]);
names(dt) = c('smarts', 'contribution', 'error');
sqlSave(channel,dt,table='simplex_coefficients');
close(channel);
The first SQL statement fetches the logp values from a data table. The
second SQL statement fetches a set of smarts from pre-defined atom-
based fragments. The third SQL statement joins the table of smarts with a
table of smiles comprising a training set and produces rows of counts of
the number of times each smarts matches each smiles. The resulting rows
are recast as a matrix containing rows as training_set smiles and columns
as atom fragment smarts. This is combined with the logP values into a
data frame passed to the lm linear models function. The results of this
computation are printed by the summary function as shown below.
Call:
lm(formula = data.frame(logpval, m))
Residuals:
Min 1Q Median 3Q Max
-2.971987 -0.375804 0.003851 0.405040 2.389759
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.262592 0.075253 -3.489 0.000496 ***
X1 0.293660 0.018785 15.633 < 2e-16 ***
X2 0.318086 0.011834 26.880 < 2e-16 ***
X3 -0.309212 0.051247 -6.034 1.94e-09 ***
X4 0.552701 0.027245 20.287 < 2e-16 ***
X5 0.324572 0.012368 26.242 < 2e-16 ***
X6 0.176798 0.045332 3.900 9.97e-05 ***
X7 -0.400717 0.033560 -11.940 < 2e-16 ***
X8 -0.313073 0.029472 -10.623 < 2e-16 ***
X9 -0.523223 0.040330 -12.974 < 2e-16 ***
X10 -0.688122 0.042941 -16.025 < 2e-16 ***
X11 -0.375329 0.034512 -10.875 < 2e-16 ***
X12 -0.058134 0.024444 -2.378 0.017497 *
X13 0.723824 0.031660 22.863 < 2e-16 ***
X14 0.008709 0.064691 0.135 0.892918
Search WWH ::




Custom Search