singleplot | R Documentation |
singleplot
is the core plotting function of ACE. Input can be either a template or a QDNAseq-object with the index of the sample specified. Several of the arguments are parameters obtained from model fitting. Returns a ggplot2
graph with absolute copies on the y-axis and genomic position on the x-axis.
singleplot(template, QDNAseqobjectsample = FALSE, cellularity = 1, error, ploidy = 2, standard, title, trncname = FALSE, cap = 12, bottom = 0, chrsubset, onlyautosomes = TRUE, sgc = c())
template |
Object. Either a data frame as created by |
QDNAseqobjectsample |
Integer. Specifies which sample to analyze from the QDNAseq-object. Required when using a QDNAseq-object as template. Default = FALSE |
cellularity |
Numeric. Used for rescaling bin and segment values. Printed on graph. Default = 1 |
error |
Numeric. When given, it is printed on the graph below cellularity. |
ploidy |
Integer. Assume the median of segments has this absolute copy number. Default = 2 |
standard |
Numeric. Force the given ploidy to represent this raw value. When omitted, the standard will be calculated from the data. When using parameters obtained from |
title |
Character string. Overwrites the automatically generated title |
trncname |
Logical. In case of a QDNAseq object, the name of the sample is retrieved from the object and used as title. If set to TRUE, |
cap |
Integer. Influences your output copy number graphs. The upper limit of the y-axis is set at this number. When set to "max", it sets the cap to the maximum absolute copynumber value, rounded up. Bins and segments that exceed the cap are represented by a special mark. Recommended use between 8 and 16. Default = 12 |
bottom |
Integer. Similar to cap, but for the lower limit of the y-axis. When set to "min", it sets the bottom to the minimum absolute copynumber value, rounded down. Bins and segments that subceed the bottom are represented by a special mark. Default = 0 |
chrsubset |
Integer vector. Specify the chromosomes you want to plot. It will always take the full range of chromosomes in your subset, so specifying chrsubset = c(4, 8) will give the same plot as chrsubset = 4:8. When using a subset, singleplot will not plot the cellularity and error on the plot. Therefore, you can use this to make a copy number plot without this information by specifying chrsubset = 1:22 |
onlyautosomes |
Logical or integer. You can fill in an integer to specify how many autosomes your species has. When TRUE, |
sgc |
Integer or character vector. Specify which chromosomes occur with only a single copy in the germline |
Returns a graph generated through the ggplot2
package.
singleplot
expects chromosome names, as specified in the chr
column of the template, to be either just the integer chromosome number, or "chr" followed by the chromosome number. This is strictly required when onlyautosomes = TRUE.
When plotting sex chromosomes, make sure to specify sgc = c()
when plotting the copy number profile of a male individual.
Jos B. Poell
objectsampletotemplate
, squaremodel
, singlemodel
## simulated data assuming each chromosome comprises 100 bins s <- jitter(c(1, 1, 0.8, 1.2, rep(1, 5), 1.4, rep(1, 13)), amount = 0) n <- c(100, 100, 40, 60, rep(100, 5), 100, rep(100, 13)) bin <- 1:2200 chr <- rep(1:22, each = 100) start <- rep(0:99*1000000+1, 22) end <- rep(1:100*1000000, 22) copynumbers <- jitter(rep(s,n), amount = 0.05) segments <- rep(s, n) template <- data.frame(bin = bin, chr = chr, start = start, end = end, copynumbers = copynumbers, segments = segments) model <- singlemodel(template) bestfit <- model$minima[model$rerror==min(model$rerror)] singleplot(template, cellularity = tail(bestfit, 1), title = "sim") ## using segmented data from a QDNAseq-object data("copyNumbersSegmented") singlemodel(copyNumbersSegmented, QDNAseqobjectsample = 1) singleplot(copyNumbersSegmented, QDNAseqobjectsample = 1, cellularity = 0.79) ## QDNAseq 'blacklists' sex chromosomes, but singleplot can plot them singleplot(copyNumbersSegmented, QDNAseqobjectsample = 1, cellularity = 0.79, chrsubset = 12:24, onlyautosomes = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.