Accessing Data in a PharmacoSet#
Quick Reference
For a more detailed introduction to PharmacoSet, see the Vignettes and Reference Manual in the PharmacoGx package.
Quick start tutorial: Load a tiny demo PSet#
Accessor functions give you a clean, read‑only (or read‑write) gateway to each slot. Use them instead of poking the S4 object directly.
# Get started by setting up PharmacoGx
library(PharmacoGx)
data(CCLEsmall) # ships with the package
treatmentInfo(CCLEsmall) # peek at treatment metadata
What is an accessor?
Accessors are S4 methods whose names read like plain English:
treatmentInfo()
returns (or sets) theTreatmentResponse
molecularProfiles()
returns (or sets) theMultiAssayExperiment
They shield you from slot names, so your code keeps working even if the class internals change.
Treatments#
Retrieve or update treatment metadata in a single call.
Migration to Pharmacoset v2.0
The drugInfo
and drugNames
slots are deprecated in Pharmacoset v2.0.
Use the new accessors below instead.
- treatmentInfo()
replaces drugInfo()
- treatmentNames()
replaces drugNames()
Similarly, sampleInfo
and sampleNames
are now used for sample metadata,
instead of cellInfo
and cellNames
.
Samples#
Keep track of cell‑line annotations without wrangling rows manually.
Molecular profiles#
Treat multi‑omics data like a tidy list of matrices plus metadata.
First, we need to know what data types are available, then we can dive into the actual data.
Migration to Pharmacoset v2.0
The molecularProfiles
slot is now a MultiAssayExperiment
(MAE) object
from SummarizedExperiment. It holds multiple assays (e.g. RNA, CNV)
with their own metadata.
The old approach was just a list of SummarizedExperiment
objects,
which is less flexible and harder to subset/filter.
Why two steps?
First ask what data types exist (mDataNames
), then dive
into a matrix with molecularProfiles
.
Treatment Response#
Migration to PharmacoSet v2.0
The treatmentResponse(pSet)
accessor now returns a
TreatmentResponseExperiment (TRE) object from CoreGx—a
SummarizedExperiment
‑derived container with assays (e.g. viability)
plus rowData
(samples) and colData
(treatments).
A TRE supports multi‑drug screens and high‑dimensional synergy analyses introduced in PharmacoGx 3.0.
It replaces the old list‑based sensitivity slot, though legacy getters still work for stability.
Modern workflow using a TreatmentResponseExperiment
(TRE).
FAQ#
- Missing assay name? If you skip the
assay
arg,molecularProfiles
defaults to the first assay in that SummarizedExperiment. - Deprecated slots?
datasetType
andperturbation
remain for backward compatibility; lean on accessors instead.