Homework 3
CS 5046 (Spring 2011)

Assigned on April 4, 2011
Due by 4pm, April 13, 2011
Submit by email to murali AT cs DOT vt DOT edu

This homework will give you practice in automating class creation using the Class::Struct package. We will do so in the context of parsing an ``OBO'' file that specifies the terms in the Gene Ontology and their relationships with each other.

Problem 1
(15 points) Add a method called part_of to the GO::Term class to store and retrieve all other GO terms that a given GO term is related to by the "part_of" relationship. This information is provided in the file in the lines starting with the string ``relationship''.
Problem 2
(30 points) Implement two methods called get_num_parents and get_parents in the GO::Term class. A parent of a term t is another term u such that t is_a u (i.e., the line "is_a: u" appears in the definition of t) or t is part_of u (i.e., the line "relationship: part_of u" appears in the definition of t). Note the word ``or'' in the definition of ``parent.'' The method get_num_parents returns the number of parents of a term. The method get_parents returns a reference to a hash whose keys are the identifiers of the parents of the term. For get_parents, you can modify the existing method, if you prefer to.
Problem 3
(55 points) Implement a method called get_siblings. The method should take a GO term's identifier (a string) as argument and return a reference to a hash whose keys are the siblings of the GO term. You have to decide in which class to implement this method. A sibling of a term t is another term u such that t and u have a common parent. You may find it useful to write other methods to "help" the get_siblings method. I will judge the efficiency of your method when I grade it.

Write a test script called go.pl that uses these methods and tests that they are working correctly.

Submitting your Homework

Last modified: Wed May 4 11:26:05 EDT 2011