美文网首页ggplot集锦
使用R包探索HPA数据库

使用R包探索HPA数据库

作者: 一只烟酒僧 | 来源:发表于2020-06-07 22:15 被阅读0次

参考文章:HPAanalyze: an R package that facilitates the retrieval and analysis of the Human Protein Atlas data
参考说明书:http://www.bioconductor.org/packages/release/bioc/html/HPAanalyze.html
原R包一共分为三大主要功能
1、对HPA数据库数据进行下载:hpaDownload()
2、对上述下载的内容进行可视化:hpaVis()家族
3、对单个基因的图片及样本信息进行下载:hpaXml()家族
基于我目前本身的使用需求,这里只说明通过hpaXml下载某个基因在不同组织的IHC图,其它功能可以参考原文献或者说明书学习

######################################################## 
#-------------------------------------------------------
# Topic:HPAanalysis 练习使用
# Author:Wang Haiquan
# Date:Sun Jun  7 21:00:21 2020
# Mail:mg1835020@smail.nju.edu.cn
#-------------------------------------------------------
########################################################

library(BiocStyle)
library(HPAanalyze)
library(dplyr)
library(tibble)
library(readr)
library(tidyr)
#
dir.create("img")
gene="PRM1"
tissue="Testis"
#获得HPA网站中该基因的xml文件
hpa_target_gene<-hpaXmlGet(gene)
#将xml中组织染色的信息提取出来
hpa_target_gene_fig_url<-hpaXmlTissueExpr(hpa_target_gene)
hpa_target_gene_fig_url<-as.data.frame(hpa_target_gene_fig_url[[1]])
hpa_target_gene_fig_url[1:6,1:18]
#选择自己感兴趣的组织
hpa_target_gene_fig_url<-hpa_target_gene_fig_url[hpa_target_gene_fig_url$tissueDescription2==tissue,]
#为该组织该基因单独建个文件夹储存
dir.create(paste(gene,tissue,"IHC",sep = "_"))
setwd(paste(gene,tissue,"IHC",sep = "_"))
for (i in 1:nrow(hpa_target_gene_fig_url)) {
  file_url<-hpa_target_gene_fig_url$imageUrl[i]
  file_dir<-paste(gene,tissue,hpa_target_gene_fig_url$patientId[i],hpa_target_gene_fig_url$tissueDescription1[i],hpa_target_gene_fig_url$tissueDescription2[i],".png",sep = "_")
  download.file(url = file_url,destfile = file_dir,mode = "wb")
}
#最后保存图片的所有信息
write.csv(hpa_target_gene_fig_url,paste(gene,"IHC_result_tab.csv",sep = "_"))

HPA数据库也会提供一些统计信息,可以从中找一些组织的marker等,而且下载速度很快,比如筛选一些分泌蛋白的基因集等。
数据下载链接:https://www.proteinatlas.org/about/download

查询分泌的蛋白的另外两种方法
1、基于一篇文章:Construction and Screening of a Lentiviral Secretome Library
2、基于uniprot数据库

相关文章

网友评论

    本文标题:使用R包探索HPA数据库

    本文链接:https://www.haomeiwen.com/subject/ebwhtktx.html