View source: R/CNVMetricsOverlapInternalMethods.R
calculateOneOverlapMetricT | R Documentation |
Calculate a specific metric using overlapping amplified/deleted regions between two samples.
calculateOneOverlapMetricT(entry, segmentData, method, type)
entry |
a |
segmentData |
a |
method |
a |
type |
a |
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 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, 32686222),
end=c(2004603, 4577608, 31695808, 32689222)), strand="*",
state=c("AMPLIFICATION", "AMPLIFICATION", "DELETION", "LOH"))
demo[["sample02"]] <- GRanges(seqnames="chr1",
ranges= IRanges(start=c(1995066, 31611222, 31690000, 32006222),
end=c(2204505, 31689898, 31895666, 32789233)),
strand=c("-", "+", "+", "+"),
state=c("AMPLIFICATION", "AMPLIFICATION", "DELETION", "LOH"))
## 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="*",
state=c("AMPLIFICATION", "DELETION"))
## The 2 samples used to calculate the metric
entries <- data.frame(row=c(2, 3), col=c(1, 1))
## Calculate Sorensen metric for the amplified regions on samples 2 and 3
CNVMetrics:::calculateOneOverlapMetricT(entry=entries, segmentData=demo,
method="sorensen", type="AMPLIFICATION")
## Calculate Szymkiewicz-Simpson metric for the amplified regions
## in samples 1 and 2
## Amplified regions of sample02 are a subset of the amplified
## regions in sample01
CNVMetrics:::calculateOneOverlapMetricT(entry=entries, segmentData=demo,
method="szymkiewicz", type="AMPLIFICATION")
## Calculate Sorensen metric for the deleted regions in samples 1 and 2
CNVMetrics:::calculateOneOverlapMetricT(entry=entries, segmentData=demo,
method="sorensen", type="DELETION")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.