codon_random {SynMut} | R Documentation |
Generating random synonymous mutations (in user-defined region), with optionally keeping/not keeping the original codon usage bias.
codon_random(object, n = 1, keep = FALSE, ...) ## S4 method for signature 'regioned_dna' codon_random(object, n, keep) ## S4 method for signature 'DNAStringSet' codon_random(object, n, keep)
object |
A regioned_dna object. |
n |
Optional n parameter specifying what proportion of the codons to be
mutate. Default value: |
keep |
Logical parameter controling whether keeping the codon usage bias
of the original sequence. Default value: |
... |
... |
This method randomly sample synonymous codons for n
propotion
of every mutable codons in the sequences. This process will be likely to
alter the codon usage bias of the original sequences. However the
keep = TRUE
argument help to preserve the codon usage bias. It is
done via the synsequence
function in seqinr
package. The
synsequence
function essentially swaps the position of the
synonymous codons without introducing new codons into the original
sequences.
A regioned_dna object containing the mutants; Or a DNAStringSet object if the input is a DNAStringSet object.
input_seq
, dinu_to
,
codon_to
, codon_mimic
filepath <- system.file("extdata", "example.fasta", package = "SynMut") rgd.seq <- input_seq(filepath) set.seed(2019) get_cu(codon_random(rgd.seq, n = 0.5)) get_cu(codon_random(rgd.seq))