Calculates and plots common diversity and overlap measures for repertoires and alike. Requires the vegan package
VDJ_diversity(
VDJ,
feature.columns,
grouping.column,
metric,
VDJ.VJ.1chain,
subsample.to.same.n
)
Returns a ggplot with the calculated metric for each group (if provided).
VDJ dataframe output from the VDJ_build function.
Character vector. One or more column names from the VDJ of which diversity or overlap metrics are calculated. if more than one column is provided (e.g. c("VDJ_cdr3s_aa","VJ_cdr3s_aa")) these columns will be pasted together before metric calculation.
Character. Column name of a column to group metrics by. This could be "sample_id" to calculate the metric for each sample. This column is required if metric = "simpson". If so, the simpson overlap index will be calculated pairwise for all combinations of elements in the grouping.column. Defaults to "none".
Character. Diversity or overlap metric to calculate. Can be c("richness", "bergerparker", "simpson", "ginisimpson", "shannon", "shannonevenness", "jaccard"). Defaults to "shannon". If jaccard is selected, a heatmap with the pairwise comparisons between all groups is returned. If any of the others is selected, a dotplot is returned
Boolean defaults to TRUE. Whether to filter out aberrant cells (more than 1 VDJ or VJ chain).
Boolean defaults to TRUE. Whether to subsample larger groups down to the size of the smallest group
VDJ_diversity(VDJ = Platypus::small_vdj,
,feature.columns = c("VDJ_jgene"), grouping.column = "sample_id"
,metric = "jaccard")
Run the code above in your browser using DataLab