ANALISIS DE EXPRESION DE GENES EN LINEA

======================================================

1. INSTALACIÓN DE PAQUETERIA

library(Biobase)
## Warning: package 'Biobase' was built under R version 4.0.3
## Loading required package: BiocGenerics
## Warning: package 'BiocGenerics' was built under R version 4.0.3
## 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':
## 
##     anyDuplicated, 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, 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")'.
library(GEOquery)
## Warning: package 'GEOquery' was built under R version 4.0.3
## Setting options('download.file.method.GEOquery'='auto')
## Setting options('GEOquery.inmemory.gpl'=FALSE)
library(limma)
## Warning: package 'limma' was built under R version 4.0.3
## 
## Attaching package: 'limma'
## The following object is masked from 'package:BiocGenerics':
## 
##     plotMA

======================================================

2. IMPORTACION DE BASE DE DATOS

gset <-  GEOquery::getGEO("GSE1397", GSEMatrix =TRUE)              # importa datasets de GSE
## Found 1 file(s)
## GSE1397_series_matrix.txt.gz
## 
## -- Column specification --------------------------------------------------------
## cols(
##   .default = col_double(),
##   ID_REF = col_character()
## )
## i Use `spec()` for the full column specifications.
## File stored at:
## C:\Users\acard\AppData\Local\Temp\Rtmp0sTNzl/GPL96.soft
## Warning: 68 parsing failures.
##   row     col           expected    actual         file
## 22216 SPOT_ID 1/0/T/F/TRUE/FALSE --Control literal data
## 22217 SPOT_ID 1/0/T/F/TRUE/FALSE --Control literal data
## 22218 SPOT_ID 1/0/T/F/TRUE/FALSE --Control literal data
## 22219 SPOT_ID 1/0/T/F/TRUE/FALSE --Control literal data
## 22220 SPOT_ID 1/0/T/F/TRUE/FALSE --Control literal data
## ..... ....... .................. ......... ............
## See problems(...) for more details.
gset2 <- GEOquery::getGEO("GSE77962", GSEMatrix = TRUE)
## Found 1 file(s)
## GSE77962_series_matrix.txt.gz
## 
## -- Column specification --------------------------------------------------------
## cols(
##   .default = col_double()
## )
## i Use `spec()` for the full column specifications.
## File stored at:
## C:\Users\acard\AppData\Local\Temp\Rtmp0sTNzl/GPL11532.soft
gsm1 <-  GEOquery::getGEO(GEO = "GSM2062466", GSEMatrix = TRUE)    # importa un ensayo GSM
## File stored at:
## C:\Users\acard\AppData\Local\Temp\Rtmp0sTNzl/GSM2062466.soft

======================================================

3. EXPLORACIÓN BÁSICA DE ELEMENTOS IMPORTADOS

Primero sacamos a los objetos de la lista

gset <- gset[[1]]
gset2 <- gset2[[1]]

Parar mostrar el contenido podemos usar la función show() o simplemente poniendo el nombre

gset

gset
## ExpressionSet (storageMode: lockedEnvironment)
## assayData: 22283 features, 28 samples 
##   element names: exprs 
## protocolData: none
## phenoData
##   sampleNames: GSM22509 GSM22510 ... GSM22705 (28 total)
##   varLabels: title geo_accession ... data_row_count (28 total)
##   varMetadata: labelDescription
## featureData
##   featureNames: 1007_s_at 1053_at ... AFFX-TrpnX-M_at (22283 total)
##   fvarLabels: ID GB_ACC ... Gene Ontology Molecular Function (16 total)
##   fvarMetadata: Column Description labelDescription
## experimentData: use 'experimentData(object)'
##   pubMedIds: 16420667 
## Annotation: GPL96

Tiene 28 muestras, en el microarreglo que tiene 22283 sondas. La plataforma es el modelo GPL96.

gset2

gset2
## ExpressionSet (storageMode: lockedEnvironment)
## assayData: 33297 features, 152 samples 
##   element names: exprs 
## protocolData: none
## phenoData
##   sampleNames: GSM2062466 GSM2062467 ... GSM2062617 (152 total)
##   varLabels: title geo_accession ... weight (kg):ch1 (52 total)
##   varMetadata: labelDescription
## featureData
##   featureNames: 7892501 7892502 ... 8180418 (33297 total)
##   fvarLabels: ID GB_LIST ... category (12 total)
##   fvarMetadata: Column Description labelDescription
## experimentData: use 'experimentData(object)'
##   pubMedIds: 30380678
## 27840413
## 32015415 
## Annotation: GPL11532

Este experimento tiene 152 muestras, con 33297 sondas. La plataforma del microarreglo es GLP11532

Nombre de art

