tcR (version 1.1)

cosine.sharing: Shared repertoire analysis.

Description

Functions for computing statistics and analysis of shared repertoire of sequences.

cosine.sharing - apply the cosine similarity measure to the vectors of sequences' counts or indices.

shared.representation - for every repertoire in the shared repetoire get a number of sequences in this repertoire which are in the other repertoires. Row names of the input matrix is the number of people.

shared.clones.count - get the number of shared clones for every number of people.

shared.summary - get a matrix with counts of pairwise shared sequences (like a result from cross function, applied to a list of data frames).

Usage

cosine.sharing(.shared.rep, .log = T)

shared.representation(.shared.rep)

shared.clones.count(.shared.rep)

shared.summary(.shared.rep, .min.ppl = min(.shared.rep$People), .max.ppl = max(.shared.rep$People))

Arguments

.shared.rep
Shared repertoire, obtained from the function shared.repertoire.
.log
If T than apply log to the after adding laplace correction equal to one.
...
Parameters passed to the prcomp function.
.min.ppl
Filter: get sequences with # people >= .min.ppl.
.max.ppl
Filter: get sequences with # people

Value

  • Plot or PCA resulr for the shared.seq.pca function or a matrix with cosine similarity values for the cosine.sharing function.

See Also

shared.repertoire

Examples

Run this code
# Load the twb data.
data(twb)
# Create shared repertoire on the twins data using CDR3 amino acid sequences with CDR1-2.
twb.shared <- shared.repertoire(twb, 'av', .verbose = T)
sh.repr <- shared.representation(twb.shared)
sh.repr
# Get proportion of represented shared sequences.
apply(sh.repr, 2, function (col) col / col[1])

Run the code above in your browser using DataLab