Wednesday, July 10, 2013

Rosland day 7

I guess I'm going to have to learn some key html tags so I can embed code in my blog in a way that sets it apart from normal text.  Blobspot only uses a very simple WYSIWYG editor.

I've only solved 19 "problems" but I've learned quite a bit.  As I learn more I've quit writing my own code for stuff that is already written.  I'm still writing code when I probably don't need to.  Also my "old" code isn't the most efficient or elegant.  Here's an example from an early Rosalind "problem"

def dna2rna(dna):
    #given a string of dna
    #return the transcribed
    rna=''
    for i in range(len(dna)-1):
        if dna[i] == 'T': rna = rna+'U'
        else: rna = rna+dna[i]
    return rna


Little did I know the same thing could be accomplished by:

def dna2rna(dna): return dna.replace('T','U')

These little routines let me find when messenger rna, mRNA, would start coding for a protein.

list(findall(dna2rna(dna),rnaStart))

Again, not much.  Still, it's little steps.

The quiz for week three of "Computational Molecular Evolution" had lots of problems.  The instructor developed a new quiz.  It's pretty short.  I think I'll do it tomorrow.  I've really got to get started on the "Coding the Matrix" lab.

No comments:

Post a Comment