Note: This class wraps a pointer to a C++ object, so do NOT change fields in this class directly. It will cause your R session to do bad things. (Ever seen the bomb popup on RStudio? Manually mess with these fields and you surely will.) For safe ways of manipulating the reference genome, see the "Methods" section.
R6Class generator object
An object of class
externalptr to a C++ object storing the sequences
representing the genome.
View the number of sequences.
View vector of sequence sizes.
View vector of sequence names.
View a sequence string based on an index,
gc_prop(seq_ind, start, end)
View the GC proportion for a range within a reference sequence.
nt_prop(nt, seq_ind, start, end)
View the proportion of a range within a
reference sequence that is of nucleotide
Set names for all sequences.
new_names is a character vector of what to change names to, and it must
be the same length as the # sequences.
Clean sequence names, converting
add_seqs(new_seqs, new_names = NULL)
Add one or more sequences
directly. They can optionally be named (using
Otherwise, their names are auto-generated.
Remove one or more sequences based on names in
Merge all sequences into one after first shuffling their order.
Filter sequences by size
method = "size") or for a proportion of total bases (
method = "prop").
For the latter, sequences are first size-sorted, then the largest
sequences are retained that allow at least
threshold * sum(<all sequence sizes>) base pairs remaining after
replace_Ns(pi_tcag, n_threads = 1, show_progress = FALSE)
Ns in reference sequence with nucleotides sampled with probabilities
You can optionally use multiple threads (
n_threads argument) and/or
show a progress bar (