plot_genes | R Documentation |
Plot gene locations for a genomic interval, as rectangles with gene symbol (and arrow indicating strand/direction) below.
plot_genes(
genes,
minrow = 4,
padding = 0.2,
colors = c("black", "red3", "green4", "blue3", "orange"),
scale_pos = 1,
start_field = "start",
stop_field = "stop",
strand_field = "strand",
name_field = "Name",
...
)
genes |
Data frame containing |
minrow |
Minimum number of rows of genes in the plot |
padding |
Proportion to pad with white space around the genes |
colors |
Vectors of colors, used sequentially and then re-used. |
scale_pos |
Factor by which to scale position (for example, to convert basepairs to Mbp) |
start_field |
Character string with name of column containing the genes' start positions. |
stop_field |
Character string with name of column containing the genes' stop positions. |
strand_field |
Character string with name of column containing the genes' strands.
(The values of the corresponding field can be character strings |
name_field |
Character string with name of column containing the genes' names. |
... |
Optional arguments passed to |
None.
Graphics parameters can be passed via ...
. For
example, xlim
to control the x-axis limits.
These are not included as formal
genes <- data.frame(chr = c("6", "6", "6", "6", "6", "6", "6", "6"),
start = c(139988753, 140680185, 141708118, 142234227, 142587862,
143232344, 144398099, 144993835),
stop = c(140041457, 140826797, 141773810, 142322981, 142702315,
143260627, 144399821, 145076184),
strand = c("-", "+", "-", "-", "-", NA, "+", "-"),
Name = c("Plcz1", "Gm30215", "Gm5724", "Slco1a5", "Abcc9",
"4930407I02Rik", "Gm31777", "Bcat1"),
stringsAsFactors=FALSE)
# use scale_pos=1e-6 because data in bp but we want the plot in Mbp
plot_genes(genes, xlim=c(140, 146), scale_pos=1e-6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.