Description Usage Arguments Details Value See Also Examples
View source: R/genomeImagePlot.R
Generate a plot that shows different classes of rearrangements along a given set of focal genome segments
1 2 3 4 5 |
SYNT |
A list of matrices that store data on different classes of
rearrangements and additional information. |
focalgenome |
Data frame representing the focal genome, containing the
mandatory columns |
ordfocal |
Character vector with the IDs of the focal genome segments
that will be plotted. Have to match (a subset of) IDs in
|
remstr |
String that should be removed from the IDs in |
main |
Title of the plot. |
remThld |
A numeric value between |
vspace |
A numeric value between |
hspace |
A numeric value between |
mar |
A numerical vector of the form |
xaxlab |
Data frame with two columns that gives the annotations of the
x-axis. The column |
xlab |
Title for the x-axis. |
yaxlab |
Annotations of the y-axis. Must be the same length as
|
cex |
Numerical value that specifies the amount of text magnification. |
font.main |
Font for the title of the plot. |
makepdf |
Logical. Save plot as PDF. See |
newdev |
Logical. Opens a new default graphics device (but not
"RStudioGD") via |
filename |
Character string that gives the name of the PDF file when
|
colormodel |
Character string that gives the color model for the PDF
when |
Parameters SYNT
, focalgenome
, and ordfocal
need to be
specified, all other parameters have default or automatic settings.
focalgenome
must contain the column $marker
, a vector of
either characters or integers with unique ortholog IDs that can be matched
to the values in the rownames of SYNT
. Values can be NA
for
markers that have no ortholog. $scaff
must be a character vector
giving the name of the focal genome segment (e.g., chromosome or scaffold)
of origin of each marker. $start
and $end
must be numeric
vectors giving the location of each marker on its focal genome segment.
$strand
must be a vector of "+"
and "-"
characters
giving the reading direction of each marker. Additional columns are ignored
and may store custom information, such as marker names. Markers need to be
ordered by their map position within each focal genome segment, for example
by running the orderGenomeMap
function. focalgenome
may contain additional rows that were absent when running the
computeRearrs
function. However, all markers present in
SYNT
need to be contained in focalgenome
, with the subset of
shared markers being in the same order. Having additional markers in
focalgenome
can be useful for example to include additional
non-orthologous markers in the plot.
When makepdf = TRUE
or newdev = TRUE
, the width and height of
the graphic will be set automatically. The dimensions are determined in
inches, thus makepdf = FALSE
and newdev = TRUE
will produce
an error or not work correctly when the default units of the default
graphics device are not inches (such as bmp
,
jpeg
, png
, or
tiff
). This can be avoided by setting the default
graphics device to one that has inches as default units. Setting both
makepdf = FALSE
and newdev = FALSE
will allow to specify
alternative, user-defined dimensions of the graphic. See examples below.
A plot to the default graphics device (but not "RStudioGD") or a PDF file.
The plot visualizes the data contained in SYNT
for each focal genome
segment in ordfocal
, arranged along the y-axis. The x-axis gives the
map position of markers on their focal genome segment. Thin vertical lines
(ticks) indicate the positions of markers, rearrangement breakpoints, and
different classes of rearrangements within six rows per focal genome
segment.
Starting at the bottom, the first row gives the map positions of all
markers in focalgenome
and of the subset of markers present in
SYNT
by gray and black ticks, respectively. The second row gives the
positions of rearrangement breakpoints by red ticks. Ticks are drawn at the
midpoints between the positions of the two markers present in SYNT
that are adjacent to the breakpoints. Only markers with black ticks can
receive colored ticks in the following rows. Maroon indicates markers that
are part of inversions (IV); purple indicates markers that are part of
syntenic moves (SM); blue indicates markers that are part of class II
nonsyntenic moves (NM2); green indicates markers that are part of class I
nonsyntenic moves (NM1).
Unless the argument remThld
is set to a value smaller than that of
remWgt
in the computeRearrs
function, only markers
that are more parsimonious to have changed position relative to alternative
markers are highlighted. Lighter tints denote markers that are part of
large rearrangements, while darker shades denote markers that are part of
small rearrangements. To distinguish between individual large
rearrangements versus multiple short adjacent rearrangements, it may be
helpful to take the position of breakpoints into account.
computeRearrs
, filterRearrs
,
getBreakpoints
, genomeRearrPlot
. For more
information about arguments that are passed to other functions, see
dev.new
, pdf
,
plot
, par
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | SYNT<-computeRearrs(TOY24_focalgenome, TOY24_compgenome, doubled = TRUE)
genomeImagePlot(SYNT, TOY24_focalgenome, c("1", "2", "3"), main = "TOY24")
## change x-axis labels
op<-options(scipen=999)
myxaxlab<-data.frame(pos=seq(2*10^6,10^7,2*10^6),
lab=as.character(seq(2*10^3,10^4,2*10^3)))
options(op)
myxlab<-"Position [kb]"
genomeImagePlot(SYNT, TOY24_focalgenome, c("1", "2", "3"), main = "TOY24",
xaxlab = myxaxlab, xlab = myxlab)
## Not run:
## make PDF (automatically determine the width and height of the graphic)
genomeImagePlot(SYNT, TOY24_focalgenome, c("1", "2", "3"), main = "TOY24",
makepdf = TRUE, newdev = FALSE, filename = "genome.pdf")
## make PDF (default dimensions, i.e., square format)
pdf(file = "genome.pdf")
genomeImagePlot(SYNT, TOY24_focalgenome, c("1", "2", "3"), main = "TOY24",
makepdf = FALSE, newdev = FALSE)
dev.off()
## plot in R Studio window
op <- options(device = "RStudioGD")
genomeImagePlot(SYNT, TOY24_focalgenome, c("1", "2", "3"), main = "TOY24",
newdev = FALSE)
options(op)
## make EPS, and set user-specified dimensions
setEPS()
postscript("genome.eps", width=4.5,height=3.42,pointsize=9)
genomeImagePlot(SYNT, TOY24_focalgenome, c("1", "2"), main = "TOY24",
vspace = 1, makepdf = FALSE, newdev = FALSE)
dev.off()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.