rosalind

Rosalind - Counting Point Mutations

rosalind

Problem: Please find the problem here. Solution: To compute the Hamming distance, we walk the strings together and count the number of differences. Code:

Rosalind - Computing GC Content

rosalind

Problem: Please find the problem here. Solution: The only challenge for this problem is to parse the FASTA format. To make life easy, I added a ‘>’ sign at the end of all the inputs - now every DNA is simply a ‘>’ terminating string. Therefore a simple scan of the file parses all the input correctly. Code:

Rosalind - Rabbits and Recurrence Relations

rosalind

Problem: Please find the problem here. Analysis: It is long known to me that the Fibonacci numbers are the solution to the rabbit’s problem. I never really bothered to understand why that is the case. It feels natural to me. In order to solve this problem, I need to understand it in more depth. Here is the problem description in its own words: The population begins in the first month with a pair of newborn rabbits.

Rosalind - Complementing a Strand of DNA

rosalind

Problem: Please find the problem here. Solution: This problem has an in-place solution. We can walk the string from two ways and swap and map at the same time. However, Python strings are immutable. We have to create new strings. To build a string, I was thinking about something like a StringBuilder, but there is no such thing in Python. It is reported that doing repeated string concatenation is the fastest way.

Rosalind - Transcribing DNA into RNA

rosalind

Problem: Please find the problem here. Solution: This one is even simpler than the one before, this is just replacing a single character. Code:

Rosalind - Counting DNA Nucleotides

rosalind

Problem: Please find the problem here. Solution: The problem is very simple, just counting the number of alphabets. Code: