STRINGDB包的簡單使用

String是一個很好的蛋白互作網(wǎng)絡(luò)數(shù)據(jù)庫,其不僅包含了直接物理作用的互作關(guān)系,還包含了蛋白之間以間接作用的互作關(guān)系。除了有實(shí)驗(yàn)證據(jù)支持的數(shù)據(jù)外,還有整合其他數(shù)據(jù)庫中的互作數(shù)據(jù)以及利用生物信息學(xué)預(yù)測獲得的互作數(shù)據(jù)。 官網(wǎng)網(wǎng)址:https://string-db.org/

從網(wǎng)址上可看出其提供了一個比較友好的界面可供大家使用,可根據(jù)需求輸入不同的protein name or protein sequence。String網(wǎng)站還提供了互作信息的數(shù)據(jù)庫可供大家下載DOWNLOAD,如果當(dāng)你需要處理N組數(shù)據(jù)時,將數(shù)據(jù)庫下載到本地進(jìn)行計(jì)算是一個不錯的選擇。

但是如果想避免下載數(shù)據(jù)庫又要獲得多組數(shù)據(jù)的互作信息,那么使用StringDB這個R包是一個不錯的選擇。The STRINGdb package provides a R interface to the STRING protein-protein interactions database (http://www.string-db.org),從這個介紹可看出,StringDB包就是連接String網(wǎng)站的數(shù)據(jù)庫進(jìn)行蛋白互作網(wǎng)絡(luò)分析的,這個R包半年更新一次,基本上也跟String數(shù)據(jù)庫的更新速度差不多,所以數(shù)據(jù)的實(shí)時性還是有保證的,下面簡單介紹下StringDB包的使用

安裝R包

source("https://bioconductor.org/biocLite.R")
biocLite("STRINGdb")

簡單使用

StringDB包將其所有函數(shù)都放在了string_db對象里面,所以可用(符號來調(diào)用函數(shù),如用STRINGdb\)methods()查看包中的所有函數(shù):

> STRINGdb$methods()
 [1] ".objectPackage"                      ".objectParent"                      
 [3] "add_diff_exp_color"                  "add_proteins_description"           
 [5] "benchmark_ppi"                       "benchmark_ppi_pathway_view"         
 [7] "callSuper"                           "copy"                               
 [9] "enrichment_heatmap"                  "export"                             
[11] "field"                               "get_aliases"                        
[13] "get_annotations"                     "get_annotations_desc"               
[15] "get_bioc_graph"                      "get_clusters"                       
[17] "get_enrichment"                      "get_graph"                          
[19] "get_homologs"                        "get_homologs_besthits"              
[21] "get_homology_graph"                  "get_interactions"                   
[23] "get_link"                            "get_neighbors"                      
[25] "get_pathways_benchmarking_blackList" "get_png"                            
[27] "get_ppi_enrichment"                  "get_ppi_enrichment_full"            
[29] "get_proteins"                        "get_pubmed"                         
[31] "get_pubmed_interaction"              "get_subnetwork"                     
[33] "get_summary"                         "get_term_proteins"                  
[35] "getClass"                            "getRefClass"                        
[37] "import"                              "initFields"                         
[39] "initialize"                          "load"                               
[41] "load_all"                            "map"                                
[43] "mp"                                  "plot_network"                       
[45] "plot_ppi_enrichment"                 "post_payload"                       
[47] "remove_homologous_interactions"      "set_background"                     
[49] "show"                                "show#envRefClass"                   
[51] "trace"                               "untrace"                            
[53] "usingMethods"                       

由于沒有幫助文檔,所以不能用?help來查看函數(shù)用法,但可用STRINGdb$help("map")來查看map函數(shù)的介紹及說明:

> STRINGdb$help("map")
Call:
$map(my_data_frame, my_data_frame_id_col_names, takeFirst = , removeUnmappedRows = , quiet = )

Description:
  Maps the gene identifiers of the input dataframe to STRING identifiers.
  It returns the input dataframe with the "STRING_id" additional column.

Input parameters:
  "my_data_frame"                 data frame provided as input. 
  "my_data_frame_id_col_names"    vector contatining the names of the columns of "my_data_frame" that have to be used for the mapping.
  "takeFirst"                     boolean indicating what to do in case of multiple STRING proteins that map to the same name. 
                                      If TRUE, only the first of those is taken. Otherwise all of them are used. (default TRUE)
  "removeUnmappedRows"            remove the rows that cannot be mapped to STRING 
                                      (by default those lines are left and their STRING_id is set to NA)
  "quiet"                         Setting this variable to TRUE we can avoid printing the warning relative to the unmapped values.

Author(s):
   Andrea Franceschini

最后就是使用函數(shù)進(jìn)行蛋白互作網(wǎng)絡(luò)分析了,首先我們肯定需要一個用于分析的gene list,然后使用map函數(shù)將gene list 的id轉(zhuǎn)化為string id,stringDB包支持多種ID轉(zhuǎn)化,比如HUGO names,Entrez GeneID, ENSEMBL proteins, RefSeq transcripts等,雖然stringdb手冊中寫著是上述幾種,其他的似乎也行,比如我這次以ENSEMBL gene id為例,總共43個ensembl id

> head(data, 5)
              geneid
1 ENSRNOG00000050827
2 ENSRNOG00000011815
3 ENSRNOG00000061527
4 ENSRNOG00000049944
5 ENSRNOG00000016348

接著我們需要先構(gòu)建一個string_db對象

string_db <- STRINGdb$new(version = "10", species = 10116, score_threshold = 700, input_directory = "")

這里我為什么選擇version 10.0而不用最新的10.5呢,因?yàn)閟tringDB包現(xiàn)在只支持10.0的數(shù)據(jù)庫(2016年的)。。。原來用了才知道也不是最新跟官網(wǎng)同步的。。后面的score_threshold則是閾值卡分,string官網(wǎng)上也有這一步,700表示高可信度

