Description Usage Arguments Details Value See Also Examples
View source: R/count_multimers.R
This is a wrapper over count_kmers function in order to enable the computation of many types of k-mers in a single invocation of the function.
A user can input multiple k-mer configurations in the following way.
Each parameter that is related to the configuration
(i.e., k_vector
, positional_vector
, and kmer_gaps_list
)
is represented in a sequential form (i.e., a list or a vector).
The i-th entry of each sequence corresponds to the i-th configuration.
1 2 3 4 5 6 7 8 9 10 11 12 | count_multimers(
sequences,
k_vector,
kmer_alphabet = getOption("seqR_kmer_alphabet_default"),
positional_vector = rep(getOption("seqR_positional_default"), length(k_vector)),
kmer_gaps_list = rep(list(c()), length(k_vector)),
with_kmer_counts = getOption("seqR_with_kmer_counts_default"),
with_kmer_names = getOption("seqR_with_kmer_names_default"),
batch_size = getOption("seqR_batch_size_default"),
hash_dim = getOption("seqR_hash_dim_default"),
verbose = getOption("seqR_verbose_default")
)
|
sequences |
input sequences of one of two supported types,
either |
k_vector |
an |
kmer_alphabet |
a |
positional_vector |
a |
kmer_gaps_list |
a |
with_kmer_counts |
a single |
with_kmer_names |
a single |
batch_size |
a single |
hash_dim |
a single |
verbose |
a single |
The comprehensive description of supported features is available
in vignette("features-overview", package = "seqR")
.
a Matrix
value that represents a result k-mer matrix.
The result is a sparse matrix in order to reduce memory consumption.
The i-th row of the matrix represents k-mers found in the i-th input sequence.
Each column represents a distinct k-mer.
The names of columns conform to human-readable schema for k-mers,
if parameter with_kmer_names = TRUE
Function that count k-mers of one type: count_kmers
Function that merges several k-mer matrices (rbind): rbind_columnwise
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | batch_size <- 1
# Counting 1-mers
count_multimers(
c("AAAACFVV", "AAAAAA", "AAAAD"),
k_vector = c(1),
batch_size=batch_size)
# Counting 1-mers and 2-mers
count_multimers(
c("AAAACFVV", "AAAAAA", "AAAAD"),
k_vector = c(1, 2),
batch_size = batch_size)
# Counting 1-mers, 2-mers, and gapped 2-mers with the length of the gap = 1
count_multimers(
c("AAAACFVV", "AAAAAA", "AAAAD"),
k_vector = c(1, 2, 2),
kmer_gaps = list(NULL, NULL, c(1)),
batch_size=batch_size)
# Counting 3-mers, positional 3-mers, and positional gapped 2-mers with the length of the gap = 1
count_multimers(
c("AAAACFVV", "AAAAAA", "AAAAD"),
k_vector = c(3, 3, 2),
kmer_gaps_list = list(NULL, NULL, c(1)),
positional_vector = c(FALSE, TRUE, TRUE),
batch_size=batch_size)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.