使用GEOquery包
肖恩戴維斯
2014年9月21日
3?GEOquery數(shù)據(jù)結(jié)構(gòu)
4轉(zhuǎn)換為BioConductor ExpressionSets和limma MALists
4.1將?GSE Series Matrix文件作為ExpressionSet獲取
4.2將GDS轉(zhuǎn)換為ExpressionSet
4.4將GSE轉(zhuǎn)換為ExpressionSet
1?GEO概述
NCBI Gene Expression Omnibus(GEO)作為各種高通量實(shí)驗(yàn)數(shù)據(jù)的公共存儲庫。這些數(shù)據(jù)包括基于單通道和雙通道微陣列的實(shí)驗(yàn),測量mRNA,基因組DNA和蛋白質(zhì)豐度,以及非陣列技術(shù),如基因表達(dá)系列分析(SAGE),質(zhì)譜蛋白質(zhì)組學(xué)數(shù)據(jù)和高通量測序數(shù)據(jù)。
在GEO最基本的組織層面,有四種基本實(shí)體類型。前三個(樣本,平臺和系列)由用戶提供;?第四,數(shù)據(jù)集由GEO工作人員根據(jù)用戶提交的數(shù)據(jù)進(jìn)行編譯和策劃。有關(guān)更多信息,請參閱GEO主頁。
1.1平臺
平臺記錄描述陣列上的元件列表(例如,cDNA,寡核苷酸探針組,ORF,抗體)或可在該實(shí)驗(yàn)中檢測和定量的元件列表(例如,SAGE標(biāo)簽,肽)。每個平臺記錄都分配有唯一且穩(wěn)定的GEO登錄號(GPLxxx)。平臺可以引用多個提交者提交的許多樣本。
1.2樣品
樣品記錄描述了處理單個樣品的條件,它經(jīng)歷的操作以及從中得到的每個元素的豐度測量。每個樣品記錄都分配有唯一且穩(wěn)定的GEO登錄號(GSMxxx)。Sample實(shí)體必須僅引用一個Platform,并且可以包含在多個Series中。
1.3系列
系列記錄定義了一組被認(rèn)為是組的一部分的相關(guān)樣本,樣本如何相關(guān),以及它們是否以及如何排序。A系列提供了整個實(shí)驗(yàn)的焦點(diǎn)和描述。系列記錄還可能包含描述提取數(shù)據(jù),摘要結(jié)論或分析的表格。每個系列記錄都分配有唯一且穩(wěn)定的GEO登記號(GSExxx)。系列記錄有幾種格式,由GEOquery獨(dú)立處理。較小的和新的GSEMatrix文件解析起來非常快;?GEOquery使用一個簡單的標(biāo)志來選擇使用GSEMatrix文件(見下文)。
1.4數(shù)據(jù)集
GEO DataSet(GDSxxx)是GEO樣本數(shù)據(jù)的精選集合。GDS記錄代表了一系列具有生物學(xué)和統(tǒng)計(jì)學(xué)意義的GEO樣本,構(gòu)成了GEO數(shù)據(jù)顯示和分析工具套件的基礎(chǔ)。GDS中的樣本指的是同一個平臺,也就是說,它們共享一組共同的探測元素。假設(shè)GDS中每個樣本的值測量值以等效方式計(jì)算,即背景處理和標(biāo)準(zhǔn)化等考慮因素在整個數(shù)據(jù)集中是一致的。通過GDS子集提供反映實(shí)驗(yàn)設(shè)計(jì)的信息。
2使用GEOquery入門
從GEO獲取數(shù)據(jù)非常簡單。只需要一個命令,getGEO。這一函數(shù)解釋其輸入以確定如何從GEO獲取數(shù)據(jù),然后將數(shù)據(jù)解析為有用的R數(shù)據(jù)結(jié)構(gòu)。用法很簡單。這會加載GEOquery庫。
現(xiàn)在,我們可以自由訪問任何GEO加入。請注意,在下面,我使用與GEOquery包一起打包的文件。通常,您將僅使用GEO加入,如代碼注釋中所述。
# If you have network access, the more typical way to do this# would be to use this:# gds <- getGEO("GDS507")gds <- getGEO(filename=system.file("extdata/GDS507.soft.gz",package="GEOquery"))
現(xiàn)在,gds包含GDS代表GEO的GDS507條目的R數(shù)據(jù)結(jié)構(gòu)(類)。您會注意到用于存儲下載的文件名已輸出到屏幕(但不保存在任何地方),以便以后用于調(diào)用getGEO(filename=...)。
我們可以對任何其他GEO加入進(jìn)行相同的操作,例如GSM11805GEO樣本。
# If you have network access, the more typical way to do this# would be to use this:# gds <- getGEO("GSM11805")gsm <- getGEO(filename=system.file("extdata/GSM11805.txt.gz",package="GEOquery"))
3?GEOquery數(shù)據(jù)結(jié)構(gòu)
GEOquery數(shù)據(jù)結(jié)構(gòu)實(shí)際上有兩種形式。第一個,包含GDS,GPL和GSM所有行為相似,訪問者對每個都有類似的影響。第四個GEOquery數(shù)據(jù)結(jié)構(gòu),GSE是由對象GSM和GPL對象組合而成的復(fù)合數(shù)據(jù)類型。我將首先解釋前三個。
3.1?GDS,GSM和GPL類
這些類中的每一個都包含一個元數(shù)據(jù)頭(幾乎從SOFT格式標(biāo)題中逐字逐句)和一個GEODataTable。GEODataTable有兩個簡單的部分,一個Columns部分,用于描述Table部分的列標(biāo)題。show每個班級還有一種方法。例如,使用上面的gsm:
# Look at gsm metadata:head(Meta(gsm))
## $channel_count## [1] "1"#### $comment## [1] "Raw data provided as supplementary file"#### $contact_address## [1] "715 Albany Street, E613B"#### $contact_city## [1] "Boston"#### $contact_country## [1] "USA"#### $contact_department## [1] "Genetics and Genomics"
# Look at data associated with the GSM:# but restrict to only first 5 rows, for brevityTable(gsm)[1:5,]
##? ? ? ? ? ID_REF? VALUE ABS_CALL## 1 AFFX-BioB-5_at? 953.9? ? ? ? P## 2 AFFX-BioB-M_at 2982.8? ? ? ? P## 3 AFFX-BioB-3_at 1657.9? ? ? ? P## 4 AFFX-BioC-5_at 2652.7? ? ? ? P## 5 AFFX-BioC-3_at 2019.5? ? ? ? P
# Look at Column descriptions:Columns(gsm)
##? ? Column## 1? ID_REF## 2? ? VALUE## 3 ABS_CALL##? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Description## 1## 2? ? ? ? ? ? ? ? ? ? ? ? MAS 5.0 Statistical Algorithm (mean scaled to 500)## 3 MAS 5.0 Absent, Marginal, Present call? with Alpha1 = 0.05, Alpha2 = 0.065
在GPL類的行為完全一樣的GSM類。但是,GDS該類具有與該Columns方法相關(guān)的更多信息:
##? ? ? sample disease.state individual## 1? GSM11815? ? ? ? ? RCC? ? ? ? 035## 2? GSM11832? ? ? ? ? RCC? ? ? ? 023## 3? GSM12069? ? ? ? ? RCC? ? ? ? 001## 4? GSM12083? ? ? ? ? RCC? ? ? ? 005## 5? GSM12101? ? ? ? ? RCC? ? ? ? 011## 6? GSM12106? ? ? ? ? RCC? ? ? ? 032## 7? GSM12274? ? ? ? ? RCC? ? ? ? ? 2## 8? GSM12299? ? ? ? ? RCC? ? ? ? ? 3## 9? GSM12412? ? ? ? ? RCC? ? ? ? ? 4## 10 GSM11810? ? ? ? normal? ? ? ? 035## 11 GSM11827? ? ? ? normal? ? ? ? 023## 12 GSM12078? ? ? ? normal? ? ? ? 001## 13 GSM12099? ? ? ? normal? ? ? ? 005## 14 GSM12269? ? ? ? normal? ? ? ? ? 1## 15 GSM12287? ? ? ? normal? ? ? ? ? 2## 16 GSM12301? ? ? ? normal? ? ? ? ? 3## 17 GSM12448? ? ? ? normal? ? ? ? ? 4
3.2?GSE課程
該GSE實(shí)體是GEO實(shí)體中最混亂的。GSE條目可以表示在任意數(shù)量的平臺上運(yùn)行的任意數(shù)量的樣本。該GSE班有一個元數(shù)據(jù)部分,就像其他類。但是,它沒有GEODataTable。相反,它包含兩個列表,可以使用GPLList和GSMList方法訪問,每個列表都包含對象GPL和列表GSM。舉個例子:
# Again, with good network access, one would do:# gse <- getGEO("GSE781",GSEMatrix=FALSE)gse <- getGEO(filename=system.file("extdata/GSE781_family.soft.gz",package="GEOquery"))head(Meta(gse))
## $contact_address## [1] "715 Albany Street, E613B"#### $contact_city## [1] "Boston"#### $contact_country## [1] "USA"#### $contact_department## [1] "Genetics and Genomics"#### $contact_email## [1] "mlenburg@bu.edu"#### $contact_fax## [1] "617-414-1646"
# names of all the GSM objects contained in the GSEnames(GSMList(gse))
##? [1] "GSM11805" "GSM11810" "GSM11814" "GSM11815" "GSM11823" "GSM11827"##? [7] "GSM11830" "GSM11832" "GSM12067" "GSM12069" "GSM12075" "GSM12078"## [13] "GSM12079" "GSM12083" "GSM12098" "GSM12099" "GSM12100" "GSM12101"## [19] "GSM12105" "GSM12106" "GSM12268" "GSM12269" "GSM12270" "GSM12274"## [25] "GSM12283" "GSM12287" "GSM12298" "GSM12299" "GSM12300" "GSM12301"## [31] "GSM12399" "GSM12412" "GSM12444" "GSM12448"
# and get the first GSM object on the listGSMList(gse)[[1]]
## An object of class "GSM"## channel_count## [1] "1"## comment## [1] "Raw data provided as supplementary file"## contact_address## [1] "715 Albany Street, E613B"## contact_city## [1] "Boston"## contact_country## [1] "USA"## contact_department## [1] "Genetics and Genomics"## contact_email## [1] "mlenburg@bu.edu"## contact_fax## [1] "617-414-1646"## contact_institute## [1] "Boston University School of Medicine"## contact_name## [1] "Marc,E.,Lenburg"## contact_phone## [1] "617-414-1375"## contact_state## [1] "MA"## contact_web_link## [1] "http://gg.bu.edu"## contact_zip/postal_code## [1] "02130"## data_row_count## [1] "22283"## description## [1] "Age = 70; Gender = Female; Right Kidney; Adjacent Tumor Type = clear cell; Adjacent Tumor Fuhrman Grade = 3; Adjacent Tumor Capsule Penetration = true; Adjacent Tumor Perinephric Fat Invasion = true; Adjacent Tumor Renal Sinus Invasion = false; Adjacent Tumor Renal Vein Invasion = true; Scaling Target = 500; Scaling Factor = 7.09; Raw Q = 2.39; Noise = 2.60; Background = 55.24."## [2] "Keywords = kidney"## [3] "Keywords = renal"## [4] "Keywords = RCC"## [5] "Keywords = carcinoma"## [6] "Keywords = cancer"## [7] "Lot batch = 2004638"## geo_accession## [1] "GSM11805"## last_update_date## [1] "May 28 2005"## molecule_ch1## [1] "total RNA"## organism_ch1## [1] "Homo sapiens"## platform_id## [1] "GPL96"## series_id## [1] "GSE781"## source_name_ch1## [1] "Trizol isolation of total RNA from normal tissue adjacent to Renal Cell Carcinoma"## status## [1] "Public on Nov 25 2003"## submission_date## [1] "Oct 20 2003"## supplementary_file## [1] "ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/samples/GSM11nnn/GSM11805/GSM11805.CEL.gz"## title## [1] "N035 Normal Human Kidney U133A"## type## [1] "RNA"## An object of class "GEODataTable"## ****** Column Descriptions ******##? ? Column## 1? ID_REF## 2? ? VALUE## 3 ABS_CALL##? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Description## 1## 2? ? ? ? ? ? ? ? ? ? ? ? MAS 5.0 Statistical Algorithm (mean scaled to 500)## 3 MAS 5.0 Absent, Marginal, Present call? with Alpha1 = 0.05, Alpha2 = 0.065## ****** Data Table ******##? ? ? ? ? ID_REF? VALUE ABS_CALL## 1 AFFX-BioB-5_at? 953.9? ? ? ? P## 2 AFFX-BioB-M_at 2982.8? ? ? ? P## 3 AFFX-BioB-3_at 1657.9? ? ? ? P## 4 AFFX-BioC-5_at 2652.7? ? ? ? P## 5 AFFX-BioC-3_at 2019.5? ? ? ? P## 22278 more rows ...
# and the names of the GPLs representednames(GPLList(gse))
## [1] "GPL96" "GPL97"
請參閱下文,了解獲取GSE信息的其他首選方法。
4轉(zhuǎn)換為BioConductor ExpressionSets和limma MALists
GEO數(shù)據(jù)集(不像其他一些地理實(shí)體的),比較相似limma的數(shù)據(jù)結(jié)構(gòu)MAList,并為Biobase數(shù)據(jù)結(jié)構(gòu)ExpressionSet。因此,有兩個功能,GDS2MA并且GDS2eSet是完成這項(xiàng)任務(wù)。
4.1將?GSE Series Matrix文件作為ExpressionSet獲取
GEO系列是相關(guān)實(shí)驗(yàn)的集合。除了可用作非常大的SOFT格式文件外,NCBI GEO還根據(jù)制表符分隔的文本準(zhǔn)備了一個更簡單的格式文件。該getGEO函數(shù)可以處理這種格式,并且可以非常快速地解析非常大的GSE。從此解析返回的數(shù)據(jù)結(jié)構(gòu)是ExpressionSets列表。例如,我們下載并解析GSE2553。
# Note that GSEMatrix=TRUE is the defaultgse2553 <- getGEO('GSE2553',GSEMatrix=TRUE)show(gse2553)
## $GSE2553_series_matrix.txt.gz## ExpressionSet (storageMode: lockedEnvironment)## assayData: 12600 features, 181 samples##? element names: exprs## protocolData: none## phenoData##? sampleNames: GSM48681 GSM48682 ... GSM48861 (181 total)##? varLabels: title geo_accession ... data_row_count (30 total)##? varMetadata: labelDescription## featureData##? featureNames: 1 2 ... 12600 (12600 total)##? fvarLabels: ID PenAt ... Chimeric_Cluster_IDs (13 total)##? fvarMetadata: Column Description labelDescription## experimentData: use 'experimentData(object)'## Annotation: GPL1977
show(pData(phenoData(gse2553[[1]]))[1:5,c(1,6,8)])
##? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? title## GSM48681? ? ? ? ? ? ? ? ? ? ? Patient sample ST18, Dermatofibrosarcoma## GSM48682? ? ? ? ? ? ? ? ? ? ? ? ? Patient sample ST410, Ewing Sarcoma## GSM48683? ? ? ? ? ? ? ? ? ? ? ? ? ? Patient sample ST130, Sarcoma, NOS## GSM48684 Patient sample ST293, Malignant Peripheral Nerve Sheath Tumor## GSM48685? ? ? ? ? ? ? ? ? ? ? ? ? ? Patient sample ST367, Liposarcoma##? ? ? ? ? type? ? ? ? ? ? ? ? ? ? ? ? source_name_ch1## GSM48681? RNA? ? ? ? ? ? ? ? ? ? Dermatofibrosarcoma## GSM48682? RNA? ? ? ? ? ? ? ? ? ? ? ? ? Ewing Sarcoma## GSM48683? RNA? ? ? ? ? ? ? ? ? ? ? ? ? ? Sarcoma, NOS## GSM48684? RNA Malignant Peripheral Nerve Sheath Tumor## GSM48685? RNA? ? ? ? ? ? ? ? ? ? ? ? ? ? Liposarcoma
4.2將GDS轉(zhuǎn)換為ExpressionSet
gds從上面看我們的對象,我們可以簡單地做:
eset <- GDS2eSet(gds,do.log2=TRUE)
現(xiàn)在,eset是一個ExpressionSet包含相同的信息作為GEO數(shù)據(jù)集,包括樣品信息,我們可以在這里看到:
## ExpressionSet (storageMode: lockedEnvironment)## assayData: 22645 features, 17 samples##? element names: exprs## protocolData: none## phenoData##? sampleNames: GSM11815 GSM11832 ... GSM12448 (17 total)##? varLabels: sample disease.state individual description##? varMetadata: labelDescription## featureData##? featureNames: 200000_s_at 200001_at ... AFFX-TrpnX-M_at (22645##? ? total)##? fvarLabels: ID Gene title ... GO:Component ID (21 total)##? fvarMetadata: Column labelDescription## experimentData: use 'experimentData(object)'##? pubMedIds: 14641932## Annotation:
##? ? ? ? ? ? sample disease.state individual## GSM11815 GSM11815? ? ? ? ? RCC? ? ? ? 035## GSM11832 GSM11832? ? ? ? ? RCC? ? ? ? 023## GSM12069 GSM12069? ? ? ? ? RCC? ? ? ? 001## GSM12083 GSM12083? ? ? ? ? RCC? ? ? ? 005## GSM12101 GSM12101? ? ? ? ? RCC? ? ? ? 011## GSM12106 GSM12106? ? ? ? ? RCC? ? ? ? 032## GSM12274 GSM12274? ? ? ? ? RCC? ? ? ? ? 2## GSM12299 GSM12299? ? ? ? ? RCC? ? ? ? ? 3## GSM12412 GSM12412? ? ? ? ? RCC? ? ? ? ? 4## GSM11810 GSM11810? ? ? ? normal? ? ? ? 035## GSM11827 GSM11827? ? ? ? normal? ? ? ? 023## GSM12078 GSM12078? ? ? ? normal? ? ? ? 001## GSM12099 GSM12099? ? ? ? normal? ? ? ? 005## GSM12269 GSM12269? ? ? ? normal? ? ? ? ? 1## GSM12287 GSM12287? ? ? ? normal? ? ? ? ? 2## GSM12301 GSM12301? ? ? ? normal? ? ? ? ? 3## GSM12448 GSM12448? ? ? ? normal? ? ? ? ? 4
4.3將GDS轉(zhuǎn)換為MAList
沒有注釋信息(由GEO稱為平臺信息),因?yàn)镋xpressionSet通常不包含基因信息的插槽。但是,很容易獲得這些信息。首先,我們需要知道這個GDS使用的平臺。然后,另一個電話getGEO會給我們提供我們需要的東西。
#get the platform from the GDS metadataMeta(gds)$platform
## [1] "GPL97"
#So use this information in a call to getGEOgpl <- getGEO(filename=system.file("extdata/GPL97.annot.gz",package="GEOquery"))
所以,gpl現(xiàn)在包含GEO的GPL5信息。與ExpressionSetlimma?不同,limma?MAList存儲基因注釋信息,因此我們可以在調(diào)用中使用我們新創(chuàng)建gpl的類GPL,GDS2MA如下所示:
MA <- GDS2MA(gds,GPL=gpl)class(MA)
## [1] "MAList"## attr(,"package")## [1] "limma"
現(xiàn)在,MA它MAList不僅包含數(shù)據(jù),還包含與GDS507相關(guān)的樣本信息和基因信息。
4.4將GSE轉(zhuǎn)換為ExpressionSet
首先,確保使用上面“將GSE系列矩陣文件作為表達(dá)式集獲取”部分中描述的方法來使用GSE Series Matrix文件不足以完成任務(wù),因?yàn)樗旄唵巍?/i>如果不是(即,需要來自每個GSM的其他列),則將需要該方法。
轉(zhuǎn)換GSE對象到ExpressionSet對象目前采用比特的R數(shù)據(jù)操縱由于可存儲在所述變化數(shù)據(jù)GSE和底層GSM和GPL對象。但是,使用一個簡單的例子有望說明該技術(shù)。
首先,我們需要確保所有這些GSMs都來自同一平臺:
gsmplatforms <- lapply(GSMList(gse),function(x) {Meta(x)$platform_id})head(gsmplatforms)
## $GSM11805## [1] "GPL96"#### $GSM11810## [1] "GPL97"#### $GSM11814## [1] "GPL96"#### $GSM11815## [1] "GPL97"#### $GSM11823## [1] "GPL96"#### $GSM11827## [1] "GPL97"
實(shí)際上,有兩個GPL,GPL96和GPL97,作為他們的平臺(我們可以通過查看GPLList來確定gse)。我們可以過濾原始GSMList以僅包含具有GPL96平臺的那些GSM并使用該列表進(jìn)行進(jìn)一步處理
gsmlist = Filter(function(gsm) {Meta(gsm)$platform_id=='GPL96'},GSMList(gse))length(gsmlist)
## [1] 17
所以,現(xiàn)在我們想知道哪個列代表我們想要提取的數(shù)據(jù)。查看單個GSM表的前幾行可能會給我們一個想法(順便說一句,GEO使用一種慣例,即每個數(shù)組包含單個測量的VALUE列稱為列,如果我們可以使用,我們不知道其他哪一欄最相關(guān))。
##? ? ? ? ? ID_REF? VALUE ABS_CALL## 1 AFFX-BioB-5_at? 953.9? ? ? ? P## 2 AFFX-BioB-M_at 2982.8? ? ? ? P## 3 AFFX-BioB-3_at 1657.9? ? ? ? P## 4 AFFX-BioC-5_at 2652.7? ? ? ? P## 5 AFFX-BioC-3_at 2019.5? ? ? ? P
# and get the column descriptionsColumns(gsmlist[[1]])[1:5,]
##? ? ? ? Column## 1? ? ? ID_REF## 2? ? ? VALUE## 3? ? ABS_CALL## NA? ? ? ## NA.1? ? ##? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Description## 1## 2? ? ? ? ? ? ? ? ? ? ? ? ? ? MAS 5.0 Statistical Algorithm (mean scaled to 500)## 3? ? MAS 5.0 Absent, Marginal, Present call? with Alpha1 = 0.05, Alpha2 = 0.065## NA? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ## NA.1? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
我們確實(shí)會使用這個VALUE專欄。然后我們想要制作這些值的矩陣,如下所示:
# get the probeset orderingprobesets <- Table(GPLList(gse)[[1]])$ID# make the data matrix from the VALUE columns from each GSM# being careful to match the order of the probesets in the platform# with those in the GSMsdata.matrix <- do.call('cbind',lapply(gsmlist,function(x){tab <- Table(x)mymatch <- match(probesets,tab$ID_REF)return(tab$VALUE[mymatch])? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }))data.matrix <- apply(data.matrix,2,function(x) {as.numeric(as.character(x))})data.matrix <- log2(data.matrix)data.matrix[1:5,]
##? ? ? GSM11805? GSM11814? GSM11823? GSM11830? GSM12067? GSM12075? GSM12079## [1,] 10.926963 11.105254 11.275019 11.438636 11.424376 11.222795 11.469845## [2,]? 5.749534? 7.908092? 7.093814? 7.514122? 7.901470? 6.407693? 5.165912## [3,]? 7.066089? 7.750205? 7.244126? 7.962896? 7.337176? 6.569856? 7.477354## [4,] 12.660353 12.479755 12.215897 11.458355 11.397568 12.529870 12.240046## [5,]? 6.195741? 6.061776? 6.565293? 6.583459? 6.877744? 6.652486? 3.981853##? ? ? GSM12098? GSM12100? GSM12105? GSM12268? GSM12270? GSM12283? GSM12298## [1,] 10.823367 10.835971 10.810893 11.062653 10.323055 11.181028 11.566387## [2,]? 6.556123? 8.207014? 6.816344? 6.563768? 7.353147? 5.770829? 6.912889## [3,]? 7.708739? 7.428779? 7.754888? 7.126188? 8.742815? 7.339850? 7.602142## [4,] 12.336534 11.762839 11.237509 12.412490 11.213408 12.678380 12.232901## [5,]? 5.501439? 6.247928? 6.017922? 6.525129? 6.683696? 5.918863? 5.837943##? ? ? GSM12300? GSM12399? GSM12444## [1,] 11.078151 11.535178 11.105450## [2,]? 4.812498? 7.471675? 7.488644## [3,]? 7.383704? 7.432959? 7.381110## [4,] 12.090939 11.421802 12.172834## [5,]? 6.281698? 5.419539? 5.469235
請注意,我們這樣做是match為了確保值和平臺信息的順序相同。最后,制作ExpressionSet對象:
require(Biobase)# go through the necessary steps to make a compliant ExpressionSetrownames(data.matrix) <- probesetscolnames(data.matrix) <- names(gsmlist)pdata <- data.frame(samples=names(gsmlist))rownames(pdata) <- names(gsmlist)pheno <- as(pdata,"AnnotatedDataFrame")eset2 <- new('ExpressionSet',exprs=data.matrix,phenoData=pheno)eset2
## ExpressionSet (storageMode: lockedEnvironment)## assayData: 22283 features, 17 samples##? element names: exprs## protocolData: none## phenoData##? sampleNames: GSM11805 GSM11814 ... GSM12444 (17 total)##? varLabels: samples##? varMetadata: labelDescription## featureData: none## experimentData: use 'experimentData(object)'## Annotation:
因此,使用lapplyGSMList?的組合,可以根據(jù)需要提取盡可能多的感興趣的列來構(gòu)建所選擇的數(shù)據(jù)結(jié)構(gòu)。因?yàn)閬碜訥EO網(wǎng)站的GSM數(shù)據(jù)被完全下載并包含在GSE對象中,所以例如可以提取雙通道陣列的前景和背景以及質(zhì)量。獲取數(shù)組注釋也有點(diǎn)復(fù)雜,但通過在lapply調(diào)用中替換“platform”來獲取每個數(shù)組的平臺信息,可以獲得與每個數(shù)組相關(guān)的其他信息。
5從GEO訪問原始數(shù)據(jù)
NCBI GEO接受(但并非總是需要)原始數(shù)據(jù),如.CEL文件,.CDF文件,圖像等。有時,快速訪問此類數(shù)據(jù)很有用。單個函數(shù)getGEOSuppFiles可以將GEO登錄作為參數(shù),并將下載與該登錄關(guān)聯(lián)的所有原始數(shù)據(jù)。默認(rèn)情況下,該函數(shù)將在當(dāng)前工作目錄中創(chuàng)建一個目錄,以存儲所選GEO登錄的原始數(shù)據(jù)。結(jié)合簡單的sapply語句或其他循環(huán)結(jié)構(gòu),getGEOSuppFiles可以非常簡單地快速輕松地獲取原始數(shù)據(jù),而無需了解GEO原始數(shù)據(jù)URL的具體信息。
6個用例
GEOquery可以非常強(qiáng)大,可以快速收集大量數(shù)據(jù)。一些示例可用于說明如何為數(shù)據(jù)挖掘目的進(jìn)行此操作。
6.1獲取給定平臺的所有系列記錄
出于數(shù)據(jù)挖掘的目的,有時能夠?yàn)榻o定平臺提取所有GSE記錄。GEOquery使這很容易,但是開始時需要對GPL記錄有一點(diǎn)了解。GPL記錄包含引用它的GSE和GSM加入。一些代碼有助于說明這一點(diǎn):
gpl97 <- getGEO('GPL97')Meta(gpl97)$title
## [1] "[HG-U133B] Affymetrix Human Genome U133B Array"
## [1] "GSE362" "GSE473" "GSE620" "GSE674" "GSE781" "GSE907"
## [1] 163
## [1] "GSM3922" "GSM3924" "GSM3926" "GSM3928" "GSM3930" "GSM3932"
## [1] 7877
上面的代碼將GPL97記錄加載到R.Meta方法從GPL記錄中提取標(biāo)題信息列表。在title給該平臺的人的名字。在series_id給出一系列ID的向量。請注意,此平臺有163個系列和7877個樣本。可以使用以下代碼下載所有樣本或系列。我只展示前5個樣本作為例子:
gsmids <- Meta(gpl97)$sample_idgsmlist <- sapply(gsmids[1:5],getGEO)names(gsmlist)
## [1] "GSM3922" "GSM3924" "GSM3926" "GSM3928" "GSM3930"
7結(jié)論
GEOquery包為NCBI GEO存儲庫中包含的大量陣列資源提供了橋梁。通過保持GEO數(shù)據(jù)的豐富性而不是僅僅關(guān)注“數(shù)字”,可以將GEO數(shù)據(jù)集成到當(dāng)前的Bioconductor數(shù)據(jù)結(jié)構(gòu)中,并且可以非常快速,輕松地對該數(shù)據(jù)進(jìn)行分析。希望這些工具能夠更全面地向陣列社區(qū)開放GEO數(shù)據(jù)。
7.1引用GEOquery
如果用于支持您自己的研究,請考慮引用GEOquery:
#### Please cite the following if utilizing the GEOquery software:####? Davis, S. and Meltzer, P. S. GEOquery: a bridge between the Gene##? Expression Omnibus (GEO) and BioConductor. Bioinformatics, 2007,##? 14, 1846-1847#### A BibTeX entry for LaTeX users is####? @Article{,##? ? author = {Sean Davis and Paul Meltzer},##? ? title = {GEOquery: a bridge between the Gene Expression Omnibus (GEO) and BioConductor},##? ? journal = {Bioinformatics},##? ? year = {2007},##? ? volume = {14},##? ? pages = {1846--1847},##? }
7.2報(bào)告問題或錯誤
如果您在使用GEOquery時遇到問題,Bioconductor支持網(wǎng)站是尋求幫助的第一個好地方。如果您確信GEOquery中存在錯誤(這是非常不尋常的,但并非聞所未聞),請隨時在GEOquery github站點(diǎn)上提交問題或直接從R提交錯誤報(bào)告(將打開一個新的github問題) :
bug.report(package='GEOquery')
8會話信息
以下包和版本用于制作此插圖。
## R version 3.5.0 (2018-04-23)## Platform: x86_64-pc-linux-gnu (64-bit)## Running under: Ubuntu 16.04.4 LTS#### Matrix products: default## BLAS: /home/biocbuild/bbs-3.7-bioc/R/lib/libRblas.so## LAPACK: /home/biocbuild/bbs-3.7-bioc/R/lib/libRlapack.so#### locale:##? [1] LC_CTYPE=en_US.UTF-8? ? ? LC_NUMERIC=C##? [3] LC_TIME=en_US.UTF-8? ? ? ? LC_COLLATE=C##? [5] LC_MONETARY=en_US.UTF-8? ? LC_MESSAGES=en_US.UTF-8##? [7] LC_PAPER=en_US.UTF-8? ? ? LC_NAME=C##? [9] LC_ADDRESS=C? ? ? ? ? ? ? LC_TELEPHONE=C## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C#### attached base packages:## [1] parallel? stats? ? graphics? grDevices utils? ? datasets? methods## [8] base#### other attached packages:## [1] GEOquery_2.48.0? ? Biobase_2.40.0? ? ? BiocGenerics_0.26.0## [4] knitr_1.20#### loaded via a namespace (and not attached):##? [1] Rcpp_0.12.16? ? xml2_1.2.0? ? ? bindr_0.1.1? ? ? magrittr_1.5##? [5] hms_0.4.2? ? ? ? R6_2.2.2? ? ? ? rlang_0.2.0? ? ? stringr_1.3.0##? [9] dplyr_0.7.4? ? ? tools_3.5.0? ? ? htmltools_0.3.6? yaml_2.1.18## [13] rprojroot_1.3-2? digest_0.6.15? ? assertthat_0.2.0 tibble_1.4.2## [17] bindrcpp_0.2.2? purrr_0.2.4? ? ? tidyr_0.8.0? ? ? readr_1.1.1## [21] curl_3.2? ? ? ? glue_1.2.0? ? ? evaluate_0.10.1? rmarkdown_1.9## [25] limma_3.36.0? ? stringi_1.1.7? ? compiler_3.5.0? pillar_1.2.2## [29] backports_1.1.2? pkgconfig_2.0.1