geneUsage: Gene usage.

Description Usage Arguments Value See Also Examples

Description

Compute frequencies or counts of gene segments ("V / J - usage").

Usage

1
2
3
4
5
6
7
geneUsage(
  .data,
  .genes = HUMAN_TRBV_MITCR,
  .quant = c(NA, "read.count", "umi.count", "read.prop", "umi.prop"),
  .norm = F,
  .ambig = F
)

Arguments

.data

Cloneset data frame or a list with clonesets.

.genes

Either one of the gene alphabet (e.g., HUMAN_TRBV, genealphabets) or list with two gene alphabets for computing joint distribution.

.quant

Which column to use for the quantity of clonotypes: NA for computing only number of genes without using clonotype counts, "read.count" for the "Read.count" column, "umi.count" for the "Umi.count" column, "read.prop" for the "Read.proportion" column, "umi.prop" for the "Umi.proportion" column.

.norm

If T then return proportions of resulting counting of genes.

.ambig

If F than remove from counting genes which are not presented in the given gene alphabet(s).

Value

If .data is a cloneset and .genes is NOT a list than return a data frame with first column "Gene" with genes and second with counts / proportions.

If .data is a list with clonesets and .genes is NOT a list than return a data frame with first column "Gene" with genes and other columns with counts / proportions for each cloneset in the input list.

If .data is a cloneset and .genes IS a list than return a matrix with gene segments for the first gene in .genes and column names for the second gene in .genes. See "Examples".

If .data is a list with clonesets and .genes IS a list than return a list with matrices like in the previous case.

See Also

genealphabets, vis.gene.usage, pca.segments

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# Load your data
data(twb)
# compute V-segments frequencies of human TCR beta.
seg <- geneUsage(twb, HUMAN_TRBV, .norm = T)
# plot V-segments frequencies as a heatmap
vis.heatmap(seg, .labs = c("Sample", "V gene"))
# plot V-segments frequencies directly from clonesets
vis.gene.usage(twb, HUMAN_TRBV)
# plot V-segments frequencies from the gene frequencies
vis.gene.usage(seg, NA)
# Compute V-J joint usage.
geneUsage(twb, list(HUMAN_TRBV, HUMAN_TRBJ))
# for future:
# geneUsage(twb, "human", "trbv")

## End(Not run)

imminfo/tcr documentation built on June 13, 2020, 7:01 a.m.