## Multiple Sclerosis
data(MS, package = "gemR")
# Subset to reduce runtime in example
MS$proteins <- MS$proteins[,20:70]
gem <- GEM(proteins ~ group * MS, data = MS)
print(gem)
summary(gem) # Summary of GEM
plot(gem) # Raw data, first feature
plot(gem,2) # Raw data, numbered feature
plot(gem,'Q76L83', col='MS', pch='group') # Selected colour and plot character
plot(gem,'Q76L83', what='effect MS',
model.line='effect group') # Comparison of factors (points and lines)
print(effs <- colnames(gem$symbolicDesign)) # Inspect factor names
eeffs <- paste0("effect ", effs)
# Example compound plot
old.par <- par(mfrow = c(3,3), mar = c(2,4,4,1))
plot(gem,'Q76L83') # Raw data, named feature
plot(gem,'Q76L83', what='fits') # Fitted values
plot(gem,'Q76L83', what='residuals') # Residuals
plot(gem,'Q76L83', what=eeffs[1]) # Effect levels
plot(gem,'Q76L83', what=eeffs[2]) # ----||----
plot(gem,'Q76L83', what=eeffs[3]) # ----||----
plot(gem,'Q76L83', what=effs[1]) # ER values
plot(gem,'Q76L83', what=effs[2]) # --------||---------
plot(gem,'Q76L83', what=effs[3]) # --------||---------
par(old.par)
# Complete overview of GEM
tab <- tableGEM(gem, 1)
# In general there can be more than two, effects, more than two levels, and continuous effects:
MS$three <- factor(c(rep(1:3,33),1:2))
gem3 <- GEM(proteins ~ MS * group + three, data = MS)
## Candy assessment
data(candies, package = "HDANOVA")
gemC <- GEM(assessment ~ assessor*candy, data=candies)
# Permutation testing
gemC <- permutation(gemC)
summary(gemC)
# GEM-SCA with ellipsoids in score plots
gemSCA <- sca(gemC)
scoreplot(gemSCA, factor="candy", ellipsoids="confidence")
# GEM-PCA with group colours
gemPCA <- pca(gemC)
scoreplot(gemPCA, factor="candy",
gr.col=gemPCA$symbolicDesign$candy)
## Lactobacillus
data(Lactobacillus, package = "gemR")
# Subset to reduce runtime in example
Lactobacillus$proteome <- Lactobacillus$proteome[,50:100]
gemLac <- GEM(proteome ~ strain * growthrate, data = Lactobacillus)
print(gemLac)
plot(gemLac) # Raw data, first feature
plot(gemLac,2) # Raw data, numbered feature
plot(gemLac,'P.LSA0316', col='strain',
pch='growthrate') # Selected colour and plot character
plot(gemLac,'P.LSA0316', what='strain',
model.line='growthrate') # Selected model.line
# Don't run this example, it takes too long
## Diabetes
data(Diabetes, package = "gemR")
gemDia <- GEM(transcriptome ~ surgery * T2D, data = Diabetes)
print(gemDia)
plot(gemDia) # Raw data, first feature
plot(gemDia,2) # Raw data, numbered feature
plot(gemDia,'ILMN_1720829', col='surgery',
pch='T2D') # Selected colour and plot character
Run the code above in your browser using DataLab