View source: R/CNVMetricsMethods.R
calculateLog2ratioMetric | R Documentation |
This function calculates a specific metric, as specified by the user, using overlapping amplified/deleted regions between to samples. The metric is calculated for the amplified and deleted regions separately. When more than 2 samples are present, the metric is calculated for each sample pair.
calculateLog2ratioMetric(
segmentData,
method = c("weightedEuclideanDistance"),
minThreshold = 0.2,
excludedRegions = NULL,
nJobs = 1
)
segmentData |
a |
method |
a |
minThreshold |
a single positive |
excludedRegions |
an optional |
nJobs |
a single positive |
The weighted euclidean distance is
(\sum((x_i - y_i)^2 * log(nbrBases_i))^0.5
where x
and y
are the
values of 2 samples for a specific segment i
and nbrBases
the
number of bases of the segment i
.
an object of class "CNVMetric
" which contains the calculated
metric. This object is a list with the following components:
LOG2RATIO
a lower-triangular matrix
with the
results of the selected metric on the log2ratio values for each paired
samples. The value NA
is present when the metric cannot be
calculated. The value NA
is also present in the top-triangular
section, as well as the diagonal, of the matrix.
The object has the following attributes (besides "class" equal to "CNVMetric"):
metric
the metric used for the calculation.
names
the names of the two matrix containing the metrics for
the amplified and deleted regions.
Astrid DeschĂȘnes, Pascal Belleau
## Load required package to generate the samples
require(GenomicRanges)
## Create a GRangesList object with 3 samples
## The stand of the regions doesn't affect the calculation of the metric
demo <- GRangesList()
demo[["sample01"]] <- GRanges(seqnames="chr1",
ranges=IRanges(start=c(1905048, 4554832, 31686841),
end=c(2004603, 4577608, 31695808)), strand="*",
log2ratio=c(2.5555, 1.9932, -0.9999))
demo[["sample02"]] <- GRanges(seqnames="chr1",
ranges=IRanges(start=c(1995066, 31611222, 31690000),
end=c(2204505, 31689898, 31895666)), strand=c("-", "+", "+"),
log2ratio=c(0.3422, 0.5454, -1.4444))
## The amplified region in sample03 is a subset of the amplified regions
## in sample01
demo[["sample03"]] <- GRanges(seqnames="chr1",
ranges=IRanges(start=c(1906069, 4558838),
end=c(1909505, 4570601)), strand="*",
log2ratio=c(3.2222, -1.3232))
## Calculating Sorensen metric
calculateLog2ratioMetric(demo, method="weightedEuclideanDistance", nJobs=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.