Lab 5

Pirates, Proteins & Penguins

This lab marks an important turning point in your computer science journey. It’s time to work with some real data! You have seen many manufactured problems that were designed to exercise the fundamentals of problem solving in Python. With those fundamentals under your belt, you are ready to tackle some real data science. The main parts of this lab will focus on the problems of protein sequence alignment and data summarization—both of which involve the manipulation of strings and lists. Time to get our hands dirty!

Goals

  • Practice manipulating strings and lists
  • Learn how to perform basic protein sequence alignment
  • Learn how to summarize data from a large study

Permitted Functions

Below is a list of the functions you are allowed to use in this lab. Generally, the rule is if you can use it in a previous lab, you can use it in this lab. If there is something you want to use but it isn’t listed here, first check if it is on your class slides / runestone and if it’s not there ask your professor.

  • YOU ARE NOT PERMITTED TO USE THE BUILT-IN replace() METHOD FOR PART 1: PIRATE
  • len()
  • list()
    • Because of the focus on string editing, you are not allowed to convert strings into lists for stringedit.py or pirate.py exercises.
  • List methods
    • .append()
    • .insert()
    • .pop()
    • .sort()
    • .reverse()
    • .index()
    • .count()
    • .remove()
  • String indexing
  • Reading files
    • .readlines()
    • .read()
    • open()
    • .write()
    • .close()
  • .split()
  • .strip()
  • .lower()
  • .upper()