##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
##Example3: Work with PAM50 object: filtrate, classify and permutate--------
##1)Keep only annotated genes presentes in PAM50 centroids
object<-filtrate(object, verbose=TRUE)
##2)Get PAM50 subtypes without any normalization
object<-classify(object, std="none", verbose=TRUE)
##Now we can inspect the how the calssification went
head(classification(object))
##3)Obtain the permutation subtype
##Let's run a quick example with 100 permutations. It is recommended at
##least 10.000
object<-permutate(object, nPerm=100, pCutoff=0.01, corCutoff=0.1,
keep=TRUE, seed=1234567890, verbose=TRUE)
object
##Now we can inspect the how the permutation went
head(permutation(object))
##Which parameters were used?
parameters(object)
##Example 4: Obtain summary statistics and reports--------------------------
##1) Let's check if we have a diagonal contigency matrix, i. e., no mistake
##is made in subtype assesment.
summary(object)
##2)Let's take a look at the how the patient genes behave according
## to PAM50
subjectReport(object, subject=1)
##3)Just get a pdf with all the used subjects (PAM50 centroids in this
##example).
#databaseReport(object, fileName="PAM50.pdf", verbose=TRUE)
Run the code above in your browser using DataLab