3 Quick-Start
This section provides a basic CopyKit workflow.
# Load library
library(copykit)
# Run pre-processing module
<- runVarbin("/path/to/marked/bam/files/",
tumor remove_Y = TRUE)
# Mark euploid cells if they exist
<- findAneuploidCells(tumor)
tumor
# Mark low-quality cells for filtering
<- findOutliers(tumor)
tumor
# Visualize cells labeled by filter and aneuploid status
plotHeatmap(tumor, label = c('outlier', 'is_aneuploid'), row_split = 'outlier')
# Remove cells marked as low-quality and/or aneuploid from the copykit object
<- tumor[,SummarizedExperiment::colData(tumor)$outlier == FALSE]
tumor <- tumor[,SummarizedExperiment::colData(tumor)$is_aneuploid == TRUE]
tumor
# kNN smooth profiles
<- knnSmooth(tumor)
tumor
# Create a umap embedding
<- runUmap(tumor)
tumor
# Search for the K value that maximizes jaccard similarity for clustering of subclones
# Plot the results
# This step is optional. A fixed K value can be provided later to findClusters()
<- findSuggestedK(tumor)
tumor plotSuggestedK(tumor)
# Find clusters of similar copy number profiles and plot the results
# If no k_subclones value is provided, automatically detect it from findSuggestedK()
<- findClusters(tumor)
tumor plotUmap(tumor, label = 'subclones')
# Calculate consensus profiles for each subclone,
# and order cells by cluster for visualization with plotHeatmap
<- calcConsensus(tumor)
tumor <- runConsensusPhylo(tumor)
tumor
# Plot a copy number heatmap with clustering annotation
plotHeatmap(tumor, label = 'subclones')
The following sections explain all functions in detail.