Introduction

The goal of the rpx package is to provide programmatic access to proteomics data from R, in particular to the ProteomeXchange (PX) central repository (see http://www.proteomexchange.org/ and http://central.proteomexchange.org/).

Vizcaino J.A. et al. ProteomeXchange: globally co-ordinated proteomics data submission and dissemination, Nature Biotechnology 2014, 32, 223 – 226, doi:10.1038/nbt.2839.

Additional repositories are likely to be added in the future.

The rpx package

PXDataset objects

The central object that handles data access is the PXDataset class. Such an instance can be generated by passing a valid PX experiment identifier to the PXDataset constructor.

library("rpx")
id <- "PXD000001"
px <- PXDataset(id)
px
## Object of class "PXDataset"
##  Id: PXD000001 with 12 files
##  [1] 'F063721.dat' ... [12] 'generated'
##  Use 'pxfiles(.)' to see all files.

Data and meta-data

Several attributes can be extracted from an PXDataset instance, as described below.

The experiment identifier, that was originally used to create the \Robject{PXDataset} instance can be extracted with the \Rfunction{pxid} method:

pxid(px)
## [1] "PXD000001"

The file transfer url where the data files can be accessed can be queried with the pxurl method:

pxurl(px)
## [1] "ftp://ftp.pride.ebi.ac.uk/pride/data/archive/2012/03/PXD000001"

The species the data has been generated the data can be obtain calling the pxtax function:

pxtax(px)
## [1] "Erwinia carotovora"

Relevant bibliographic references can be queried with the pxref method:

strwrap(pxref(px))
## [1] "Gatto L, Christoforou A. Using R and Bioconductor for proteomics"
## [2] "data analysis. Biochim Biophys Acta. 2014 1844(1 pt a):42-51"

All files available for the PX experiment can be obtained with the pxfiles method:

pxfiles(px)
##  [1] "F063721.dat"                                                         
##  [2] "F063721.dat-mztab.txt"                                               
##  [3] "PRIDE_Exp_Complete_Ac_22134.xml.gz"                                  
##  [4] "PRIDE_Exp_mzData_Ac_22134.xml.gz"                                    
##  [5] "PXD000001_mztab.txt"                                                 
##  [6] "README.txt"                                                          
##  [7] "TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzML" 
##  [8] "TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzXML"
##  [9] "TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzXML"         
## [10] "TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.raw"           
## [11] "erwinia_carotovora.fasta"                                            
## [12] "generated"

The complete or partial data set can be downloaded with the pxget function. The function takes an instance of class PXDataset as first mandatory argument.

The next argument, list, specifies what files to download. If missing, a menu is printed and the user can select a file. If set to "all", all files of the experiment are downloaded in the working directory. Alternatively, numerics or logicals can also be used to subset the relevant files to be downloaded based on the pxfiles(.) output.

The last argument, force, can be set to TRUE to force the download of files that already exists in the working directory.

pxget(px, "erwinia_carotovora.fasta")
## Downloading 1 file
dir(pattern = "fasta")
## [1] "erwinia_carotovora.fasta"

By default, pxget will not download and overwrite a file if already available. The last argument of pxget, force, can be set to TRUE to force the download of files that already exists in the working directory.

(i <- grep("fasta", pxfiles(px)))
## [1] 11
pxget(px, i) ## same as above
## Downloading 1 file
## /tmp/Rtmpjr4Jit/Rbuild3a036981f3e3/rpx/vignettes/erwinia_carotovora.fasta already present.

Finally, a list of recent PX additions and updates can be obtained using the pxannounced() function:

pxannounced()
## 15 new ProteomeXchange annoucements
##     Data.Set    Publication.Data             Message
## 1  PXD010977 2019-04-22 04:24:22                 New
## 2  PXD013582 2019-04-22 02:44:54                 New
## 3  PXD008315 2019-04-19 15:00:07                 New
## 4  PXD012669 2019-04-19 07:30:39 Updated information
## 5  PXD006396 2019-04-19 07:30:34 Updated information
## 6  PXD012147 2019-04-18 17:46:45                 New
## 7  PXD013383 2019-04-18 16:49:41                 New
## 8  PXD006396 2019-04-18 16:35:32                 New
## 9  PXD009543 2019-04-18 15:11:22                 New
## 10 PXD009543 2019-04-18 15:11:24                 New
## 11 PXD012669 2019-04-18 14:48:47                 New
## 12 PXD012693 2019-04-18 14:47:23                 New
## 13 PXD009938 2019-04-18 14:30:36                 New
## 14 PXD009365 2019-04-18 14:07:33                 New
## 15 PXD013405 2019-04-18 13:49:56                 New

A simple use-case

Below, we show how to automate the extraction of files of interest (fasta and mzTab files), download them and read them using appropriate Bioconductor infrastructure. (Note that we read version 0.9 of the MzTab format below. For recent data, the version argument would be omitted.)

(mzt <- grep("F0.+mztab", pxfiles(px), value = TRUE))
## [1] "F063721.dat-mztab.txt"
(fas <- grep("fasta", pxfiles(px), value = TRUE))
## [1] "erwinia_carotovora.fasta"
pxget(px, c(mzt, fas))
## Downloading 2 files
## /tmp/Rtmpjr4Jit/Rbuild3a036981f3e3/rpx/vignettes/erwinia_carotovora.fasta already present.
library("Biostrings")
readAAStringSet(fas)
##   A AAStringSet instance of length 4499
##        width seq                                       names               
##    [1]   147 MADITLISGSTLGSAEYVA...QIPEDPAEEWLGSWVNLLK ECA0001 putative ...
##    [2]   153 VAEIYQIDNLDRGILSALM...QSTETLISLQNPIMRTIAP ECA0002 AsnC-fami...
##    [3]   330 MKKQYIEKQQQISFVKSFF...QVQCGVWPQPLRESVSGLL ECA0003 putative ...
##    [4]   492 MITLESLEMLLSIDENELL...FDTGLKSRLMRRWQHGKAY ECA0004 conserved...
##    [5]   499 MRQTAALAERISRLSHALE...IEASLQQVAEQIQQSEQQD ECA0005 conserved...
##    ...   ... ...
## [4495]   634 MSDKIIHLTDDSFDTDVLK...KVDPLRVFASDMARRLELL trx-rv3790 trx-rv...
## [4496]    93 MTKMNNKARRTARELKHLG...LRDEFPMGYLGDYKDDDDK TimBlower TimBlower
## [4497]   309 MFSNLSKRWAQRTLSKSFY...KWAGIKTRKFVFNPPKPRK sp|P07143|CY1_YEA...
## [4498]   231 FPTDDDDKIVGGYTCAANS...VYTKVCNYVNWIQQTIAAN sp|P00761|TRYP_PI...
## [4499]   269 GVSGSCNIDVVCPEGNGHR...AGTGAQFIDGLDSTGTPPV sp|Q7M135|LYSC_LY...
library("MSnbase")
(x <- readMzTabData(mzt, "PEP", version = "0.9"))
## MSnSet (storageMode: lockedEnvironment)
## assayData: 1528 features, 6 samples 
##   element names: exprs 
## protocolData: none
## phenoData
##   sampleNames: sub[1] sub[2] ... sub[6] (6 total)
##   varLabels: abundance
##   varMetadata: labelDescription
## featureData
##   featureNames: 1 2 ... 1528 (1528 total)
##   fvarLabels: sequence accession ... uri (14 total)
##   fvarMetadata: labelDescription
## experimentData: use 'experimentData(object)'
## Annotation:  
## - - - Processing information - - -
## mzTab read: Mon Apr 22 20:44:26 2019 
##  MSnbase version: 2.9.5
head(exprs(x))
##     sub[1]   sub[2]   sub[3]   sub[4]   sub[5]   sub[6]
## 1 10630132 11238708 12424917 10997763  9928972 10398534
## 2 11105690 12403253 13160903 12229367 11061660 10131218
## 3  1183431  1322371  1599088  1243715  1306602  1159064
## 4  5384958  5508454  6883086  6136023  5626680  5213771
## 5 18033537 17926487 21052620 19810368 17381162 17268329
## 6  9873585 10299931 11142071 10258214  9664315  9518271
head(fData(x)[, 1:2])
##    sequence accession
## 1   DGVSVAR   ECA0625
## 2    NVVLDK   ECA0625
## 3 VEDALHATR   ECA0625
## 4 LAGGVAVIK   ECA0625
## 5  LIAEAMEK   ECA0625
## 6 SFGAPTITK   ECA0625

Questions and help

Eithe post questions on the Bioconductor support forum or open a GitHub issue.

Session information

sessionInfo()
## R version 3.6.0 beta (2019-04-14 r76394)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.2 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.9-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.9-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] stats4    parallel  stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] rpx_1.19.3          MSnbase_2.9.5       ProtGenerics_1.15.0
##  [4] mzR_2.17.4          Rcpp_1.0.1          Biobase_2.43.1     
##  [7] Biostrings_2.51.5   XVector_0.23.2      IRanges_2.17.5     
## [10] S4Vectors_0.21.23   BiocGenerics_0.29.2 BiocStyle_2.11.0   
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_0.2.5      xfun_0.6              purrr_0.3.2          
##  [4] lattice_0.20-38       colorspace_1.4-1      htmltools_0.3.6      
##  [7] yaml_2.2.0            vsn_3.51.0            XML_3.98-1.19        
## [10] rlang_0.3.4           pillar_1.3.1          glue_1.3.1           
## [13] BiocParallel_1.17.19  affy_1.61.0           affyio_1.53.0        
## [16] foreach_1.4.4         plyr_1.8.4            mzID_1.21.1          
## [19] stringr_1.4.0         zlibbioc_1.29.0       munsell_0.5.0        
## [22] pcaMethods_1.75.1     gtable_0.3.0          codetools_0.2-16     
## [25] evaluate_0.13         knitr_1.22            doParallel_1.0.14    
## [28] curl_3.3              preprocessCore_1.45.0 scales_1.0.0         
## [31] BiocManager_1.30.4    limma_3.39.17         impute_1.57.0        
## [34] ggplot2_3.1.1         digest_0.6.18         stringi_1.4.3        
## [37] dplyr_0.8.0.1         ncdf4_1.16.1          grid_3.6.0           
## [40] bitops_1.0-6          tools_3.6.0           magrittr_1.5         
## [43] RCurl_1.95-4.12       lazyeval_0.2.2        tibble_2.1.1         
## [46] crayon_1.3.4          pkgconfig_2.0.2       MASS_7.3-51.4        
## [49] xml2_1.2.0            assertthat_0.2.1      rmarkdown_1.12       
## [52] iterators_1.0.10      R6_2.4.0              MALDIquant_1.19.2    
## [55] compiler_3.6.0