Skip to content

Commit

Permalink
Converted to a RProject
Browse files Browse the repository at this point in the history
  • Loading branch information
colbyford committed Aug 7, 2018
1 parent 6d3d633 commit da70a1e
Show file tree
Hide file tree
Showing 22 changed files with 224 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$
7 changes: 7 additions & 0 deletions .Rproj.user/902F8FED/build_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
auto_roxygenize_for_build_and_reload="1"
auto_roxygenize_for_build_package="1"
auto_roxygenize_for_check="1"
live_preview_website="1"
makefile_args=""
preview_website="1"
website_output_format="all"
1 change: 1 addition & 0 deletions .Rproj.user/902F8FED/console06/INDEX001
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
2 changes: 2 additions & 0 deletions .Rproj.user/902F8FED/cpp-definition-cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[
]
9 changes: 9 additions & 0 deletions .Rproj.user/902F8FED/pcs/files-pane.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"path" : "C:/Users/Colby Ford/Desktop/parEBEN",
"sortOrder" : [
{
"ascending" : true,
"columnIndex" : 2
}
]
}
3 changes: 3 additions & 0 deletions .Rproj.user/902F8FED/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"activeTab" : 0
}
14 changes: 14 additions & 0 deletions .Rproj.user/902F8FED/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"left" : {
"panelheight" : 958,
"splitterpos" : 398,
"topwindowstate" : "NORMAL",
"windowheight" : 996
},
"right" : {
"panelheight" : 958,
"splitterpos" : 597,
"topwindowstate" : "NORMAL",
"windowheight" : 996
}
}
6 changes: 6 additions & 0 deletions .Rproj.user/902F8FED/pcs/workbench-pane.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"TabSet1" : 3,
"TabSet2" : 0,
"TabZoom" : {
}
}
8 changes: 8 additions & 0 deletions .Rproj.user/902F8FED/persistent-state
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build-last-errors="[]"
build-last-errors-base-dir="C:/Users/Colby Ford/Desktop/parEBEN/"
build-last-outputs="[{\"output\":\"==> devtools::document(roclets=c('rd', 'collate', 'namespace'))\\n\\n\",\"type\":0},{\"output\":\"Updating parEBEN documentation\\r\\nLoading parEBEN\\r\\n\",\"type\":2},{\"output\":\"First time using roxygen2. Upgrading automatically...\\r\\n\",\"type\":2},{\"output\":\"Updating roxygen version in C:\\\\Users\\\\Colby Ford\\\\Desktop\\\\parEBEN/DESCRIPTION\\r\\n\",\"type\":2},{\"output\":\"Warning: The existing 'NAMESPACE' file was not generated by roxygen2, and will not be overwritten.\\r\\n\",\"type\":2},{\"output\":\"Documentation completed\\n\\n\",\"type\":1},{\"output\":\"==> Rcmd.exe INSTALL --preclean --no-multiarch --with-keep.source parEBEN\\n\\n\",\"type\":0},{\"output\":\"* installing to library 'C:/Users/Colby Ford/Documents/R/win-library/3.3'\\r\\n\",\"type\":1},{\"output\":\"* installing *source* package 'parEBEN' ...\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** R\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** data\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** preparing package for lazy loading\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** help\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** installing help indices\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** building package indices\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** testing if installed package can be loaded\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* DONE (parEBEN)\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1}]"
compile_pdf_state="{\"errors\":[],\"output\":\"\",\"running\":false,\"tab_visible\":false,\"target_file\":\"\"}"
files.monitored-path=""
find-in-files-state="{\"handle\":\"\",\"input\":\"\",\"path\":\"\",\"regex\":true,\"results\":{\"file\":[],\"line\":[],\"lineValue\":[],\"matchOff\":[],\"matchOn\":[]},\"running\":false}"
imageDirtyState="0"
saveActionState="0"
5 changes: 5 additions & 0 deletions .Rproj.user/902F8FED/rmd-outputs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@





1 change: 1 addition & 0 deletions .Rproj.user/902F8FED/saved_source_markers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"active_set":"","sets":[]}
2 changes: 2 additions & 0 deletions .Rproj.user/902F8FED/sources/prop/323D307A
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
2 changes: 2 additions & 0 deletions .Rproj.user/902F8FED/sources/prop/8F1286A9
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
2 changes: 2 additions & 0 deletions .Rproj.user/902F8FED/sources/prop/INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
C%3A%2FUsers%2FColby%20Ford%2FDesktop%2FparEBEN%2FEBEN_orig%2Fman%2FEBEN-package.Rd="8F1286A9"
C%3A%2FUsers%2FColby%20Ford%2FDesktop%2FparEBEN%2FR%2FCrossValidate.R="323D307A"
20 changes: 20 additions & 0 deletions .Rproj.user/902F8FED/sources/s-18DE930C/3B9010C1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"collab_server" : "",
"contents" : "",
"created" : 1533672813721.000,
"dirty" : false,
"encoding" : "UTF-8",
"folds" : "",
"hash" : "1675177655",
"id" : "3B9010C1",
"lastKnownWriteTime" : 1533672816,
"last_content_update" : 1533672816421,
"path" : "C:/Users/Colby Ford/Desktop/parEBEN/EBEN_orig/man/EBEN-package.Rd",
"project_path" : "EBEN_orig/man/EBEN-package.Rd",
"properties" : {
},
"relative_order" : 2,
"source_on_save" : false,
"source_window" : "",
"type" : "r_doc"
}
44 changes: 44 additions & 0 deletions .Rproj.user/902F8FED/sources/s-18DE930C/3B9010C1-contents
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
\name{EBEN-package}
\alias{EBEN-package}
\alias{EBEN}
\docType{package}
\title{Empirical Bayesian Elastic Net (EBEN)}

