HPAStainR

Tim O. Nieuwenhuis

2022-11-01

HPAStainR is a package designed to query the pathologist scored staining data of multiple proteins/genes at once in the Human Protein Atlas (HPA). This vignette will walk you through:

How to install HPAStainR

Installation can be completed using BiocManager and the code below.

if(!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("HPAStainR")

Preparing data for HPAStainR

Downloading data from the website

The first step required to run HPAStainR is downloading HPA’s normal tissue staining data and their cancer data. While available online, HPAStainR has a function that can download and load the data for you.

The above function has downloaded both normal tissue and cancer data. save_file was set to FALSE, but if it were set to TRUE as there was no given argument for save location, both files being saved to the current working directory. The data has also been unzipped and loaded into the object HPA_dat as a list of data frames called hpa_dat and cancer_dat which hold the normal tissue and cancer tissue data respectively. If the code is run again it would redownload the files unless you had set save_file to TRUE, in which case it would just load said saved files.

Head of normal tissue

Gene Gene.name Tissue Cell.type Level Reliability
ENSG00000000003 TSPAN6 adipose tissue adipocytes Not detected Approved
ENSG00000000003 TSPAN6 adrenal gland glandular cells Not detected Approved
ENSG00000000003 TSPAN6 appendix glandular cells Medium Approved
ENSG00000000003 TSPAN6 appendix lymphoid tissue Not detected Approved
ENSG00000000003 TSPAN6 bone marrow hematopoietic cells Not detected Approved
ENSG00000000003 TSPAN6 breast adipocytes Not detected Approved
ENSG00000000003 TSPAN6 breast glandular cells High Approved
ENSG00000000003 TSPAN6 breast myoepithelial cells Not detected Approved
ENSG00000000003 TSPAN6 bronchus respiratory epithelial cells High Approved
ENSG00000000003 TSPAN6 caudate glial cells Not detected Approved

Head of cancer tissue (columns 1-7)

Gene Gene.name Cancer High Medium Low Not.detected
ENSG00000000003 TSPAN6 breast cancer 1 7 2 2
ENSG00000000003 TSPAN6 carcinoid 0 1 1 2
ENSG00000000003 TSPAN6 cervical cancer 11 1 0 0
ENSG00000000003 TSPAN6 colorectal cancer 0 6 2 2
ENSG00000000003 TSPAN6 endometrial cancer 10 2 0 0
ENSG00000000003 TSPAN6 glioma 0 0 0 11
ENSG00000000003 TSPAN6 head and neck cancer 0 3 1 0
ENSG00000000003 TSPAN6 liver cancer 4 5 1 0
ENSG00000000003 TSPAN6 lung cancer 8 4 0 0
ENSG00000000003 TSPAN6 lymphoma 0 0 0 11

The hpar package as a version controlled alternative

HPA_data_downloader provides the most up to date information on the Human Protein Atlas website. However for more consistent results with version control, feel free to use the data from the hpar BioConductor package using the following commands.

Head of hpar’s normal tissue

Gene Gene.name Tissue Cell.type Level Reliability
ENSG00000000003 TSPAN6 adipose tissue adipocytes Not detected Approved
ENSG00000000003 TSPAN6 adrenal gland glandular cells Not detected Approved
ENSG00000000003 TSPAN6 appendix glandular cells Medium Approved
ENSG00000000003 TSPAN6 appendix lymphoid tissue Not detected Approved
ENSG00000000003 TSPAN6 bone marrow hematopoietic cells Not detected Approved
ENSG00000000003 TSPAN6 breast adipocytes Not detected Approved
ENSG00000000003 TSPAN6 breast glandular cells High Approved
ENSG00000000003 TSPAN6 breast myoepithelial cells Not detected Approved
ENSG00000000003 TSPAN6 bronchus respiratory epithelial cells High Approved
ENSG00000000003 TSPAN6 caudate glial cells Not detected Approved

Using HPAStainR

Using the HPAStainR function

Now that the data is available you can now us the HPAStainR function. This requires a list of proteins or genes you are interested in. In this example, we’re going to use pancreatic enzymes PRSS1, PNLIP, CELA3A, and the hormone PRL.

The output of HPAStainR is a tibble with multiple columns. The basic columns include the following:

The staining score an arbitrary rank of staining weighted on how highly a protein stained. See the manual for the equation and further information.

Using the HPAStainR Shiny app

Another way to use HPAStainR is as a Shiny app, and the function shiny_HPAStainR allows you to run a local version of the app:

Note: If you want the tab from the online Shiny that gives you the stained : tested ratio of proteins, make sure to run the below code and insert the resulting object in the third argument (cell_type_data) of shiny_HPAStainR

hpa_summary <- HPA_summary_maker(hpa_dat = HPA_data$hpa_dat)

Run the Shiny app

A window should open like that below

Shiny Output You should now be able to query whatever list of proteins you like and can easily rank them on whatever column you wish. Also all of the options from the functions are modifiable on the left hand side panel.

Session Info

sessionInfo()
#> R version 4.2.1 (2022-06-23)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.5 LTS
#> 
#> Matrix products: default
#> BLAS:   /home/biocbuild/bbs-3.16-bioc/R/lib/libRblas.so
#> LAPACK: /home/biocbuild/bbs-3.16-bioc/R/lib/libRlapack.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_GB              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] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] HPAStainR_1.8.0 tidyr_1.2.1     dplyr_1.0.10   
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.9        highr_0.9         pillar_1.8.1      bslib_0.4.0      
#>  [5] compiler_4.2.1    later_1.3.0       jquerylib_0.1.4   tools_4.2.1      
#>  [9] digest_0.6.30     jsonlite_1.8.3    evaluate_0.17     lifecycle_1.0.3  
#> [13] tibble_3.1.8      pkgconfig_2.0.3   rlang_1.0.6       shiny_1.7.3      
#> [17] cli_3.4.1         DBI_1.1.3         yaml_2.3.6        xfun_0.34        
#> [21] fastmap_1.1.0     withr_2.5.0       stringr_1.4.1     knitr_1.40       
#> [25] generics_0.1.3    vctrs_0.5.0       sass_0.4.2        tidyselect_1.2.0 
#> [29] data.table_1.14.4 glue_1.6.2        R6_2.5.1          fansi_1.0.3      
#> [33] rmarkdown_2.17    hpar_1.40.0       purrr_0.3.5       magrittr_2.0.3   
#> [37] scales_1.2.1      ellipsis_0.3.2    promises_1.2.0.1  htmltools_0.5.3  
#> [41] assertthat_0.2.1  colorspace_2.0-3  xtable_1.8-4      mime_0.12        
#> [45] httpuv_1.6.6      utf8_1.2.2        stringi_1.7.8     munsell_0.5.0    
#> [49] cachem_1.0.6

Any questions? Feel free to contact me at tnieuwe1[@]jhmi.edu