R/drawLevels.DNAcopy.R

setMethodS3("drawLevels", "DNAcopy", function(fit, field=c("seg.mean", "tcn.mean", "dh.mean"), xScale=1, col="red", lwd=3, ...) {
  field <- match.arg(field)
  segments <- fit$output[,c("loc.start", "loc.end", field)]
  apply(segments, MARGIN=1, FUN=function(seg) {
    x <- c(seg[["loc.start"]], seg[["loc.end"]])
    y <- rep(seg[[field]], times=2)
    lines(x=xScale*x, y=y, col=col, lwd=lwd, ...)
  })
})

Try the PSCBS package in your browser

Any scripts or data that you put into this service are public.

PSCBS documentation built on Oct. 23, 2021, 9:09 a.m.