\description{ Fast EBEN algorithms. \cr
EBEN implements a normal and generalized gamma hierearchical priors. \cr
( ** ) Two parameters (alpha, lambda) are equivalent with elastic net priors. \cr
( ** ) When parameter alpha = 1, it is equivalent with EBlasso-NE (normal + exponential) \cr
Two models are available for both methods: \cr
( ** ) General linear regression model. \cr
( ** ) Logistic regression model. \cr
Multi-collinearity: \cr
( ** ) for group of high correlated or collinear variables: EBEN identifies the group of variables estimates their effects together. \cr
( ** ) group of variables can be selected together. \cr
*Epistasis (two-way interactions) can be included for all models/priors \cr
*model implemented with memory efficient c code. \cr
*LAPACK/BLAS are used for most linear algebra computations.
}
\details{
\tabular{ll}{
Package: \tab EBEN\cr
Type: \tab Package\cr
Version: \tab 4.6\cr
Date: \tab 2015-10-06\cr
License: \tab gpl\cr
}

}
\author{
Anhui Huang
}
\references{
key algorithms: \cr
Cai, X., Huang, A., and Xu, S. (2011). Fast empirical Bayesian LASSO for multiple quantitative trait locus mapping. BMC Bioinformatics 12, 211.\cr
Huang A, Xu S, Cai X. (2013). Empirical Bayesian LASSO-logistic regression for multiple binary trait locus mapping. BMC genetics 14(1):5. \cr
Huang, A., Xu, S., and Cai, X. (2014). Empirical Bayesian elastic net for multiple quantitative trait locus mapping. Heredity 10.1038/hdy.2014.79 \cr
Other publications: \cr
Huang, A., E. Martin, et al. (2014). "Detecting genetic interactions in pathway-based genome-wide association studies." Genet Epidemiol 38(4): 300-309.\cr
Huang, A., S. Xu, et al. (2014). "Whole-genome quantitative trait locus mapping reveals major role of epistasis on yield of rice." PLoS ONE 9(1): e87330.\cr
Huang, A. (2014). "Sparse model learning for inferring genotype and phenotype associations." Ph.D Dissertation. University of Miami(1186).
}
\keyword{ package }
20 changes: 20 additions & 0 deletions .Rproj.user/902F8FED/sources/s-18DE930C/D6DE16C8
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"collab_server" : "",
"contents" : "",
"created" : 1533672741033.000,
"dirty" : false,
"encoding" : "UTF-8",
"folds" : "",
"hash" : "598847090",
"id" : "D6DE16C8",
"lastKnownWriteTime" : 1525278909,
"last_content_update" : 1525278909,
"path" : "C:/Users/Colby Ford/Desktop/parEBEN/R/CrossValidate.R",
"project_path" : "R/CrossValidate.R",
"properties" : {
},
"relative_order" : 1,
"source_on_save" : false,
"source_window" : "",
"type" : "r_source"
}
57 changes: 57 additions & 0 deletions .Rproj.user/902F8FED/sources/s-18DE930C/D6DE16C8-contents
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
CrossValidate <- function(BASIS, Target, nFolds, foldId = 0, Epis = "no", prior = "gaussian", search = "global"){
if(search == "global"){
ParameterGrid <- BuildGrid(BASIS, Target, nFolds, Epis)

if(prior == "gaussian"){
MSE_temp <- foreach (row = 1:nrow(ParameterGrid), .combine = rbind, .packages = "parEBEN") %dopar% {
alpha <- ParameterGrid$alpha[row]
lambda <- ParameterGrid$lambda[row]
TestModel(BASIS, Target, lambda, alpha, nFolds, foldId, Epis, prior = "gaussian")
}

Error <- MSE_temp %>%
group_by(alpha, lambda) %>%
summarise(SE = sd(MSE)/sqrt(max(foldId)),
MSE = mean(MSE)
)

index <- which.min(Error$MSE)
lambda.optimal <- Error[index,]$lambda
alpha.optimal <- Error[index,]$alpha

out <- list(Results.Detail = MSE_temp,
Results.Summary = Error,
lambda.optimal = lambda.optimal,
alpha.optimal = alpha.optimal)

}else{
logL_temp <- foreach (row = 1:nrow(ParameterGrid), .combine = rbind, .package = "parEBEN") %dopar% {
alpha <- ParameterGrid$alpha[row]
lambda <- ParameterGrid$lambda[row]
TestModel(BASIS, Target, lambda, alpha, nFolds, foldId, Epis, prior = "binomial")
}
Error <- logL_temp %>%
group_by(alpha, lambda) %>%
summarise(SE = sd(logL)/sqrt(max(foldId)),
Likelihood = -mean(logL)
)

index <- which.min(Error$MSE)
lambda.optimal <- Error[index,]$lambda
alpha.optimal <- Error[index,]$alpha

out <- list(Results.Detail = logL_temp,
Results.Summary = Error,
lambda.optimal = lambda.optimal,
alpha.optimal = alpha.optimal)
}

return(out)

}else{
out <- LocalSearch(BASIS, Target, nFolds, Epis, foldId, prior)

return(out)
}

}
Empty file.
Empty file.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ Collate:
'LocalSearch.R'
'GetModelError.R'
'TestModel.R'
RoxygenNote: 6.0.1
18 changes: 18 additions & 0 deletions parEBEN.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace

0 comments on commit da70a1e

Please sign in to comment.