Skip to content

Commit

Permalink
Per Issue #64, cleaning up the package. Version bump to trigger bioco…
Browse files Browse the repository at this point in the history
…nductor build
  • Loading branch information
gabrielodom committed Feb 20, 2019
1 parent 2f1a864 commit 3bd452b
Show file tree
Hide file tree
Showing 18 changed files with 361 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pathwayPCA
Type: Package
Title: Integrative Pathway Analysis with Modern PCA Methodology and Gene Selection
Version: 0.99.2
Version: 0.99.3
Authors@R: c(person("Gabriel", "Odom", email = "gabriel.odom@med.miami.edu", role = c("aut","cre")),
person("James", "Ban", email = "yuguang.ban@med.miami.edu", role = c("aut")),
person("Lizhong", "Liu", email = "lxl816@miami.edu", role = c("aut")),
Expand Down
14 changes: 14 additions & 0 deletions R/aesPC_calculate_LARS.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@
#' @examples
#' # DO NOT CALL THIS FUNCTION DIRECTLY.
#' # Use AESPCA_pVals() instead
#'
#' X_mat <- as.matrix(colonSurv_df[, 5:50])
#' X_mat <- scale(X_mat)
#'
#' XtX <- t(X_mat) %*% X_mat
#' A_mat <- svd(XtX)$v
#'
#' lars.lsa(
#' Sigma0 = XtX,
#' b0 = A_mat[1, ] * sign(A_mat[1, 1]),
#' n = ncol(X_mat)
#' )
#'
#'
lars.lsa <- function(Sigma0, b0, n,
type = c("lar","lasso"),
max.steps = NULL,
Expand Down
23 changes: 22 additions & 1 deletion R/superPC_model_CoxPH.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,28 @@
#' @examples
#' # DO NOT CALL THIS FUNCTION DIRECTLY.
#' # Use SuperPCA_pVals() instead

#'
#'
#' p <- 500
#' n <- 50
#'
#' x_mat <- matrix(rnorm(n * p), nrow = p, ncol = n)
#' x_df <- data.frame(x_mat)
#' time_int <- rpois(n, lambda = 365 * 2)
#' obs_logi <- sample(
#' c(FALSE, TRUE),
#' size = n,
#' replace = TRUE,
#' prob = c(0.2, 0.8)
#' )
#'
#' coxTrain_fun(
#' x = x_df,
#' y = time_int,
#' censoring.status = !obs_logi
#' )
#'
#'
coxTrain_fun <- function(x, y, censoring.status, s0.perc = NULL){
# browser()

Expand Down
19 changes: 19 additions & 0 deletions R/superPC_model_GLM.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@
#' @examples
#' # DO NOT CALL THIS FUNCTION DIRECTLY.
#' # Use SuperPCA_pVals() instead
#'
#'
#' p <- 500
#' n <- 50
#'
#' x_mat <- matrix(rnorm(n * p), nrow = p, ncol = n)
#' obs_logi <- sample(
#' c(FALSE, TRUE),
#' size = n,
#' replace = TRUE,
#' prob = c(0.2, 0.8)
#' )
#'
#' glmTrain_fun(
#' x = x_mat,
#' y = obs_logi
#' )
#'
#'
glmTrain_fun <- function(x, y, family = binomial){

glmCoeffs <- function(x_mat){
Expand Down
14 changes: 14 additions & 0 deletions R/superPC_model_LS.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@
#' @examples
#' # DO NOT CALL THIS FUNCTION DIRECTLY.
#' # Use SuperPCA_pVals() instead
#'
#'
#' p <- 500
#' n <- 50
#'
#' x_mat <- matrix(rnorm(n * p), nrow = p, ncol = n)
#' time_int <- rpois(n, lambda = 365 * 2)
#'
#' olsTrain_fun(
#' x = x_mat,
#' y = time_int
#' )
#'
#'
olsTrain_fun <- function(x, y, s0.perc = NULL){
# browser()

Expand Down
34 changes: 33 additions & 1 deletion R/superPC_model_tStats.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,39 @@
#' @examples
#' # DO NOT CALL THIS FUNCTION DIRECTLY.
#' # Use SuperPCA_pVals() instead

#'
#'
#' data("colon_pathwayCollection")
#' data("colonSurv_df")
#'
#' colon_OmicsSurv <- CreateOmics(
#' assayData_df = colonSurv_df[,-(2:3)],
#' pathwayCollection_ls = colon_pathwayCollection,
#' response = colonSurv_df[, 1:3],
#' respType = "surv"
#' )
#'
#' asthmaGenes_char <-
#' getTrimPathwayCollection(colon_OmicsSurv)[["KEGG_ASTHMA"]]$IDs
#'
#' data_ls <- list(
#' x = t(getAssay(colon_OmicsSurv))[asthmaGenes_char, ],
#' y = getEventTime(colon_OmicsSurv),
#' censoring.status = getEvent(colon_OmicsSurv),
#' featurenames = asthmaGenes_char
#' )
#'
#' superpcFit <- superpc.train(
#' data = data_ls,
#' type = "surv"
#' )
#'
#' superpc.st(
#' fit = superpcFit,
#' data = data_ls
#' )
#'
#'
superpc.st <- function(fit,
data,
n.threshold = 20,
Expand Down
29 changes: 28 additions & 1 deletion R/superPC_model_train.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,34 @@
#' @examples
#' # DO NOT CALL THIS FUNCTION DIRECTLY.
#' # Use SuperPCA_pVals() instead

#'
#'
#' data("colon_pathwayCollection")
#' data("colonSurv_df")
#'
#' colon_OmicsSurv <- CreateOmics(
#' assayData_df = colonSurv_df[,-(2:3)],
#' pathwayCollection_ls = colon_pathwayCollection,
#' response = colonSurv_df[, 1:3],
#' respType = "surv"
#' )
#'
#' asthmaGenes_char <-
#' getTrimPathwayCollection(colon_OmicsSurv)[["KEGG_ASTHMA"]]$IDs
#'
#' data_ls <- list(
#' x = t(getAssay(colon_OmicsSurv))[asthmaGenes_char, ],
#' y = getEventTime(colon_OmicsSurv),
#' censoring.status = getEvent(colon_OmicsSurv),
#' featurenames = asthmaGenes_char
#' )
#'
#' superpc.train(
#' data = data_ls,
#' type = "surv"
#' )
#'
#'
superpc.train <- function(data,
type = c("survival", "regression", "categorical"),
s0.perc = NULL){
Expand Down
18 changes: 18 additions & 0 deletions R/superPC_modifiedSVD.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@
#' @examples
#' # DO NOT CALL THIS FUNCTION DIRECTLY.
#' # Use SuperPCA_pVals() instead
#'
#'
#' data("colon_pathwayCollection")
#' data("colonSurv_df")
#'
#' colon_OmicsSurv <- CreateOmics(
#' assayData_df = colonSurv_df[,-(2:3)],
#' pathwayCollection_ls = colon_pathwayCollection,
#' response = colonSurv_df[, 1:3],
#' respType = "surv"
#' )
#'
#' asthmaGenes_char <-
#' getTrimPathwayCollection(colon_OmicsSurv)[["KEGG_ASTHMA"]]$IDs
#'
#' mysvd(t(getAssay(colon_OmicsSurv))[asthmaGenes_char, ])
#'
#'

mysvd <- function(mat, method = svd, n.components = NULL){

Expand Down
22 changes: 22 additions & 0 deletions man/coxTrain_fun.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions man/glmTrain_fun.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/lars.lsa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions man/mysvd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/olsTrain_fun.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions man/superpc.st.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3bd452b

Please sign in to comment.