Description Usage Arguments Value Author(s) See Also Examples
This function provides various data to manually fit or upgrade a copy number model, as needed by model.apply
to translate logRatios into copy numbers.
1 2 3 4 5 6 7 8 | model.test(segLogRatios, segChroms, segLengths = rep(1, length(segLogRatios)),
model = NA, center = model['center'], width = model['width'],
ploidy = model['ploidy'], bw = model['bw'], minDensity = 0.001,
peakFrom = model['peakFrom'], peakTo = model['peakTo'], graph = TRUE,
parameters = TRUE, returnPar = FALSE, xlim = c(0, 5), ylim = c(0, max(segLengths)),
xlab = "Segment copy number", ylab = "Segment length", cex.seg = 0.4, cex.leg = 0.7,
cex.l2r = 0.7, exclude = c("X", "Y", "Xp", "Xq", "Yp", "Yq"), title = NULL,
panel = FALSE, klim = NULL, ...)
|
segLogRatios |
Double vector, the log ratios of the CGH segments to modelize. |
segChroms |
Vector, the chromosome holding the CGH segments to modelize. |
segLengths |
Double vector, the lengths of the CGH segments to modelize. Amount of probes should be prefered if available, but nucleotide length or no length at all can also be used. |
model |
A double vector, as returned by |
center |
Single double value, the center parameter to use in the model. |
width |
Single double value, the width parameter to use in the model. |
ploidy |
Single numeric value, copy number supposed to be the most common within the analyzed genome. |
bw |
Single double value, the bandwidth parameter to use in the model. |
minDensity |
Single double value, minimal density for a peak to be detected. |
peakFrom |
Single double value, the peak logRatio lower limit parameter to use in the model. |
peakTo |
Single double value, the peak logRatio upper limit parameter to use in the model. |
graph |
Single logical value, whether to plot the density distribution of the segments with the modelized copy numbers or not. |
parameters |
Single logical value, whether to add a legend to the plot with the parameters and statistics of the model or not. |
returnPar |
Single logical value, whether to return the |
xlim |
Vector of two double values, the boundaries of the plot on the horizontal axis (in |
ylim |
Vector of two double values, the boundaries of the plot on the vertical axis (in the same units than |
xlab |
Single character value, the title to print for the horizontal axis. |
ylab |
Single character value, the title to print for the vertical axis. |
cex.seg |
Single double value, the character expansion factor for points (segments) on the plot. |
cex.leg |
Single double value, the character expansion factor for the plot legend. |
cex.l2r |
Single double value, the character expansion factor for the log-ratio axis of the plot. |
exclude |
Vector, the chromosomes to exclude from the density computation and to plot with distinct symbols (use |
title |
To be passed to |
panel |
Single logical value, whether to plot a rotated minimalist graph or a classic one. |
klim |
Double vector of two values, alternative definition of |
... |
Further graphical arguments to be passed to |
When returnPar
is TRUE
, invisibly returns the par
content, for point identification.
When returnPar
is FALSE
, returns the same vector as model.auto
, see its help page for further details.
Sylvain Mareschal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | # Generating random segmentation results
## with 30% normal cells contamination
## with +10% for normal DNA labelling
segLogRatios <- c(
rnorm(
sample(5:20, 1),
mean = log((1*0.7 + 2*0.3)/(2*1.1), 2), # One deletion
sd = 0.08
),
rnorm(
sample(80:120, 1),
mean = log(2/(2*1.1), 2), # No alteration
sd = 0.08
),
rnorm(
sample(40:60, 1),
mean = log((3*0.7 + 2*0.3)/(2*1.1), 2), # One more copy
sd = 0.08
)
)
segLogRatios <- sample(segLogRatios)
segLengths <- as.integer(3 + round(rchisq(length(segLogRatios), 1)*100))
segEnds <- cumsum(segLengths)
segStarts <- c(1L, head(segEnds, -1))
segChroms <- rep("chr1", length(segEnds))
# Generated genome
genome <- data.frame(
segChroms,
segStarts,
segEnds,
segLogRatios,
segLengths
)
print(genome)
# Automatic modelization
autoModel <- model.auto(
segLogRatios = segLogRatios,
segChroms = segChroms,
segLengths = segLengths
)
layout(matrix(1:2, ncol=1))
# Show automatic model
model.test(
segLogRatios = segLogRatios,
segChroms = segChroms,
segLengths = segLengths,
model = autoModel
)
# Standard model derived from the log ratios definition
refModel <- model.test(
segLogRatios = segLogRatios,
segChroms = segChroms,
segLengths = segLengths,
center = 2,
width = 1,
bw = 0.1 # Arbitrary
)
# Differences in scores
print(autoModel)
print(refModel)
layout(1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.