Version: | 1.7.1 |
Depends: | R (≥ 3.1.2), R.utils (≥ 2.11.0), aroma.core (≥ 3.2.2) |
Imports: | R.methodsS3 (≥ 1.8.1), R.oo (≥ 1.24.0), R.filesets (≥ 2.14.0), R.cache (≥ 0.15.0), matrixStats (≥ 0.61.0), PSCBS (≥ 0.65.0), future.apply |
Suggests: | aroma.light (≥ 2.2.1), DNAcopy (≥ 1.40.0), GLAD (≥ 1.12.0) |
SuggestsNote: | BioC (>= 3.0), Recommended: aroma.light, DNAcopy |
Title: | Copy-Number Analysis of Large Microarray Data Sets |
Description: | Methods for analyzing DNA copy-number data. Specifically, this package implements the multi-source copy-number normalization (MSCN) method for normalizing copy-number data obtained on various platforms and technologies. It also implements the TumorBoost method for normalizing paired tumor-normal SNP data. |
License: | LGPL-2.1 | LGPL-3 [expanded from: LGPL (≥ 2.1)] |
LazyLoad: | TRUE |
biocViews: | ProprietaryPlatforms, aCGH, CopyNumberVariants, SNP, Microarray, OneChannel, TwoChannel, DataImport, DataRepresentation, Preprocessing, QualityControl |
URL: | https://www.aroma-project.org/, https://github.com/HenrikBengtsson/aroma.cn |
BugReports: | https://github.com/HenrikBengtsson/aroma.cn/issues |
NeedsCompilation: | no |
Packaged: | 2024-02-17 19:57:52 UTC; henrik |
Author: | Henrik Bengtsson [aut, cre, cph], Pierre Neuvial [aut] |
Maintainer: | Henrik Bengtsson <henrikb@braju.com> |
Repository: | CRAN |
Date/Publication: | 2024-02-17 20:30:02 UTC |
Package aroma.cn
Description
Methods for analyzing DNA copy-number data. Specifically, this package implements the multi-source copy-number normalization (MSCN) method for normalizing copy-number data obtained on various platforms and technologies. It also implements the TumorBoost method for normalizing paired tumor-normal SNP data.
This package should be considered to be in an alpha or beta phase. You should expect the API to be changing over time.
Installation and updates
To install this package, call install.packages("aroma.cn")
.
To get started
To get started, see:
...
License
The releases of this package is licensed under LGPL version 2.1 or newer.
The development code of the packages is under a private licence (where applicable) and patches sent to the author fall under the latter license, but will be, if incorporated, released under the "release" license above.
Author(s)
Henrik Bengtsson, Pierre Neuvial
References
Please cite PSCBS using one or more of the following references:
A.B. Olshen, H. Bengtsson, P. Neuvial, P.T. Spellman, R.A. Olshen, V.E. Seshan. Parent-specific copy number in paired tumor-normal studies using circular binary segmentation, Bioinformatics, 2011
Please cite PSCBS using one or more of the following references:
H. Bengtsson, P. Neuvial and T.P. Speed. TumorBoost: Normalization of allele-specific tumor copy numbers from a single pair of tumor-normal genotyping microarrays, BMC Bioinformatics, 2010
H. Bengtsson, A. Ray, P. Spellman and T.P. Speed. A single-sample method for normalizing and combining full-resolutioncopy numbers from multiple platforms, labs and analysis methods, Bioinformatics, 2009
H. Bengtsson; K. Simpson; J. Bullard; K. Hansen. aroma.affymetrix: A generic framework in R for analyzing small to very large Affymetrix data sets in bounded memory, Tech Report 745, Department of Statistics, University of California, Berkeley, February 2008
H. Bengtsson, R. Irizarry, B. Carvalho, & T.P. Speed. Estimation and assessment of raw copy numbers at the single locus level, Bioinformatics, 2008
To see these entries in BibTeX format, use 'print(<citation>, bibtex=TRUE)', 'toBibtex(.)', or set 'options(citation.bibtex.max=999)'.
The AbstractCurveNormalization class
Description
Package: aroma.cn
Class AbstractCurveNormalization
Object
~~|
~~+--
AbstractCurveNormalization
Directly known subclasses:
PrincipalCurveNormalization, XYCurveNormalization
public abstract static class AbstractCurveNormalization
extends Object
Usage
AbstractCurveNormalization(dataSet=NULL, targetSet=NULL, subsetToFit=NULL, tags="*",
copyTarget=TRUE, ...)
Arguments
dataSet |
An |
targetSet |
An |
subsetToFit |
The subset of loci to be used to fit the
normalization functions.
If |
tags |
(Optional) Sets the tags for the output data sets. |
copyTarget |
If |
... |
Not used. |
Fields and Methods
Methods:
getFullName | - | |
getInputDataSet | - | |
getName | - | |
getOutputDataSet | - | |
getTags | - | |
getTargetDataSet | - | |
process | - | |
setTags | - | |
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Author(s)
Henrik Bengtsson
The MultiSourceCopyNumberNormalization class
Description
Package: aroma.cn
Class MultiSourceCopyNumberNormalization
Object
~~|
~~+--
ParametersInterface
~~~~~~~|
~~~~~~~+--
MultiSourceCopyNumberNormalization
Directly known subclasses:
public static class MultiSourceCopyNumberNormalization
extends ParametersInterface
The multi-source copy-number normalization (MSCN) method [1] is a normalization method that normalizes copy-number estimates measured by multiple sites and/or platforms for common samples. It normalizes the estimates toward a common scale such that for any copy-number level the mean level of the normalized data are the same.
Usage
MultiSourceCopyNumberNormalization(dsList=NULL, fitUgp=NULL, subsetToFit=NULL,
targetDimension=1, align=c("byChromosome", "none"), tags="*", ...)
Arguments
dsList |
A |
fitUgp |
An |
subsetToFit |
The subset of loci (as mapped by the |
targetDimension |
A |
align |
A |
tags |
(Optional) Sets the tags for the output data sets. |
... |
Not used. |
Details
The multi-source normalization method is by nature a single-sample method, that is, it normalizes arrays for one sample at the time and independently of all other samples/arrays.
However, the current implementation is such that it first generates smoothed data for all samples/arrays. Then, it normalizes the sample one by one.
Fields and Methods
Methods:
getAllNames | - | |
getAsteriskTags | - | |
getInputDataSets | - | |
getOutputDataSets | - | |
getTags | - | |
nbrOfDataSets | - | |
process | - | |
Methods inherited from ParametersInterface:
getParameterSets, getParameters, getParametersAsString
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Different preprocessing methods normalize ChrX & ChrY differently
Some preprocessing methods estimate copy numbers on sex chromosomes differently from the autosomal chromosomes. The way this is done may vary from method to method and we cannot assume anything about what approach is. This is the main reason why the estimation of the normalization function is by default based on signals from autosomal chromosomes only; this protects the estimate of the function from being biased by specially estimated sex-chromosome signals. Note that the normalization function is still applied to all chromosomes.
This means that if the transformation applied by a particular preprocessing method is not the same for the sex chromosomes as the autosomal chromosomes, the normalization applied on the sex chromosomes is not optimal one. This is why multi-source normalization sometimes fails to bring sex-chromosome signals to the same scale across sources. Unfortunately, there is no automatic way to handle this. The only way would be to fit a specific normalization function to each of the sex chromosomes, but that would require that there exist copy-number abberations on those chromosomes, which could be a too strong assumption.
A more conservative approach is to normalize the signals such that
afterward the median of the smoothed copy-number levels are the same
across sources for any particular chromosome.
This is done by setting argument align="byChromosome"
.
Author(s)
Henrik Bengtsson
References
[1] H. Bengtsson, A. Ray, P. Spellman & T.P. Speed,
A single-sample method for normalizing and combining
full-resolution copy numbers from multiple platforms,
labs and analysis methods,
Bioinformatics 2009.
Non-documented objects
Description
This page contains aliases for all "non-documented" objects that
R CMD check
detects in this package.
Almost all of them are generic functions that have specific
document for the corresponding method coupled to a specific class.
Other functions are re-defined by setMethodS3()
to
default methods. Neither of these two classes are non-documented
in reality.
The rest are deprecated methods.
The PairedPscbsModel class
Description
Package: aroma.cn
Class PairedPscbsModel
Object
~~|
~~+--
ParametersInterface
~~~~~~~|
~~~~~~~+--
PairedPscbsModel
Directly known subclasses:
public static class PairedPscbsModel
extends ParametersInterface
This class represents the Paired PSCBS method [1], which segments matched tumor-normal parental copy-number data into piecewise constant segments.
Usage
PairedPscbsModel(dsT=NULL, dsN=NULL, tags="*", ..., dropTcnOutliers=TRUE,
gapMinLength=1e+06, seed=NULL)
Arguments
dsT , dsN |
The tumor and the normal
|
tags |
Tags added to the output data sets. |
... |
(Optional) Additional arguments passed to
|
dropTcnOutliers |
If |
gapMinLength |
Genomic regions with no data points that are of
this length and greater are considered to be "gaps" and are ignored
in the segmentation. If + |
seed |
An optional |
Fields and Methods
Methods:
fit | - | |
getChipType | - | |
getChromosomes | - | |
getDataSets | - | |
getFullName | - | |
getName | - | |
getNormalDataSet | - | |
getOutputDataSet | - | |
getTags | - | |
getTumorDataSet | - | |
indexOf | - | |
nbrOfFiles | - | |
setTags | - | |
Methods inherited from ParametersInterface:
getParameterSets, getParameters, getParametersAsString
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
References
[1] ...
See Also
...
Examples
## Not run:
dataSet <- "GSE12702"
tags <- "ASCRMAv2"
chipType <- "Mapping250K_Nsp"
ds <- AromaUnitPscnBinarySet$byName(dataSet, tags=tags, chipType=chipType)
print(ds)
# Extract tumors and normals
idxs <- seq(from=1, to=nbrOfFiles(ds), by=2)
dsT <- extract(ds, idxs);
idxs <- seq(from=2, to=nbrOfFiles(ds), by=2)
dsN <- extract(ds, idxs);
# Setup Paired PSCBS model
seg <- PairedPscbsModel(dsT=dsT, dsN=dsN)
print(seg)
# Segment all tumor-normal pairs
fit(seg, verbose=-10)
## End(Not run)
The PrincipalCurveNormalization class
Description
Package: aroma.cn
Class PrincipalCurveNormalization
Object
~~|
~~+--
AbstractCurveNormalization
~~~~~~~|
~~~~~~~+--
PrincipalCurveNormalization
Directly known subclasses:
public static class PrincipalCurveNormalization
extends AbstractCurveNormalization
Usage
PrincipalCurveNormalization(..., subset=1/20)
Arguments
... |
Arguments passed to |
subset |
A |
Fields and Methods
Methods:
No methods defined.
Methods inherited from AbstractCurveNormalization:
as.character, backtransformOne, fitOne, getAsteriskTags, getDataSets, getFullName, getInputDataSet, getName, getOutputDataSet, getPairedDataSet, getPath, getRootPath, getSubsetToFit, getTags, getTargetDataSet, nbrOfFiles, process, setTags
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Author(s)
Henrik Bengtsson
The TotalCnBinnedSmoothing class
Description
Package: aroma.cn
Class TotalCnBinnedSmoothing
Object
~~|
~~+--
ParametersInterface
~~~~~~~|
~~~~~~~+--
AromaTransform
~~~~~~~~~~~~|
~~~~~~~~~~~~+--
TotalCnSmoothing
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--
TotalCnBinnedSmoothing
Directly known subclasses:
public static class TotalCnBinnedSmoothing
extends TotalCnSmoothing
Usage
TotalCnBinnedSmoothing(..., robust=FALSE)
Arguments
... |
Arguments passed to |
robust |
If |
Details
Note that dsS <- TotalCnBinnedSmoothing(ds, targetUgp=ugp)
where
ugp <- getAromaUgpFile(ds)
returns a data set with an identical
set of loci as the input data set and identical signals as the
input ones, except for loci with duplicated positions. If all
loci have unique positions, the the output is identical to the input.
Fields and Methods
Methods:
No methods defined.
Methods inherited from TotalCnSmoothing:
getAsteriskTags, getOutputDataSet0, getOutputFileClass, getOutputFileExtension, getOutputFileSetClass, getOutputFiles, getParameters, getPath, getRootPath, getTargetPositions, getTargetUgpFile, process, smoothRawCopyNumbers
Methods inherited from AromaTransform:
as.character, findFilesTodo, getAsteriskTags, getExpectedOutputFiles, getExpectedOutputFullnames, getFullName, getInputDataSet, getName, getOutputDataSet, getOutputDataSet0, getOutputFiles, getPath, getRootPath, getTags, isDone, process, setTags
Methods inherited from ParametersInterface:
getParameterSets, getParameters, getParametersAsString
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Author(s)
Henrik Bengtsson
The TotalCnKernelSmoothing class
Description
Package: aroma.cn
Class TotalCnKernelSmoothing
Object
~~|
~~+--
ParametersInterface
~~~~~~~|
~~~~~~~+--
AromaTransform
~~~~~~~~~~~~|
~~~~~~~~~~~~+--
TotalCnSmoothing
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--
TotalCnKernelSmoothing
Directly known subclasses:
public static class TotalCnKernelSmoothing
extends TotalCnSmoothing
Usage
TotalCnKernelSmoothing(..., kernel=c("gaussian", "uniform"), bandwidth=50000, censorH=3,
robust=FALSE)
Arguments
... |
Arguments passed to |
kernel |
A |
bandwidth |
A |
censorH |
A positive |
robust |
If |
Fields and Methods
Methods:
No methods defined.
Methods inherited from TotalCnSmoothing:
getAsteriskTags, getOutputDataSet0, getOutputFileClass, getOutputFileExtension, getOutputFileSetClass, getOutputFiles, getParameters, getPath, getRootPath, getTargetPositions, getTargetUgpFile, process, smoothRawCopyNumbers
Methods inherited from AromaTransform:
as.character, findFilesTodo, getAsteriskTags, getExpectedOutputFiles, getExpectedOutputFullnames, getFullName, getInputDataSet, getName, getOutputDataSet, getOutputDataSet0, getOutputFiles, getPath, getRootPath, getTags, isDone, process, setTags
Methods inherited from ParametersInterface:
getParameterSets, getParameters, getParametersAsString
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Author(s)
Henrik Bengtsson
The abstract TotalCnSmoothing class
Description
Package: aroma.cn
Class TotalCnSmoothing
Object
~~|
~~+--
ParametersInterface
~~~~~~~|
~~~~~~~+--
AromaTransform
~~~~~~~~~~~~|
~~~~~~~~~~~~+--
TotalCnSmoothing
Directly known subclasses:
TotalCnBinnedSmoothing, TotalCnKernelSmoothing
public abstract static class TotalCnSmoothing
extends AromaTransform
Usage
TotalCnSmoothing(dataSet=NULL, ..., targetUgp=NULL,
.reqSetClass="AromaUnitTotalCnBinarySet")
Arguments
dataSet |
|
... |
Arguments passed to |
targetUgp |
An |
.reqSetClass |
(internal only) |
Fields and Methods
Methods:
getTargetUgpFile | - | |
process | - | |
Methods inherited from AromaTransform:
as.character, findFilesTodo, getAsteriskTags, getExpectedOutputFiles, getExpectedOutputFullnames, getFullName, getInputDataSet, getName, getOutputDataSet, getOutputDataSet0, getOutputFiles, getPath, getRootPath, getTags, isDone, process, setTags
Methods inherited from ParametersInterface:
getParameterSets, getParameters, getParametersAsString
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Author(s)
Henrik Bengtsson
The TumorBoostNormalization class
Description
Package: aroma.cn
Class TumorBoostNormalization
Object
~~|
~~+--
TumorBoostNormalization
Directly known subclasses:
public static class TumorBoostNormalization
extends Object
TumorBoost is normalization method that normalizes the allele B fractions of a tumor sample given the allele B fractions and genotype calls for a matched normal. The method is a single-sample (single-pair) method. It does not require total copy number estimates. The normalization is done such that the total copy number is unchanged afterwards.
Usage
TumorBoostNormalization(dsT=NULL, dsN=NULL, gcN=NULL, flavor=c("v4", "v3", "v2", "v1"),
preserveScale=TRUE, collapseHomozygous=FALSE, tags="*", ...)
Arguments
dsT |
An |
dsN |
An |
gcN |
An |
flavor |
A |
preserveScale |
If |
collapseHomozygous |
If |
tags |
(Optional) Sets the tags for the output data sets. |
... |
Not used. |
Fields and Methods
Methods:
getFullName | - | |
getInputDataSet | - | |
getName | - | |
getNormalDataSet | - | |
getNormalGenotypeCallSet | - | |
getOutputDataSet | - | |
getTags | - | |
nbrOfFiles | - | |
process | - | |
setTags | - | |
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Author(s)
Henrik Bengtsson, Pierre Neuvial
The XYCurveNormalization class
Description
Package: aroma.cn
Class XYCurveNormalization
Object
~~|
~~+--
AbstractCurveNormalization
~~~~~~~|
~~~~~~~+--
XYCurveNormalization
Directly known subclasses:
public static class XYCurveNormalization
extends AbstractCurveNormalization
Usage
XYCurveNormalization(...)
Arguments
... |
Arguments passed to |
Fields and Methods
Methods:
No methods defined.
Methods inherited from AbstractCurveNormalization:
as.character, backtransformOne, fitOne, getAsteriskTags, getDataSets, getFullName, getInputDataSet, getName, getOutputDataSet, getPairedDataSet, getPath, getRootPath, getSubsetToFit, getTags, getTargetDataSet, nbrOfFiles, process, setTags
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save, asThis
Author(s)
Henrik Bengtsson
Calls regions that are in allelic balance
Description
Calls regions that are in allelic balance from the allele B fractions (BAF).
Usage
## S3 method for class 'PairedPSCBS'
callAllelicBalanceByBAFs(fit, maxScore="auto", ..., force=FALSE, cache=FALSE,
verbose=FALSE)
Arguments
fit |
A |
maxScore |
A positive |
... |
Not used. |
force |
If |
verbose |
See |
Value
Returns a PairedPSCBS
fit object
where columns for allelic imbalance scores and
p-values as well as allelic balance calls are added.
Author(s)
Henrik Bengtsson, Pierre Neuvial
See Also
Internally, testAllelicBalanceByBAFs
() is used.
Note that this AB caller differs from the default one in the
PSCBS package, cf. callAB.PairedPSCBS
.
Examples
if (Sys.getenv("_R_CHECK_FULL_") != "" && require("PSCBS")) {
# Load example ASCN data
data <- PSCBS::exampleData("paired.chr01");
# PSCBS segmentation
fit <- segmentByPairedPSCBS(data, verbose=-10);
# Normalize
fitN <- normalizeBAFsByRegions(fit, verbose=-10);
fitN2 <- callAllelicBalanceByBAFs(fitN, verbose=-10);
print(fitN2);
} # if (require("PSCBS"))
Calls regions that are copy neutral
Description
Calls regions that are copy neutral from the allele B fractions (BAF).
Usage
## S3 method for class 'PairedPSCBS'
callCopyNeutralRegions(fit, ...)
Arguments
fit |
A |
... |
Additional arguments passed to
|
Value
Returns a PairedPSCBS
fit object
where a column with the copy-neutral call.
Author(s)
Henrik Bengtsson
Examples
if (Sys.getenv("_R_CHECK_FULL_") != "" && require("PSCBS")) {
# Load example ASCN data
data <- PSCBS::exampleData("paired.chr01");
# PSCBS segmentation
fit <- segmentByPairedPSCBS(data, verbose=-10);
fit <- bootstrapTCNandDHByRegion(fit, verbose=-10);
fitC <- callCopyNeutralRegions(fit, verbose=-10);
print(fitC);
# Normalize
fitN <- normalizeBAFsByRegions(fitC, verbose=-10);
} # if (require("PSCBS"))
Calls the peaks in peaks-and-valley estimates
Description
Calls the peaks in peaks-and-valley estimates to a set of known state.
Usage
## S3 method for class 'PeaksAndValleys'
callPeaks(fit, expected=c(-1/2, -1/4, 0, +1/4, +1/2) * pi, flavor=c("decreasing", "all"),
verbose=FALSE, ...)
Arguments
fit |
A KxC |
expected |
The expected locations of the peaks to be called. |
flavor |
A |
verbose |
|
... |
Not used. |
Value
Returns a Kx(C+2) data.frame
.
Flavors
If flavor == "all"
, each peak is called to the state with the
closest expected value.
If flavor == "decreasing"
, the strongest peak is called to the
state with the closest expected value, then the second strongest peak
is called analogously to one of the remaining states, and so on.
Author(s)
Henrik Bengtsson, Pierre Neuvial
See Also
To get peaks-and-valley estimates, use
findPeaksAndValleys
.
Calls XX or XY from ChrX allele B fractions of a normal sample
Description
Calls XX or XY from ChrX allele B fractions of a normal sample.
Usage
## S3 method for class 'numeric'
callXXorXY(betaX, betaY=NULL, flavor=c("density"), adjust=1.5, ...,
censorAt=c(-0.5, +1.5), verbose=FALSE)
Arguments
betaX |
|
betaY |
A optional |
flavor |
A |
adjust |
A postive |
... |
Additional arguments passed to
|
censorAt |
A |
verbose |
Value
Returns a ...
Missing and non-finite values
Missing and non-finite values are dropped before trying to call XX or XY.
Author(s)
Henrik Bengtsson, Pierre Neuvial
See Also
Internally findPeaksAndValleys
is used to identify
the thresholds.
Simple creation of a CopyNumberRegions object
Description
Simple creation of a CopyNumberRegions object containing a single region.
Usage
cnr(start, stop=NULL, mean=1, chromosome=1, xScale=1e+06, ...)
Arguments
start , stop |
Two |
mean |
A |
chromosome |
An |
xScale |
The default scaling parameter used for |
... |
Additional arguments passed to
|
Value
Return an CopyNumberRegions
object.
Author(s)
Henrik Bengtsson
Examples
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Build up a tumor CN profile
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
pT <- cnr(1,1000, 2) +
cnr(400,500) +
cnr(600,800) +
cnr(600,700) +
cnr(100,200) - cnr(850,900);
print(pT);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Simulate CN signals from this profile
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cn <- simulateRawCopyNumbers(pT, n=2000, sd=1/2);
print(cn);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Plot
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
plot(cn, col="#aaaaaa", ylim=c(0,5));
drawLevels(pT, col="#ff0000", lwd=3);
Gets a list of data files for a particular name across several data sets
Description
Gets a list of data files for a particular name across several data sets.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
extractTupleOfDataFiles(this, dsList, name, ..., na.rm=FALSE, verbose=FALSE)
Arguments
name |
A |
... |
Not used. |
verbose |
See |
Value
Returns a list
of K AromaUnitTotalCnBinarySet
:s.
Author(s)
Henrik Bengtsson
See Also
For more information see MultiSourceCopyNumberNormalization
.
Finds all possible atomic regions
Description
Finds all possible atomic regions of a certain length.
Usage
## S3 method for class 'CopyNumberRegions'
findAtomicAberrations(cnr, data, H=1, alpha=0.02, ..., verbose=FALSE)
Arguments
cnr |
The segments defining the partitioning of the data. |
data |
The data used to test for equality. |
H |
A positive |
alpha |
A |
... |
Not used. |
verbose |
See |
Details
An aberration of length H is defined as any H consecutive segments. Each aberrations has two flanking segments on each side. Regardless of the content of the aberration, it is possible to test the null-hypothesis that the two flanking segments are equal or not. The two flanking regions are said to be equal, if the null-hypothesis of being equal is not rejected. If the two flanking regions are called equal, then the contained abberation (of length H) is called atomic, otherwise not.
For consistency one may also define atomic aberrations of length H=0. Consider that an imaginary aberration of zero length splits a single segment into to flanking segments. Then by construction those two segments are equal. The case where H=0 is still not implemented.
Value
Returns a data.frame
with K rows, where K >= 0 is the number
of atomic aberrations found.
Author(s)
Henrik Bengtsson
See Also
...
Examples
library("aroma.cn")
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Local functions
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
xAxisBar <- function(x0, x1=NULL, y=par("usr")[3], lwd=4, col=par("col"),
length=0.04, xpd=FALSE, ...) {
if (is.null(x1)) {
x1 <- x0[2]
x0 <- x0[1]
}
arrows(x0=x0, x1=x1, y0=y, code=3, angle=90, length=length, lwd=lwd,
col=col, xpd=xpd, lend=2, ...)
} # xAxisBar()
verbose <- Arguments$getVerbose(-8, timestamp=TRUE)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Simulating copy-number data
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Build up CN profile generation by generation
pT <- cnr(1,2000, 2) +
cnr(1000,1500) +
cnr(1000,1250) +
cnr(1650,1800) +
cnr(200,300) - cnr(650,800)
print(pT)
# Simulate data from the track
cn <- simulateRawCopyNumbers(pT, n=2000, sd=1/2)
print(cn)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Find atomic aberrations
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
subplots(4, ncol=1)
par(mar=c(2,4,1,1)+0.1)
# Plot observed and true signals
plot(cn, col="#aaaaaa", ylim=c(0,5))
drawLevels(pT, col="white", lwd=4, lty=1)
drawLevels(pT, col="black", lwd=3, lty=6)
stext(side=3, pos=1, line=-1, "\"H=0\"", cex=1.5)
for (H in 1:3) {
plot(cn, col="#aaaaaa", ylim=c(0,5))
drawLevels(pT, col="white", lwd=4, lty=1)
drawLevels(pT, col="black", lwd=3, lty=6)
col <- H+1
stext(side=3, pos=1, line=-1, sprintf("H=%d", H), cex=1.5, col=col)
par <- par("usr")
y0 <- par("usr")[3]
y1 <- par("usr")[4]
dy <- 0.05*(y1-y0)
fit <- findAtomicAberrations(cnr=pT, data=cn, H=H, verbose=verbose)
df <- fit$res
for (kk in seq_len(nrow(df))) {
dfKK <- df[kk,]
segments <- as.integer(dfKK[,c("firstRegion", "lastRegion")])
segments <- segments[1]:segments[2]
xRange <- as.double(dfKK[,c("start", "stop")])
cnrKK <- subset(pT, subset=segments)
drawLevels(cnrKK, col=col, lwd=3)
x <- xRange/1e6
y <- y0 + 0.2*dy
xAxisBar(x0=x[1], x1=x[2], y=y, col=col)
box()
}
} # for (H ...)
Fits the multi-source model for one sample
Description
Fits the multi-source model for one sample.
The model is fitted on the subset of units returned
by *getSubsetToFit()
.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
fitOne(this, dfList, ..., force=FALSE, .retData=FALSE, verbose=FALSE)
Arguments
... |
Not used. |
force |
If |
verbose |
See |
Value
Returns a list
of transforms.
Author(s)
Henrik Bengtsson
See Also
For more information see MultiSourceCopyNumberNormalization
.
Gets the names of all unique samples across all sources
Description
Gets the names of all unique samples across all sources.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
getAllNames(this, ...)
Arguments
... |
Passed to |
Value
Author(s)
Henrik Bengtsson
See Also
For more information see MultiSourceCopyNumberNormalization
.
Gets the UGP file specifying the common set of loci to normalize at
Description
Gets the UGP file specifying the common set of loci to normalize at.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
getFitAromaUgpFile(this, ...)
Arguments
... |
Not used. |
Value
Returns a AromaUgpFile
.
Author(s)
Henrik Bengtsson
See Also
For more information see MultiSourceCopyNumberNormalization
.
Gets the list of data sets to be normalized
Description
Gets the list of data sets to be normalized.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
getInputDataSets(this, ...)
Arguments
... |
Not used. |
Value
Returns a list
.
Author(s)
Henrik Bengtsson
See Also
For more information see MultiSourceCopyNumberNormalization
.
Gets the data sets smoothed toward the UGP file
Description
Gets the data sets smoothed toward the UGP file.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
getSmoothedDataSets(this, ..., verbose=FALSE)
Arguments
... |
Not used. |
verbose |
See |
Details
This method smooth each data set, each array, and each chromosome toward the target (smoothing) UGP file independently of everything else.
The resulting data sets are stored in a separate location where they will be located automatically in future sessions.
Value
Returns a list
of K AromaUnitTotalCnBinarySet
:s.
Author(s)
Henrik Bengtsson
See Also
*getFitAromaUgpFile()
.
For more information see MultiSourceCopyNumberNormalization
.
Gets subset of (smoothing) units for fitting the model
Description
Gets subset of (smoothing) units for fitting the model.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
getSubsetToFit(this, ..., verbose=FALSE)
Arguments
... |
Not used. |
verbose |
See |
Value
Returns an integer
vector
of unit indices.
Author(s)
Henrik Bengtsson
See Also
For more information see MultiSourceCopyNumberNormalization
.
Normalizes allele B fractions (BAFs) based on region-based PSCN estimates
Description
Normalizes allele B fractions (BAFs) based on region-based PSCN estimates as given by the PSCBS segmentation method.
Usage
## S3 method for class 'PairedPSCBS'
normalizeBAFsByRegions(fit, by=c("betaTN", "betaT"), ..., force=FALSE, cache=TRUE,
verbose=FALSE)
Arguments
fit |
A PairedPSCBS fit object as returned by
|
by |
A |
... |
Additional arguments passed
|
verbose |
See |
Details
Note that his normalization method depends on the segmentation results. Hence, it recommended not to resegment the normalized signals returned by this, because such a segmentation will be highly dependent on the initial segmentation round.
Value
Returns a PairedPSCBS fit object where the region-level decrease-in-heterozygosity (DH) means have been normalized, as well as the locus-specific tumor allele B fractions.
Author(s)
Henrik Bengtsson, Pierre Neuvial
See Also
Internally normalizeMirroredBAFsByRegions
is used.
Examples
library("aroma.cn")
if (Sys.getenv("_R_CHECK_FULL_") != "" && require("PSCBS")) {
# Load example ASCN data
data <- PSCBS::exampleData("paired.chr01")
R.oo::attachLocally(data)
# AD HOC: Robustification
CT[CT < 0] <- 0
CT[CT > 30] <- 30
# PSCBS segmentation
fit <- segmentByPairedPSCBS(CT, betaT=betaT, betaN=betaN, x=x, verbose=-10)
# Normalize
fitN <- normalizeBAFsByRegions(fit, verbose=-10)
devSet("tracks")
subplots(10, ncol=2, byrow=FALSE)
par(mar=c(1,3.5,1,0.5)+1)
plot(fit, subplots=TRUE)
plot(fitN, subplots=TRUE)
devSet("C1C2")
Clim <- c(0,4)
subplots(4, ncol=2, byrow=TRUE)
par(mar=c(1,3.5,1,0.5)+1)
plotC1C2(fit, Clim=Clim)
linesC1C2(fit)
title(main="(C1,C2)")
plotC1C2(fitN, Clim=Clim)
linesC1C2(fitN)
title(main="(C1,C2) - adjusted")
plotC1C2(fit, col="gray", Clim=Clim)
linesC1C2(fit, col="gray")
pointsC1C2(fitN)
linesC1C2(fitN)
title(main="(C1,C2) - both")
} # if (require("PSCBS"))
Normalizes region-level mirrored allele B fractions (mBAFs)
Description
Normalizes region-level mirrored allele B fractions (mBAFs) for heterozygous and homozygous SNPs by rescaling both equally much such that the normalized homozygous mBAFs become exactly or close to their expected values (which is at zero and one).
Usage
## S3 method for class 'matrix'
normalizeMirroredBAFsByRegions(data, flavor=c("plain", "total"), ..., verbose=FALSE)
Arguments
data |
A |
flavor |
A |
... |
Additional arguments passed |
verbose |
See |
Details
The mBAFs for heterozygous SNPs are also known as the Decrease in Heterozygosity signals (DHs).
Value
A numeric
matrix
of the same dimensions as argument data
.
Author(s)
Henrik Bengtsson, Pierre Neuvial
Normalizes data in K dimensions using principal curves
Description
Normalizes data in K dimensions using principal curves such that afterward the data cluster (approximately linearly) along the diagonal (in K dimensions).
Usage
## S3 method for class 'matrix'
normalizePrincipalCurve(x, ..., center=TRUE, returnFit=FALSE)
Arguments
x |
An NxK |
... |
Additional arguments passed to
|
center |
If |
returnFit |
If |
Value
Returns an NxK matrix
.
Author(s)
Henrik Bengtsson
References
[1] Hastie, T. and Stuetzle, W, Principal Curves, JASA, 1989.
See Also
fitPrincipalCurve
and
backtransformPrincipalCurve
.
Normalizes all samples
Description
Normalizes all samples.
Usage
## S3 method for class 'MultiSourceCopyNumberNormalization'
process(this, ..., force=FALSE, verbose=FALSE)
Arguments
... |
Not used. |
verbose |
See |
Value
Returns a list
of K AromaUnitTotalCnBinarySet
:s.
Author(s)
Henrik Bengtsson
See Also
For more information see MultiSourceCopyNumberNormalization
.
Tests for allelic balance in a genomic region
Description
Tests for allelic balance in a genomic region.
Usage
## Default S3 method:
testAllelicBalanceByBAFs(betaT, muN, flavor=c("var", "mean"), ..., verbose=FALSE)
Arguments
betaT |
|
muN |
|
flavor |
A |
... |
Not used. |
verbose |
See |
Value
A list
of class "htest".
Author(s)
Henrik Bengtsson, Pierre Neuvial
Examples
if (Sys.getenv("_R_CHECK_FULL_") != "" && require("PSCBS")) {
# Load example ASCN data
data <- PSCBS::exampleData("paired.chr01");
# PSCBS segmentation
fit <- segmentByPairedPSCBS(data, verbose=-10);
# Normalize
fitN <- normalizeBAFsByRegions(fit, verbose=-10);
fitN2 <- callAllelicBalanceByBAFs(fitN, verbose=-10);
print(fitN2);
} # if (require("PSCBS"))