# resumen del artículo
Biobase::abstract(gset2)
## [1] "Background: Moderate weight loss can ameliorate adverse health effects associated with obesity, reflected by an improved adipose tissue (AT) gene expression profile. However, the effect of rate of weight loss on the AT transcriptome is unknown.\n\nObjective: We investigated the global AT gene expression profile before and after two different rates of weight loss that resulted in similar total weight loss, and after a subsequent weight stabilization period.\n\nDesign: In this randomized controlled trial, 25 male and 28 female individuals (BMI: 28-35 kg/m2) followed either a low-calorie diet (LCD; 1250 kcal/d) for 12 weeks or a very-low-calorie diet (VLCD; 500 kcal/d) for 5 weeks (weight loss (WL) period) and a subsequent weight stable (WS) period of four weeks. The WL period and WS period together is termed dietary intervention (DI) period. Abdominal subcutaneous AT biopsies were collected for microarray analysis, and gene expression changes were calculated for all three periods in the LCD group, VLCD group and between diets (ΔVLCD-ΔLCD).\n\nResults: Weight loss was similar between groups during the WL period (LCD: -8.1±0.5 kg, VLCD: -8.9±0.4 kg, difference p=0.25). Overall, more genes were significantly regulated and changes in gene expression were more extreme in the VLCD group compared to the LCD group. Gene sets related to mitochondrial function, adipogenesis and immunity/inflammation were more strongly upregulated on a VLCD compared to a LCD during the DI period (positive ΔVLCD-ΔLCD). Neuronal- and olfactory-related gene sets were decreased during the WL period and DI period in the VLCD group.\n\nConclusions: The rate of weight loss (LCD vs. VLCD), with similar total weight loss, strongly regulates AT gene expression. Increased mitochondrial function and adipogenesis on a VLCD compared to a LCD reflect potential beneficial diet-induced changes in AT, while differential neuronal and olfactory regulation suggest functions of these genes beyond the current paradigm."
# estructura del objeto
Biobase::phenoData(gset2)
## An object of class 'AnnotatedDataFrame'
##   sampleNames: GSM2062466 GSM2062467 ... GSM2062617 (152 total)
##   varLabels: title geo_accession ... weight (kg):ch1 (52 total)
##   varMetadata: labelDescription
# Plataforma
Biobase::annotation(gset2)
## [1] "GPL11532"
# Estructura de los datos (nombre de las sondas, y terminos relacionados a estos)
Biobase::featureData(gset2)
## An object of class 'AnnotatedDataFrame'
##   featureNames: 7892501 7892502 ... 8180418 (33297 total)
##   varLabels: ID GB_LIST ... category (12 total)
##   varMetadata: Column Description labelDescription
# Busca si hay datos perdidos en la base de datos
Biobase::anyMissing(gset2)
## [1] FALSE
# tabla con los detalles de cada uno de los GSM del GSE
(Biobase::pData(Biobase::phenoData(gset2))[1:3,1:10])
##                                                                                         title
## GSM2062466             Abdominal subcutaneous white adipose tissue, at study start, subject 1
## GSM2062467   Abdominal subcutaneous white adipose tissue, after weight loss period, subject 1
## GSM2062468 Abdominal subcutaneous white adipose tissue, after weight stable period, subject 1
##            geo_accession                status submission_date last_update_date
## GSM2062466    GSM2062466 Public on Feb 07 2017     Feb 16 2016      Feb 07 2017
## GSM2062467    GSM2062467 Public on Feb 07 2017     Feb 16 2016      Feb 07 2017
## GSM2062468    GSM2062468 Public on Feb 07 2017     Feb 16 2016      Feb 07 2017
##            type channel_count
## GSM2062466  RNA             1
## GSM2062467  RNA             1
## GSM2062468  RNA             1
##                                                                          source_name_ch1
## GSM2062466             abdominal subcutaneous white adipose tissue, VLCD, at study start
## GSM2062467   abdominal subcutaneous white adipose tissue, VLCD, after weight loss period
## GSM2062468 abdominal subcutaneous white adipose tissue, VLCD, after weight stable period
##            organism_ch1 characteristics_ch1
## GSM2062466 Homo sapiens       subject_id: 1
## GSM2062467 Homo sapiens       subject_id: 1
## GSM2062468 Homo sapiens       subject_id: 1
# Nombre de la plataforma
Biobase::annotation(gset2)
## [1] "GPL11532"
# Busqueda de datos perdidos
Biobase::anyMissing(gset2)
## [1] FALSE
# Nombre de las columnas del objeto
Biobase::varLabels(gset2)
##  [1] "title"                   "geo_accession"          
##  [3] "status"                  "submission_date"        
##  [5] "last_update_date"        "type"                   
##  [7] "channel_count"           "source_name_ch1"        
##  [9] "organism_ch1"            "characteristics_ch1"    
## [11] "characteristics_ch1.1"   "characteristics_ch1.2"  
## [13] "characteristics_ch1.3"   "characteristics_ch1.4"  
## [15] "characteristics_ch1.5"   "characteristics_ch1.6"  
## [17] "characteristics_ch1.7"   "characteristics_ch1.8"  
## [19] "characteristics_ch1.9"   "treatment_protocol_ch1" 
## [21] "growth_protocol_ch1"     "molecule_ch1"           
## [23] "extract_protocol_ch1"    "label_ch1"              
## [25] "label_protocol_ch1"      "taxid_ch1"              
## [27] "hyb_protocol"            "scan_protocol"          
## [29] "description"             "data_processing"        
## [31] "platform_id"             "contact_name"           
## [33] "contact_email"           "contact_laboratory"     
## [35] "contact_department"      "contact_institute"      
## [37] "contact_address"         "contact_city"           
## [39] "contact_zip/postal_code" "contact_country"        
## [41] "supplementary_file"      "data_row_count"         
## [43] "age (yrs):ch1"           "bmi (kg/m2):ch1"        
## [45] "body fat %:ch1"          "height (cm):ch1"        
## [47] "Sex:ch1"                 "subject_id:ch1"         
## [49] "time point:ch1"          "tissue:ch1"             
## [51] "treatment:ch1"           "weight (kg):ch1"

======================================================

4. ANALISIS DE EXPRESION

4.1 Preprocesamiento de los datos

a) Renombrar los encabzados de columna

Convertimos los encabezados en un vector de nombres

fvarLabels(gset2) <- make.names(fvarLabels(gset2))
fvarLabels(gset2)
##  [1] "ID"              "GB_LIST"         "SPOT_ID"         "seqname"        
##  [5] "RANGE_GB"        "RANGE_STRAND"    "RANGE_START"     "RANGE_STOP"     
##  [9] "total_probes"    "gene_assignment" "mrna_assignment" "category"

c) Denición de grupos experimentales

Primero generamos un data.frame con información util para entender los datos

