Convert MultiAssayExperiment to TreatmentResponseExperiment
Source:R/MAE_to_PSet.R
convert_MAE_to_PSet.Rd
This function converts a MultiAssayExperiment generated by gDR into a TreatmentResponseExperiment for use in the PharmacoGx package. The resulting PharmacoSet can be used for pharmacogenomic analysis of drug response.
Arguments
- mae
A MultiAssayExperiment object generated by gDR.
- pset_name
A character string specifying the name of the resulting PharmacoSet object.
Examples
# Convert a MultiAssayExperiment object to a PharmacoSet object
m <- 20
n <- 10
rnames <- LETTERS[1:m]
cnames <- letters[1:n]
ref_gr_value <- matrix(runif(m * n), nrow = m, ncol = n, dimnames = list(rnames, cnames))
se <- SummarizedExperiment::SummarizedExperiment(assays = list(RefGRvalue = ref_gr_value),
rowData = S4Vectors::DataFrame(rnames),
colData = S4Vectors::DataFrame(cnames))
mae <- MultiAssayExperiment::MultiAssayExperiment(experiments = list("single-agent" = se))
convert_MAE_to_PSet(mae, "my_pset")
#> <PharmacoSet>
#> Name: my_pset
#> Date Created: Thu Nov 7 10:36:41 2024
#> Number of samples: 10
#> Molecular profiles:
#> A MultiAssayExperiment object of 1 listed
#> experiment with a user-defined name and respective class.
#> Containing an ExperimentList class object of length 1:
#> [1] emptySE: SummarizedExperiment with 0 rows and 10 columns
#> Treatment response:
#> <TreatmentResponseExperiment>
#> dim: 20 10
#> assays(1): RefGRvalue
#> rownames(20): A B ... S T
#> rowData(2): treatmentid rnames
#> colnames(10): a b c ... h i j
#> colData(2): sampleid cnames
#> metadata(0): none