selex.kmerPSFM {SELEX} | R Documentation

## Construct a PSFM from a K-mer table

### Description

A function used to calculate and return the PFSM (Position Specific Frequency Matrix) for a K-mer table of length `k` from `sample`. If an `offset` value is provided, K-mer counting takes place at a fixed position within the variable region.

### Usage

    selex.kmerPSFM(sample, k, offset=NULL)

### Arguments

`sample` | A sample handle to the dataset on which K-mer counting should be perfomed.
`k` | K-mer length(s) to be counted.
`offset` | Location of window for which K-mers should be counted for. If not provided, K-mers are counted across all windows. `offset` starts from 0.

### Details

A K-mer table will be constructed for the specified `sample`, length `k`, and `offset` if it does not already exist.

The output can be used by the `seqLogo` package to create a sequence logo.

### Value

`selex.kmerPSFM` returns a matrix containing the frequences for each base at every position.

### See Also

`selex.counts`, `selex.fastqPSFM`

### Examples

    # Build the PSFM
    psfm1 = selex.kmerPSFM(sample=r0, k=8, 0)

    # Can make sequence logos using the seqLogo package:
    #library(seqLogo)
    #seqLogo(makePWM(t(psfm1)))

[Package SELEX version 1.19.5 Index]