tab.ref <- Biobase::pData(Biobase::phenoData(gset2))[,47:52]
tab.ref
##            Sex:ch1 subject_id:ch1             time point:ch1
## GSM2062466  female              1             at study start
## GSM2062467  female              1   after weight loss period
## GSM2062468  female              1 after weight stable period
## GSM2062469  female              2             at study start
## GSM2062470  female              2   after weight loss period
## GSM2062471  female              2 after weight stable period
## GSM2062472    male              3             at study start
## GSM2062473    male              3   after weight loss period
## GSM2062474    male              3 after weight stable period
## GSM2062475  female              4             at study start
## GSM2062476  female              4   after weight loss period
## GSM2062477  female              4 after weight stable period
## GSM2062478    male              5             at study start
## GSM2062479    male              5   after weight loss period
## GSM2062480    male              5 after weight stable period
## GSM2062481  female              6             at study start
## GSM2062482  female              6   after weight loss period
## GSM2062483  female              6 after weight stable period
## GSM2062484  female              8             at study start
## GSM2062485  female              8   after weight loss period
## GSM2062486  female              8 after weight stable period
## GSM2062487  female              9             at study start
## GSM2062488  female              9   after weight loss period
## GSM2062489  female              9 after weight stable period
## GSM2062490  female             10             at study start
## GSM2062491  female             10   after weight loss period
## GSM2062492  female             10 after weight stable period
## GSM2062493    male             11             at study start
## GSM2062494    male             11   after weight loss period
## GSM2062495    male             11 after weight stable period
## GSM2062496  female             12             at study start
## GSM2062497  female             12   after weight loss period
## GSM2062498  female             12 after weight stable period
## GSM2062499  female             13             at study start
## GSM2062500  female             13   after weight loss period
## GSM2062501  female             13 after weight stable period
## GSM2062502    male             14             at study start
## GSM2062503    male             14   after weight loss period
## GSM2062504    male             14 after weight stable period
## GSM2062505    male             15   after weight loss period
## GSM2062506    male             15 after weight stable period
## GSM2062507  female             18             at study start
## GSM2062508  female             18 after weight stable period
## GSM2062509  female             19             at study start
## GSM2062510  female             19   after weight loss period
## GSM2062511  female             19 after weight stable period
## GSM2062512    male             20             at study start
## GSM2062513    male             20   after weight loss period
## GSM2062514    male             20 after weight stable period
## GSM2062515  female             21             at study start
## GSM2062516  female             21   after weight loss period
## GSM2062517  female             21 after weight stable period
## GSM2062518    male             22             at study start
## GSM2062519    male             22   after weight loss period
## GSM2062520    male             22 after weight stable period
## GSM2062521    male             23             at study start
## GSM2062522    male             23   after weight loss period
## GSM2062523    male             23 after weight stable period
## GSM2062524  female             24             at study start
## GSM2062525  female             24   after weight loss period
## GSM2062526  female             24 after weight stable period
## GSM2062527    male             25             at study start
## GSM2062528    male             25   after weight loss period
## GSM2062529    male             25 after weight stable period
## GSM2062530    male             26             at study start
## GSM2062531    male             26   after weight loss period
## GSM2062532    male             26 after weight stable period
## GSM2062533  female             27             at study start
## GSM2062534  female             27   after weight loss period
## GSM2062535  female             27 after weight stable period
## GSM2062536  female             28             at study start
## GSM2062537  female             28   after weight loss period
## GSM2062538  female             28 after weight stable period
## GSM2062539    male             29             at study start
## GSM2062540    male             29   after weight loss period
## GSM2062541    male             29 after weight stable period
## GSM2062542    male             30             at study start
## GSM2062543    male             30   after weight loss period
## GSM2062544    male             30 after weight stable period
## GSM2062545  female             31             at study start
## GSM2062546  female             31   after weight loss period
## GSM2062547  female             31 after weight stable period
## GSM2062548    male             33             at study start
## GSM2062549    male             33   after weight loss period
## GSM2062550    male             33 after weight stable period
## GSM2062551  female             34             at study start
## GSM2062552  female             34   after weight loss period
## GSM2062553  female             34 after weight stable period
## GSM2062554  female             35             at study start
## GSM2062555  female             35   after weight loss period
## GSM2062556  female             35 after weight stable period
## GSM2062557  female             36             at study start
## GSM2062558  female             36   after weight loss period
## GSM2062559  female             36 after weight stable period
## GSM2062560  female             37             at study start
## GSM2062561  female             37   after weight loss period
## GSM2062562  female             37 after weight stable period
## GSM2062563  female             38             at study start
## GSM2062564  female             38   after weight loss period
## GSM2062565  female             38 after weight stable period
## GSM2062566  female             39             at study start
## GSM2062567  female             39   after weight loss period
## GSM2062568  female             39 after weight stable period
## GSM2062569  female             40             at study start
## GSM2062570  female             40   after weight loss period
## GSM2062571  female             40 after weight stable period
## GSM2062572  female             41             at study start
## GSM2062573  female             41   after weight loss period
## GSM2062574  female             41 after weight stable period
## GSM2062575    male             42             at study start
## GSM2062576    male             42   after weight loss period
## GSM2062577    male             42 after weight stable period
## GSM2062578    male             43             at study start
## GSM2062579    male             43   after weight loss period
## GSM2062580    male             43 after weight stable period
## GSM2062581  female             45             at study start
## GSM2062582  female             45   after weight loss period
## GSM2062583  female             45 after weight stable period
## GSM2062584  female             46             at study start
## GSM2062585  female             46   after weight loss period
## GSM2062586  female             46 after weight stable period
## GSM2062587  female             47             at study start
## GSM2062588  female             47   after weight loss period
## GSM2062589  female             47 after weight stable period
## GSM2062590    male             48             at study start
## GSM2062591    male             48   after weight loss period
## GSM2062592    male             48 after weight stable period
## GSM2062593    male             49             at study start
## GSM2062594    male             49   after weight loss period
## GSM2062595    male             49 after weight stable period
## GSM2062596  female             50             at study start
## GSM2062597  female             50   after weight loss period
## GSM2062598  female             50 after weight stable period
## GSM2062599    male             51             at study start
## GSM2062600    male             51   after weight loss period
## GSM2062601    male             51 after weight stable period
## GSM2062602    male             52             at study start
## GSM2062603    male             52   after weight loss period
## GSM2062604    male             52 after weight stable period
## GSM2062605    male             53             at study start
## GSM2062606    male             53   after weight loss period
## GSM2062607    male             54   after weight loss period
## GSM2062608    male             54 after weight stable period
## GSM2062609    male             55             at study start
## GSM2062610    male             55   after weight loss period
## GSM2062611    male             55 after weight stable period
## GSM2062612    male             56             at study start
## GSM2062613    male             56 after weight stable period
## GSM2062614    male             59             at study start
## GSM2062615    male             59   after weight loss period
## GSM2062616    male             61             at study start
## GSM2062617    male             61 after weight stable period
##                                      tissue:ch1         treatment:ch1
## GSM2062466 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062467 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062468 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062469 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062470 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062471 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062472 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062473 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062474 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062475 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062476 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062477 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062478 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062479 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062480 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062481 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062482 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062483 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062484 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062485 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062486 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062487 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062488 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062489 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062490 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062491 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062492 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062493 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062494 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062495 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062496 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062497 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062498 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062499 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062500 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062501 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062502 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062503 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062504 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062505 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062506 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062507 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062508 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062509 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062510 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062511 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062512 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062513 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062514 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062515 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062516 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062517 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062518 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062519 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062520 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062521 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062522 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062523 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062524 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062525 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062526 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062527 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062528 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062529 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062530 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062531 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062532 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062533 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062534 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062535 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062536 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062537 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062538 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062539 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062540 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062541 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062542 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062543 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062544 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062545 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062546 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062547 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062548 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062549 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062550 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062551 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062552 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062553 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062554 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062555 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062556 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062557 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062558 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062559 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062560 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062561 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062562 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062563 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062564 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062565 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062566 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062567 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062568 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062569 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062570 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062571 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062572 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062573 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062574 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062575 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062576 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062577 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062578 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062579 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062580 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062581 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062582 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062583 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062584 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062585 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062586 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062587 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062588 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062589 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062590 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062591 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062592 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062593 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062594 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062595 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062596 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062597 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062598 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062599 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062600 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062601 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062602 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062603 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062604 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062605 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062606 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062607 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062608 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062609 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062610 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062611 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062612 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062613 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062614 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062615 abdominal subcutaneous white adipose      low-calorie diet
## GSM2062616 abdominal subcutaneous white adipose very-low-calorie diet
## GSM2062617 abdominal subcutaneous white adipose very-low-calorie diet
##            weight (kg):ch1
## GSM2062466           83.38
## GSM2062467           75.16
## GSM2062468           73.79
## GSM2062469           80.94
## GSM2062470           71.92
## GSM2062471           70.97
## GSM2062472           99.62
## GSM2062473           88.02
## GSM2062474           90.15
## GSM2062475           80.34
## GSM2062476           75.32
## GSM2062477           75.43
## GSM2062478           96.67
## GSM2062479           84.37
## GSM2062480           84.02
## GSM2062481           82.09
## GSM2062482           76.28
## GSM2062483           78.15
## GSM2062484           78.25
## GSM2062485           72.01
## GSM2062486           72.59
## GSM2062487           97.56
## GSM2062488           88.19
## GSM2062489           87.62
## GSM2062490          100.01
## GSM2062491           90.55
## GSM2062492           89.53
## GSM2062493           94.28
## GSM2062494           85.28
## GSM2062495           84.55
## GSM2062496           85.04
## GSM2062497           78.93
## GSM2062498            79.9
## GSM2062499          102.92
## GSM2062500            91.8
## GSM2062501           91.78
## GSM2062502          119.63
## GSM2062503          108.88
## GSM2062504          109.55
## GSM2062505           76.59
## GSM2062506            76.4
## GSM2062507           96.25
## GSM2062508           85.83
## GSM2062509           86.03
## GSM2062510           81.74
## GSM2062511            82.1
## GSM2062512           94.98
## GSM2062513            86.5
## GSM2062514           85.54
## GSM2062515            87.4
## GSM2062516           82.49
## GSM2062517           82.73
## GSM2062518          107.12
## GSM2062519           97.41
## GSM2062520          101.47
## GSM2062521           99.85
## GSM2062522           88.13
## GSM2062523              88
## GSM2062524           91.06
## GSM2062525           81.55
## GSM2062526           80.92
## GSM2062527           94.24
## GSM2062528           86.36
## GSM2062529           85.83
## GSM2062530          114.08
## GSM2062531          103.22
## GSM2062532          101.92
## GSM2062533           81.43
## GSM2062534           74.36
## GSM2062535           73.81
## GSM2062536           79.23
## GSM2062537           72.44
## GSM2062538           70.31
## GSM2062539           98.66
## GSM2062540           89.44
## GSM2062541           87.32
## GSM2062542             104
## GSM2062543           94.29
## GSM2062544           94.69
## GSM2062545           90.06
## GSM2062546           85.12
## GSM2062547           84.24
## GSM2062548           93.66
## GSM2062549           87.42
## GSM2062550           86.96
## GSM2062551           72.87
## GSM2062552           64.16
## GSM2062553           63.36
## GSM2062554           82.83
## GSM2062555            76.1
## GSM2062556           76.45
## GSM2062557           79.31
## GSM2062558           70.14
## GSM2062559           68.96
## GSM2062560            90.1
## GSM2062561           82.32
## GSM2062562           81.92
## GSM2062563           96.72
## GSM2062564           86.38
## GSM2062565           84.86
## GSM2062566           92.75
## GSM2062567           88.67
## GSM2062568           89.07
## GSM2062569            83.6
## GSM2062570            76.4
## GSM2062571           75.17
## GSM2062572           76.21
## GSM2062573           67.21
## GSM2062574           67.54
## GSM2062575           93.56
## GSM2062576           80.87
## GSM2062577           80.69
## GSM2062578          105.43
## GSM2062579           93.87
## GSM2062580           93.71
## GSM2062581           85.66
## GSM2062582            78.4
## GSM2062583           78.05
## GSM2062584            98.1
## GSM2062585           88.68
## GSM2062586           86.41
## GSM2062587           79.63
## GSM2062588           72.45
## GSM2062589           70.99
## GSM2062590          105.07
## GSM2062591           95.98
## GSM2062592           96.41
## GSM2062593           99.32
## GSM2062594           89.64
## GSM2062595           88.68
## GSM2062596          101.96
## GSM2062597           97.57
## GSM2062598           97.63
## GSM2062599           94.28
## GSM2062600            86.1
## GSM2062601           85.46
## GSM2062602           91.85
## GSM2062603           81.91
## GSM2062604           83.72
## GSM2062605           94.09
## GSM2062606           84.81
## GSM2062607          100.79
## GSM2062608          100.38
## GSM2062609            86.7
## GSM2062610           74.46
## GSM2062611           74.21
## GSM2062612           93.36
## GSM2062613           89.98
## GSM2062614           82.42
## GSM2062615           75.01
## GSM2062616           94.26
## GSM2062617            88.5

