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/RtmpwaR8UX/Rbuild62e16f3a1ea2/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  PXD011575 2019-01-04 08:33:25                 New
## 2  PXD010930 2019-01-03 21:03:33                 New
## 3  PXD010931 2019-01-03 21:01:07                 New
## 4  PXD012198 2019-01-03 20:58:23                 New
## 5  PXD006895 2019-01-03 20:54:52                 New
## 6  PXD008418 2019-01-03 10:28:49 Updated information
## 7  PXD010120 2019-01-03 10:28:32 Updated information
## 8  PXD011019 2019-01-03 10:28:16 Updated information
## 9  PXD008151 2019-01-03 10:27:55 Updated information
## 10 PXD003930 2019-01-03 10:26:52 Updated information
## 11 PXD011320 2019-01-03 10:26:22                 New
## 12 PXD011306 2019-01-03 10:21:40                 New
## 13 PXD010036 2019-01-03 10:12:45                 New
## 14 PXD012223 2019-01-03 04:25:58                 New
## 15 PXD007523 2019-01-02 21:24:20                 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/RtmpwaR8UX/Rbuild62e16f3a1ea2/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: Fri Jan  4 20:07:53 2019 
##  MSnbase version: 2.8.3
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.5.2 (2018-12-20)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 16.04.5 LTS
## 
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.8-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.8-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.18.1          MSnbase_2.8.3       ProtGenerics_1.14.0
##  [4] mzR_2.16.1          Rcpp_1.0.0          Biobase_2.42.0     
##  [7] Biostrings_2.50.2   XVector_0.22.0      IRanges_2.16.0     
## [10] S4Vectors_0.20.1    BiocGenerics_0.28.0 BiocStyle_2.10.0   
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_0.2.5      xfun_0.4              purrr_0.2.5          
##  [4] lattice_0.20-38       colorspace_1.3-2      htmltools_0.3.6      
##  [7] yaml_2.2.0            vsn_3.50.0            XML_3.98-1.16        
## [10] rlang_0.3.0.1         pillar_1.3.1          glue_1.3.0           
## [13] BiocParallel_1.16.5   affy_1.60.0           bindrcpp_0.2.2       
## [16] affyio_1.52.0         foreach_1.4.4         plyr_1.8.4           
## [19] bindr_0.1.1           mzID_1.20.1           stringr_1.3.1        
## [22] zlibbioc_1.28.0       munsell_0.5.0         pcaMethods_1.74.0    
## [25] gtable_0.2.0          codetools_0.2-16      evaluate_0.12        
## [28] knitr_1.21            doParallel_1.0.14     curl_3.2             
## [31] preprocessCore_1.44.0 scales_1.0.0          BiocManager_1.30.4   
## [34] limma_3.38.3          impute_1.56.0         ggplot2_3.1.0        
## [37] digest_0.6.18         stringi_1.2.4         dplyr_0.7.8          
## [40] ncdf4_1.16            grid_3.5.2            bitops_1.0-6         
## [43] tools_3.5.2           magrittr_1.5          RCurl_1.95-4.11      
## [46] lazyeval_0.2.1        tibble_2.0.0          crayon_1.3.4         
## [49] pkgconfig_2.0.2       MASS_7.3-51.1         xml2_1.2.0           
## [52] iterators_1.0.10      assertthat_0.2.0      rmarkdown_1.11       
## [55] R6_2.3.0              MALDIquant_1.18       compiler_3.5.2