Convert Text to a DNA Sequence with Python

ABOUT THE PROJECT

Before the text is mapped to a nucleotide sequence, it must be converted to a binary sequence. In digital electronics, binary sequences represent instructions to the computer and types of data using bits and bytes. Binary digits, or bits, store either 0 or 1, rendering them the smallest units of storage. 8 bits grouped together make a byte, such as 01011010 and 01000001.

https://www.genome.gov/sites/default/files/tg/en/illustration/dna_deoxyribonucleic_acid_adv.jpg — Annotated by me

DISSECTING THE PROJECT

At first, I set a variable (original_str) with the user’s input. The text can vary in length and content; it’s all up to the user.

WHAT’S NEXT FOR THE PROJECT?

Next, this program could convert documents, pictures and videos to a binary sequence and thus, a nucleotide sequence. By including more than just text, different types of information can be encoded and stored in DNA. Also, a file including the resulting sequence could be downloaded to be used for in silico analyses with computational and statistical techniques.

https://github.com/JohnHammond/ctf-katana/blob/master/img/dna_codes.png?raw=true — Another way to encode characters in the English alphabet with codons

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store