plot: Draw Multi-Set Intersections

plot.msetsR Documentation

Draw Multi-Set Intersections

Description

This function draws intersections among multiple sets.

Usage

## S3 method for class 'msets'
plot(x, Layout=c('circular','landscape'), degree=NULL,
	keep.empty.intersections=TRUE,
	sort.by=c('set','size','degree','p-value'),
	min.intersection.size=0, max.intersection.size=Inf,
	ylim=NULL, log.scale=FALSE, yfrac=0.8, margin=NULL,
	color.scale.pos=c(0.85, 0.9), legend.pos=c(0.85,0.25),
	legend.col=2, legend.text.cex=1, color.scale.cex=1, 
	color.scale.title=expression(paste(-Log[10],'(',italic(P),')')),
	color.on='#2EFE64', color.off='#EEEEEE', 
	show.overlap.size=TRUE, show.fold.enrichment=FALSE, show.set.size=TRUE,
	overlap.size.cex=0.9, track.area.range=0.3, bar.area.range=0.2,
	new.gridPage=TRUE, minMinusLog10PValue=0,
	maxMinusLog10PValue=NULL, show.elements=FALSE, ...)

Arguments

x

a msets object.

Layout

layout for plotting.

degree

a vector of intersection degrees for plotting. E.g., when degree=c(2:3), only those intersections involving two or three sets will be plotted. By default, degree=NULL, all possible intersections are plotted.

keep.empty.intersections

logical; if FALSE, empty intersection(s) will be discarded to save plotting space.

min.intersection.size

Minimum size of an intersection to be plotted.

max.intersection.size

Maximum size of an intersection to be plotted.

sort.by

how to sort intersections. It can be either one of the key words "set", "size", "degree", and "p-value", or a vector of custom ordered set combination strings.

ylim

the limits c(y1, y2) of plotting overlap size.

log.scale

logical; whether to plot with log transformed intersection sizes.

yfrac

numeric; the fraction (0 to 1) of canvas used for plotting bars. Only used for landscape Layout.

margin

numeric; a vector of 4 numeric values specifying the margins (bottom, left, top, & right) in unit of "lines". Default c(1,1,1,1)+0.1 for circular Layout and c(0.5,5,1.5,2)+0.1 for landscape Layout. Increase margin if the plot area is cropped.

color.scale.pos

numeric; x and y coordinates (0 to 1) for packing the color scale guide. It could be a keyword "topright" or "topleft" in the landscape layout, and one of "topright", "topleft", "bottomright" and "bottomleft" in the circular layout.

legend.pos

numeric; x and y coordinates (0 to 1) for packing the legend in the circular layout. It could be one of the keywords "bottomright", "bottomleft", "topleft" and "topright".

legend.col

integer; number of columns of the legend in the circular layout.

legend.text.cex

numeric; specifying the amount by which legend text should be magnified relative to the default.

color.scale.cex

numeric; specifying the amount by which color scale text should be magnified relative to the default.

color.scale.title

character or expression; a title for the color scale guide.

color.on

color code; specifying the color for set(s) which are "present" for an intersection. Can be a vector of colors. When NULL, a predefined list of colors will be used.

color.off

color code; specifying the color for set(s) which are "absent" for an intersection.

show.overlap.size

logical; whether to show overlap size on top of the bars. This will be set to FALSE if show.fold.enrichment = TRUE.

show.fold.enrichment

logical; whether to show fold enrichment if available rather than overlap size. This will impact show.overlap.size.

show.set.size

color code; whether to show set size in the landscape layout.

overlap.size.cex

numeric; specifying the amount by which overlap size text should be magnified relative to the default.

track.area.range

the magnitude of track area from origin in the circular layout.

bar.area.range

the magnitude of bar area from edge of the track area in the circular layout. The sum of track.area.range and track.area.range should not be larger than 0.5.

new.gridPage

logic; whether to start a new grid page. Set FALSE to allow for customized arrangement of the grid layout.

minMinusLog10PValue

numeric; minimum minus log10 P value for capping the scale of color map. Default 0.

maxMinusLog10PValue

numeric; maximum minus log10 P value for capping the scale of color map. Default maximum from the data.

show.elements

logical; whether to show the intersection elements on top of the bars with the landscape layout. See Details for more control options elements.*.

...

additional arguments for the plot function. See Details.

Details

The plot canvas has coordinates 0~1 for both x and y axes. Additional optional plot parameters include:

  • ylab, a chracter string of y axis label.

  • circle.radii, radii size of the circles in landscape Layout. Default 0.5.

  • heatmapColor, a vector of customized heat colors.

  • show.expected.overlap, whether to show expcted overlap in landscape Layout. Default 'FALSE'.

  • expected.overlap.style, one of c("hatchedBox","horizBar","box"). Default 'hatchedBox'.

  • expected.overlap.lwd, line width for expected.overlap "horizBar" and "box". Default 2.

  • color.expected.overlap, color for showing expcted overlap in hatched lines. Default 'grey'.

  • alpha.expected.overlap, alpha channel for transparency for showing expcted overlap hatched lines. Default 1 (normalized to the range 0 to 1).

  • cex, scale of text font size.

  • cex.lab, scale of axis label text font size.

  • show.track.id, logic, whether to show the track id in the circular layout. Default TRUE.

  • phantom.tracks, number of phantom tracks in the middle in the circular layout. Default 2.

  • gap.within.track, ratio of gap width over block width on the same track. Default 0.1.

  • gap.between.track, ratio of gap width over track width. Default 0.1.

  • bar.split, a vector of two values specifying a continuous range that will be cropped in the y axis with the landscape layout.

  • elements.list, a data.frame or matrix such as the one generated by the summary function from a msets object, with row names matching the barcodes of intersection combinations and at least one column named "Elements" listing the elements to be displayed (the elements should be concatenated by separator ", ").

  • elements.cex, numeric; specifying the amount by which intersection element text should be magnified. Default 0.9.

  • elements.rot, numeric; the angle to rotate the text of intersection elements. Default 45.

  • elements.col, colour for intersection element text. Default black.

  • elements.maximum, maximum number of elements to show.

  • intersection.size.rotate, logic, whether to rotate the text of intersection size.

  • flip.vertical, logic, whether to flip the bars to downwards in landscape Layout. Default 'FALSE'.

  • title, figure title. Default NULL.

  • cex.title, scale of title text font size. Default 1.

Value

No return.

Author(s)

Minghui Wang <minghui.wang@mssm.edu>, Bin Zhang <bin.zhang@mssm.edu>

References

Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. Scientific Reports 5: 16923.

See Also

msets

Examples

## Not run: 
#set up fake data
x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10))
obj=supertest(x,n=26)
plot(obj)

## End(Not run)

SuperExactTest documentation built on March 23, 2022, 5:07 p.m.