Last data update: 2014.03.03

R: Plot a sample point matrix
plotR Documentation

Plot a sample point matrix

Description

Plot the sample point matrix or parts of it

Usage

plot(x,y, ...)
## S4 method for signature 'scaleSpace,missing'
plot(x, y, spm, type='b', ...)
## S4 method for signature 'samplePointMatrix,missing'
plot(x, y, type="b", sigLevels=NULL, chromosomes=NULL, colinAxis=NULL, fillColor=NULL, maploc=NULL, interpolation=1, main=NULL, col=NULL, ylim=NULL, add=F, ...)
## S4 method for signature 'compKc,missing'
plot(x, sigRegions=NULL, type="1", chromosomes=NULL, colinAxis=NULL, maploc=NULL, interpolation=1, main=NULL, col1=NULL, col2=NULL, ylim=NULL, add=F, ...)

Arguments

x

either an object of class samplePointMatrix, scaleSpace or compKc

y

object of class missing

type

Determines which data is plotted. 'g' for gains only, 'l' for losses only and 'b' and '1' for both in one plot device

spm

add stuff here

sigRegions

The significant regions as calculated by the compKcSigRegions function

sigLevels

If given, the cutoffs will be drawn as lines in the plots. Optional

chromosomes

Takes a vector of chromosomes to be plotted. Defaults to all chromosomes.

colinAxis

Allows you to override default behaviour of axis labeling. Choose False for genomic position labeling for each individual chromosome, True for colinear labeling.

fillColor

Allows you to choose the colors used to fill the significant areas under the curve. Takes a list with the 'pos' element giving the color for the gains and the 'neg' element the color for the losses.

maploc

Currently not in use

interpolation

Determines which points from the sample point matrix will actually be plotted. If the value of 'interpolation' is n, then every n-th point will be plotted. The default value of 1 will results in all points being plotted. This can be useful when a high density sample point matrix results in big file size when exporting the image (especially to pdf or eps format).

main

Set the title of the plot

col

Set the color of the plotted lines

col1

Set the color of the plotted lines

col2

Set the color of the plotted lines

ylim

Set the y-axis limits

add

When set to true the plot is added to the current plot device

...

Any other parameters you would like to pass to 'plot'. See 'par' for more details.

Value

Plots the sample point matrix. The gains and the losses are plotted separately. The KC normalized score is plotted on the y-axis, the genomic position on the x-axis. If centromeres are present these are represented by dotted, lightblue lines. Setting type to 'b' or to '1' will both make the plot appear in one plot device, '1' will plot the gains and the losses in one plot, 'b' will plot the gains and losses separately. Using the 'add' flag it is possible to add a plot to the current plot device. The 'col' and 'ylim' arguments can be used to set the color of each plot and the plot regions. The function 'idPoints' can be used to identify points in the sample point matrix plot. See the corresponding documentation for details.

In case of plotting a compKc object, col1 and col2 can be used to set the colors of the group 1 and group 2 mean values respectively.

Author(s)

Jorma de Ronde

See Also

calcSpm, plotScaleSpace, idPoints

Examples

data(hsSampleData)
data(hsMirrorLocs)

spm1mb <- calcSpm(hsSampleData, hsMirrorLocs)

plot(spm1mb)
plot(spm1mb, interpolation=10)
plot(spm1mb, chromosomes=c(1,4,'X'))

siglevel1mb <- findSigLevelTrad(hsSampleData, spm1mb, n=3)
plot(spm1mb, chromosomes=c(1,4,'X'), sigLevels=siglevel1mb)
plot(spm1mb, chromosomes=c(1,4,'X'), sigLevels=siglevel1mb, fillColor=list(pos='darkred',neg='darkgreen'))

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(KCsmart)
Loading required package: siggenes
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: multtest
Loading required package: splines
Loading required package: KernSmooth
KernSmooth 2.23 loaded
Copyright M. P. Wand 1997-2009
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/KCsmart/plot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot
> ### Title: Plot a sample point matrix
> ### Aliases: plot plot,scaleSpace,missing-method
> ###   plot,samplePointMatrix,missing-method plot,compKc,missing-method
> ### Keywords: hplot
> 
> ### ** Examples
> 
> data(hsSampleData)
> data(hsMirrorLocs)
> 
> spm1mb <- calcSpm(hsSampleData, hsMirrorLocs)
[1] "Mirror locations looking fine"
[1] "Splitting data .."
[1] "Summing data .."
[1] "Mirroring data .."
[1] "Calculating sample point matrix .."

Processing chromosome 1 

Processing chromosome 10 

Processing chromosome 11 

Processing chromosome 12 

Processing chromosome 13 

Processing chromosome 14 

Processing chromosome 15 

Processing chromosome 16 

Processing chromosome 17 

Processing chromosome 18 

Processing chromosome 19 

Processing chromosome 2 

Processing chromosome 20 

Processing chromosome 21 

Processing chromosome 22 

Processing chromosome 3 

Processing chromosome 4 

Processing chromosome 5 

Processing chromosome 6 

Processing chromosome 7 

Processing chromosome 8 

Processing chromosome 9 

Processing chromosome X 

Processing chromosome Y 


[1] "Done"
> 
> plot(spm1mb)
> plot(spm1mb, interpolation=10)
> plot(spm1mb, chromosomes=c(1,4,'X'))
> 
> siglevel1mb <- findSigLevelTrad(hsSampleData, spm1mb, n=3)
[1] "Calculating alpha =  0.05 significance cut-off"
[1] "Found  584  pos peaks and  598  neg peaks in observed sample point matrix"
[1] "Calculating Mirror Positions"
[1] "Starting permutations .."
 At iteration 1 of 3[1] "Permuting"
[1] "Combining"
[1] "Returning"
 At iteration 2 of 3[1] "Permuting"
[1] "Combining"
[1] "Returning"
 At iteration 3 of 3[1] "Permuting"
[1] "Combining"
[1] "Returning"

> plot(spm1mb, chromosomes=c(1,4,'X'), sigLevels=siglevel1mb)
> plot(spm1mb, chromosomes=c(1,4,'X'), sigLevels=siglevel1mb, fillColor=list(pos='darkred',neg='darkgreen'))
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>