Learn R Programming

seqTools (version 1.6.0)

countFastaKmers: countFastaKmers function: Counts DNA k-mers from (compressed) fasta files.

Description

Reads (compressed) fasta files and counts for DNA k-mers in the sequence.

Usage

countFastaKmers(filenames,k=4)

Arguments

filenames
character: Vector of fasta file names. Files can be gz compressed.
k
Length of counted DNA k-mers.

Value

.

Details

Maximal allowed value for k is 12.

References

Cock PJA, Fields CJ, Goto N, Heuer ML, Rice PM The sanger FASTQ file format for sequences with quality scores and the Solexa/Illumina FASTQ variants. Nucleic Acids Research 2010 Vol.38 No.6 1767-177

Examples

Run this code
basedir <- system.file("extdata", package="seqTools")
filename <- file.path(basedir,"small.fa")
## Not run: writeFai(filename, "small.fa.fai")
res <- countFastaKmers(filename, k=2)

Run the code above in your browser using DataLab