---
title: "Secreted Proteins in Hypoxia"
output:
  html_vignette:
    mathjax: null
vignette: >
  %\VignetteIndexEntry{Secreted Proteins in Hypoxia}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
bibliography: cpdat.bib
csl: peerj.csl
---

```{r setup, include=FALSE}
library(canprot)
library(CHNOSZ)
library(knitr)
## use pngquant to reduce size of PNG images
knit_hooks$set(pngquant = hook_pngquant)
pngquant <- "--speed=1 --quality=0-25"
# in case pngquant isn't available (R-Forge?)
if (!nzchar(Sys.which("pngquant"))) pngquant <- NULL 
```

This vignette from the R package [canprot](https://github.com/jedick/canprot) version `r packageDescription("canprot")$Version` shows compositional metrics and phylostrata for secreted proteins that are differentially expressed in hypoxia compared to control conditions.
Abbreviations:

  * <i>Z</i><sub>C</sub> &ndash; carbon oxidation state; <i>n</i><sub>H<sub>2</sub>O</sub> &ndash; stoichiometric hydration state per residue ([<span title="Distinct trends in chemical composition of proteins from metagenomes in redox and salinity gradients">Dick et al., 2020</span>](https://doi.org/10.1101/2020.04.01.020008); [<span title="Water as a reactant in the differential expression of proteins in cancer">Dick, 2020</a>](https://doi.org/10.1101/2020.04.09.035022)).
  * PS &ndash; phylostratum; <i>n</i><sub>AA</sub> &ndash; protein length; MW &ndash; molecular weight per residue.

Gene ages, expressed as phylostratum numbers, are taken from [<span title="Altered interactions between unicellular and multicellular genes drive hallmarks of transformation in a diverse range of solid tumors">Trigos et al., 2017</span>](https://doi.org/10.1073/pnas.1617743114) (TPPG17) or [<span title="Towards consensus gene ages ">Liebeskind et al, 2016</span>](https://doi.org/10.1093/gbe/evw113) (LMM16).

```{r options, echo=FALSE}
options(width = 90)
```

<style type="text/css">
body {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
</style>

```{r datasets}
datasets <- pdat_secreted(2020)
```

```{r comptab, results="hide", message=FALSE, echo = FALSE}
pdat1 <- lapply(datasets, pdat_secreted)
comptab1 <- lapply(pdat1, get_comptab)
comptab2 <- lapply(pdat1, get_comptab, "PS_TPPG17", "PS_LMM16")
comptab3 <- lapply(pdat1, get_comptab, "nAA", "MW")
```

Differences are calculated as (median value for up-regulated proteins) - (median value for down-regulated proteins), except for phylostrata, where mean values are used.
Dashed lines enclose the 50% credible region for highest probability density.

```{r diffplot, fig.width=9, fig.height=8, fig.align = "center", echo = FALSE, pngquant = pngquant}
layout(matrix(c(0, 2, 1, 2, 1, 3, 0, 3), nrow = 2))
par(cex = 1, mar = c(4, 4, 1, 1), mgp = c(2.5, 1, 0))
diffplot(comptab1, labtext = NA)
diffplot(comptab2, c("PS_TPPG17", "PS_LMM16"))
diffplot(comptab3, c("nAA", "MW"), labtext = NA)
```

In the table, values of &Delta;<i>Z</i><sub>C</sub> and &Delta;<i>n</i><sub>H<sub>2</sub>O</sub> are multiplied by 1000, values of &Delta;PS and &Delta;MW are multiplied by 100, and negative values are shown in bold.
Abbreviations:

  * _n_~down~ &ndash; number of down-regulated proteins; _n_~up~ &ndash; number of up-regulated proteins; pMSC &ndash; placental mesenchymal stem cells.

```{r xsummary, results="asis", echo = FALSE}
library(xtable)
out <- xsummary2(comptab1, comptab2, comptab3)
# round values and include dataset tags
tags <- sapply(sapply(strsplit(datasets, "="), "[", -1), paste, collapse = ";")
out <- cbind(out[, 1:2], tags = tags, out[, 3:19])
out[, 6:20] <- round(out[, 6:20], 4)
write.csv(out, "secreted.csv", row.names = FALSE, quote = 2)
```

## Data Sources
Gene names or other identifiers were converted to UniProt accession numbers using the <a href="https://www.uniprot.org/mapping/">UniProt mapping tool</a>.

__a__. Tables 2 and 3 of @BRA+10.
__b__. __c__. Gene names from Supplementary Table S1 of @PTD+10, filtered with p-value < 0.05, expression ratio > 1.3 or < 1/1.3 and EF < 2.
__d__. Extracted from Supplementary Table SIII of @JVC+12: median values of peptide quantification (omitting proteins identified with less than 5 peptides that have different signs of log~2~ values); differentially expressed proteins identifed using a log~2~ cutoff of 0.2.
__e__. Extracted from Table 1 of @SKA+13, to include proteins exclusively identified in 1% or 8% O~2~.
__f__. __g__. Extracted from Table 1 of @SRS+13a, including unique proteins for 1%, 3%, and 8% O~2~.
__h__. GI numbers from Supplementary Data 6 of @LRS+14.
__i__. __j__. Extracted from Table S1 of @YKK+14, to include proteins identified by at least 2 unique peptides and surpassing a log~2~ cutoff of 0.5 in soluble or exosome fractions.
__k__. __l__. Gene names from Supplementary Information Table 1 of @CRS+15, filtered to include proteins with log~2~ fold change between air and hypoxia > 0.2 or < -0.2.
__m__. Gene names from Supporting Information Tables S1 (normoxic) and S2 (hypoxic) of @RTA+15, filtered to include proteins that were exclusively identified in either condition.
__n__. Gene names from Tables 1 and 2 of @RSE+16.
__o__. __p__. Extracted from Tables S2A (exosomes) and S2B (secretome) of @CGH+17, keeping proteins with FDR < 0.05.
__q__. Supplementary Tables S8-S9 (secretome) of @CLY+18.
__r__. Supplementary Table 1 of @DWW+18.
__s__. Table S2 of @FPR+18.
__t__. Supplementary Material Tables S1 and S2 of @ODS+18, filtered to include proteins exclusively identified in hypoxia or normoxia.
__u__. Supplementary Tables 1 and 2 of @CWG+19, filtered to include proteins uniquely identified in either hypoxia or normoxia.
__v__. Proteins identified as up- or down-regulated > 1 SD in Data File S1 of @KAN+19 (pooled data from sheets "Soluble Secretome" and "EVs").
__w__. __x__. Extracted from proteinGroups.txt in ProteomeXchange Dataset [PXD008104](ftp://ftp.pride.ebi.ac.uk/pride/data/archive/2019/03/PXD008104) [@NJVS19]. Expression ratios between hypoxia and normoxia were calculated from LFQ intensity values, and proteins were classified as up- or down-regulated if they had expression ratios > 1.2 or < 1/1.2 in all three experiments for one cell type (CAM or NTM). The Majority protein IDs and mean values of the expression ratios were saved in the data file.
__y__. Supplementary Table 2 of @PDT+19, filtered with log~2~ fold-change cutoff of 1.

## References
