generateKmers {transite} | R Documentation

## k-mer Counts for Sequence Set

### Description

Counts occurrences of k-mers of length `k` in the given set of sequences. Corrects for homopolymeric stretches.

### Usage

    generateKmers(sequences, k)

### Arguments

`sequences` | character vector of DNA or RNA sequences
`k` | length of k-mer, either `6` for hexamers or `7` for heptamers

### Value

Returns a named numeric vector, where the elements are k-mer counts and the names are DNA k-mers.

### Warning

`generateKmers` always returns DNA k-mers, even if `sequences` contains RNA sequences. RNA sequences are internally converted to DNA sequences. It is not allowed to mix DNA and RNA sequences.

### See Also

Other k-mer functions: `calculateKmerEnrichment`, `checkKmers`, `computeKmerEnrichment`, `drawVolcanoPlot`, `empiricalEnrichmentMeanCDF`, `generatePermutedEnrichments`, `homopolymerCorrection`, `permTestGeometricMean`, `runKmerSPMA`, `runKmerTSMA`

### Examples

    # count hexamers in set of RNA sequences
    rna.sequences <- c(
      "CAACAGCCUUAAUU", "CAGUCAAGACUCC", "CUUUGGGGAAU",
      "UCAUUUUAUUAAA", "AAUUGGUGUCUGGAUACUUCCCUGUACAU",
      "AUCAAAUUA", "AGAU", "GACACUUAAAGAUCCU",
      "UAGCAUUAACUUAAUG", "AUGGA", "GAAGAGUGCUCA",
      "AUAGAC", "AGUUC", "CCAGUAA",
      "UUAUUUA", "AUCCUUUACA", "UUUUUUU", "UUUCAUCAUU",
      "CCACACAC", "CUCAUUGGAG", "ACUUUGGGACA", "CAGGUCAGCA"
    )
    hexamer.counts <- generateKmers(rna.sequences, 6)

    # count heptamers in set of DNA sequences
    dna.sequences <- c(
      "CAACAGCCTTAATT", "CAGTCAAGACTCC", "CTTTGGGGAAT",
      "TCATTTTATTAAA", "AATTGGTGTCTGGATACTTCCCTGTACAT",
      "ATCAAATTA", "AGAT", "GACACTTAAAGATCCT",
      "TAGCATTAACTTAATG", "ATGGA", "GAAGAGTGCTCA",
      "ATAGAC", "AGTTC", "CCAGTAA",
      "TTATTTA", "ATCCTTTACA", "TTTTTTT", "TTTCATCATT",
      "CCACACAC", "CTCATTGGAG", "ACTTTGGGACA", "CAGGTCAGCA"
    )
    hexamer.counts <- generateKmers(dna.sequences, 7)

[Package transite version 1.0.2 Index]