plot_genes: Plot gene locations for a genomic interval

Description Usage Arguments Value Hidden graphics parameters Examples

View source: R/plot_genes.R

Description

Plot gene locations for a genomic interval, as rectangles with gene symbol (and arrow indicating strand/direction) below.

Usage

1
2
3
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", ...)

Arguments

genes

Data frame containing start and stop in Mbp, strand (as "-", "+", or NA), and Name.

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.

name_field

Character string with name of column containing the genes' names.

...

Optional arguments passed to graphics::plot().

Value

None.

Hidden graphics parameters

Graphics parameters can be passed via .... For example, xlim to control the x-axis limits. These are not included as formal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)
plot_genes(genes, xlim=c(140, 146))

rqtl/qtl2plot documentation built on May 28, 2019, 2:36 a.m.