-
Notifications
You must be signed in to change notification settings - Fork 0
/
SHARP-match-gex-exposome-proteome.Rmd
84 lines (71 loc) · 1.86 KB
/
SHARP-match-gex-exposome-proteome.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
title: "SHARP-match-gex-exposome-proteome"
author: "ks"
date: "6/25/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Libraries
```{r rlibraries}
library(tidyverse)
```
## Load data
```{r data}
load("data/mgex.RData")
dim(mgex)
load("data/proteome.Rdata")
dim(proteome)
load("data/exposome.RData")
```
Find subset of individuals with expression, proteome and exposome.
```{r common-ids}
isctids <- intersect(covariates$ID,sampleNames(mgex))
length(isctids)
isctids <- intersect(isctids, sampleNames(proteome))
length(isctids)
expsm <- exposome %>%
filter(is.element(ID,isctids))
covars <- covariates %>%
filter(is.element(ID,isctids))
phenos <- phenotype %>%
filter(is.element(ID,isctids))
```
## ----order-mgex-measures----------------
```{r database}
#identical(covars$ID,sampleNames(mgex))
helix <- list()
helix$covars <- covars
# add phenotype data
helix$phenos <- phenos
identical(as.character(helix$covars$ID),
as.character(helix$phenos$ID))
# add expression data
helix$E <- exprs(mgex)
helix$E <- helix$E[,as.character(helix$covars$ID)]
identical(as.character(helix$covars$ID),
colnames(helix$E))
# add expression pData
helix$pDataE <- pData(mgex)
helix$pDataE <-
helix$pDataE[as.character(helix$covars$ID),]
identical(as.character(helix$covars$ID),
as.character(helix$pDataE$ID))
# add exposome data
identical(as.character(expsm$ID),
colnames(helix$E))
rownames(expsm) <- expsm$ID
helix$expsm <- expsm[,-1]
identical(rownames(helix$expsm),
as.character(helix$pDataE$ID))
# add proteome data
helix$prtm <- exprs(proteome)
helix$prtm <-
helix$prtm[,as.character(helix$covars$ID)]
identical(as.character(helix$covars$ID),
colnames(helix$prtm))
save(helix,file="helix.RData")
save(codebook,file="codebook.RData")
# add dnam??
```