addlegend: adds a legend to a Sushi plot

Description Usage Arguments Examples

View source: R/addlegend.R

Description

This function adds a legend to Sushi plots that have a colorby function (e.g. plotHic, plotGenes, and plotBedpe)

Usage

1
2
3
4
5
addlegend(range, title = "", labels.digits = 1, palette = topo.colors,
  side = "right", labelside = "left", xoffset = 0.1, width = 0.05,
  bottominset = 0.025, topinset = 0.025, tick.num = 5,
  tick.length = 0.01, txt.font = 1, txt.cex = 0.75, title.offset = 0.05,
  title.font = 2, title.cex = 1)

Arguments

range

the rang of values to be plotted. ie c(min,max)

title

title of values to be mapped

labels.digits

Number of digits after the decimal point to include in labels

palette

color palette to use

side

side of plot to place legend ('right','left')

labelside

side of legend to place legend title

xoffset

fraction of plot to offset the legend

width

width as a fraction of the plot width

bottominset

inset from the bottom of the blot as a fraction of the plot width

topinset

inset from the top of the blot as a fraction of the plot width

tick.num

desired number of tickmarks

tick.length

length of tick marks

txt.font

font type of legend text

txt.cex

font size of legned text

title.offset

offset of title from the key

title.font

font type of legend title

title.cex

font size of legned text

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(Sushi_HiC.matrix)

chrom            = "chr11"
chromstart       = 500000
chromend         = 5050000

phic = plotHic(Sushi_HiC.matrix,chrom,chromstart,chromend,max_y = 20,zrange=c(0,28),palette = topo.colors,flip=FALSE)

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

addlegend(phic[[1]],palette=phic[[2]],title="score",side="right",bottominset=0.4,topinset=0,xoffset=-.035,labelside="left",width=0.025,title.offset=0.035)

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

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