knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

ggmotif

add DNA sequence motifs to ggplot

Inspired by, and letters based on, seqLogo Bioconductor package.

Plots DNA sequence motif in ggplot2 framework.

Install using devtools::install_github (Not on CRAN).

Either create a standalone plot, or add a sequence logo at a specific position with a specific size into a ggplot.

library(ggmotif)
ggmotif_plot("ACGWRT") 

Can also use position frequency matrix instead of character string:

mat = Biostrings::consensusMatrix("ACGWRT")
mat

ggmotif_plot(mat) 

Or add a sequence logo at a specific position with a specific size into a ggplot.

ggplot(data.frame(x = 1:5,y =1:5),aes(x=x,y=y)) + geom_line() + 
  ggmotif("ACGWRT", x.pos = 5.1, y.pos = 5.1, ht = 0.2, wt = 0.2) + 
  ggmotif_scale() 


AliciaSchep/ggmotif documentation built on May 5, 2019, 4:54 a.m.