Write and document a Python script dnastruct.py which takes as command-line arguments a DNA sequence file and a DNA structure file and determines for each structure whether or not it occurs in the sequence. If it occurs, a list is printed describing via tuple-pairs each motif and its start-position. A DNA sequence file may represent the sequence over multiple lines. Each line in a DNA structure file describes an individual structure that consists of either a single motif or a pair of motifs separated by a lower/upper bound-pair written as l/u. Your script must work on DNA sequence file seq1.dat and DNA structure file struct1.dat to produce the output given in typescript-file dnastruct.script. You may assume that all given files are formatted correctly.
1 2 3 4 5 6 7 8 9 10 11 12
and has the following associated row, column, and diagonal data-vectors:
Each line of the command file consists of X in {row, column, diagonal} and a number Yspecifying a data vector relative to the data matrix in file Z.dat; the statistics for this data vector are written to data-vector-specific file Z.XY.stt. Your script must work on data matrix file data1.dat and command-file cmd1.dat to produce statistics-file data1.row3.stt, data1.col2.stt, data1.dia3.stt, data1.dia2.stt, data1.dia1.stt, data1.dia0.stt, data1.dia-1.stt, and data1.dia-2.stt as specified in typescript-file stats2.script. You may assume that all given files are formatted correctly.
In Q2, you may find it useful to store the data matrix internally as a nested list and extract data vectors to process as required.
######################################################### ## CS 2500 (Fall 2009), Assignment #4, Question #1 ## ## Script File Name: numdesc.py ## ## Student Name: Todd Wareham ## ## Login Name: harold ## ## MUN #: 8008765 ## #########################################################You do not have to develop your code on our CS departmental systems. However, as your code will be interpreted and tested on our CS departmental systems as part of the assignment marking process, you should ensure that your code interprets and runs correctly on at least one of these systems.
Created: August 21, 2009
Last Modified: August 21, 2009