Skip to content

Commit

Permalink
getPCa parameter sampletypes added
Browse files Browse the repository at this point in the history
  • Loading branch information
Syksy committed Aug 9, 2023
1 parent 019a304 commit ba50efa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 16 additions & 2 deletions R/getpca.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
#' @param timestamp character(1) "20230215" indicating the data version to
#' obtain from `ExperimentHub`. See `timestamp` section details.
#'
#' @param sampletypes A character vector of sample types to include in the MAE.
#' If the parameter is missing, then all samples are returned. Allowed values
#' are: 'primary', 'metastatic', 'normal', 'BPH', 'atrophic'
#'
#' @param ... Additional arguments passed on to the
#' \code{\link[ExperimentHub:ExperimentHub-class]{ExperimentHub}}
#' constructor
Expand Down Expand Up @@ -156,6 +160,8 @@ getPCa <- function(
assays,
# Timestamps of data from ExperimentHub; allowed values: '20230215'
timestamp,
# If not missing, subsetting the MAE object to certain sample types
sampletypes,
# Verbosity
verbose = FALSE,
# Additional parameters
Expand Down Expand Up @@ -268,10 +274,18 @@ getPCa <- function(
# Inform user
message("Constructing the MultiAssayExperiment object from retrieved
components.")
# Return MAE
MultiAssayExperiment::MultiAssayExperiment(
# Return MAE; if parameter 'sampletypes' is not missing, subsetting
mae <- MultiAssayExperiment::MultiAssayExperiment(
experiments = eh_experiments,
colData = assay_list[cD_idx][[1]],
sampleMap = assay_list[sM_idx][[1]]
)
# Return full MAE
if(missing(sampletypes)){
mae
# Return a MAE with a subset to certain sample_types
}else{
MultiAssayExperiment::subsetByColData(mae, mae$sample_types %in%
sampletypes)
}
}
6 changes: 5 additions & 1 deletion man/getPCa.Rd

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

0 comments on commit ba50efa

Please sign in to comment.