

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A python programming assignment for a university course. The assignment consists of two parts: the first part involves calculating the sum, average, and standard deviation of numerical data from a text file, while the second part requires writing a python module to count the occurrences and percentages of di-nucleotides in a dna sequence from a fasta-formatted file. Students are expected to write the code in separate files, named part1.py and part2.py, respectively.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


The purpose of this is assignment is for you to familiarize yourself with Python. Example input files for the programs can be found on the homework section of the course website.
σ =
N
i=
(xi − x)^2
Write your code in a file named part1.py. Your program for this part should execute from a linux shell as $python part1.py infile outfile. An example python script is provided. Warning: Python distinguishes between integer and float division. Cast a number to the appropriate type to ensure the correct operation. Hint: You might find the Python function sum useful.
Homework 1
Table 1: Example Counts
CG 1 GT 2 TG 2 GA 1 AC 1
You have been provided a fasta parser that you will import into your code and use to help read the fasta file. Look for the file fasta.py on the homework section of the website, and use the class fasta itr. Information about the fasta format can be found at: http://en.wikipedia.org/wiki/Fasta_format. Visit/Email the TA for help on using this parser. Put your function into a file called part2.py.
Submission Please tar your source code files, part1.py and part2.py into a file named assign1.tar and submit the tar file via WebCT.