View source: R/CNVMetricsSimulations.R
processSim | R Documentation |
The function uses the input sample to simulate new samples. The simulated samples will possess similar sizes of events, proportional to the original chromosome. To generate realistic simulations, the specified sample must contain segments covering the majority of the genome. Most importantly, the NEUTRAL segments should be present.
processSim(curSample, nbSim)
curSample |
a |
nbSim |
a single positive |
TODO
a data.frame
containing the segments for each
simulated sample. The data.frame
has 6 columns:
ID
a character
string, the name of the simulated
sample
chr
a character
string, the name fo the chromosome
start
a integer
, the starting position of the
segment
end
a integer
, the ending position of the segment
log2ratio
a numerical
, the log2 copy number
ratio assigned to the segment
state
a character
string, the state of the segment
(ex: DELETION, AMPLIFICATION, NEUTRAL, etc.)
Astrid DeschĂȘnes, Pascal Belleau
## Load required package to generate the sample
require(GenomicRanges)
## Create one 'demo' genome with 2 chromosomes and few segments
## The stand of the regions doesn't affect the calculation of the metric
sample01 <- GRanges(seqnames=c(rep("chr1", 4), rep("chr2", 3)),
ranges=IRanges(start=c(1905048, 4554832, 31686841, 32686222,
1, 120331, 725531),
end=c(2004603, 4577608, 31695808, 32689222, 117121,
325555, 1225582)),
strand="*",
state=c("AMPLIFICATION", "NEUTRAL", "DELETION", "LOH",
"DELETION", "NEUTRAL", "NEUTRAL"),
log2ratio=c(0.5849625, 0, -1, -1, -0.87777, 0, 0))
## Generates 10 simulated genomes based on the 'demo' genome
simRes <- processSim(curSample=sample01, nbSim=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.