Reference no: EM131291169
Python Regular Expressions and Dictionaries
Module Overview
In this module you'll use Python regular expressions to parse /scratch/go- basic.obo and put the fields in a dictionary with GO id as the key. The GO records in this file are multiline, so you'll need to use a record separator other than the newline character. Unlike Perl, Python doesn't allow you to change the record separator for the readline() method, so you'll read the whole file in with the read() method and then use a regular expression to split the file into records.
Since you want to find all the records with your regular expression, you'll need to use re.findall(r"your regex here",goFile, re.DOTALL), which returns a list of matches. re.DOTALL tells Python to match across line breaks with .*.
Required Reading
- Python for Biologists Chapter 7
- Python for Biologists Chapter 8
SwissProt Parser
The code shown below parses a SwissProt file. SwissProt records are multi--line, so it's very similar to what you need to do to parse go--basic.obo.

Assignment
Complete as many exercises from the book as necessary to understand the concepts. These will not be graded. The graded part of the assignment is to use regular expressions to parse /scratch/go-basic.obo and put the results in a dictionary. Your program should be written for Python3 and named
~/BIOL6200/Module10/parseGoInfo.py.
- Parse the GO id, name, namespace, and is_a values for each term.
- Create a string with namespace on the first line followed by a line for name, and one line per is_a.
- Put the string as the value in a dictionary where go_id is the key.
- Iterate over the keys in the dictionary, printing go_id followed by a tab, then the string containing the name, namespace, and is_a values.
- Create a function for splitting the file into records, and a function for splitting the records into fields.
- Your output should look something like this:

What kind of risk do the mcos assess
: What kind of risk do the MCOs assess? Does risk-based compensation limit the freedom of primary care physicians in any way in terms of patient care? Why or why not? How does the capitation model of reimbursement work?
|
Two of the nation biggest airlines challenged
: Please provide a comparison between Delta and American Airlines regarding concerns of capacity growth exceeding demand.
|
Find optimal solution to given integer programming problem
: Find the optimal solution to the given integer programming problem.- Suppose that instead of maximizing profit from surgeries, our objective is to minimize the cost incurred due to surgeries.
|
Examples of economies and diseconomies of scale
: Provide and discuss some examples of economies and diseconomies of scale in a college environment. Discuss some forecasting issues that you encounter in your daily life. How do you make your forecasts? Provide some examples of time series that exhibi..
|
Python regular expressions and dictionaries
: Complete as many exercises from the book as necessary to understand the concepts. These will not be graded. The graded part of the assignment is to use regular expression
|
Determine the intrinsic value of the call
: On December 9 of a particular year, a January Swiss franc call option with an exercise price of 46 had a price of 1.63. The January 46 put was at 0.14. The spot rate was 47.28.
|
What are the trends movements and key buildings or projects
: What are the trends, movements, and key buildings/projects? Is architecture in 2016 still modernist? Why or why not? Write a three-page (750 word) essay on that topic, using specific examples as needed to reinforce your argument.
|
Managing dynamic enviroment
: For this assignment, you should create a plan to hire an employee for a position within your organization to support a recent change. In this plan, you should include the following:
|
Identify the appropriate arbitrage opportunity
: Identify the appropriate arbitrage opportunity and show the appropriate arbitrage strategy.
|