plotGenes: plots gene structure or transcript structures

Description Usage Arguments Examples

View source: R/plotGenes.R

Description

plots gene structure or transcript structures

Usage

1
2
3
4
5
6
7
8
plotGenes(geneinfo = NULL, chrom = NULL, chromstart = NULL,
  chromend = NULL, col = SushiColors(2)(2)[1], bheight = 0.3,
  lheight = 0.3, bentline = TRUE, packrow = TRUE, maxrows = 10000,
  colorby = NULL, colorbyrange = NULL,
  colorbycol = colorRampPalette(c("blue", "red")), types = "exon",
  plotgenetype = "box", arrowlength = 0.005, wigglefactor = 0.05,
  labeltext = TRUE, labeloffset = 0.4, fontsize = 0.7, fonttype = 2,
  labelat = "middle", ...)

Arguments

geneinfo

gene info stored in a bed-like format. If NULL it will look up genes in the region using biomart (with biomart="ensembl" and dataset="hsapiens_gene_ensembl"). See also useMart

chrom

chromosome of region to be plotted

chromstart

start position

chromend

end position

col

single value or vector specifying colors of gene structures

bheight

the height of the boxes drawn for exons

lheight

the height of the bent line is bent is set to TRUE

bentline

TRUE/FALSE indicating whether lines between exons should be bent

packrow

TRUE / FALSE indicating whether genes should be packed or whether each gene should be plotted on its own row

maxrows

The maximum number of rows to plot on the y-axis

colorby

vector to scale colors by

colorbyrange

the range of values to apply the color scale to. Values outside that range will be set to the limits of the range.

colorbycol

palette to apply color scale to (only valid when colorby is not NULL)

types

single value or vector specifying types of elements (acceptable values are 'exon','utr')

plotgenetype

String specifying whether the genes should resemble a 'box' or a 'arrow'

arrowlength

value (between 0 and 1) specifying the length of the tail of each arrow as a fraction of the total plot width (only valid when plotgenetype is set to "arrow")

wigglefactor

the fraction of the plot to leave blank on either side of each element to avoid overcrowding.

labeltext

TRUE/FALSE indicating whether genes should be labeled

labeloffset

value (between 0 and 1) specifying the vertical offset of gene labels

fontsize

font size of gene labels

fonttype

font type of gene labels

labelat

postion along gene to place labels (acceptable values are "middle","start",and "end")

...

values to be passed to plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(Sushi_genes.bed)

chrom            = "chr15"
chromstart       = 72998000
chromend         = 73020000
chrom_biomart    = 15

plotGenes(Sushi_genes.bed,chrom_biomart,chromstart,chromend ,types=Sushi_genes.bed$type,
     maxrows=1,height=0.5,plotgenetype="arrow",bentline=FALSE,col="blue",
     labeloffset=1,fontsize=1.2)

labelgenome( chrom, chromstart,chromend,side=1,scipen=20,n=3,scale="Mb",line=.18,chromline=.5,scaleline=0.5)

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: biomaRt
[[1]]
NULL

[[2]]
function (n) 
{
    x <- ramp(seq.int(0, 1, length.out = n))
    if (ncol(x) == 4L) 
        rgb(x[, 1L], x[, 2L], x[, 3L], x[, 4L], maxColorValue = 255)
    else rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255)
}
<bytecode: 0x9ddf9d8>
<environment: 0x9de0918>

Sushi documentation built on Nov. 8, 2020, 7:48 p.m.