-
Notifications
You must be signed in to change notification settings - Fork 3
/
THOR.Rmd
32 lines (27 loc) · 805 Bytes
/
THOR.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
---
title: "Untitled"
author: "Aurelien Ginolhac"
date: "9/21/2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
##
```{r}
library(tidyverse)
diffpeaks <- read_tsv("2018/THOR_TC1-I-A-D0vsD1/TC1-I-A-D0vsD15-diffpeaks.bed",
col_names = FALSE, trim_ws = TRUE, col_types = cols(X1 = col_character()))
diffpeaks %>%
separate(X11, into = c("count1", "count2", "third"), sep = ";", convert = TRUE) %>%
mutate(FC = count2 / count1) -> thor_splitted
thor_splitted %>%
ggplot(aes(x = log2(FC))) +
geom_histogram() +
scale_x_continuous(breaks = seq(-3, 3, 1))
thor_splitted %>%
filter(log2(FC) > 0.5) %>%
select(X1, X2, X3) %>%
mutate(X1 = paste0("chr", X1)) %>%
write_tsv("2018/THOR_logFC0.5.bed", col_names = FALSE)
```