HPAStainR

Tim O. Nieuwenhuis

2021-11-28

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.1.2 (2021-11-01)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.3 LTS
#> 
#> Matrix products: default
#> BLAS:   /home/biocbuild/bbs-3.14-bioc/R/lib/libRblas.so
#> LAPACK: /home/biocbuild/bbs-3.14-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.4.1 tidyr_1.1.4     dplyr_1.0.7    
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.7        highr_0.9         pillar_1.6.4      bslib_0.3.1      
#>  [5] compiler_4.1.2    later_1.3.0       jquerylib_0.1.4   tools_4.1.2      
#>  [9] digest_0.6.28     jsonlite_1.7.2    evaluate_0.14     lifecycle_1.0.1  
#> [13] tibble_3.1.6      pkgconfig_2.0.3   rlang_0.4.12      cli_3.1.0        
#> [17] shiny_1.7.1       DBI_1.1.1         yaml_2.2.1        xfun_0.28        
#> [21] fastmap_1.1.0     stringr_1.4.0     knitr_1.36        generics_0.1.1   
#> [25] vctrs_0.3.8       sass_0.4.0        tidyselect_1.1.1  data.table_1.14.2
#> [29] glue_1.5.0        R6_2.5.1          fansi_0.5.0       rmarkdown_2.11   
#> [33] hpar_1.36.0       purrr_0.3.4       magrittr_2.0.1    scales_1.1.1     
#> [37] promises_1.2.0.1  ellipsis_0.3.2    htmltools_0.5.2   assertthat_0.2.1 
#> [41] colorspace_2.0-2  xtable_1.8-4      mime_0.12         httpuv_1.6.3     
#> [45] utf8_1.2.2        stringi_1.7.5     munsell_0.5.0     crayon_1.4.2

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