kmers: Kmer Frequency

Description Usage Arguments Details Value Examples

Description

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

Usage

1
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

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

SomaticSignatures documentation built on Nov. 1, 2018, 2:23 a.m.