seqMatrix {LymphoSeq} | R Documentation

## Sequence matrix

### Description

Creates a data frame with unique, productive amino acid sequences as rows and sample names as headers. Each value in the data frame represents the frequency that the sequence appeared in the sample.

### Usage

    seqMatrix(productive.aa, sequences)

### Arguments

`productive.aa` | A list data frames of of productive amino acid sequences generated by LymphoSeq function productiveSeq where the aggregate parameter was set to "aminoAcid".
`sequences` | A character vector of amino acid sequences of interest. It is useful to specify the output from the LymphoSeq functions uniqueSeqs or topSeqs and subsetting the "aminoAcid" column. See examples below.

### Value

Returns a data frame of unique, productive amino acid sequences as rows and the % frequency it appears in each sample as columns.

### See Also

`topSeqs` and `uniqueSeqs`

### Examples

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

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

    productive.aa <- productiveSeq(file.list = file.list, aggregate = "aminoAcid")

    top.seqs <- topSeqs(productive.seqs = productive.aa, top = 0.1)

    sequence.matrix <- seqMatrix(productive.aa = productive.aa,
       sequences = top.seqs$aminoAcid)

    unique.seqs <- uniqueSeqs(productive.aa = productive.aa)

    sequence.matrix <- seqMatrix(productive.aa = productive.aa,
       sequences = unique.seqs$aminoAcid)

    # It can be helpful to combine top.freq and sequence.matrix
    top.freq <- topFreq(productive.aa = productive.aa, percent = 0)

    sequence.matrix <- seqMatrix(productive.aa = productive.aa, sequences = top.freq$aminoAcid)

    top.freq.matrix <- merge(top.freq, sequence.matrix)

[Package LymphoSeq version 1.8.0 Index]