R/startracDiversity.R
StartracDiversity.Rd
This function utilizes the Startrac approach derived from PMID: 30479382. Required to run the function, the "type" variable needs to include the difference in where the cells were derived. The output of this function will produce 3 indices: expa (clonal expansion), migra (cross-tissue migration), and trans (state transition). In order to understand the underlying analyses of the outputs please read and cite the linked manuscript.
StartracDiversity(
sc.data,
cloneCall = "strict",
chain = "both",
type = NULL,
group.by = NULL,
exportTable = FALSE,
palette = "inferno"
)
The single-cell object after combineExpression()
.
For SCE objects, the cluster variable must be in the meta data under
"cluster".
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 variable in the meta data that provides tissue type.
The variable in the meta data to group by, often samples.
Returns the data frame used for forming the graph.
Colors to use in visualization - input any hcl.pals.
ggplot object of Startrac diversity metrics
#Getting the combined contigs
combined <- combineTCR(contig_list,
samples = c("P17B", "P17L", "P18B", "P18L",
"P19B","P19L", "P20B", "P20L"))
#Getting a sample of a Seurat object
scRep_example <- get(data("scRep_example"))
scRep_example <- combineExpression(combined, scRep_example)
scRep_example$Patient <- substring(scRep_example$orig.ident,1,3)
scRep_example$Type <- substring(scRep_example$orig.ident,4,4)
#Using StartracDiversity()
StartracDiversity(scRep_example,
type = "Type",
group.by = "Patient")