Learn R Programming

tcR (version 2.3.2)

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 then apply log to the after adding laplace correction equal to one.

.min.ppl

Filter: get sequences with # people >= .min.ppl.

.max.ppl

Filter: get sequences with # people <= .max.ppl.

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
# NOT RUN {
# 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