View source: R/bedr.plot.region.R
| bedr.plot.region | R Documentation | 
Visualize regions or intervals. e.g. VennDiagrams of intersections of distinct intervals, base pairs and genes.
bedr.plot.region(
	input,
	filename = NULL,
	type = "venn",
	feature = "interval",
	fraction.overlap = 0.000000001,
	group = NULL,
	params = list(),
	verbose = TRUE
	)
| input | A list of input regions or indices | 
| filename | The name of the output image file | 
| type | The type of plot. only 'venn' is supported for intersections at the moment. | 
| feature | How should the regions be intersected. By unique "interval", "gene", "size" or "other" to use the features in the first item in the input list. | 
| fraction.overlap | Minimum overlap required as a fraction of A. Default is 1E-9 (i.e. 1bp). | 
| group | A grouping parameter for barplots. Possible values include "input", "chr", or a categorical vector of length equal to the sum of the input. | 
| params | Additional parameters for plotting or intersecting.  See  | 
| verbose | Include text messages. | 
By default a venn diagram is output. If a single input is used then the plot shows the number of unique and collapsed regions after applying a merge.
Plots!
Daryl Waggott
## Not run: 
if (check.binary("bedtools")) {
	# example data
	a <- get.random.regions(n = 1000, chr = "chr22", size.mean = 10)
	b <- get.random.regions(n = 1000, chr = "chr22", size.mean = 10)
	d <- get.random.regions(n = 1000, chr = "chr22", size.mean = 10)
	e <- get.random.regions(n = 1000, chr = "chr22", size.mean = 10)
	f <- get.random.regions(n = 1000, chr = "chr22", size.mean = 10)
	pdf("bedr.plot.region.ex.pdf")
	# basic venn diagrams
	bedr.plot.region(input = list(a=a,b=b))
	bedr.plot.region(input = list(a=a,b=b,d=d))
	#bedr.plot.region(input = list(a=a,b=b,d=d,e=e))
	#bedr.plot.region(input = list(a=a,b=b,d=d,e=e,f=f))
	### change venn parameters
	bedr.plot.region(
		input = list(a=a,b=b,d=d),
		params = list(lty = 2, label.col = "black", main = "Region Overlap")
		)
	### try with different 
	#bedr.plot.region(input = list(a=a,b=b), feature = "gene")
	#bedr.plot.region(input = list(a=a,b=b), feature = "reference")
	#bedr.plot.region(input = list(a=a,b=b), feature = "interval")
	#bedr.plot.region(input = list(a=a,b=b), feature = "cluster")
	#bedr.plot.region(input = list(a=a,b=b), feature = "bp")
	dev.off()
	}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.