searchSeq {LymphoSeq} | R Documentation

## Search for a sequence

### Description

Search for one or more amino acid or nucleotide CDR3 sequences in a list of data frames.

### Usage

    searchSeq(list, sequence, type = "aminoAcid", match = "global",
      editDistance = 0)

### Arguments

`list` | A list of data frames generated by the LymphoSeq functions readImmunoSeq or productiveSeq. "aminoAcid" or "nucleotide", "frequencyCount", and "count" are required columns.
`sequence` | A character vector of one ore more amino acid or nucleotide CDR3 sequences to search.
`type` | A character vector specifying the type of sequence(s) to be searched. Available options are "aminoAcid" or "nucleotide".
`match` | A character vector specifying whether an exact partial or exact global match of the searched sequence(s) is desired. Available options are "partial" and "global".
`editDistance` | An integer giving the minimum edit distance that the sequence must be less than or equal to. See details below.

### Details

An exact partial match means the searched sequence is contained within target sequence. An exact global match means the searched sequence is identical to the target sequence.

Edit distance is a way of quantifying how dissimilar two sequences are to one another by counting the minimum number of operations required to transform one sequence into the other. For example, an edit distance of 0 means the sequences are identical and an edit distance of 1 indicates that the sequences different by a single amino acid or nucleotide.

### Value

Returns the rows for every instance in the list of data frames where the searched sequence(s) appeared.

### Examples

    file.path <- system.file("extdata", "TCRB_sequencing", package = "LymphoSeq")

    file.list <- readImmunoSeq(path = file.path)

    aa1 <- "CASSPVSNEQFF"

    aa2 <- "CASSQEVPPYQAFF"

    searchSeq(list = file.list, sequence = aa1, type = "aminoAcid",
       match = "global", editDistance = 0)

    searchSeq(list = file.list, sequence = c(aa1, aa2),
       type = "aminoAcid", match = "global", editDistance = 0)

    searchSeq(list = file.list, sequence = aa1, type = "aminoAcid", editDistance = 1)

    nt <- "CTGATTCTGGAGTCCGCCAGCACCAACCAGACATCTATGTACCTCTGTGCCAGCAGTCCGGTAAGCAATGAGCAGTTCTTCGGGCCA"

    searchSeq(list = file.list, sequence = nt, type = "nucleotide", editDistance = 3)

    searchSeq(list = file.list, sequence = "CASSPVS", type = "aminoAcid",
       match = "partial", editDistance = 0)

    searchSeq(list = file.list, sequence = nt, type = "nucleotide", editDistance = 0)

[Package LymphoSeq version 1.18.0 Index]