5.1 Types of Learning and Chapter Code Preparation

Unsupervised Machine Learning. Source: https://www.analytixlabs.co.in/blog/types-of-machine-learning
# get file paths
fileLGGexp=system.file("extdata",
                      "LGGrnaseq.rds",
                      package="compGenomRData")
fileLGGann=system.file("extdata",
                      "patient2LGGsubtypes.rds",
                      package="compGenomRData")
# gene expression values
gexp=readRDS(fileLGGexp)

head(gexp[,1:5])
##       TCGA-CS-4941 TCGA-CS-4944 TCGA-CS-5393 TCGA-CS-5394 TCGA-CS-5395
## A1BG       72.2326      24.7132      46.3789      37.9659      19.5162
## A1CF        0.0000       0.0000       0.0000       0.0000       0.0000
## A2BP1     524.4997     105.4092     323.5828      19.7390     299.5375
## A2LD1     144.0856      18.0154      29.0942       7.5945     202.1231
## A2ML1     521.3941     159.3746     164.6157      63.5664     953.4106
## A2M     17944.7205   10894.9590   16480.1130    9217.7919   10801.8461
dim(gexp)
## [1] 20501   184
# patient annotation
patient=readRDS(fileLGGann)
head(patient)
##              subtype
## TCGA-FG-8185    CIMP
## TCGA-DB-5276    CIMP
## TCGA-P5-A77X    CIMP
## TCGA-IK-8125    CIMP
## TCGA-DU-A5TR    CIMP
## TCGA-E1-5311    CIMP
dim(patient)
## [1] 184   1