Learn R Programming

tcR (version 2.3.2)

find.clonotypes: Find target clonotypes and get columns' value corresponded to that clonotypes.

Description

Find the given target clonotypes in the given list of data.frames and get corresponding values of desired columns.

Usage

find.clonotypes(
  .data,
  .targets,
  .method = c("exact", "hamm", "lev"),
  .col.name = "Read.count",
  .target.col = "CDR3.amino.acid.sequence",
  .verbose = T
)

Arguments

.data

List with mitcr data.frames or a mitcr data.frame.

.targets

Target sequences or elements to search. Either character vector or a matrix / data frame (not a data table!) with two columns: first for sequences, second for V-segments.

.method

Method, which will be used to find clonotypes:

- "exact" performs exact matching of targets;

- "hamm" finds targets and close sequences using hamming distance <= 1;

- "lev" finds targets and close sequences using levenshtein distance <= 1.

.col.name

Character vector with column names which values should be returned.

.target.col

Character vector specifying name of columns in which function will search for a targets. Only first column's name will be used for matching by different method, others will match exactly. .targets should be a two-column character matrix or data frame with second column for V-segments.

.verbose

if T then print messages about the search process.

Value

Data.frame.

Examples

Run this code
# NOT RUN {
# Get ranks of all given sequences in a list of data frames.
immdata <- set.rank(immdata)
find.clonotypes(.data = immdata, .targets = head(immdata[[1]]$CDR3.amino.acid.sequence),
                .method = 'exact', .col.name = "Rank", .target.col = "CDR3.amino.acid.sequence")
# Find close by levenhstein distance clonotypes with similar V-segments and return
# their values in columns 'Read.count' and 'Total.insertions'.
find.clonotypes(.data = twb, .targets = twb[[1]][, c('CDR3.amino.acid.sequence', 'V.gene')],
                .col.name = c('Read.count', 'Total.insertions'), .method = 'lev',
                .target.col = c('CDR3.amino.acid.sequence', 'V.gene'))
# }

Run the code above in your browser using DataLab