Learn R Programming

cgh (version 1.0-7.1)

sw.plot: Plot Results of Smith-Waterman Algorithm

Description

This function plots the sign-adjusted logratios by their chromosomal location. It can superimpose the location of the highest-scoring island found by the Smith-Waterman algorithm, the results of a robustness analysis, and the expected logratios based on known copy numbers in the test DNA.

Usage

sw.plot(logratio, location = seq(length(logratio)), threshold.func = function(x) median(x) + .2 * mad(x), sign = -1, highest = TRUE, expected = NULL, rob = NULL, legend = TRUE, xlab = "Chromosomal location", ylab = "Intensity log ratio", ...)

Arguments

logratio
a vector of logratios, not adjusted for sign or threshold
location
a vector of chromosomal locations corresponding to the log ratios
threshold.func
threshold function: see sw.threshold
sign
sign of logratio adjustment: see sw.threshold
highest
plot location of highest-scoring island if TRUE
expected
a vector of expected copy numbers, or NULL
rob
a vector of robustness scores, or NULL
legend
plot legend if TRUE
xlab
X axis label
ylab
Y axis label
...
other arguments passed to the 'plot' function

References

Price TS, et al. SW-ARRAY: a dynamic programming solution for the identification of copy-number changes in genomic DNA using array comparative genome hybridization data. Nucl Acids Res. 2005;33(11):3455-3464.

See Also

sw sw.threshold sw.perm.test sw.rob

Examples

Run this code
## simluate vector of logratios
set.seed(3)
logratio <- c(rnorm(20) - 1, rnorm(20))

## invert sign of values and subtract threshold to ensure negative mean
x <- sw.threshold(logratio, function(x) median(x) + .2 * mad(x), -1)

## perform permuation test for islands identified
p <- sw.perm.test(x, max.nIslands = NULL, nIter = 1e4)

## calculate robustness scores
r <- sw.rob(x)

## plot results
sw.plot(logratio, seq(length(logratio)),
  function(x) median(x) + .2 * mad(x), sign = -1, rob = r,
  main = paste("Toy dataset, highest-scoring island p =", p[1]))
  

Run the code above in your browser using DataLab