Usamos la columna time point:ch1 para definir los grupos experimentales

sml <- as.factor(tab.ref$`time point:ch1`)
levels(sml) <- c("t1", "t2", "t0")
sml <- as.character(sml)
head(cbind(tab.ref$`time point:ch1`, sml),10)
##                                    sml 
##  [1,] "at study start"             "t0"
##  [2,] "after weight loss period"   "t1"
##  [3,] "after weight stable period" "t2"
##  [4,] "at study start"             "t0"
##  [5,] "after weight loss period"   "t1"
##  [6,] "after weight stable period" "t2"
##  [7,] "at study start"             "t0"
##  [8,] "after weight loss period"   "t1"
##  [9,] "after weight stable period" "t2"
## [10,] "at study start"             "t0"
table(tab.ref$`time point:ch1`)
## 
##   after weight loss period after weight stable period 
##                         50                         51 
##             at study start 
##                         51

d) Selección de los grupos a comparar

Vamos a comparar el estado basal “t0” con el estado final “t2”. Entonces necesitamos conservar esos experimentos.

sel <- which(sml == "t0" | sml == "t2")
sml <- sml[sel]
gset2.sel <- gset2[,sel]
gset2.sel
## ExpressionSet (storageMode: lockedEnvironment)
## assayData: 33297 features, 102 samples 
##   element names: exprs 
## protocolData: none
## phenoData
##   sampleNames: GSM2062466 GSM2062468 ... GSM2062617 (102 total)
##   varLabels: title geo_accession ... weight (kg):ch1 (52 total)
##   varMetadata: labelDescription
## featureData
##   featureNames: 7892501 7892502 ... 8180418 (33297 total)
##   fvarLabels: ID GB_LIST ... category (12 total)
##   fvarMetadata: Column Description labelDescription
## experimentData: use 'experimentData(object)'
##   pubMedIds: 30380678
## 27840413
## 32015415 
## Annotation: GPL11532

