Last data update: 2014.03.03

R: Plot a sequence logo
seqLogoR Documentation

Plot a sequence logo

Description

This function takes a ICMatrix or TFFM object and plot the sequence logo.

Usage

  seqLogo(x, ic.scale = TRUE, xaxis = TRUE, yaxis = TRUE,
           xfontsize = 15, yfontsize = 15)

Arguments

x

x is a valid ICMatrix object or TFFM object.

ic.scale

A logical value. If TRUE, the total height of one column is proportional to the information content at that position. Otherwise, all the columns will have the same height.

Ignored for TFFM object.

xaxis

A logical value. If TRUE, the x-axis will be plotted.

Ignored for TFFM object.

yaxis

A logical value. If TRUE, the y-axis will be plotted.

Ignored for TFFM object.

xfontsize

A numeric value. The font size for x-axis.

yfontsize

A numeric value. The font size for y-axis.

Details

A sequence logo is a graphical representation of the matrix model, based on the information content of each position. The information content ranges from 0 (no base preference) to 2 (only 1 base used). If ic.scale is TRUE, the height of the logo at certain site is proportinal to the information content value. And each stacked base (A, C, G, T)'s height is also proportional to the information content of each base at that position, and sorted based on the character size.

For a TFFM object, a novel graphical representation is used for capturing the dinucleotide dependencies on the TFFM. For the upper part of the sequence logo, we represent the nucleotide probabilities at position p for each possible nucleotide at position p-1. Hence, each column represents a position within a TFBS and each row the nucleotide probabilities found at that position. Each row assumes a specific nucleotide has been emitted by the previous hidden state. The intersection between a column corresponding to position p and row corresponding to nucleotide n gives the probabilities of getting each nucleotide at position p if n has been seen at position p-1. The opacity to represent the sequence logo is proportional to the probablity of possible row to be used by the TFFM.

Value

No return value.

Note

This function is based on the function seqLogo from the Bioconductor package seqLogo, especially for the plotting code of TFFM.

Author(s)

Ge Tan

References

T D Schneider, R. M. S. (1990). Sequence logos: a new way to display consensus sequences. Nucleic acids research, 18(20), 6097.

Mathelier, A., and Wasserman, W.W. (2013). The next generation of transcription factor binding site prediction. PLoS Comput. Biol. 9, e1003214.

See Also

toICM, ICMatrix,

Examples

  ## ICMatrix
  data(MA0003.2)
  icm = toICM(MA0003.2)
  seqLogo(icm, ic.scale = TRUE)
  
  ## TFFM
  xmlFirst <- file.path(system.file("extdata", package="TFBSTools"),
                        "tffm_first_order.xml")
  tffmFirst <- readXMLTFFM(xmlFirst, type="First")
  seqLogo(tffmFirst)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(TFBSTools)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/TFBSTools/seqLogo.Rd_%03d_medium.png", width=480, height=480)
> ### Name: seqLogo
> ### Title: Plot a sequence logo
> ### Aliases: seqLogo seqLogo,ICMatrix-method seqLogo,TFFM-method
> ### Keywords: methods ~~ other possible keyword(s) ~~
> 
> ### ** Examples
> 
>   ## ICMatrix
>   data(MA0003.2)
>   icm = toICM(MA0003.2)
>   seqLogo(icm, ic.scale = TRUE)
>   
>   ## TFFM
>   xmlFirst <- file.path(system.file("extdata", package="TFBSTools"),
+                         "tffm_first_order.xml")
>   tffmFirst <- readXMLTFFM(xmlFirst, type="First")
>   seqLogo(tffmFirst)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>