This document explains the functionalities available in the a4Classif package.
This package contains for classification of Affymetrix microarray data, stored in an ExpressionSet
. This package integrates within the Automated Affymetrix Array Analysis suite of packages.
## Loading required package: a4Core
## Loading required package: a4Preproc
##
## a4Classif version 1.38.0
## Loading required package: Biobase
## Loading required package: BiocGenerics
## Loading required package: parallel
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
##
## clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
## clusterExport, clusterMap, parApply, parCapply, parLapply,
## parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## Filter, Find, Map, Position, Reduce, anyDuplicated, append,
## as.data.frame, basename, cbind, colnames, dirname, do.call,
## duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
## lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
## pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
## tapply, union, unique, unsplit, which.max, which.min
## Welcome to Bioconductor
##
## Vignettes contain introductory material; view with
## 'browseVignettes()'. To cite Bioconductor, see
## 'citation("Biobase")', and for packages 'citation("pkgname")'.
To demonstrate the functionalities of the package, the ALL
dataset is used. The genes are annotated thanks to the addGeneInfo
utility function of the a4Preproc
package.
data(ALL, package = "ALL")
ALL <- addGeneInfo(ALL)
## Loading required package: hgu95av2.db
## Loading required package: AnnotationDbi
## Loading required package: stats4
## Loading required package: IRanges
## Loading required package: S4Vectors
##
## Attaching package: 'S4Vectors'
## The following object is masked from 'package:base':
##
## expand.grid
## Loading required package: org.Hs.eg.db
##
##
ALL$BTtype <- as.factor(substr(ALL$BT,0,1))
resultLasso <- lassoClass(object = ALL, groups = "BTtype")
plot(resultLasso,
label = TRUE,
main = "Lasso coefficients in relation to degree of penalization."
)
topTable(resultLasso, n = 15)
## The lasso selected 16 genes. The top 15 genes are:
##
## Gene Coefficient
## 38319_at CD3D 0.95966733
## 35016_at CD74 -0.60928095
## 38147_at SH2D1A 0.49240967
## 35792_at MGLL 0.46856925
## 37563_at SRGAP3 0.26648240
## 38917_at YME1L1 0.25100075
## 40278_at GGA2 -0.25017550
## 41164_at IGHM -0.12387272
## 41409_at THEMIS2 -0.10581122
## 38242_at BLNK -0.10309606
## 35523_at HPGDS 0.10169706
## 38949_at PRKCQ 0.07832802
## 33316_at TOX 0.06963509
## 33839_at ITPR2 0.05801832
## 40570_at FOXO1 -0.04858863
resultPam <- pamClass(object = ALL, groups = "BTtype")
plot(resultPam,
main = "Pam misclassification error versus number of genes."
)
topTable(resultPam, n = 15)
## Pam selected 42 genes. The top 15 genes are:
##
## GeneSymbol B.score T.score av.rank.in.CV prop.selected.in.CV
## 38319_at CD3D -0.7621 2.1938 1 1
## 38147_at SH2D1A -0.4221 1.2152 2 1
## 33238_at LCK -0.3331 0.959 4 1
## 35016_at CD74 0.333 -0.9586 3.6 1
## 38095_i_at HLA-DPB1 0.3166 -0.9113 5 1
## 37039_at HLA-DRA 0.3113 -0.8962 5.8 1
## 38096_f_at HLA-DPB1 0.298 -0.8578 7.1 1
## 2059_s_at LCK -0.282 0.8118 7.6 1
## 38833_at HLA-DPA1 0.2498 -0.7191 9.2 1
## 41723_s_at <NA> 0.2229 -0.6418 10.7 1
## 1110_at YME1L1 -0.2176 0.6264 11.5 1
## 38242_at BLNK 0.1964 -0.5653 12.6 1
## 1096_g_at CD19 0.1954 -0.5624 12.6 1
## 37344_at HLA-DMA 0.188 -0.5413 13.5 1
## 39389_at CD9 0.1788 -0.5148 14.2 1
confusionMatrix(resultPam)
## predicted
## true B T
## B 95 0
## T 0 33
# select only a subset of the data for computation time reason
ALLSubset <- ALL[sample.int(n = nrow(ALL), size = 100, replace = TRUE), ]
resultRf <- rfClass(object = ALLSubset, groups = "BTtype")
plot(resultRf)
topTable(resultRf, n = 15)
## Random forest selected 2 genes. The top 15 genes are:
##
## GeneSymbol
## 1433_g_at SMAD3
## 633_s_at TFDP2
ROCcurve(gene = "ABL1", object = ALL, groups = "BTtype")
## Warning in ROCcurve(gene = "ABL1", object = ALL, groups = "BTtype"): Gene ABL1 corresponds to 6 probesets; only the first probeset ( 1635_at ) has been displayed on the plot.
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Mojave 10.14.6
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
##
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats4 parallel stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] hgu95av2.db_3.2.3 org.Hs.eg.db_3.12.0 AnnotationDbi_1.52.0 IRanges_2.24.0 S4Vectors_0.28.0 ALL_1.31.0 Biobase_2.50.0 BiocGenerics_0.36.0 a4Classif_1.38.0 a4Preproc_1.38.0 a4Core_1.38.0
##
## loaded via a namespace (and not attached):
## [1] Rcpp_1.0.5 compiler_4.0.3 iterators_1.0.13 tools_4.0.3 bit_4.0.4 digest_0.6.27 memoise_1.1.0 evaluate_0.14 RSQLite_2.2.1 lattice_0.20-41 pkgconfig_2.0.3 rlang_0.4.8 Matrix_1.2-18 foreach_1.5.1 DBI_1.1.0 yaml_2.2.1 xfun_0.18 stringr_1.4.0 knitr_1.30 pamr_1.56.1 cluster_2.1.0 vctrs_0.3.4 bit64_4.0.5 glmnet_4.0-2
## [25] grid_4.0.3 varSelRF_0.7-8 survival_3.2-7 rmarkdown_2.5 blob_1.2.1 ROCR_1.0-11 magrittr_1.5 codetools_0.2-16 htmltools_0.5.0 splines_4.0.3 randomForest_4.6-14 shape_1.4.5 stringi_1.5.3