occupiedscRepertoire {scRepertoire} | R Documentation

## Visualize the number of single cells with clonotype frequencies by cluster

### Description

View the count of clonotypes frequency group in seurat or SCE object meta data after combineExpression(). The visualization will take the new meta data variable "cloneType" and plot the number of cells with each designation using a secondary variable, like cluster. Credit to the idea goes to Dr. Carmonia and his work with [ProjectTIL](https://github.com/carmonalab/ProjecTILs).

### Usage

    occupiedscRepertoire(sc, x.axis = "cluster", exportTable = FALSE)

### Arguments

`sc` | The seurat or SCE object to visualize after combineExpression(). For SCE objects, the cluster variable must be in the meta data under "cluster".
`x.axis` | The variable in the meta data to graph along the x.axis
`exportTable` | Exports a table of the data into the global environment in addition to the visualization

### Value

Stacked bar plot of counts of cells by clonotype frequency group

### Examples

    #Getting the combined contigs
    combined <- combineTCR(contig_list, rep(c("PX", "PY", "PZ"), each=2),
    rep(c("P", "T"), 3), cells ="T-AB")

    #Getting a sample of a Seurat object
    screp_example <- get(data("screp_example"))
    sce <- suppressMessages(Seurat::UpdateSeuratObject(screp_example))
    sce <- Seurat::as.SingleCellExperiment(sce)

    #Using combineExpresion()
    sce <- combineExpression(combined, sce)

    #Using occupiedscRepertoire()
    occupiedscRepertoire(sce, x.axis = "cluster")
    table <- occupiedscRepertoire(sce, x.axis = "cluster", exportTable = TRUE)

[Package scRepertoire version 1.0.0 Index]