Avatar of stajich


Code to get the sequence for problem 1

October 8, 2012 in Problem Sets

To avoid you worrying about how to get the sequence for problems 1-4 into your program, here is some code that does it for you. I don’t think it is that informative for you deal with cut and paste and removing the newlines (though it is good to learn something that is annoying so you are more potentially excited with your new tools).

Here it is in a gist or in my class repository for the problems.

I also mentioned that the second script could be solved using the ‘index’ function. This is true but may be more involved than other solutions. You should think about how you would go through and examine the codons (based on the fact that you should know the start codon) and think about how you test whether or not a particular codon is a stop codon.

3 responses to Code to get the sequence for problem 1

  1. the returning length count is bigger than the actual length. does the length command count spaces as well?

    • Yes length will count the spaces.

      Are you getting this longer length in the code I posted or in your own code?

  2. i did a copy and paste of the sequence from NCBI last week. I’ve re-pasted with your seq and it’s fine now

Leave a Reply