CS 1101.py Computer Science I
Spring 2016

Computer Science Department
The Morrissey College of Arts and Sciences
Boston College

About Staff Textbook Grading Schedule Canvas
Piazza Library Resources Labs GitHub Problem Sets
Problem Set 8: Overlap Graphs

Assigned: Monday April 18, 2016
Due: Monday April 25, 2016
Points: 9 Points up to 12 Points

This is an individual problem set, you can consult with friends but you should all author your code independently. The problem set has a required part and an optional extra credit part.

Part 1: (Required, 9 Points): Overlap Graphs

Rosalind is a terrific website with problems in bioinformatics. The website is named after Dr. Rosalind Franklin, the discoverer of the helical structure of DNA.

Solve the Overlap Graphs problem. Your solution should be in the form of a self-contained Python program contained in one file named overlap.py containing a function overlap : string * int -> void such that a call overlap(fastafile, n) where fastafile is the name of a FASTA file (e.g., "a.fas", "b.fas", ...) of the form shown on the Overlap Graph page, the program should create a new file a.graph containing a representation of the overlap graph as specified on the Rosalind page.

Notes

  1. There is no harness code for this problem set, use SublimeText to create both sample FASTA files as well as the source file overlap.py. But feel free to use a variation of the following snippet of code for reading the input text from the FASTA file.

    
    # readLines : string -> string list
    #
    # The call (readLines filename) returns a list of strings with
    # one list-entry for each line in filename.
    #  
    def readLines(fasta):
      infile = open(fasta, "r")
      lines = [nextline.strip() for nextline in infile]
      infile.close()
      return lines
    
    

  2. You'll want to make use of several of the functions in Python's String module.

Part 2: (Optional, 3 Points): Locating Restriction Sites

Do the Locating Restriction Sites problem on Rosalind.
Created on 01-19-2016 23:10.