Kyle Reese
Kyle Reese
Projects
Code
Blog
Textbooks
Contact
Light
Dark
Automatic
Data
Complementing a Strand of DNA
We firstly need to reverse the string which we can do by list slicing. We then loop through the now inversed string changing A to T, C to G, etc.
Counting DNA Nucleotides
We can write a function to easily get the count of the letters of a string. We use a Python dictionary to store and count the DNA string nucleotides:
ISLR
Notes, code, and solutions for ISLR: Chapter 2 Chapter 3 Chapter 4
Linear Algebra: Theory, Intuition, Code by Mike X Cohen
Notes, code, and solutions for Linear Algebra: Theory, Intuition, Code by Mike X Cohen: Chapter 2 Chapter 3 Chapter 4
Project Rosalind Programming Solutions
Solutions to Project Rosalind questions: Counting DNA Nucleotides Transcribing DNA into RNA Complementing a Strand of DNA
Transcribing DNA into RNA
This is an extremely easy problem. We can just use the replace string method to replace the T’s with U’s: def dna_transtribed_to_rna(dna_string: str) -> str: """ Parameters ---------- dna_string : Str DNA Nucleotide String (DNA String) Returns ------- String Transcribes the DNA string into a RNA string (replaces Thymine with Uracil) Example ------- Input: GATGGAACTTGACTACGTAAATT Output: GAUGGAACUUGACUACGUAAAUU """ return dna_string.
Cite
×