select_alternative: select_alternative

Description Usage Arguments Examples

View source: R/select_alternative.R

Description

Select a codon from a provided list that has a decent codon usage. Works by selecting a codon at random from the possible_codons list until it isn't also on the excluded forbidden_codons list. Codon lists with only one variant, or with no non-forbidden options will return original codon. Returned codon is provided as lower case string. Verbose option helps to follow the function as it is working. Is called by synonymise function, but can also be used independently.

Usage

1
2
select_alternative(input = "", possible_codons, forbidden_codons,
  verbose = FALSE)

Arguments

input

optional. string used to specify input codon, only required for verbosity. Defaults to "".

possible_codons

dataframe of codons to choose from (eg. output from find_synonymous_codons function).

forbidden_codons

dataframe of codons to exclude, such as rare codons.

verbose

logical. Defaults to FALSE.

Examples

1
select_alternative(possible_codons = synonymous_codons, forbidden_codons = c(very_rare_codons, rare_codons), verbose=TRUE, input="CGC")

ec363/synonymise documentation built on Aug. 9, 2020, 1:34 a.m.