synonymise: synonymise

Description Usage Arguments Examples

View source: R/synonymise.R

Description

Using an input coding sequence (cds), make synonymous replacements codons in the CDS at a selected frequency and excluding certain sets of codons. Unlike other tools, this function (a) doesn't replace stop codons or treat them as rare, (b) rare codons can be excluded but this is optional and can be specified manually, (c) the replacement codon is randomised so that you don't just end up using same codon for each (eg.) Alanine, (d) the frequency of changes can be specified such that not every codon is changed. Codons requiring replacement but that do not have a synonymous alternative, or any non-forbidden alternatives will return the original codon silently. All changed codons are returned in lower case, allowing inspection. Verbose option helps to follow the function as it is working. Some more specifics: The frequency parameter allows you to specify how often to edit a codon: every codon = 1, every 3 codons = 3. It is specified by the term index 3 (then every 3rd codon after). The displacement parameter allows you to start editing on a codon other than the one provided by the frequency value alone, that is, when frequency = 3 and displacement = 0, the first edited codon will be the third codon. To start at codon 1 instead, then codon 4, etc, use frequency = 3, displacement = 1, which gets the index of the first codon to 0 (so index

Usage

1
2
3
synonymise(cds, codon_table = codon_table,
  forbidden_codons = c(very_rare_codons, rare_codons), frequency = 1,
  displacement = 0, verbose_synonymise = TRUE)

Arguments

cds

input coding sequence as a string. Must be in frame!

codon_table

dataframe object to be used as lookup table. Defaults to object named codon_table.

forbidden_codons

dataframe of codons to exclude, such as rare codons. Defaults to very_rare_codons + rare_codons.

frequency

integer. How often to make a replacement? Defaults to 1, meaning every codon is replaced.

displacement

integer. Which codon to be the first to be replaced? Defaults to 0, meaning the first codon.

verbose_synonymise

logical. Defaults to TRUE.

Examples

1
myCDS <- synonymise(cds = "gggaaaccctag", codon_table = codon_table, forbidden_codons = c(very_rare_codons, rare_codons), frequency = 2, displacement = 1)

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