-
Notifications
You must be signed in to change notification settings - Fork 1
/
upsetter.Rmd
80 lines (53 loc) · 2.95 KB
/
upsetter.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
---
title: "Upsetter plot with all phenotypes"
author: "Briana Mittleman"
date: "1/7/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
In this analysis I will use the UpSetR package to look at all of the differential gene regulation phenotype results in one plot. This should be easier to visualize than the venn diagrams.
```{r}
library(UpSetR)
library(workflowr)
library(tidyverse)
```
Input the datasets:
```{r}
#protein
Protein=read.table("../data/Khan_prot/HC_SigProtein.txt", header = T, stringsAsFactors = F)
#trans
Translation=read.table("../data/Wang_ribo/HC_SigTranslation.txt", header = T, stringsAsFactors = F)
#expression
nameID=read.table("../../genome_anotation_data/ensemble_to_genename.txt",sep="\t", header = T, stringsAsFactors = F)
DEgenes=read.table("../data/DiffExpression/DE_genes.txt", header = F,col.names = c("Gene_stable_ID"),stringsAsFactors = F) %>% inner_join(nameID, by="Gene_stable_ID") %>% dplyr::select(Gene.name)
#nuclear apa
NucAPA=read.table("../data/DiffIso_Nuclear/SignifianceEitherGENES_Nuclear.txt",header = T,stringsAsFactors = F)
#totalAPA
totAPA=read.table("../data/DiffIso_Total/SignifianceEitherGENES_Total.txt",header = T,stringsAsFactors = F)
DSgenes=read.table("../data/DiffSplice_liftedJunc/orderedGeneListFixed.txt",stringsAsFactors = F, col.names = "DS")
```
Create a named list object
```{r}
# example of list input (list of named vectors)
listInput <- list(DE=DEgenes$Gene.name, DS=DSgenes$DS, DapaNuc=NucAPA$gene, DapaTot=totAPA$gene, DT=Translation$Gene, DP=Protein$gene.symbol)
```
Create plot:
```{r}
upset(fromList(listInput), order.by = "freq", keep.order = T,empty.intersections = "on")
```
Do this without total APA:
```{r}
listInput_nucOnly <- list(DE=DEgenes$Gene.name, DS=DSgenes$DS, DAPA=NucAPA$gene, DT=Translation$Gene, DP=Protein$gene.symbol)
upset(fromList(listInput_nucOnly), order.by = "freq", keep.order = T,empty.intersections = "on")
```
Add colors for certain queries:
```{r}
#upset(movies, queries = list(list(query = intersects, params = list("Drama",
# "Comedy", "Action"), color = "orange", active = T), list(query = intersects,
# params = list("Drama"), color = "red", active = F), list(query = intersects,
# params = list("Action", "Drama"), active = T)))
upset(fromList(listInput_nucOnly), queries = list(list(query=intersects, params=list("DAPA", "DT", "DP"), color="red", active=T,query.name="APA,Ribo, Protein"),list(query=intersects, params=list("DE", "DT", "DP"), color="orange", active=T, query.name="Expression,Ribo, Protein"), list(query=intersects, params=list("DS", "DT", "DP"), color="green", active=T,query.name="Splicing ,Ribo, Protein"),list(query=intersects, params=list("DAPA", "DT"), color="blue", active=T, query.name="APA,Ribo") ,list(query=intersects, params=list("DAPA", "DP"), color="purple", active=T, query.name="APA, Protein")), order.by = "freq", query.legend = "bottom")
```
**Can I do this by proportion???**