然后使用map函數(shù)來做ID轉(zhuǎn)化,stringDB包會下載臨時的數(shù)據(jù)庫文件,所以需要聯(lián)網(wǎng)的,但是如果將R關(guān)閉,這些文件則會被刪除

data_mapped <- string_db$map(data, "geneid", removeUnmappedRows = TRUE)
Warning:  we couldn't map to STRING 11% of your identifiers

我用removeUnmappedRows參數(shù)設(shè)定了如果沒mapping上的id在最后結(jié)果中不顯示,最后43個ID有38個mapping上了,如下:

hit <- data_mapped$STRING_id
> length(hit)
[1] 38

再著我們將轉(zhuǎn)化后的string id進(jìn)行作圖,這是stringDB包還是需要下載string數(shù)據(jù)庫中的互作連接數(shù)據(jù),這個比較大,需要等待下的,然后簡單的使用plot_network函數(shù)作圖

string_db$plot_network(hit)

[圖片上傳失敗...(image-80fb0a-1629254616665)]

<figcaption>stringdb_pic</figcaption>

結(jié)果略尷尬,一個有互作關(guān)系的蛋白都沒,可能是我設(shè)置的可信度太高了,也有可能是因?yàn)榘姹静皇亲钚碌?。所以我也string官網(wǎng)也嘗試了下,45個ID有40個mapping上了,比stringDB包多2個。然后出圖,結(jié)果中有4條蛋白有互作關(guān)系,但是這時的默認(rèn)可信度是400(屬于中等可信度),但是當(dāng)我將可信度設(shè)置為700后,這2條互作信息就沒了。。??礃幼又皊tringdb包出的結(jié)果還是跟官網(wǎng)一樣的,只是我可信度設(shè)置過高了

image.png

用stringdb作圖后,stringdb還提供了一個小功能STRING payload mechanism,就是能根據(jù)基因表達(dá)的上下調(diào)信息對互作網(wǎng)絡(luò)圖上的點(diǎn)進(jìn)行標(biāo)注顏色,比如上調(diào)標(biāo)注為紅色,下調(diào)標(biāo)注為綠色。個人覺得這個不如用cytoscape軟件來實(shí)現(xiàn)比較好,但我們需要先從stringdb中將互作網(wǎng)絡(luò)的信息導(dǎo)出,所以我先將可信度重新設(shè)置為400,然后重置下string_db對象,結(jié)果顯示的互作關(guān)系比string官網(wǎng)的還多1條,這時只能用版本不同來解釋了,畢竟數(shù)據(jù)庫都是在更新的

info <- string_db$get_interactions(hit)
image.png

最后將info數(shù)據(jù)庫輸出到txt文件中,然后再導(dǎo)入cytoscape即可作圖了

Summary

Stringdb包還提供了聚類功能,可將復(fù)雜的互作網(wǎng)絡(luò)圖分割成幾個小塊(官網(wǎng)也有這個功能的),還有GO/KEGG富集功能(個人感覺其他的包做的更好,畢竟stringDB包只是基于string數(shù)據(jù)庫的,信息不夠全)。最后如果想用string數(shù)據(jù)庫最新數(shù)據(jù)的話,還是建議去官網(wǎng)使用,或者把官網(wǎng)的數(shù)據(jù)庫下載下來后自行用腳本進(jìn)行處理,但是如果不太建議數(shù)據(jù)的更新程度,stringDB包則是個不錯的選擇。

參考:
http://bioconductor.org/packages/release/bioc/vignettes/STRINGdb/inst/doc/STRINGdb.pdf
http://bioconductor.org/packages/release/bioc/html/STRINGdb.html

本文出自于http://www.bioinfo-scrounger.com轉(zhuǎn)載請注明出處

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容