compute_kmer {LncFinder} | R Documentation |
Compute k-mer Features
Description
This function can calculate the k-mer frequencies of the sequences.
Usage
compute_kmer(
Sequences,
label = NULL,
k = 1:5,
step = 1,
freq = TRUE,
improved.mode = FALSE,
alphabet = c("a", "c", "g", "t"),
on.ORF = FALSE,
auto.full = FALSE,
parallel.cores = 2
)
Arguments
Sequences |
A FASTA file loaded by function |
label |
Optional. String. Indicate the label of the sequences such as "NonCoding", "Coding". |
k |
An integer that indicates the sliding window size. (Default: |
step |
Integer defaulting to |
freq |
Logical. If TRUE, the frequencies of different patterns are returned
instead of counts. (Default: |
improved.mode |
Logical. If TRUE, the frequencies will be normalized using
the method proposed by PLEK (Li et al. 2014).
Ignored if |
alphabet |
A vector of single characters that specify the different character
of the sequence. (Default: |
on.ORF |
Logical. If |
auto.full |
Logical. When |
parallel.cores |
Integer. The number of cores for parallel computation.
By default the number of cores is |
Details
This function can extract k-mer features. k
and step
can be customized.
The count (freq = FALSE
) or frequencies (freq = TRUE
) of different patterns can be returned.
If freq = TRUE
, improved.mode
is available. The improved mode is proposed by method PLEK.
(Ref: Li et al. 2014)
Value
A dataframe.
Author(s)
HAN Siyu
Examples
## Not run:
data(demo_DNA.seq)
Seqs <- demo_DNA.seq
kmer_res1 <- compute_kmer(Seqs, k = 1:5, step = 1, freq = TRUE, improved.mode = FALSE)
kmer_res2 <- compute_kmer(Seqs, k = 1:5, step = 3, freq = TRUE,
improved.mode = TRUE, on.ORF = TRUE, auto.full = TRUE)
## End(Not run)