#TenFoldCVTimesTen_VinaLC.R #Requires the R package 'glmnet' print("Reading in datasets...") #Specify absolute filepath in quotes filepath <- "" #Read in VinaLC CSV file as a data frame dockScores <- read.csv(paste(filepath,"N560_p409_DockScore_Matrix.csv",sep=""),header=T) #Read in ADR group response matrix Y <- read.csv(paste(filepath,"N560_p10_DrugADR_Matrix.csv",sep=""),header=T) #Set binding threshold for MM/GBSA scores #dockThresh <- -8.0 print("...finished!") print("Generating the design matrix...") #Generate a data matrix 'X' that consists of only the docking scores for drugs that are found in the SIDER dataset dataMatrix <- matrix(nrow=nrow(dockScores),ncol=(ncol(dockScores)-4)) i <- 0 while(idockThresh) dataMatrix[i,j-4] <- 0 } } dataMatrixNew <- matrix(nrow=nrow(dataMatrix),ncol=ncol(dataMatrix)) j <- 0 kcnt2 <- 0 while(jdockThresh) dataMatrixNew[i,kcnt2] <- 0 #} } } rm(dataMatrix) dataMatrix <- dataMatrixNew rm(dataMatrixNew) dataMatrixNew <- matrix(nrow=nrow(dataMatrix),ncol=kcnt2) j <- 0 while(j1) chosenOneIndx <- chosenOneIndx[[1]] tenCVResultsMatrix[i,1] <- lambdaMinVect[[chosenOneIndx]] tenCVResultsMatrix[i,2] <- cvloVect[[chosenOneIndx]] tenCVResultsMatrix[i,3] <- cvmVect[[chosenOneIndx]] tenCVResultsMatrix[i,4] <- cvupVect[[chosenOneIndx]] tenCVResultsMatrix[i,5] <- nzeroVect[[chosenOneIndx]] betaVect <- vector(length=length(betas[chosenOneIndx,])) nn <- 0;while(nn