R/clonalCompare.R
clonalCompare.Rd
This function produces an alluvial or area graph of the proportion or count composition of the indicated clones for all or selected samples (using the samples parameter). Individual clones can be selected using the clones parameter with the specific sequence of interest or using the top.clones parameter with the top n clones by proportion / counts to be visualized.
clonalCompare(
input.data,
cloneCall = "strict",
chain = "both",
samples = NULL,
clones = NULL,
top.clones = NULL,
highlight.clones = NULL,
relabel.clones = FALSE,
group.by = NULL,
order.by = NULL,
graph = "alluvial",
proportion = TRUE,
exportTable = FALSE,
palette = "inferno"
)
The product of combineTCR
,
combineBCR
, or combineExpression
.
How to call the clone - VDJC gene (gene), CDR3 nucleotide (nt), CDR3 amino acid (aa), VDJC gene + CDR3 nucleotide (strict) or a custom variable in the data
indicate if both or a specific chain should be used - e.g. "both", "TRA", "TRG", "IGH", "IGL"
The specific samples to isolate for visualization.
The specific clonal sequences of interest
The top number of clonal sequences per group. (e.g., top.clones = 5)
Clonal sequences to highlight, if present, all other clones returned will be grey
Simplify the legend of the graph by returning clones that are numerically indexed
If using a single-cell object, the column header to group the new list. NULL will return the active identity or cluster
A vector of specific plotting order or "alphanumeric" to plot groups in order
The type of graph produced, either "alluvial" or "area"
If TRUE, the proportion of the total sequencing reads will be used for the y-axis. If FALSE, the raw count will be used
Returns the data frame used for forming the graph
Colors to use in visualization - input any hcl.pals
ggplot of the proportion of total sequencing read of selecting clones
#Making combined contig data
combined <- combineTCR(contig_list,
samples = c("P17B", "P17L", "P18B", "P18L",
"P19B","P19L", "P20B", "P20L"))
clonalCompare(combined,
top.clones = 5,
samples = c("P17B", "P17L"),
cloneCall="aa")