Este nuevo grupo de datos solo tiene 102 muestras y no las 152 muestras deel objeto original

e) Conversión de los datos a escala logaritmica

Biobase::exprs(gset2.sel) <- log2(Biobase::exprs(gset2.sel))
exprs(gset2)[1:10, 1:10]
##         GSM2062466 GSM2062467 GSM2062468 GSM2062469 GSM2062470 GSM2062471
## 7892501   4.428059   4.175376   4.025431   4.058749   5.077221   4.167342
## 7892502   3.015303   3.382805   4.266405   3.859811   3.524342   3.983906
## 7892503   2.469030   1.683800   1.353440   1.833336   1.773266   2.073515
## 7892504   7.469548   7.575583   8.319473   7.877318   7.463798   7.777693
## 7892505   2.655132   1.349682   1.610853   1.264390   2.165488   1.744837
## 7892506   3.249786   2.036092   2.997583   3.740663   4.503293   3.034553
## 7892507   4.477538   3.443418   1.898563   2.522465   2.255274   2.785241
## 7892508   4.670769   5.668864   4.620866   4.818567   5.228200   4.565037
## 7892509   9.371950   8.928887   9.044602   9.420649   9.138381   9.007842
## 7892510   3.829357   5.110848   4.364140   4.125794   4.725425   4.407576
##         GSM2062472 GSM2062473 GSM2062474 GSM2062475
## 7892501   5.217643   5.940471   4.454951   4.561600
## 7892502   3.177080   3.634795   2.864439   2.929677
## 7892503   2.035071   1.663281   1.647068   2.473372
## 7892504   8.129641   7.505768   8.378240   7.843780
## 7892505   2.018746   1.284328   1.381185   1.591711
## 7892506   3.711080   3.380133   3.368932   2.352224
## 7892507   1.681038   2.673393   3.213846   2.674602
## 7892508   4.197106   5.718841   4.363664   3.552247
## 7892509   9.092477   8.810397   8.168989   8.725467
## 7892510   3.654858   3.996811   4.334708   2.816610
exprs(gset2.sel)[1:10, 1:10]
##         GSM2062466 GSM2062468 GSM2062469 GSM2062471 GSM2062472 GSM2062474
## 7892501   2.146675  2.0091432  2.0210351  2.0591274  2.3833981  2.1554096
## 7892502   1.592303  2.0930208  1.9485303  1.9941834  1.6677012  1.5182527
## 7892503   1.303944  0.4366313  0.8744709  1.0520785  1.0250792  0.7199005
## 7892504   2.901021  3.0564922  2.9777045  2.9593422  3.0231916  3.0666473
## 7892505   1.408783  0.6878247  0.3384420  0.8030919  1.0134591  0.4659069
## 7892506   1.700345  1.5837997  1.9032939  1.6014842  1.8918389  1.7522912
## 7892507   2.162706  0.9249077  1.3348345  1.4778020  0.7493524  1.6843008
## 7892508   2.223660  2.2081633  2.2686042  2.1906265  2.0693949  2.1255400
## 7892509   3.228349  3.1770570  3.2358265  3.1711815  3.1846734  3.0301576
## 7892510   1.937102  2.1256974  2.0446717  2.1399855  1.8698152  2.1159349
##         GSM2062475 GSM2062477 GSM2062478 GSM2062480
## 7892501  2.1895399  2.3262887  1.4334180  2.4491141
## 7892502  1.5507415  1.7606308  1.6663763  2.0226608
## 7892503  1.3064795  1.7254773  1.5966113  0.2659277
## 7892504  2.9715490  3.0216918  3.2546946  2.9357117
## 7892505  0.6705781  0.5992727  0.9822516  0.6072214
## 7892506  1.2340256  1.6206185  1.2253831  2.1652501
## 7892507  1.4193240  1.8783526  1.7767849  1.6645434
## 7892508  1.8287318  2.4302321  1.6542023  2.5525036
## 7892509  3.1252323  3.2200353  3.1265988  3.2013015
## 7892510  1.4939597  2.1676196  1.7497367  2.0433382

f) Generación de modelos de regresion

Primero cambiamos el nombre anotado en la descripción por los nombres de grupo. Para ello generamos un factor de los código de grupo sml (“t0” y “t2”), al cual llamaremos como fl. Luego lo asignamos estos resultados a la descripción. Finalmente usamos la función model.matrix() para generar el modelo de matriz.

gset2.sel$description[1:10]
##  [1] "AP01_1_VLCD_A01.CEL"   "AP01_3_VLCD_A03.CEL"   "AP02_1_VLCD_A04.CEL"  
##  [4] "AP02_3_VLCD_A06_2.CEL" "AP03_1_VLCD_A07.CEL"   "AP03_3_VLCD_A09.CEL"  
##  [7] "AP04_1_VLCD_A10.CEL"   "AP04_3_VLCD_A12.CEL"   "AP05_1_VLCD_B01.CEL"  
## [10] "AP05_3_VLCD_B03.CEL"
fl <- as.factor(sml)
gset2.sel$description <- fl
gset2.sel$description[1:10]
##  [1] t0 t2 t0 t2 t0 t2 t0 t2 t0 t2
## Levels: t0 t2
design <- model.matrix(~ description + 0, gset2.sel)
colnames(design) <- levels(fl)
design[1:10,]
##            t0 t2
## GSM2062466  1  0
## GSM2062468  0  1
## GSM2062469  1  0
## GSM2062471  0  1
## GSM2062472  1  0
## GSM2062474  0  1
## GSM2062475  1  0
## GSM2062477  0  1
## GSM2062478  1  0
## GSM2062480  0  1

Ahora generamos el modelo de regresión lineal

fit <- lmFit(gset2.sel, design)
summary(fit)
##                  Length Class      Mode     
## coefficients     66594  -none-     numeric  
## rank                 1  -none-     numeric  
## assign               2  -none-     numeric  
## qr                   5  qr         list     
## df.residual      33297  -none-     numeric  
## sigma            33297  -none-     numeric  
## cov.coefficients     4  -none-     numeric  
## stdev.unscaled   66594  -none-     numeric  
## pivot                2  -none-     numeric  
## genes               12  data.frame list     
## Amean            33297  -none-     numeric  
## method               1  -none-     character
## design             204  -none-     numeric

