selex.kmerPSFM: 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.
Value
selex.kmerPSFM returns a matrix containing the frequences for each base at every position.
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.
# Build the PSFMpsfm1 = selex.kmerPSFM(sample=r0, k=8, 0)
# Can make sequence logos using the seqLogo package:#library(seqLogo)#seqLogo(makePWM(t(psfm1)))