R/clonalSizeDistribution.R
clonalSizeDistribution.RdThis function produces a hierarchical clustering of clones by sample using discrete gamma-GPD spliced threshold model. If using this model please read and cite powerTCR (more info available at PMID: 30485278).
clonalSizeDistribution(
input.data,
cloneCall = "strict",
chain = "both",
method = "ward.D2",
threshold = 1,
group.by = NULL,
exportTable = FALSE,
palette = "inferno",
...
)The product of combineTCR(),
combineBCR(), or combineExpression().
Defines the clonal sequence grouping. Accepted values
are: gene (VDJC genes), nt (CDR3 nucleotide sequence), aa (CDR3 amino
acid sequence), or strict (VDJC + nt). A custom column header can also be used.
The TCR/BCR chain to use. Use both to include both chains
(e.g., TRA/TRB). Accepted values: TRA, TRB, TRG, TRD, IGH, IGL
(for both light chains), both.
The clustering parameter for the dendrogram.
Numerical vector containing the thresholds the grid search was performed over.
A column header in the metadata or lists to group the analysis
by (e.g., "sample", "treatment"). If NULL, data will be analyzed as
by list element or active identity in the case of single-cell objects.
If TRUE, returns a data frame or matrix of the results
instead of a plot.
Colors to use in visualization - input any hcl.pals.
Additional arguments passed to the ggplot theme
A ggplot object visualizing dendrogram of clonal size distribution
or a data.frame if exportTable = TRUE.
The probability density function (pdf) for the Generalized Pareto Distribution (GPD) is given by: f(x|μ,σ,ξ)=1σ(1+ξ(x−μσ))−(1ξ+1)
Where:
μ is a location parameter
σ>0 is a scale parameter
ξ is a shape parameter
x≥μ if ξ≥0 and μ≤x≤μ−σ/ξ if ξ<0
The probability density function (pdf) for the Gamma Distribution is given by: f(x|α,β)=xα−1e−x/ββαΓ(α)
Where:
α>0 is the shape parameter
β>0 is the scale parameter
x≥0
Γ(α) is the gamma function of α
# Making combined contig data
combined <- combineTCR(contig_list,
samples = c("P17B", "P17L", "P18B", "P18L",
"P19B","P19L", "P20B", "P20L"))
# Using clonalSizeDistribution()
clonalSizeDistribution(combined,
cloneCall = "strict",
method="ward.D2")