Last data update: 2014.03.03

R: Plot a chromosome-value pair
plotChromValuePairR Documentation

Plot a chromosome-value pair

Description

Base function which plots the ideogram and superimposed data for a single chromosome. plotOnIdeo() calls this function and stacks the resulting output.

Usage

plotChromValuePair(chrom, cytoTable, bpLim, vertical, values_GR, 
    val_range, col, value_cols = "values", default_margins, addScale, 
    ablines_y, smoothVals, span=0.03, verbose = FALSE, ...)

Arguments

chrom

(character) chromosome(s) to create ideograms for

cytoTable

(data.frame) loaded ideogram table. (see ideoTable argument to plotOnIdeo())

bpLim

(numeric) (aka xlim); display only a section of the chromosome and the corresponding values

vertical

(logical) if TRUE, chromosomes will be plotted vertically

values_GR

(GenomicRanges) data to be plotted must be in metadata columns

val_range

(numeric) (aka ylim); y-axis scale for data series

col

(character) colour for series

value_cols

(character) column name for series to plot

default_margins

(numeric) page inner margins (in inches)

addScale

(logical) if FALSE, bp positions will be hidden

ablines_y

(numeric) when specified, will draw reference lines on the y-axis

smoothVals

(logical) when T applies loess() to each series

span

(numeric)span argument for loess function

verbose

(logical) print messages

...

arguments to axis(), line(), and rect()

Details

Plots one unit of chromosome ideogram with dataseries superimposed. Usually, the user can avoid this function and directly call plotOnIdeo(). However, this function may be used in cases where further plot customization is required.

Author(s)

Shraddha Pai <Shraddha.Pai@camh.ca>, Jingliang Ren

See Also

plotOnIdeo()

Examples

data(hg18_ideo)
data(binned_multiSeries)
layout(matrix(1:2, byrow=TRUE,ncol=1),heights=c(2.5,1))
plotChromValuePair("chr1",hg18_ideo, 
	values_GR=binned_multiSeries,value_cols=colnames(mcols(binned_multiSeries)),plotType='lines',
	col=1:5,val_range=c(0,10),bpLim=NULL,vertical=FALSE,addScale=TRUE,ablines_y=NULL,
	smoothVals=FALSE,default_margins=c(0.5,.5,.1,.1))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IdeoViz)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

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

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

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

    IQR, mad, xtabs

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

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

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

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: RColorBrewer
Loading required package: rtracklayer
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/IdeoViz/plotChromValuePair.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotChromValuePair
> ### Title: Plot a chromosome-value pair
> ### Aliases: plotChromValuePair
> 
> ### ** Examples
> 
> data(hg18_ideo)
> data(binned_multiSeries)
> layout(matrix(1:2, byrow=TRUE,ncol=1),heights=c(2.5,1))
> plotChromValuePair("chr1",hg18_ideo, 
+ 	values_GR=binned_multiSeries,value_cols=colnames(mcols(binned_multiSeries)),plotType='lines',
+ 	col=1:5,val_range=c(0,10),bpLim=NULL,vertical=FALSE,addScale=TRUE,ablines_y=NULL,
+ 	smoothVals=FALSE,default_margins=c(0.5,.5,.1,.1))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>