MCB112: Biological Data Analysis (Fall 2019)

answers 01:

the case of the dead sand mouse

Here’s three different answers from us as Jupyter Notebook pages you can download. Each week we’ll give you three answers, two from the TFs and one from me (Sean).

No matter what the pythonistas say, there isn’t just One Right Way to solve a problem in python. By comparing the different answers, you’ll be able to see a range of different approaches and tricks. For example, in comparing the Moriarty and Adler gene name lists for part 1, a naturally pythonic approach is to use set operations, subtracting one set from the other. But you can just as easily iterate over the gene names in one list and test if a gene name is not in the other list. Python has some very powerful syntax, such as list comprehensions and lambdas (anonymous functions), which is helpful (if you know them) but not necessary (if you don’t). You’ll see examples of more or less clever syntax here, but all of it’s getting the job done.