SynMut: Tools for Designing Synonymously Mutated Sequences

Haogao Gu, Leo L.M. Poon

School of Public Health, The University of Hong Kong

2019-05-08


Introduction

Synonymous mutations refer to the mutations in DNA/RNA sequences that cause no modification in the translated amino acid sequence. Most of the synonymous mutations are also silent mutations as they do not have observable effects on the organism’s phenotype. Designing mutant sequences with synonymous mutations is often applied in many biological studies as a method to control some unwanted changes in the translated amino acid sequences.

The codon usage bias and dinucleotide usage bias are two genomic signatures in DNA/RNA sequences, even for synonymous sequences. Characterizing the functions of synonymous sequences with different codon usage bias or dinucleotide usage bias help to study their impacts on various biological functions. In fact, this method has been applied in many researches in virology.

SynMut provides tools for generating multiple synonymous DNA sequences of different genomic features (in particular codon / dinucleotide usage pattern). Users can also specify mutable regions in the sequences (this is particular useful as there are some conserved regions in the genome which we do not want to modify). This tool was originally designed for generating recombinant virus sequences in influenza A virus to study the effects of different dinucleotide usage and codon usage, yet these functions provided in this package can be generic to a variety of other biological researches.

Below is a flowchart illustrating how the components work togaether in this package.

Getting started

Input data

We use the below data in the package for example.

  • example.fasta: The fasta file contains the segment 7 and segment 8 DNA sequences of Influenza A/Brisbane/59/2007 (H1N1) (BR59).
  • target_regions.csv: The region file in csv format reads as a data.frame specifying the user-defined mutable positions (in amino acid position) correspond to the DNA sequences.

The input_seq function takes either a system fasta file or a DNAStringSet object as input, to construct a regioned_dna object that is used in the SynMut package.

Important Notes: if the region parameter is specified in the resulted regioned_dna object, it will be automatically applied to all the downstream functions for mutations. Mutations will only performed in the specified mutable regions.

Access the data

Various get_ functions were used to get some useful information:

  • get_dna: Access the DNA sequences. This will return a DNAStringSet object (from Biostrings package).
  • get_region: Access the user-defined mutable region. if there is no specified regions, this function will return a list of length 0.
  • get_cu: Get the codon usage
  • get_du: Get dinucleotide usage
  • get_nu: Get nucleotide usage
  • We also provide functions to:
    • get the codon usage frequency of synonymous codons: get_freq
    • get Relative Synonymous Codon Usage (rscu) of synonymous codons: get_rscu

Generating mutations

Random synonymous mutants

Generating random synonymous mutations (in specific region if provided in the input_seq), with optional keeping or not keeping the original codon usage bias.

We can also specify the n parameter to control the proportion of the codons to be mutated.

Synonymous mutants with maximal/minimal usage of specific codon

When studying the role of a particular codon, it would be useful to have the mutants with maximal/minimal usage of that codon. The codon_to function will do this job for you. Pass a string of codon to either the max.codon or min.codon argument to maximize or minimize the usage of certain codon in the sequence.

Synonymous mutants with maximal/minimal usage of specific dinucleotide

Use dinu_to to generate mutations with maximal/minimal usage of specific dinucleotide. This was done by a two-step heuristic greedy algorithm, details can be found at this link.

An alternative keep = TRUE argument allow retaining the original codon usage bias. This can be useful when in combination with codon_mimic in the next section to design mutant sequences with similar codon usage bias but distinct specific dinucleotide usage.

# Maximaize the usage of "CG" dinucleotide in the pre-defined region
mut.seq <- dinu_to(rgd.seq, max.dinu = "cg")
# Check the dinucelotide usage difference between the mutant and the original
get_du(mut.seq) - get_du(rgd.seq)
#>       AA AC  AG  AT  CA CC CG CT GA GC GG GT  TA TC  TG  TT
#> [1,] -29  8 -14 -22 -10  3 78 -7  3 31 -1  4 -21 22 -26 -19
#> [2,] -12  1  -1  -2   1 -1 15 -1  0  6  2  3  -3  8  -5 -11

# Minimize the usage of "CA", and compare the dinucleotide usage.
mut.seq <- dinu_to(rgd.seq, min.dinu = "CA")
get_du(mut.seq) - get_du(rgd.seq)
#>      AA AC  AG AT  CA  CC CG CT GA GC GG GT TA TC TG TT
#> [1,] -3 -5 -21  0 -33 -19 32  5 12  0  5  7 -5  9  8  8
#> [2,] -7 -2   0  1  -6  -6  7  0  4  3  4  3  1  0  3 -5

# Maximize the usage of "CG" while keeping the original codon usage
mut.seq <- dinu_to(rgd.seq, max.dinu = "cg", keep = TRUE)
# Compare the dinucleotide usage
get_du(mut.seq) - get_du(rgd.seq)
#>      AA AC AG AT  CA CC CG CT GA GC GG GT TA TC  TG TT
#> [1,]  3  0 -5  2 -13 -5 20 -2  0  2 -2  0 10  3 -13  0
#> [2,]  0  1 -1  0   0 -1  1  0  0  0  0  0  0  0   0  0
# Compare the codon usage
get_cu(mut.seq) - get_cu(rgd.seq)
#>      AAA AAC AAG AAT ACA ACC ACG ACT AGA AGC AGG AGT ATA ATC ATG ATT CAA
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      CAC CAG CAT CCA CCC CCG CCT CGA CGC CGG CGT CTA CTC CTG CTT GAA GAC
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      GAG GAT GCA GCC GCG GCT GGA GGC GGG GGT GTA GTC GTG GTT TAA TAC TAG
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      TAT TCA TCC TCG TCT TGA TGC TGG TGT TTA TTC TTG TTT
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0

