1 Introduction

The goal of the rpx package is to provide programmatic access to proteomics data from R, in particular to the ProteomeXchange (Vizcaino J.A. et al, 2014) central repository (see http://www.proteomexchange.org/ and http://central.proteomexchange.org/). Additional repositories are likely to be added in the future.

2 The rpx package

2.1 PXDataset objects

The central object that handles data access is the PXDataset (version 2) 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)
## Loading PXD000001 from cache.
px
## Project PXD000001 with 10 files
## 
## Resource ID BFC6 in cache in /home/biocbuild/.cache/R/rpx.
##  [1] 'erwinia_carotovora.fasta' ... [10] 'PRIDE_Exp_Complete_Ac_22134.pride.mgf.gz'
##  Use 'pxfiles(.)' to see all files.

2.2 Data and meta-data

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

The experiment identifier, that was originally used to create the project can be extracted with the 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 data"
## [2] "analysis., Biochim Biophys Acta, 2013 May 18,"                        
## [3] "doi:10.1016/j.bbapap.2013.04.032 PMID:23692960"

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

pxfiles(px)
## Project PXD000001 files (10):
##  [local]  erwinia_carotovora.fasta
##  [remote] F063721.dat
##  [local]  F063721.dat-mztab.txt
##  [remote] PRIDE_Exp_Complete_Ac_22134.xml.gz
##  [remote] TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.raw
##  [local]  TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzXML
##  [remote] TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzXML
##  [local]  TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzML
##  [remote] PRIDE_Exp_Complete_Ac_22134.pride.mztab.gz
##  [remote] PRIDE_Exp_Complete_Ac_22134.pride.mgf.gz

The complete or partial data set can be downloaded with the pxget() function. The function takes a project instance 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. One of multiple file names, their indices or logicals can also be used to download specific files.

f <- pxget(px, "F063721.dat-mztab.txt")
## Loading F063721.dat-mztab.txt from cache.
f
## [1] "/home/biocbuild/.cache/R/rpx/2e848554bc0b37_F063721.dat-mztab.txt"

The rpx package makes use of the BiocFileCache package to avoid repeatedly dowloading data. When PXDataset projects are created and and project files are downloaded, they stored in the package’s central or a user-defined cache. Next time the project is instantiated with PXDataset() or a project file is downloaded with pxget(), existing artefacts will be retrieve from cache, instead of being created/downloaded from the remote server again. See ?rpxCache for details about caching.

2.3 A simple use-case

Below, we download the fasta file from the PXD000001 dataset and load it with the Biostrings package.

fas <- grep("fasta", pxfiles(px), value = TRUE)
## Project PXD000001 files (10):
##  [local]  erwinia_carotovora.fasta
##  [remote] F063721.dat
##  [local]  F063721.dat-mztab.txt
##  [remote] PRIDE_Exp_Complete_Ac_22134.xml.gz
##  [remote] TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.raw
##  [local]  TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzXML
##  [remote] TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzXML
##  [local]  TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzML
##  [remote] PRIDE_Exp_Complete_Ac_22134.pride.mztab.gz
##  [remote] PRIDE_Exp_Complete_Ac_22134.pride.mgf.gz
fas
## [1] "erwinia_carotovora.fasta"
f <- pxget(px, fas) ## file available in the rpx cache
## Loading erwinia_carotovora.fasta from cache.
f
## [1] "/home/biocbuild/.cache/R/rpx/228f2fd42ba55_erwinia_carotovora.fasta"
library("Biostrings")
readAAStringSet(f)
## AAStringSet object of length 4499:
##        width seq                                            names               
##    [1]   147 MADITLISGSTLGSAEYVAEHL...QHQIPEDPAEEWLGSWVNLLK ECA0001 putative ...
##    [2]   153 VAEIYQIDNLDRGILSALMENA...EIQSTETLISLQNPIMRTIAP ECA0002 AsnC-fami...
##    [3]   330 MKKQYIEKQQQISFVKSFFSSQ...IGQVQCGVWPQPLRESVSGLL ECA0003 putative ...
##    [4]   492 MITLESLEMLLSIDENELLDDL...WRFDTGLKSRLMRRWQHGKAY ECA0004 conserved...
##    [5]   499 MRQTAALAERISRLSHALEHGL...AKIEASLQQVAEQIQQSEQQD ECA0005 conserved...
##    ...   ... ...
## [4495]   634 MSDKIIHLTDDSFDTDVLKADG...RRKVDPLRVFASDMARRLELL trx-rv3790 trx-rv...
## [4496]    93 MTKMNNKARRTARELKHLGASI...RELRDEFPMGYLGDYKDDDDK TimBlower TimBlower
## [4497]   309 MFSNLSKRWAQRTLSKSFYSTA...KFKWAGIKTRKFVFNPPKPRK sp|P07143|CY1_YEA...
## [4498]   231 FPTDDDDKIVGGYTCAANSIPY...PGVYTKVCNYVNWIQQTIAAN sp|P00761|TRYP_PI...
## [4499]   269 GVSGSCNIDVVCPEGNGHRDVI...DAAGTGAQFIDGLDSTGTPPV sp|Q7M135|LYSC_LY...

3 Questions and help

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

4 Session information

sessionInfo()
## R version 4.1.1 (2021-08-10)
## 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] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
## [1] rpx_2.1.12          Biostrings_2.61.2   GenomeInfoDb_1.29.8
## [4] XVector_0.33.0      IRanges_2.27.2      S4Vectors_0.31.5   
## [7] BiocGenerics_0.39.2 BiocStyle_2.21.3   
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_1.1.1       xfun_0.26              bslib_0.3.1           
##  [4] purrr_0.3.4            vctrs_0.3.8            generics_0.1.0        
##  [7] htmltools_0.5.2        BiocFileCache_2.1.1    yaml_2.2.1            
## [10] utf8_1.2.2             blob_1.2.2             rlang_0.4.11          
## [13] jquerylib_0.1.4        pillar_1.6.3           withr_2.4.2           
## [16] glue_1.4.2             DBI_1.1.1              rappdirs_0.3.3        
## [19] bit64_4.0.5            dbplyr_2.1.1           GenomeInfoDbData_1.2.7
## [22] lifecycle_1.0.1        stringr_1.4.0          zlibbioc_1.39.0       
## [25] evaluate_0.14          memoise_2.0.0          knitr_1.36            
## [28] fastmap_1.1.0          curl_4.3.2             fansi_0.5.0           
## [31] Rcpp_1.0.7             filelock_1.0.2         BiocManager_1.30.16   
## [34] cachem_1.0.6           jsonlite_1.7.2         bit_4.0.4             
## [37] digest_0.6.28          stringi_1.7.5          bookdown_0.24         
## [40] dplyr_1.0.7            tools_4.1.1            bitops_1.0-7          
## [43] magrittr_2.0.1         sass_0.4.0             RCurl_1.98-1.5        
## [46] RSQLite_2.2.8          tibble_3.1.5           crayon_1.4.1          
## [49] pkgconfig_2.0.3        ellipsis_0.3.2         xml2_1.3.2            
## [52] httr_1.4.2             assertthat_0.2.1       rmarkdown_2.11        
## [55] R6_2.5.1               compiler_4.1.1