Estimate global background in segmented copy numbers based on the location of peaks in a weighted density estimator of the minor copy number mean levels.
The global background, here called \(\kappa\), may have multiple origins where normal contamination is one, but not necessarily the only one.
Assumptions: This estimator assumes that there are segments with C1=0 and C1=1, i.e. some deletions and, typically, some normal segements.
# S3 method for PairedPSCBS
estimateKappaByC1Density(this, typeOfWeights=c("dhNbrOfLoci", "sqrt(dhNbrOfLoci)"),
adjust=1, from=0, minDensity=0.2, ..., verbose=FALSE)
Returns the background estimate as a numeric
scalar.
A character
string specifying how weights
are calculated.
A numeric
scale factor specifying the size of
the bandwidth parameter used by the density estimator.
A numeric
scalar specifying the lower bound for the
support of the estimated density.
A non-negative numeric
threshold specifying
the minimum density a peak should have in order to consider
it a peak.
Not used.
See Verbose
.
Retrieve segment-level minor copy numbers and corresponding weights:
Grabs the segment-level C1 estimates.
Calculate segment weights.
The default (typeOfWeights="dhNbrOfLoci"
) is to use
weights proportional to the number of heterozygous SNPs.
An alternative (typeOfWeights="sqrt(dhNbrOfLoci)"
) is
to use the square root of those counts.
Identify subset of regions with C1=0:
Estimates the weighted empirical density function (truncated at zero below). Tuning parameter 'adjust'.
Find the first two peaks (with a density greater than tuning parameter 'minDensity').
Assumes that the two peaks corresponds to C1=0 and C1=1.
Defines threshold Delta0.5 as the center location between these two peaks.
Estimate the global background signal:
For all segments with C1 < Delta0.5, calculate the weighted median of their C1:s.
Let kappa be the above weighted median. This is the estimated background.
Henrik Bengtsson
Instead of calling this method explicitly, it is recommended
to use the *estimateKappa()
method.