##Example 1: Create a PAM50 object -----------------------------------------
##1) Just an empty object
object<-PAM50()
object
##2) Using Breast Cancer NKI database, if available.
if(requireNamespace("breastCancerNKI")){
object<-loadBCDataset(Class=PAM50, libname="nki", verbose=TRUE)
object
##Now we can inspect the object
head(exprs(object)) ##The gene expression
head(annotation(object)) ##The available annotation
head(targets(object)) ##The clinical data present in the package
}
##Example 2: Build a PAM50 object with user data --------------------------
##Option 1: using PAM50 constructor. The user will only need:
##a) The M gene expression object, i. e., gene in rows and sample in columns
##b) The annotation data.frame which must include the compulsory fields
## "probe", "NCBI.gene.symbol" and "EntrezGene.ID"
M<-pam50$centroids
genes<-pam50$centroids.map
names(genes)<-c("probe", "NCBI.gene.symbol", "EntrezGene.ID")
object<-PAM50(exprs=M, annotation=genes)
object
##Option 2: Two ways to build it from a MAList (as or as.PAM50)-------------
##Let's use PAM50 classifier's centroids toy example, i. e., the five subject
##subtypes, which must correctly classify all the subject.
M<-pam50$centroids
genes<-pam50$centroids.map
names(genes)<-c("probe", "NCBI.gene.symbol", "EntrezGene.ID")
maux<-new("MAList", list(M=M, genes=genes))
##calling as function
object<-as(maux, "PAM50")
object
##same result with as.PAM50 function
object<-as.PAM50(maux)
object
Run the code above in your browser using DataLab