Plots the probability densities of GMM components for given chromosome or chromosome arm, store in a TapestriExperiment
.
calcGMMCopyNumber()
must be run first.
Usage
plotCopyNumberGMM(
TapestriExperiment,
feature.id = 1,
chromosome.scope = "chr",
draw.boundaries = FALSE
)
Arguments
- TapestriExperiment
TapestriExperiment
object.- feature.id
chromosome or chromosome arm to plot.
- chromosome.scope
"chr" or "arm", for plotting models for either whole chromosomes or chromosome arms.
- draw.boundaries
logical, if
TRUE
, draw decision boundaries between each Gaussian component.
Examples
# \donttest{
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... [1s]
#>
tap.object <- calcGMMCopyNumber(tap.object,
cell.barcodes = colnames(tap.object),
control.copy.number = control.copy.number,
model.components = 1:5
)
#> ℹ Calculating GMMs using 300 input cells.
#> ℹ Generating probe values for 500 simulated cells...
#> ✔ Generating probe values for 500 simulated cells... [982ms]
#>
#> ℹ Fitting Gaussian distributions to simulated cells...
#> ✔ Fitting Gaussian distributions to simulated cells... [11.3s]
#>
#> ℹ Calculating posterior probabilities...
#> ✔ Calculating posterior probabilities... [292ms]
#>
#> ℹ Calling copy number from posterior probabilities...
#> ✔ Calling copy number from posterior probabilities... [59ms]
#>
#> ✔ Saving whole chromosome copy number calls to altExp: smoothedCopyNumberByChr,
#> assay: gmmCopyNumber...
#> ✔ Saving chromosome arm copy number calls to altExp: smoothedCopyNumberByArm,
#> assay: gmmCopyNumber...
#> ✔ Saving GMM models and metadata to `gmmParams` slot...
tap.object <- plotCopyNumberGMM(tap.object,
feature.id = 7,
chromosome.scope = "chr",
draw.boundaries = TRUE
)
# }