您的“gse”对象是两个表达式集的列表。
library(GEOquery)
gse <- getGEO('GSE16560', GSEMatrix = T)
class(gse)
# [1] "list"
length(gse)
# [1] 2
您可以使用双括号 ,[[]]
来访问列表的元素。
# get the class of the first element in the list
class(gse[[1]])
# [1] "ExpressionSet"
# attr(,"package")
# [1] "Biobase"
我相信GSMList
将使用“GSE”类的对象,如果将“GSEMatrix”参数更改getGEO
为FALSE
既然您说您是 R 和这些数据结构的新手,请查看?str
. 它对于快速了解对象中存储的内容以及如何索引数据(如果出于某种原因需要这样做)非常有用。
str(gse[[1]])
# Formal class 'ExpressionSet' [package "Biobase"] with 7 slots
# ..@ experimentData :Formal class 'MIAME' [package "Biobase"] with 13 slots
# .. .. ..@ name : chr ""
# .. .. ..@ lab : chr ""
# .. .. ..@ contact : chr ""
# .. .. ..@ title : chr ""
# .. .. ..@ abstract : chr ""
# .. .. ..@ url : chr ""
# .. .. ..@ pubMedIds : chr ""
# .. .. ..@ samples : list()
# .. .. ..@ hybridizations : list()
# .. .. ..@ normControls : list()
# .. .. ..@ preprocessing : list()
# .. .. ..@ other : list()
# .. .. ..@ .__classVersion__:Formal class 'Versions' [package "Biobase"] with 1 slots
# .. .. .. .. ..@ .Data:List of 2
# .. .. .. .. .. ..$ : int [1:3] 1 0 0
# .. .. .. .. .. ..$ : int [1:3] 1 1 0
# ..@ assayData :<environment: 0x7fb344a81758>
# ..@ phenoData :Formal class 'AnnotatedDataFrame' [package "Biobase"] with 4 slots
# .. .. ..@ varMetadata :'data.frame': 44 obs. of 1 variable:
# .. .. .. ..$ labelDescription: chr [1:44] NA NA NA NA ...
# .. .. ..@ data :'data.frame': 255 obs. of 44 variables:
# ....and so on and so forth
gse[[1]]@experimentData
# Experiment data
# Experimenter name:
# Laboratory:
# Contact information:
# Title:
# URL:
# PMIDs:
# No abstract available.
# and one more example...
head(levels(gse[[1]]@phenoData@data$geo_accession))
# [1] "GSM416241" "GSM416242" "GSM416243" "GSM416244" "GSM416245" "GSM416246"