1 Introduction

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.52.0
## Loading required package: Biobase
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
##     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
##     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff, 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:utils':
## 
##     findMatches
## The following objects are masked from 'package:base':
## 
##     expand.grid, I, unname
## Loading required package: org.Hs.eg.db
## 
## 
ALL$BTtype <- as.factor(substr(ALL$BT,0,1))

2 Classify microarray data

2.1 Lasso regression

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

2.2 PAM regression

resultPam <- pamClass(object = ALL, groups = "BTtype")
plot(resultPam, 
    main = "Pam misclassification error versus number of genes."
)

topTable(resultPam, n = 15)
## Pam selected  53  genes. The top  15  genes are:
## 
##            GeneSymbol B.score T.score av.rank.in.CV prop.selected.in.CV
## 38319_at         CD3D -0.8044  2.3156             1                   1
## 38147_at       SH2D1A -0.4644  1.3369             2                   1
## 33238_at          LCK -0.3754  1.0808             4                   1
## 35016_at         CD74  0.3753 -1.0804           3.8                   1
## 38095_i_at   HLA-DPB1  0.3589 -1.0331           5.1                   1
## 37039_at      HLA-DRA  0.3536  -1.018           5.8                   1
## 38096_f_at   HLA-DPB1  0.3403 -0.9796           7.1                   1
## 2059_s_at         LCK -0.3243  0.9336           7.7                   1
## 38833_at     HLA-DPA1  0.2921 -0.8408           9.1                   1
## 41723_s_at       <NA>  0.2652 -0.7636          10.8                   1
## 1110_at          TRDC -0.2599  0.7481          11.7                   1
## 38242_at         BLNK  0.2387 -0.6871            13                   1
## 1096_g_at        CD19  0.2377 -0.6842          12.6                   1
## 37344_at      HLA-DMA  0.2303 -0.6631          13.6                   1
## 39389_at          CD9  0.2211 -0.6366            14                   1
confusionMatrix(resultPam)
##     predicted
## true  B  T
##    B 95  0
##    T  0 33

2.3 Random forest

# select only a subset of the data for computation time reason
ALLSubset <- ALL[sample.int(n = nrow(ALL), size = 100, replace = FALSE), ]

resultRf <- rfClass(object = ALLSubset, groups = "BTtype")
plot(resultRf)

topTable(resultRf, n = 15)
## Random forest selected 14 genes. The top 15 genes are:
## 
##            GeneSymbol
## 1650_g_at        SMOX
## 32649_at         TCF7
## 32756_at         ECH1
## 32780_at          DST
## 33098_at         CCR3
## 33514_at        CAMK4
## 34269_at        EDRF1
## 35320_at      SLC11A2
## 36020_at         <NA>
## 36829_at         PER1
## 38771_at        HDAC1
## 39709_at      SELENOW
## 39850_at         ANK2
## 41136_s_at        APP

2.4 ROC curve

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.

3 Appendix

3.1 Session information

## R version 4.4.0 beta (2024-04-14 r86421)
## Platform: x86_64-apple-darwin20
## Running under: macOS Monterey 12.7.1
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib 
## LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## time zone: America/New_York
## tzcode source: internal
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] hgu95av2.db_3.13.0   org.Hs.eg.db_3.19.1  AnnotationDbi_1.66.0 IRanges_2.38.0       S4Vectors_0.42.0     ALL_1.45.0           Biobase_2.64.0       BiocGenerics_0.50.0  a4Classif_1.52.0     a4Preproc_1.52.0     a4Core_1.52.0       
## 
## loaded via a namespace (and not attached):
##  [1] sass_0.4.9              varSelRF_0.7-8          shape_1.4.6.1           RSQLite_2.3.6           lattice_0.22-6          digest_0.6.35           evaluate_0.23           grid_4.4.0              iterators_1.0.14        fastmap_1.1.1           blob_1.2.4              foreach_1.5.2           jsonlite_1.8.8          glmnet_4.1-8            Matrix_1.7-0            GenomeInfoDb_1.40.0     DBI_1.2.2               survival_3.6-4          httr_1.4.7              UCSC.utils_1.0.0       
## [21] Biostrings_2.72.0       codetools_0.2-20        jquerylib_0.1.4         cli_3.6.2               crayon_1.5.2            rlang_1.1.3             XVector_0.44.0          pamr_1.56.2             bit64_4.0.5             splines_4.4.0           cachem_1.0.8            yaml_2.3.8              tools_4.4.0             parallel_4.4.0          memoise_2.0.1           GenomeInfoDbData_1.2.12 ROCR_1.0-11             vctrs_0.6.5             R6_2.5.1                png_0.1-8              
## [41] lifecycle_1.0.4         zlibbioc_1.50.0         KEGGREST_1.44.0         randomForest_4.7-1.1    bit_4.0.5               cluster_2.1.6           pkgconfig_2.0.3         bslib_0.7.0             Rcpp_1.0.12             highr_0.10              xfun_0.43               knitr_1.46              htmltools_0.5.8.1       rmarkdown_2.26          compiler_4.4.0