text: user8682: I've got a DNA sequence that I'd like to make synonymous mutations throughout, thereby preserving the amino acid sequence. Does anyone know of a tool to achieve this
  
  user439: There seems to be a bioconductor package named synmut which does just that.
  Apparently, it can take codon usage into account when generating synonymous mutations.
  Copy pasting an example that matches your use case from the official doc:
  library("SynMut")
  filepath.fasta <- system.file("extdata", "example.fasta", package = "SynMut")
  filepath.csv <- system.file("extdata", "target_regions.csv", package = "SynMut")
  region <- read.csv(filepath.csv)
  rgd.seq <- input_seq(filepath.fasta, region)
  mut.seq <- codon_random(rgd.seq, keep = TRUE)
  Biostrings::writeXStringSet(get_dna(mut.seq), "rgd.fasta")
  
  
original_text: 8682: <p>I've got a DNA sequence that I'd like to make synonymous mutations throughout, thereby preserving the amino acid sequence. Does anyone know of a tool to achieve this</p>
   439: <p>There seems to be a bioconductor package named <code>synmut</code> which does just that.
  Apparently, it can take codon usage into account when generating synonymous mutations.</p>
  
  <p>Copy pasting an example that matches your use case from <a href="https://bioconductor.org/packages/3.11/bioc/vignettes/SynMut/inst/doc/SynMut.html" rel="nofollow noreferrer">the official doc</a>:</p>
  
  <pre class="lang-r prettyprint-override"><code>library("SynMut")
  filepath.fasta &lt;- system.file("extdata", "example.fasta", package = "SynMut")
  filepath.csv &lt;- system.file("extdata", "target_regions.csv", package = "SynMut")
  region &lt;- read.csv(filepath.csv)
  rgd.seq &lt;- input_seq(filepath.fasta, region)
  mut.seq &lt;- codon_random(rgd.seq, keep = TRUE)
  Biostrings::writeXStringSet(get_dna(mut.seq), "rgd.fasta")
  </code></pre>
  