--- title: "Adding CPTAC proteomics to a TCGA MultiAssayExperiment" author: "Marcel Ramos" output: BiocStyle::html_document vignette: > %\VignetteIndexEntry{Adding CPTAC proteomics to a TCGA MultiAssayExperiment} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set(collapse = TRUE, comment = "#>") ``` # CPTACdata # Overview The Clinical Proteomic Tumor Analysis Consortium (CPTAC) profiled the proteomes of several hundred TCGA tumors. `CPTACdata` downloads those data from the Proteomic Data Commons (PDC) and appends them to a `MultiAssayExperiment` from `curatedTCGAData`. It also downloads the CPTAC cohorts that use their own patients; see [CPTAC cohorts beyond TCGA](#cptac-cohorts-beyond-tcga). TCGA measured the genome and transcriptome of these tumors, and only a small panel of proteins with antibody arrays. Mass-spectrometry proteomics measures the protein layer directly, and protein levels often differ from mRNA levels, so matched protein data lets you compare the layers in the same patients. Adding the CPTAC data to a `MultiAssayExperiment` you already use keeps the samples aligned across all assays. `cBioPortalData` also returns cancer study data as `MultiAssayExperiment` objects, and it includes TCGA reverse-phase protein array (RPPA) data. `CPTACdata` reads the mass-spectrometry quantifications directly from the PDC for the CPTAC-TCGA cohorts. Check whether the cBioPortal studies you need contain the same CPTAC data before choosing between the two. ```{r load-packages, message = FALSE} library(CPTACdata) library(curatedTCGAData) library(MultiAssayExperiment) ``` # Installation ```{r install, eval=FALSE} if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("CPTACdata") ``` # CPTAC cohorts beyond TCGA This vignette covers CPTAC data generated on TCGA tumors. Most CPTAC data come from cohorts with their own patients instead: the CPTAC-3 discovery and confirmatory cohorts, such as clear cell renal cell carcinoma, glioblastoma and lung adenocarcinoma, and the CPTAC-2 Prospective collections. `getCPTAC()` downloads one of these cohorts as a new `MultiAssayExperiment`, with one experiment per PDC study and the PDC clinical data of its patients. The cohorts are listed in `cptacCohorts`. The vignette "Downloading CPTAC cohorts as MultiAssayExperiment objects" walks through an example: ```{r cohorts-vignette, eval = FALSE} vignette("CPTACcohorts", package = "CPTACdata") ``` # Which TCGA projects have CPTAC data? `cptacProjects` has one row per TCGA project and PDC study. Its columns are: - `tcga_project`: the TCGA project the study covers. - `pdc_study_id`: the PDC study identifier. - `pdc_name`: the PDC study name. - `experiment`: the name given to the experiment added to the object. - `analytical_fraction`: Proteome, Phosphoproteome or Glycoproteome. - `data_type`: the PDC quantification matrix that is downloaded, or `NA`. - `pdc_disease_type`: a PDC label used to split a study that covers more than one TCGA project, or `NA`. - `verified`: `TRUE` if every qualified TCGA patient in the study was found in the GDC project when the data were built. Some rows have `data_type = NA`. For these studies the PDC holds biospecimen records, but its API returns no quantification matrix for any data type tried. `appendCPTAC()` skips them with a warning, so they never add an experiment. ```{r list-cptac-projects} data("cptacProjects", package = "CPTACdata") cptacProjects ``` # Appending to a MultiAssayExperiment Start with any `curatedTCGAData` object for one TCGA project. Only patients in its `colData` can be matched, so include enough assays to cover the patients of interest. Downloading the TCGA object, the dry run and the append all need network access. The dry run and the append query the PDC API at `https://pdc.cancer.gov/graphql`. `cptacProjects` ships with the package and needs no network access. Biospecimen tables are cached for the R session, so a dry run followed by an append downloads each one only once. The CPTAC data are provided under the PDC Data Use Agreement at . Read it before running the next chunk, which accepts it on your behalf for this document: ```{r accept-pdc-dua} options(CPTACdata.acceptDUA = TRUE) ``` ```{r fetch-tcga-mae, message = FALSE} mae <- curatedTCGAData("OV", "RPPAArray", version = "2.1.1", dry.run = FALSE) ``` A dry run reports how many patients each PDC study shares with the object, downloading only sample metadata: ```{r dry-run} appendCPTAC(mae, dry_run = TRUE) ``` The dry run returns one row per study for the requested project and fraction. Its columns are: - `experiment`: the name the study would be added as. - `pdc_study_id`: the PDC study identifier. - `quant_available`: `TRUE` if the PDC has a quantification matrix for the study. - `mae_patients`: the number of patients in the object. - `pdc_patients`: the number of TCGA patients in the study that pass the specimen filters. - `matched_patients`: the number of those patients that are also in the object. Studies without a matrix show `NA` for `pdc_patients` and `matched_patients`. Then add the data. The project is detected from `colData`, and the **proteome is added by default**. Call `appendCPTAC()` again for other assay types: ```{r append-experiments} mae <- appendCPTAC(mae) mae <- appendCPTAC(mae, fraction = "Phosphoproteome") mae ``` The new experiments have one column per TCGA sample, and the `sampleMap` links them to patients: ```{r sample-map} tail(sampleMap(mae)) mae[["CPTAC_PNNL_Proteome"]] ``` Each new experiment is a `SummarizedExperiment` with one assay, named after its `data_type`. For the proteome and phosphoproteome the assay is `log2_ratio`. Each value is the log2 ratio of a sample's abundance to a common reference that the PDC used for the whole study. A value of 0 means the same abundance as the reference, 1 means twice the reference, and -1 means half. The reference is set per study, so compare values across experiments with care. Each experiment also records where its data came from, in its metadata. This includes the PDC study version and the time the matrix was downloaded: ```{r experiment-metadata} S4Vectors::metadata(mae[["CPTAC_PNNL_Proteome"]]) ``` Rows are genes in the proteome. In the phosphoproteome they are RefSeq protein and site identifiers, such as `NP_000005.2:s710`. Columns keep the labels of the PDC matrix, with `TCGA-` added where the PDC leaves it out: sample barcodes in the proteome and aliquot barcodes in the phosphoproteome. Missing values are stored as `NA`. Technical replicates of a sample carry a `.1`, `.2` suffix in the PDC matrix. All replicates are kept, and the suffix stays in the column name, such as `TCGA-C8-A131-01A.1` and `TCGA-C8-A131-01A.2`. The `sample_submitter_id` column of `colData` gives the sample barcode shared by the replicates. Use `replicates = "first"` to keep only the first replicate of each sample. Patients who are in the object but missing from the PDC matrix get no column, and the append reports how many there are. The JHU and PNNL ovarian proteomes are separate experiments that share some patients: ```{r upset-samples, eval = FALSE} upsetSamples(mae) ``` ```{r upset-samples-figure, echo = FALSE} img_path <- if (knitr::opts_knit$get("child")) "man/figures/" else "../man/figures/" knitr::include_graphics(paste0(img_path, "CPTACdata_upset.png")) ``` # Session info ```{r session-info} sessionInfo() ```