kmr_count: kmr_count

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/kmr_count.R

Description

Count kmers.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
kmr_count(
  in_files,
  out_file,
  k = 11,
  m = 12,
  sm = FALSE,
  f = "a",
  ci = 2,
  cx = 1e+09,
  cs = 255,
  b = FALSE,
  r = FALSE,
  n = 255,
  t = parallel::detectCores(),
  v = FALSE
)

Arguments

in_files

a name of a single file, a vector of file names, or a directory containing files.

out_file

name of the output file

k

kmer size; default is 11.

m

RAM memory size; default is 12.

sm

strict memory mode; default is FALSE.

f

format of input files; options: a fasta, m multiple fasta, q fastq. Default is a.

ci

minimum occurrence of kmers; default is 2.

cx

maximum occurrence of kmers: default is 1e9.

cs

maximum size of counter; default is 255.

b

do not use canonical transformation of kmers. Default is FALSE.

r

turn on RAM only. Default is FALSE.

n

Number of bins. Default is 255.

t

Number of threads. Default is all available number of CPUs.

v

Use verbose mode. Default is FALSE.

Details

A few parameters of the kmc3 counting program are not supported: p signature length; default is 9. sf Number of threads for FASTQ reading. Default is 4. sp Number of threads for splitting. Default is 4. sr Number of threads for second stage. Default is 4

Value

out_file

Note

Counts kmers up to a maximum of size of k = 255. Uses kmc3 in the backend on Windows, Linux, and Mac. The parameter lists corresponds to the list of options of kmc3.

Author(s)

Reinhard Simon

References

Kokot M, Dlugosz M, Deorowicz S. KMC 3: counting and manipulating k-mer statistics. Bioinformatics. 2017 Sep 1;33(17):2759-61.

See Also

Other kmer_core: kmr_install_kmc(), kmr_read_parquet(), kmr_read_rds(), kmr_read_tab(), kmr_write_parquet(), kmr_write_rds(), kmr_write_tab()

Examples

1
2
3
4
5
6
7
8
if (interactive()) {
  fa <- system.file("testdata/phix174_m-pe_w_err_5k_30q.fastq.gz",
    package = "kmerize"
  )
  k <- 13
  out_file <- file.path(tempdir(), "phwei11")
  kmerize:::kmr_count(fa, out_file, k = k, f = "q")
}

c5sire/kmerize documentation built on June 7, 2020, 9:26 p.m.