plot.msa: Plot an alignment

Description Usage Arguments Author(s) Examples

View source: R/msa.R

Description

Plot an alignment

Usage

1
2
3
4
## S3 method for class 'msa'
plot(x, refseq = names.msa(x)[1], xlim = NULL, ylim = c(0,
  1), add = FALSE, pretty = FALSE, min.char.size = 0.05,
  nuc.text = NULL, nuc.text.pos = "bottom", nuc.text.col = "black", ...)

Arguments

x

An object of type msa

refseq

A character string naming the reference sequence to use (NULL implies frame of reference of entire alignment).

xlim

(Only used when add==FALSE. A vector of length 2 giving the coordinate range to plot in terms of refseq coordinates. If NULL use entire range of alignment.

ylim

(Only used when add==TRUE. The limits to use on the y-axis.

add

If TRUE, add to the current plot

pretty

If TRUE, display bases as dots which are in 2nd or higher row and are identical to corresponding base in 1st row.

min.char.size

The smallest value (in inches) that a character can be. If characters need to be smaller than this, skip the plot.

nuc.text

If not NULL, can be a vector of character strings. Each character string should be the same length as the MSA with respect to refseq. Each string will be displayed in its own row along with the alignment.

nuc.text.pos

If nuc.text is not NULL, can be either "top" or "bottom" to indicate where to place nuc.text relative to the alignment. Will be recycled to the length of nuc.text.

nuc.text.col

If nuc.text is not NULL, color to be used for printing nuc.text. Will be recycled to the length of nuc.text.

...

Additional arguments to be passed to plot()

Author(s)

Melissa J. Hubisz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
exampleArchive <- system.file("extdata", "examples.zip", package="rphast")
unzip(exampleArchive, "ENr334-100k.maf")
m <- read.msa("ENr334-100k.maf")
plot.msa(m)
plot.msa(m[, 1:2])
plot.msa(m[,1:20])
plot.msa(m[1:3,1:40])
plot.msa(m[,1:100])
plot.msa(m[,1:50], refseq=NULL)
plot.msa(m[,1:50], refseq=NULL, nuc.text=rep(paste(rep("ASDFG", 10), sep="", collapse=""), 2),
         nuc.text.col=c("black", "red"), nuc.text.pos=c("top"))
rm(m)
unlink("ENr334-100k.maf")

Example output

Warning message:
In plot.msa(m) : plot.msa could not plot alignment; characters too small

rphast documentation built on May 1, 2019, 9:26 p.m.