Description Usage Arguments Value Author(s) See Also Examples
copies
applies a model to a vector of logRatios, converting them into copy amounts.
LCN
is similar, but returns only Log-ratio related Copy Numbers, corresponding to a model with 0 as center
, 1 as width
and 2 as ploidy
. See the references for further details on the models.
1 2 3 |
x |
Numeric vector, the values to be converted (their nature depends on |
model |
A numeric vector, as returned by |
center |
Single numeric value, the most common |
width |
Single numeric value, |
ploidy |
Single numeric value, the real copy amount corresponding to |
exact |
Single logical value, whether to |
from |
Single character value defining what computation apply to |
A numeric vector the same length as x
.
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 | # 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
model <- model.auto(
segLogRatios = segLogRatios,
segChroms = segChroms,
segLengths = segLengths
)
# Relative copy numbers
print(
copies(
segLogRatios,
model = model,
ploidy = 0,
exact = FALSE
)
)
# Absolute copy number (assuming n=2)
print(
copies(
segLogRatios,
model = model,
ploidy = 2,
exact = FALSE
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.