
Smooth copy number values across chromosomes and chromosome arms
Source:R/copyNumberCalculation.R
calcSmoothCopyNumber.RdcalcSmoothCopyNumber() takes copyNumber slot values for probes on a chromosome and smooths them by median (default) for each chromosome
and chromosome arm, resulting in one copy number value per chromosome and chromosome arm for each cell barcode.
Cell-chromosome values are then discretized into integers by conventional rounding (1.5 <= x < 2.5 rounds to 2).
Smoothed copy number and discretized smoothed copy number values are stored as smoothedCopyNumber and discreteCopyNumber assays,
in altExp slots smoothedCopyNumberByChr for chromosome-level smoothing, and smoothedCopyNumberByArm for chromosome arm-level smoothing.
Value
TapestriExperiment with smoothedCopyNumber and discreteCopyNumber assays in altExp slots smoothedCopyNumberByChr and smoothedCopyNumberByArm.
Examples
tap.object <- newTapestriExperimentExample() # example TapestriExperiment object
#> ℹ Moving gRNA probe to `altExp` slot "grnaCounts".
#> ℹ Moving barcode probe to `altExp` slot "barcodeCounts".
#> ℹ Moving chrY probe(s) probe_231, probe_232, probe_233, probe_234, probe_235, probe_236, probe_237, probe_238, probe_239, and probe_240 to `altExp` slot "chrYCounts".
tap.object <- calcNormCounts(tap.object)
control.copy.number <- generateControlCopyNumberTemplate(tap.object,
copy.number = 2,
sample.feature.label = "cellline1"
)
tap.object <- calcCopyNumber(tap.object,
control.copy.number,
sample.feature = "test.cluster"
)
tap.object <- calcSmoothCopyNumber(tap.object)
#> ℹ Smoothing copy number by median...
#> ✔ Smoothing copy number by median... [918ms]
#>