---
title: "Pancreatic Cancer"
output:
  html_vignette:
    mathjax: null
vignette: >
  %\VignetteIndexEntry{Pancreatic Cancer}
  %\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 proteins that are differentially expressed in pancreatic cancer compared to normal tissue.
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_pancreatic(2020)
```

```{r comptab, results="hide", message=FALSE, echo = FALSE}
pdat1 <- lapply(datasets, pdat_pancreatic)
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; T &ndash; tumor; N &ndash; normal; LCM &ndash; laser capture microdisecction; FFPE &ndash; formalin-fixed paraffin-embedded; DM &ndash; diabetes mellitus.

```{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, "pancreatic.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>, except for IPI accession numbers, which were converted using the <a href="https://david-d.ncifcrf.gov/conversion.jsp">DAVID 6.7 conversion tool</a>.

__a__. Tables 2 and 3 of @LHE+04.
__b__. Tables 1 and 2 of @CYD+05.
__c__. Table 2 of @CGB+05.
__d__. Table 1 of @CTZ+09.
__e__. IPI numbers from Supplementary Table S2 of @MLC+11.
__f__. Supplementary Table 3 of @PCS+11.
__g__. Extracted from the SI Table of @TMW+11.
__h__. Supplementary Tables 2 and 3 of @KBK+12.
__i__. SI Table S3 of @KHO+13, filtered to include proteins with an expression ratio >2 [or <0.5] in at least 5 of the 7 experiments and ratio >1 [or <1] in all experiments.
__j__. Supplementary Table 2 of @KPC+13.
__k__. __l__. Supplementary Tables S3 and S4 of @WLL+13a, including proteins with >3/2 or <2/3 fold change in at least 3 of 4 iTRAQ experiments for different pooled samples.
__m__. Supplementary Tables 2 and 3 of @YKK+13 (data file provided by Youngsoo Kim).
__n__. SI Table S5 of @ZNWL13.
__o__. SI Table S5 of @ISI+14, filtered to exclude proteins marked as "not passed", i.e. having inconsistent regulation.
__p__. Table S6, Sheet 2 of @BZQ+14.
__q__. Table 1 of @MZH+14.
__r__. Table S6 of @BHB+15.
__s__. Supplementary Table of @KKC+16.
__t__. Supplementary Table S3 of @CHO+18.
__u__. Table S1 of @SWW+18, filtered to exclude proteins with opposite expression changes in different patients.
__v__. Gene names extracted from Figure 1b of @ZAH+19.

## Acknowledgement
Thanks to Youngsoo Kim for providing a data file.

## References
