---
layout: post
title: "Base conversion in R to represent DNA sequences in base 4 (CC270)"
blurb: "10 different nucleotides"
author: "PD Schloss"
date: 2024-04-01 11:00
comments: false
youtube: rnV2aPGBmhs
start_hash: 088c275123b1f9a22fef78cad90fca0c63b9a68c
end_hash: 917970118bc2f64e3ecdc4ae03a028265862e8dc
---

Because DNA sequences contain 4 characters, they are often thought of as base 4 strings. Pat will show you how to carry out base conversion in R from base 4 to base 10. He explains the benefits of storing kmers and other DNA fragments in this format in bioinformatics approaches. Of course, he'll do it all with test driven development using tools from base R including strtoi. This is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repository at the

* [beginning of the episode](https://github.com/riffomonas/phylotyper/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/phylotyper/tree/{{page.end_hash}})