g) Determinación de veces de cambio

Para ello generamos una matriz de contraste makeContrast() y con estat calculamoms las veces de cambio con la función contrast.fit()

cont.matrix <- makeContrasts(t2-t0, levels=design)
fit2 <- contrasts.fit(fit, cont.matrix)
fit2$qr$qr[1:10,]
##                   t0        t2
## GSM2062466 -7.141428  0.000000
## GSM2062468  0.000000 -7.141428
## GSM2062469  0.140028  0.000000
## GSM2062471  0.000000  0.140028
## GSM2062472  0.140028  0.000000
## GSM2062474  0.000000  0.140028
## GSM2062475  0.140028  0.000000
## GSM2062477  0.000000  0.140028
## GSM2062478  0.140028  0.000000
## GSM2062480  0.000000  0.140028

h) Cáculo de la diferencia estadistica

Primero hacemos una prueba empirica de Bayes

fit2 <- eBayes(fit2, 0.01)

Luego aplicamos una prueba de corrección FDR y ordenamos los datos en una tabla

tT <- topTable(fit2, adjust="fdr", sort.by="B", number=250)
names(tT)
##  [1] "ID"              "GB_LIST"         "SPOT_ID"         "seqname"        
##  [5] "RANGE_GB"        "RANGE_STRAND"    "RANGE_START"     "RANGE_STOP"     
##  [9] "total_probes"    "gene_assignment" "mrna_assignment" "category"       
## [13] "logFC"           "AveExpr"         "t"               "P.Value"        
## [17] "adj.P.Val"       "B"
tT[1:10,c(2,12:17)]
##                                                                                                                                                    GB_LIST
## 8162940                              NM_005502,AF285167,BC146856,AB445477,AB055982,AF165281,BC141816,BC142693,AB208839,AK024328,AF258627,AK130814,BC034824
## 8117020                                                                                                                                 NM_013262,AF187016
## 7995907                                                                                                                                   NM_000078,M30185
## 8153890                                                                                                                                 NM_138367,AK091638
## 8113504 NM_004772,NM_001142478,NM_001142482,NM_001142476,NM_001142477,NM_001142479,NM_001142480,NM_001142481,NM_001142483,NM_001142474,NM_001142475,U30521
## 8029530                                                                                                                          NM_000041,K00396,AK130027
## 8129985                               NM_006718,NM_001080951,NM_001080952,NM_001080953,NM_001080954,NM_002656,NM_001080956,NM_001080955,NR_002768,AJ311395
## 8025828                                                                NM_000527,NM_001195798,NM_001195799,NM_001195800,NM_001195803,NM_001195802,BC014514
## 8027566                                                                                                                                 NM_001806,BC007582
## 8102792                                                                                                                                 NM_019035,AK292018
##         category       logFC  AveExpr         t      P.Value    adj.P.Val
## 8162940     main  0.06666646 3.022428  6.685869 1.242644e-09 4.137631e-05
## 8117020     main  0.06287193 2.945982  6.401047 4.754999e-09 7.916361e-05
## 7995907     main  0.23333217 2.482309  6.311873 7.205073e-09 7.996910e-05
## 8153890     main  0.04622307 2.691991  5.478665 3.095728e-07 2.576961e-03
## 8113504     main  0.05804069 2.814585  5.368877 4.987178e-07 3.321161e-03
## 8029530     main  0.09306653 3.216542  5.316511 6.250183e-07 3.468539e-03
## 8129985     main  0.05337820 2.955687  5.017984 2.214266e-06 1.053263e-02
## 8025828     main -0.08927095 2.785342 -4.934059 3.137674e-06 1.207828e-02
## 8027566     main -0.03285473 2.756959 -4.918628 3.344184e-06 1.207828e-02
## 8102792     main  0.05005513 3.216703  4.881611 3.894941e-06 1.207828e-02

i) Anotación de nombre de genes y funciones

Primero definimos la plataforma del microarreglo

(gpl <- Biobase::annotation(gset2.sel))
## [1] "GPL11532"

En este caso la plataforma es GLP11532. Ahora para descargar las anotaciones específicas de estas sondas usamos la función getGEO()

annot <- getGEO(gpl, AnnotGPL=TRUE)
## File stored at:
## C:\Users\acard\AppData\Local\Temp\Rtmp0sTNzl/GPL11532.annot.gz
GEOquery::Table(annot)[1:3,]
##        ID
## 1 7896736
## 2 7896738
## 3 7896740
##                                                                                                                                                Gene title
## 1                                                                                                                                                        
## 2                                                                                                                                                        
## 3 olfactory receptor family 4 subfamily F member 17///olfactory receptor family 4 subfamily F member 5///olfactory receptor family 4 subfamily F member 4
##              Gene symbol               Gene ID UniGene title UniGene symbol
## 1                                                                          
## 2                                                                          
## 3 OR4F17///OR4F5///OR4F4 81099///79501///26682                             
##   UniGene ID
## 1           
## 2           
## 3           
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Nucleotide Title
## 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 3 Homo sapiens olfactory receptor family 4 subfamily F member 17 (OR4F17), mRNA///Homo sapiens olfactory receptor family 4 subfamily F member 4 (OR4F4), mRNA///Homo sapiens olfactory receptor family 4 subfamily F member 5 (OR4F5), mRNA///Homo sapiens olfactory receptor, family 4, subfamily F, member 17, mRNA (cDNA clone MGC:168462 IMAGE:9020839), complete cds///Homo sapiens olfactory receptor, family 4, subfamily F, member 4, mRNA (cDNA clone MGC:168521 IMAGE:9020898), complete cds
##                                                       GI
## 1                                                       
## 2                                                       
## 3 52546738///57528065///53828739///187953368///187952254
##                                                  GenBank Accession
## 1                                                                 
## 2                                                                 
## 3 NM_001005240///NM_001004195///NM_001005484///BC136848///BC136907
##   Platform_CLONEID Platform_ORF  Platform_SPOTID         Chromosome location
## 1               NA           NA chr1:53049-54936                            
## 2               NA           NA chr1:63015-63887                            
## 3               NA           NA chr1:69091-70008 19p13.3///1p36.33///15q26.3
##                                                                                                                                       Chromosome annotation
## 1                                                                                                                                                          
## 2                                                                                                                                                          
## 3 Chromosome 19, NC_000019.10 (107152..111690)///Chromosome 1, NC_000001.11 (69091..70008)///Chromosome 15, NC_000015.10 (101922142..101923059, complement)
##                                                                                                                                                                                                                                                                                                                                     GO:Function
## 1                                                                                                                                                                                                                                                                                                                                              
## 2                                                                                                                                                                                                                                                                                                                                              
## 3 G-protein coupled receptor activity///olfactory receptor activity///transmembrane signaling receptor activity///G-protein coupled receptor activity///olfactory receptor activity///transmembrane signaling receptor activity///G-protein coupled receptor activity///olfactory receptor activity///transmembrane signaling receptor activity
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              GO:Process
## 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
## 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
## 3 G-protein coupled receptor signaling pathway///detection of chemical stimulus involved in sensory perception///detection of chemical stimulus involved in sensory perception of smell///G-protein coupled receptor signaling pathway///detection of chemical stimulus involved in sensory perception///detection of chemical stimulus involved in sensory perception of smell///G-protein coupled receptor signaling pathway///detection of chemical stimulus involved in sensory perception///detection of chemical stimulus involved in sensory perception of smell
##                                                                                                                                             GO:Component
## 1                                                                                                                                                       
## 2                                                                                                                                                       
## 3 integral component of membrane///plasma membrane///integral component of membrane///plasma membrane///integral component of membrane///plasma membrane
##                                                                                                       GO:Function ID
## 1                                                                                                                   
## 2                                                                                                                   
## 3 GO:0004930///GO:0004984///GO:0004888///GO:0004930///GO:0004984///GO:0004888///GO:0004930///GO:0004984///GO:0004888
##                                                                                                        GO:Process ID
## 1                                                                                                                   
## 2                                                                                                                   
## 3 GO:0007186///GO:0050907///GO:0050911///GO:0007186///GO:0050907///GO:0050911///GO:0007186///GO:0050907///GO:0050911
##                                                               GO:Component ID
## 1                                                                            
## 2                                                                            
## 3 GO:0016021///GO:0005886///GO:0016021///GO:0005886///GO:0016021///GO:0005886

