## Load the McGill dataset used in the paper
data(mcgillExample)
## Convert the expression matrix to an ExpressionSet.
## could also send directly an expresion matrix
mcgillExample$D <- ExpressionSet(assayData=mcgillExample$D)
## Assigne AIMS on McGill dataset
mcgill.AIMS.subtypes.batch <- applyAIMS (mcgillExample$D,
mcgillExample$EntrezID)
## Print a summary of all the subtype in the dataset
table(mcgill.AIMS.subtypes.batch$cl)
## We can do the samething using only one sample
mcgill.AIMS.subtypes.first <- applyAIMS (mcgillExample$D[,1,drop=FALSE],
mcgillExample$EntrezID)
table(mcgill.AIMS.subtypes.first$cl)
if (mcgill.AIMS.subtypes.batch$cl[1] == mcgill.AIMS.subtypes.first$cl[1]){
message("Identical assignment batch and first sample")
}else{
message("Different assignment batch and first sample")
}
## We can do the samething for the first 20 samples
mcgill.AIMS.subtypes.first20 <- applyAIMS (mcgillExample$D[,1:20,drop=FALSE],
mcgillExample$EntrezID)
table(mcgill.AIMS.subtypes.first20$cl)
if (all(mcgill.AIMS.subtypes.batch$cl[1:20] == mcgill.AIMS.subtypes.first20$cl)){
message("Identical assignment batch and first 20")
}else{
message("Different assignment batch and first 20")
}
## We can do the samething using 50 randomly selected samples, no
## set.seed needed
sel.rand.50 = sample(1:ncol(mcgillExample$D),50)
mcgill.AIMS.subtypes.rand50 <- applyAIMS (mcgillExample$D[,sel.rand.50,drop=FALSE],
mcgillExample$EntrezID)
table(mcgill.AIMS.subtypes.rand50$cl)
if (all(mcgill.AIMS.subtypes.batch$cl[sel.rand.50] == mcgill.AIMS.subtypes.rand50$cl)){
message("Identical assignment batch and random 50")
}else{
message("Different assignment batch and random 50")
}Run the code above in your browser using DataLab