View source: R/startracDiversity.R
StartracDiversity | R Documentation |
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"
)
sc.data |
The single-cell object after |
cloneCall |
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. |
chain |
indicate if both or a specific chain should be used - e.g. "both", "TRA", "TRG", "IGH", "IGL". |
type |
The variable in the meta data that provides tissue type. |
group.by |
The variable in the meta data to group by, often samples. |
exportTable |
Returns the data frame used for forming the graph. |
palette |
Colors to use in visualization - input any hcl.pals. |
ggplot object of Startrac diversity metrics
Liangtao Zheng
#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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.