kmerFrequency {SomaticSignatures} | R Documentation

## Kmer Frequency

### Description

Estimate the occurance frequency of k-mers in a reference sequence.

### Usage

    kmerFrequency(ref, n = 1e4, k = 1, ranges = as(seqinfo(ref), "GRanges"))

### Arguments

`ref` | A 'BSgenome' or 'FaFile' object matching the respective reference sequence [required].
`n` | The number of samples to draw [integer, default: 1e4].
`k` | The 'k'-mer size of the context, including the variant position [integer, default: 3].
`ranges` | Ranges in respect to the reference sequence to sample from [GRanges, default: take from the 'seqinfo' slot].

### Details

The k-mer frequency is estimated by random sampling of 'n' locations across the specified 'ranges' of the reference sequence.

### Value

A named vector, with names corresponding the the k-mer and value to the frequency.

### Examples

      library(BSgenome.Hsapiens.1000genomes.hs37d5)

      kmer_freq = kmerFrequency(BSgenome.Hsapiens.1000genomes.hs37d5, 1e2, 3)

[Package SomaticSignatures version 2.26.0 Index]