---
title: "Colorectal Cancer"
output:
  html_vignette:
    mathjax: null
vignette: >
  %\VignetteIndexEntry{Colorectal 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 colorectal 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_colorectal(2020)
```

```{r comptab, results="hide", message=FALSE, echo = FALSE}
pdat1 <- lapply(datasets, pdat_colorectal)
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; MSS &ndash; microsatellite stable; CIS &ndash; carcinoma in situ; ICC &ndash; invasive colonic carcinoma.

```{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, "colorectal.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__. Table 1 and Supplementary Data 1 of @WTK+08 (Swiss-Prot and UniProt accession numbers from Supplementary Data 2).
__b__. __c__. IPI accession numbers from Supplemental Table 4 of @XZC+10.
__d__. IPI accession numbers from Supplemental Table 4 of @ZYS+10.
__e__. __f__. __g__. __h__. Gene names from supplemental Table 9 of @BPV+11.
__i__. Supplementary Table 2 of @JCF+11.
__j__. Table S8 of @MRK+11.
__k__. Supplementary Table 1 of @SHHS11.
__l__. Appendix of @FGW+12.
__m__. Gene names from Supplementary Table 4 of @KYK+12, filtered to include proteins with expression ratio > 2 or < 0.5 in both mTRAQ and cICAT analyses.
__n__. Supplementary Table 4 of @WOD+12.
__o__. Table 2 of @CZD+14.
__p__. Ensembl protein IDs from Supporting Table 2 of @STK+15.
__q__. Proteins marked as having a significant change between normal tissue (N) and adenocarcinoma (C) in SI Table 3 of @WDO+15.
__r__. SI Table S3 of @LXM+16, filtered to include proteins with _p_-value < 0.05.
__s__. __t__. Gene names from Supplementary Table 4 of @PHL+16, for differential expression between normal colonic mucosa (NC) and carcinoma in situ (CIS) or invasive colorectal cancer (ICC).
__u__. Table S3 of @CTW+17.
__v__. Dataset 6A of @HZW+17.
__w__. Supplementary Material Table S1 of @LLL+17.
__x__. Table 2 of @NKG+17.
__y__. Table S2 of @QMB+17, filtered to include comparisons between adenocarcinoma and diverticular disease.
__z__. Table S1 of @TMS+17, filtered to include proteins that are consistently up- or down-regulated in at least 11 of 12 patients.
__A__. IPI accession numbers from Table S2 of @ZLY+17.
__B__. Supplementary Table 1B of @AKG+18, filtered to include proteins with expression ratio > 3/2 or < 2/3.
__C__. __D__. Supplementary Table S2 of @STA+19, filtered to include proteins with log~2~ ratio > ± the standard deviation of values for all quantified proteins.
__E__. [Online data](http://linkedomics.org/cptac-colon) from @VHW+19 (file: Human__CPTAC_COAD__PNNL__Proteome__TMT__03_01_2017__BCM__Gene__Tumor_Normal_log2FC.cct), filtered to include proteins with median log~2~ ratio > 1 or < -1.
__F__. Supplementary Information Table S2 of @WYL+19.

## References