Synonymous mutants mimicking a specific codon usage pattern

The function codon_mimic mutates the sequences to mimic a target codon usage patterns. Detail algorithm was provided at this link.

The alt argument specifies the target codon usage in either a codon usage vector (result from get_cu) or a DNAStringSet of length 1 representing the desired codon usage.

# Use a codon usage vector as a target
target <- get_cu(rgd.seq)[2,]
mut.seq <- codon_mimic(rgd.seq, alt = target)
# Compare the codon usage
get_cu(mut.seq) - get_cu(rgd.seq)
#>      AAA AAC AAG AAT ACA ACC ACG ACT AGA AGC AGG AGT ATA ATC ATG ATT CAA
#> [1,]   3   2  -3  -2   2  -4   0   2  -3   1   1  -3  -1  -1   0   2   2
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      CAC CAG CAT CCA CCC CCG CCT CGA CGC CGG CGT CTA CTC CTG CTT GAA GAC
#> [1,]   1  -2  -1   1   0   0  -1  -2   1   3   0   4  -3   0  -1   4   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      GAG GAT GCA GCC GCG GCT GGA GGC GGG GGT GTA GTC GTG GTT TAA TAC TAG
#> [1,]  -4   0   3  -7   3   1   3   2  -4  -1   0   1  -2   1   0   2   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      TAT TCA TCC TCG TCT TGA TGC TGG TGT TTA TTC TTG TTT
#> [1,]  -2   1   2   0  -1   0   1   0  -1  -2   2   2  -2
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0

# Use a sequence as a target
target <- Biostrings::DNAStringSet("TTGAAAA-CTC-N--AAG")
mut.seq <- codon_mimic(rgd.seq, alt = target)
# Compare the codon usage
get_cu(mut.seq) - get_cu(rgd.seq)
#>      AAA AAC AAG AAT ACA ACC ACG ACT AGA AGC AGG AGT ATA ATC ATG ATT CAA
#> [1,]   1   0  -1   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]  -2   0   2   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      CAC CAG CAT CCA CCC CCG CCT CGA CGC CGG CGT CTA CTC CTG CTT GAA GAC
#> [1,]   0   0   0   0   0   0   0   0   0   0   0  -1  -3  -3  -6   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0  -1  -1  -3  -2   0   0
#>      GAG GAT GCA GCC GCG GCT GGA GGC GGG GGT GTA GTC GTG GTT TAA TAC TAG
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      TAT TCA TCC TCG TCT TGA TGC TGG TGT TTA TTC TTG TTT
#> [1,]   0   0   0   0   0   0   0   0   0  -2   0  15   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   7   0
# Compare the synonymous codon usage frequency
get_freq(mut.seq) - get_freq(rgd.seq)
#>              AAA AAC         AAG AAT ACA ACC ACG ACT AGA AGC AGG AGT ATA
#> [1,]  0.07692308   0 -0.07692308   0   0   0   0   0   0   0   0   0   0
#> [2,] -0.15384615   0  0.15384615   0   0   0   0   0   0   0   0   0   0
#>      ATC ATG ATT CAA CAC CAG CAT CCA CCC CCG CCT CGA CGC CGG CGT
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>              CTA         CTC        CTG         CTT GAA GAC GAG GAT GCA
#> [1,] -0.03846154 -0.11538462 -0.1153846 -0.23076923   0   0   0   0   0
#> [2,] -0.04545455 -0.04545455 -0.1363636 -0.09090909   0   0   0   0   0
#>      GCC GCG GCT GGA GGC GGG GGT GTA GTC GTG GTT TAA TAC TAG TAT TCA TCC
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      TCG TCT TGA TGC TGG TGT         TTA TTC       TTG TTT
#> [1,]   0   0   0   0   0   0 -0.07692308   0 0.5769231   0
#> [2,]   0   0   0   0   0   0  0.00000000   0 0.3181818   0
# Compare the Relative Synonymous Codon Usage (RSCU)
get_rscu(mut.seq) - get_rscu(rgd.seq)
#>             AAA AAC        AAG AAT ACA ACC ACG ACT AGA AGC AGG AGT ATA ATC
#> [1,]  0.1538462   0 -0.1538462   0   0   0   0   0   0   0   0   0   0   0
#> [2,] -0.3076923   0  0.3076923   0   0   0   0   0   0   0   0   0   0   0
#>      ATG ATT CAA CAC CAG CAT CCA CCC CCG CCT CGA CGC CGG CGT        CTA
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0 -0.2307692
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0 -0.2727273
#>             CTC        CTG        CTT GAA GAC GAG GAT GCA GCC GCG GCT GGA
#> [1,] -0.6923077 -0.6923077 -1.3846154   0   0   0   0   0   0   0   0   0
#> [2,] -0.2727273 -0.8181818 -0.5454545   0   0   0   0   0   0   0   0   0
#>      GGC GGG GGT GTA GTC GTG GTT TAA TAC TAG TAT TCA TCC TCG TCT TGA TGC
#> [1,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#> [2,]   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
#>      TGG TGT        TTA TTC      TTG TTT
#> [1,]   0   0 -0.4615385   0 3.461538   0
#> [2,]   0   0  0.0000000   0 1.909091   0

Output the results

Output the DNA mutant sequences