-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
executable file
·60 lines (46 loc) · 1.17 KB
/
README.Rmd
File metadata and controls
executable file
·60 lines (46 loc) · 1.17 KB
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
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
eval = FALSE
)
```
# gpwm
<!-- badges: start -->
<!-- badges: end -->
The goal of gpwm is to supply functions for analysis of PWM motifs using the misha package.
## Installation
You can install gpwm by running:
```r
remotes::install_github("aviezerl/gpwm")
```
## Example
```r
library(gpwm)
library(tidyverse)
# Set misha database
gsetroot("/net/mraid14/export/data/db/tgdb/mm9/trackdb/")
# Define foreground intervals
intervals_fg <- get_promoters(upstream = 40, downstream=10) %>% sample_n(1e4)
# Define background intervals
intervals_bg <- get_promoters(upstream = 40, downstream=10) %>% anti_join(intervals_fg)
intervals <- bind_rows(
intervals_fg %>% mutate(type = 'fg'),
intervals_bg %>% mutate(type = 'bg')
)
# Extract motifs
motifs <- gpwm.extract_all('motifs_10bp', intervals)
# Calculate enrichment
enrich <- gpwm.motif_enrich(
fg = motifs %>% filter(type == "fg"),
bg = motifs %>% filter(type == "bg"),
pattern = "motifs_10bp",
size = 50,
quantile_thresh=0.99,
max.jobs = 5)
```