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

```{r setup, include=FALSE}
library(canprot)
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 
# read 'basis' option
basis <- getOption("basis")
```

This vignette from the R package [canprot](https://github.com/jedick/canprot) version `r packageDescription("canprot")$Version` shows compositional metrics and phylostrata for proteins that are differentially expressed in hypoxia compared to control conditions.
The analysis is described in more detail in a manuscript ([<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)).
Abbreviations:

  * <i>Z</i><sub>C</sub> &ndash; average oxidation state of carbon.
  * <i>n</i><sub>H<sub>2</sub>O</sub> &ndash; stoichiometric hydration state per residue ([<span title="Uncovering chemical signatures of salinity gradients through compositional analysis of protein sequences">Dick et al., 2020</span>](https://doi.org/10.5194/bg-2020-146)) computed using the **`r basis`** basis species (`r basis.text(basis)`, H~2~O, O~2~).
  * 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).

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

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

```{r comptab, results="hide", message=FALSE, echo = FALSE}
pdat1 <- lapply(datasets, pdat_hypoxia)
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% confidence 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; Hx48 &ndash; hypoxia 48 h; Hx72 &ndash; hypoxia 72 h; -S &ndash; supernatant fraction; -P &ndash; pellet fraction; DMSO &ndash; dimethyl sulfoxide; NO.sul &ndash; nitric oxide-donating sulindac; sul &ndash; sulindac; 4Gy &ndash; radiation; POS &ndash; primay origin canine osteosarcoma (OS) cells; HMPOS &ndash; metastatic origin canine OS 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)
file <- paste0("hypoxia_", basis, ".csv")
write.csv(out, file, row.names = FALSE, quote = 2)
```

## Data Sources
Where given, 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__. Supplemental Table 1 of @SBB+06, filtered to include proteins with expression ratio ≥ 1.7 or ≤ 0.58.
__b__. Supplemental Table 2A of @FWH+13 (control virus cells).
__c__. __d__. Supplemental Table S1 of @RHD+13, filtered to include proteins with iTRAQ ratios < 0.83 or > 1.2 and _p_-value < 0.05.
__e__. Supporting Information table of @VTMF13, filtered to include proteins with a normalized expression ratio of > 1.2 or < 0.83.
__f__. Supporting Information Table S1 @DCH+14.
__g__. __h__. __i__. __j__. Supplemental Table S1 of @DYL+14, filtered to include proteins with _p_-value < 0.05 (-S: supernatant fraction; -P: pellet fraction).
__k__. Supplementary Table S1 of @BSA+15.
__l__. Supplemental Information Table S1 of @HWA+16, filtered to include proteins with a fold change of < 0.5 or > 1 and that were detected in only hypoxic or only normoxic conditions.
__m__. Gene names from @LCS16 (data files provided by Ming-Chih Lai).
__n__. Extracted from Table S2E (whole cell lysate) of @CGH+17, keeping proteins with FDR < 0.05.
__o__. Supplemental Table S4 of @ZXS+17.
__p__. Supplementary Tables S6-S7 (proteome) of @CLY+18.
__q__. List of up- and down-regulated proteins from @GBH+18 (provided by Alex Greenhough), filtered to include proteins with average fold change ≥ 1.5 or ≤ 2/3.
__r__. Gene names from Figure 1F of @LKK+18.
__s__. Supplemental file 1 of @WTG+18 (provided by Gordana Vunjak-Novakovic), filtered to include proteins with Normalized Ratio [Hypoxia MSC/Control MSC] ≥ 1.5 or ≤ 2/3 and _p_-value < 0.05.
__t__. Gene names from Supplementary file S1 of @CSK+19 for the two replicates labelled as "input_Log2ratioHL_firstIP" and "input_Log2ratioLH_secondIP" (soluble extracts before immunoprecipitation), filtered to include proteins where Log2ratio is > 0.2 or < -0.2 for both replicates.
__u__. __v__. Supplementary Data 1 of @GPT+19, filtered to include proteins with _p_-value < 0.05 and fold-change > 2 or < 0.5
__w__. Proteins identified as up- or down-regulated > 1 SD in Data File S1 of @KAN+19 (sheet "Proteome").
__x__. Additional file 1: Table S1 of @LLL+19.
__y__. Gene names from Supplementary Information Tables S6 and S7 of @BCMS20.
__z__. __A__. __B__. __C__. __D__. __E__. Supplementary Table 1A of @RVN+20, filtered to include proteins with median fold change between normoxic and hypoxic conditions in any individual treatment > 1.5 or < 2/3.
__F__. __G__. Supplementary Tables S3b (sheet "HPNP") and S3c (sheet "HHNH") of @SPJ+20.

## Acknowledgements
Thanks to Alex Greenhough, Ming-Chih Lai, and Gordana Vunjak-Novakovic for providing data files.

## References
