Skip to content

tanaylab/gpwm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpwm

The goal of gpwm is to supply functions for analysis of PWM motifs using the misha package.

Installation

You can install gpwm by running:

remotes::install_github("aviezerl/gpwm")

Example

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)

About

Motif analysis using the Misha package

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published