kmerFrequency {SomaticSignatures} | R Documentation |
Estimate the occurance frequency of k-mers in a reference sequence.
kmerFrequency(ref, n = 1e4, k = 1, ranges = as(seqinfo(ref), "GRanges"))
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]. |
The k-mer frequency is estimated by random sampling of 'n' locations across the specified 'ranges' of the reference sequence.
A named vector, with names corresponding the the k-mer and value to the frequency.
library(BSgenome.Hsapiens.1000genomes.hs37d5) kmer_freq = kmerFrequency(BSgenome.Hsapiens.1000genomes.hs37d5, 1e2, 3)