inst/doc/seqLogo.R

## ----init, echo=FALSE, results='hide'-----------------------------------------
## crop=NULL or FALSE =>  fix vignette rendering based on yihui/knitr#1796
## added also error=FALSE to include_graphics
knitr::opts_chunk$set(
  collapse = TRUE,
  tidy = FALSE,
  ## comment = "#>",
  error = FALSE,
  warning = FALSE,
  message = FALSE,
  crop = NULL                           
)

## check the output type
out_type <- knitr::opts_knit$get("rmarkdown.pandoc.to")
if (is.null(out_type))
    out_type <- "html"

## add styling
if (out_type == "html") {
    BiocStyle::markdown()
    ## BiocStyle::markdown(css.files = c('custom.css'))
} else if (out_type == "latex") {
    BiocStyle::latex()
}

## ----library------------------------------------------------------------------
library() 

## ----makePWM------------------------------------------------------------------
mFile <- system.file("extdata/pwm1", package="seqLogo")
m <- read.table(mFile)
m
p <- makePWM(m)

## ----slots--------------------------------------------------------------------
slotNames(p)
pwm(p)
ic(p)
consensus(p)

## ----seqLogo1, fig.height=4, fig.width=6, fig.cap="Sequence logo with column heights proportional to information content."----
(p)

## ----seqLogo2, fig.height=4, fig.width=6, fig.cap="Sequence logo with uniform column heights."----
(p, ic.scale=FALSE)

## ----seqLogo3, fig.height=4, fig.width=6, fig.cap="Sequence logo with user specified colors."----
(p, fill=c(A="#4daf4a", C="#377eb8", G="#ffd92f", T="#e41a1c"),
        ic.scale=FALSE)

## ----seqLogo4, fig.height=4, fig.width=6, fig.cap="RNA Sequence logo."--------
r <- makePWM(m, alphabet="RNA")
(r, ic.scale=FALSE)

## ----session-info-------------------------------------------------------------
sessionInfo()

Try the seqLogo package in your browser

Any scripts or data that you put into this service are public.

seqLogo documentation built on Nov. 8, 2020, 8:20 p.m.