Ahora extraemos los nombres de los genes de las sondas correspondientes de los atributos de objeto annot y los coloacamos como una data.frame en un objeto llamado ncbifd

ncbifd <- data.frame(attr(dataTable(annot), "table"))
names(ncbifd)
##  [1] "ID"                    "Gene.title"            "Gene.symbol"          
##  [4] "Gene.ID"               "UniGene.title"         "UniGene.symbol"       
##  [7] "UniGene.ID"            "Nucleotide.Title"      "GI"                   
## [10] "GenBank.Accession"     "Platform_CLONEID"      "Platform_ORF"         
## [13] "Platform_SPOTID"       "Chromosome.location"   "Chromosome.annotation"
## [16] "GO.Function"           "GO.Process"            "GO.Component"         
## [19] "GO.Function.ID"        "GO.Process.ID"         "GO.Component.ID"
head(ncbifd,3)
##        ID
## 1 7896736
## 2 7896738
## 3 7896740
##                                                                                                                                                Gene.title
## 1                                                                                                                                                        
## 2                                                                                                                                                        
## 3 olfactory receptor family 4 subfamily F member 17///olfactory receptor family 4 subfamily F member 5///olfactory receptor family 4 subfamily F member 4
##              Gene.symbol               Gene.ID UniGene.title UniGene.symbol
## 1                                                                          
## 2                                                                          
## 3 OR4F17///OR4F5///OR4F4 81099///79501///26682                             
##   UniGene.ID
## 1           
## 2           
## 3           
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Nucleotide.Title
## 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 3 Homo sapiens olfactory receptor family 4 subfamily F member 17 (OR4F17), mRNA///Homo sapiens olfactory receptor family 4 subfamily F member 4 (OR4F4), mRNA///Homo sapiens olfactory receptor family 4 subfamily F member 5 (OR4F5), mRNA///Homo sapiens olfactory receptor, family 4, subfamily F, member 17, mRNA (cDNA clone MGC:168462 IMAGE:9020839), complete cds///Homo sapiens olfactory receptor, family 4, subfamily F, member 4, mRNA (cDNA clone MGC:168521 IMAGE:9020898), complete cds
##                                                       GI
## 1                                                       
## 2                                                       
## 3 52546738///57528065///53828739///187953368///187952254
##                                                  GenBank.Accession
## 1                                                                 
## 2                                                                 
## 3 NM_001005240///NM_001004195///NM_001005484///BC136848///BC136907
##   Platform_CLONEID Platform_ORF  Platform_SPOTID         Chromosome.location
## 1               NA           NA chr1:53049-54936                            
## 2               NA           NA chr1:63015-63887                            
## 3               NA           NA chr1:69091-70008 19p13.3///1p36.33///15q26.3
##                                                                                                                                       Chromosome.annotation
## 1                                                                                                                                                          
## 2                                                                                                                                                          
## 3 Chromosome 19, NC_000019.10 (107152..111690)///Chromosome 1, NC_000001.11 (69091..70008)///Chromosome 15, NC_000015.10 (101922142..101923059, complement)
##                                                                                                                                                                                                                                                                                                                                     GO.Function
## 1                                                                                                                                                                                                                                                                                                                                              
## 2                                                                                                                                                                                                                                                                                                                                              
## 3 G-protein coupled receptor activity///olfactory receptor activity///transmembrane signaling receptor activity///G-protein coupled receptor activity///olfactory receptor activity///transmembrane signaling receptor activity///G-protein coupled receptor activity///olfactory receptor activity///transmembrane signaling receptor activity
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              GO.Process
## 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
## 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
## 3 G-protein coupled receptor signaling pathway///detection of chemical stimulus involved in sensory perception///detection of chemical stimulus involved in sensory perception of smell///G-protein coupled receptor signaling pathway///detection of chemical stimulus involved in sensory perception///detection of chemical stimulus involved in sensory perception of smell///G-protein coupled receptor signaling pathway///detection of chemical stimulus involved in sensory perception///detection of chemical stimulus involved in sensory perception of smell
##                                                                                                                                             GO.Component
## 1                                                                                                                                                       
## 2                                                                                                                                                       
## 3 integral component of membrane///plasma membrane///integral component of membrane///plasma membrane///integral component of membrane///plasma membrane
##                                                                                                       GO.Function.ID
## 1                                                                                                                   
## 2                                                                                                                   
## 3 GO:0004930///GO:0004984///GO:0004888///GO:0004930///GO:0004984///GO:0004888///GO:0004930///GO:0004984///GO:0004888
##                                                                                                        GO.Process.ID
## 1                                                                                                                   
## 2                                                                                                                   
## 3 GO:0007186///GO:0050907///GO:0050911///GO:0007186///GO:0050907///GO:0050911///GO:0007186///GO:0050907///GO:0050911
##                                                               GO.Component.ID
## 1                                                                            
## 2                                                                            
## 3 GO:0016021///GO:0005886///GO:0016021///GO:0005886///GO:0016021///GO:0005886

