View source: R/CNVMetricsLog2ratioInternalMethods.R
calculateOneLog2valueMetricT | R Documentation |
Calculate a specific metric using the level of amplification/deletion, in log2 ratio, between two samples.
calculateOneLog2valueMetricT(
entry,
segmentData,
method,
minThreshold,
bedExclusion
)
entry |
a |
segmentData |
a |
method |
a |
minThreshold |
a single |
bedExclusion |
an optional |
The method calculates a specified metric using overlapping regions between the samples. Only regions corresponding to the type specified by user are used in the calculation of the metric. The strand of the regions is not taken into account while calculating the metric.
The Sorensen metric is calculated by dividing twice the size of
the intersection by the sum of the size of the two sets. If the sum of
the size of the two sets is zero; the value NA
is
returned instead.
a list
containing 1 entry:
metric
a data.frame
, which contains 3 columns. The 2
first columns, called row
and column
correspond to the
indexes of the metric in the final matrix. Those
2 first columns match to the entry
parameter. The third column,
called metric
,
contains the values of the specified metric for each combination.
If the metric cannot be calculated, NA
is present.
Astrid DeschĂȘnes
## Load required package to generate the two 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()
## Generate two samples with log2value information as a metadata column
demo[["sample01"]] <- GRanges(seqnames="chr1",
ranges=IRanges(start=c(100, 201, 400),
end=c(200, 350, 500)), strand="*",
log2ratio=c(1.1111, 2.2222, -0.9999))
demo[["sample02"]] <- GRanges(seqnames="chr1",
ranges=IRanges(start=c(150, 200, 450),
end=c(250, 350, 500)), strand="*",
log2ratio=c(2.2121, 1.1212, -1.3939))
## The 2 samples used to calculate the metric
entries <- data.frame(row=c(2), col=c(1))
## Calculate weighted Euclidean distance
CNVMetrics:::calculateOneLog2valueMetricT(entry=entries,
segmentData=demo, method="weightedEuclideanDistance",
minThreshold=0.2, bedExclusion=NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.