/
signalsiteanalysis.Rmd
86 lines (59 loc) · 3.47 KB
/
signalsiteanalysis.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
83
84
85
86
---
title: "Signal Site analysis"
author: "Briana Mittleman"
date: "4/23/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tidyverse)
library(workflowr)
library(reshape2)
```
In this analysis I will plot the distribution of signal sites upstream of the PAS I have found.
First I use a python script to make a bed file with the 100 base pairs upsream of the PAS:
```{bash,eval=F}
module load Anaconda3
source activate three-prime-env
mkdir ../data/SignalSiteFiles
python Upstream100Bases_general.py ../data/PAS/APAPAS_GeneLocAnno.5perc.bed ../data/SignalSiteFiles/APAPAS_100up.bed
```
Now I use bedtools nuc to get the sequence for each of these regions:
```{bash,eval=F}
sbatch getSeq100up.sh
```
I can now run the DistPAS2Sig.py which will give me the location for the signal site for each PAS.I am running this with the 12 most common PAS signal sites.
```{bash,eval=F}
sbatch run_distPAS2Sig.sh
```
Upload all of the results:
```{r}
Loc_AATAAA= read.table("../data/SignalSiteFiles/Loc_AATAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="AATAAA")
Loc_AAAAAG= read.table("../data/SignalSiteFiles/Loc_AAAAAG_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="AAAAAG")
Loc_AATACA= read.table("../data/SignalSiteFiles/Loc_AATACA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="AATACA")
Loc_AATAGA= read.table("../data/SignalSiteFiles/Loc_AATAGA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="AATAGA")
Loc_AATATA= read.table("../data/SignalSiteFiles/Loc_AATATA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="AATATA")
Loc_ACTAAA= read.table("../data/SignalSiteFiles/Loc_ACTAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="ACTAAA")
Loc_AGTAAA= read.table("../data/SignalSiteFiles/Loc_AGTAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="AGTAAA")
Loc_ATTAAA= read.table("../data/SignalSiteFiles/Loc_ATTAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="ATTAAA")
Loc_CATAAA= read.table("../data/SignalSiteFiles/Loc_CATAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="CATAAA")
Loc_GATAAA= read.table("../data/SignalSiteFiles/Loc_GATAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="GATAAA")
Loc_TATAAA= read.table("../data/SignalSiteFiles/Loc_TATAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="TATAAA")
Loc_AAAAAA= read.table("../data/SignalSiteFiles/Loc_AAAAAA_Distance2end.txt", header=F, col.names =c( "PAS", "Distance2PAS")) %>% mutate(Site="AAAAAA")
```
Join these together:
```{r}
AllsiteDF=as.data.frame(rbind(Loc_AATAAA,Loc_AAAAAG,Loc_AATACA,Loc_AATAGA,Loc_AATATA,Loc_ACTAAA,Loc_AGTAAA,Loc_ATTAAA, Loc_GATAAA,Loc_TATAAA,Loc_CATAAA, Loc_AAAAAA))
```
```{r}
AllsiteDF_sep = AllsiteDF %>% separate(PAS, int=c("GenePeak", "Location"), sep="_")
ggplot(AllsiteDF_sep, aes(x=Distance2PAS, by=Site, col=Site)) + stat_ecdf() + facet_wrap(~Location)
```
**Next plot: look at presence of signal site compared to PAS usage**
Check to see if any PAS have more than one signal site detected:
```{r}
AllsiteDFmultsites=AllsiteDF %>% group_by(PAS) %>% mutate(nSites=n()) %>% filter(nSites>1)
```
First take the perfect match within 50 bp then use the closest.