Finalmente reemplazamos las anotaciones de nuestro objeto por las de la plataforma

# replace original platform annotation
colnames(tT)
##  [1] "ID"              "GB_LIST"         "SPOT_ID"         "seqname"        
##  [5] "RANGE_GB"        "RANGE_STRAND"    "RANGE_START"     "RANGE_STOP"     
##  [9] "total_probes"    "gene_assignment" "mrna_assignment" "category"       
## [13] "logFC"           "AveExpr"         "t"               "P.Value"        
## [17] "adj.P.Val"       "B"
fvarLabels(gset2.sel)
##  [1] "ID"              "GB_LIST"         "SPOT_ID"         "seqname"        
##  [5] "RANGE_GB"        "RANGE_STRAND"    "RANGE_START"     "RANGE_STOP"     
##  [9] "total_probes"    "gene_assignment" "mrna_assignment" "category"
tT <- tT[setdiff(colnames(tT), setdiff(fvarLabels(gset2.sel), "ID"))]
colnames(tT)
## [1] "ID"        "logFC"     "AveExpr"   "t"         "P.Value"   "adj.P.Val"
## [7] "B"
colnames(ncbifd)
##  [1] "ID"                    "Gene.title"            "Gene.symbol"          
##  [4] "Gene.ID"               "UniGene.title"         "UniGene.symbol"       
##  [7] "UniGene.ID"            "Nucleotide.Title"      "GI"                   
## [10] "GenBank.Accession"     "Platform_CLONEID"      "Platform_ORF"         
## [13] "Platform_SPOTID"       "Chromosome.location"   "Chromosome.annotation"
## [16] "GO.Function"           "GO.Process"            "GO.Component"         
## [19] "GO.Function.ID"        "GO.Process.ID"         "GO.Component.ID"
tT <- merge(tT, ncbifd, by="ID")
head(tT)
##        ID       logFC  AveExpr         t      P.Value  adj.P.Val          B
## 1 7892703 -0.05836107 2.631622 -3.667390 0.0003911748 0.09370466 -0.3273478
## 2 7893112  0.18986676 1.727679  3.735525 0.0003087598 0.08194541 -0.1076165
## 3 7893164  0.04099345 3.125884  3.452566 0.0008092809 0.12138120 -0.9996973
## 4 7893722  0.08824893 2.305622  3.706298 0.0003418591 0.08431765 -0.2022463
## 5 7893804  0.18364563 2.153936  3.775303 0.0002685742 0.07990425  0.0220761
## 6 7893876  0.06010353 2.709580  3.410522 0.0009298190 0.12886532 -1.1275685
##   Gene.title Gene.symbol Gene.ID UniGene.title UniGene.symbol UniGene.ID
## 1                                                                       
## 2                                                                       
## 3                                                                       
## 4                                                                       
## 5                                                                       
## 6                                                                       
##   Nucleotide.Title GI GenBank.Accession Platform_CLONEID Platform_ORF
## 1                                                     NA           NA
## 2                                                     NA           NA
## 3                                                     NA           NA
## 4                                                     NA           NA
## 5                                                     NA           NA
## 6                                                     NA           NA
##      Platform_SPOTID Chromosome.location Chromosome.annotation GO.Function
## 1   --normgene->exon                                                      
## 2 --normgene->intron                                                      
## 3   --normgene->exon                                                      
## 4 --normgene->intron                                                      
## 5 --normgene->intron                                                      
## 6 --normgene->intron                                                      
##   GO.Process GO.Component GO.Function.ID GO.Process.ID GO.Component.ID
## 1                                                                     
## 2                                                                     
## 3                                                                     
## 4                                                                     
## 5                                                                     
## 6
tT <- tT[order(tT$P.Value), ] # restore correct order
names(tT)
##  [1] "ID"                    "logFC"                 "AveExpr"              
##  [4] "t"                     "P.Value"               "adj.P.Val"            
##  [7] "B"                     "Gene.title"            "Gene.symbol"          
## [10] "Gene.ID"               "UniGene.title"         "UniGene.symbol"       
## [13] "UniGene.ID"            "Nucleotide.Title"      "GI"                   
## [16] "GenBank.Accession"     "Platform_CLONEID"      "Platform_ORF"         
## [19] "Platform_SPOTID"       "Chromosome.location"   "Chromosome.annotation"
## [22] "GO.Function"           "GO.Process"            "GO.Component"         
## [25] "GO.Function.ID"        "GO.Process.ID"         "GO.Component.ID"
tT <- subset(tT, select=c("ID","adj.P.Val","P.Value","t","B","logFC","Gene.symbol","Gene.title","Chromosome.location"))
head(tT)
##          ID    adj.P.Val      P.Value        t         B      logFC
## 231 8162940 4.137631e-05 1.242644e-09 6.685869 11.715914 0.06666646
## 181 8117020 7.916361e-05 4.754999e-09 6.401047 10.425354 0.06287193
## 98  7995907 7.996910e-05 7.205073e-09 6.311873 10.025993 0.23333217
## 218 8153890 2.576961e-03 3.095728e-07 5.478665  6.421709 0.04622307
## 174 8113504 3.321161e-03 4.987178e-07 5.368877  5.966212 0.05804069
## 125 8029530 3.468539e-03 6.250183e-07 5.316511  5.750734 0.09306653
##      Gene.symbol                                        Gene.title
## 231        ABCA1         ATP binding cassette subfamily A member 1
## 181        MYLIP myosin regulatory light chain interacting protein
## 98          CETP                cholesteryl ester transfer protein
## 218       ZNF251                           zinc finger protein 251
## 174         NREP             neuronal regeneration related protein
## 125 APOE///HMGA1  apolipoprotein E///high mobility group AT-hook 1
##     Chromosome.location
## 231              9q31.1
## 181              6p22.3
## 98                16q21
## 218              8q24.3
## 174              5q22.1
## 125      19q13.2///6p21

Guardamos la tabla que se generó

write.table(tT, file="C:/Users/acard/CloudStation/R-project/mara_nat_project/result/GSE77962_t0_t2.txt", row.names=F, sep="\t")

======================================================

======================================================