Biol4230 - Python homework - DUE Monday, Feb. 5, 5:00 PM


In addition to putting the python programs an shell scripts for this homework in biol4230/hwk3, also create a file hwk3.notes that links the names of your programs with the question and contains the output for each of the python programs.


  1. Arrays of random numbers
    1. A write a program to generate 10 random integers between 1 and 100 (1 <= x <= 100), calculate the mean (average) as a floating point number. Print both the random numbers and the mean.
    2. write a program that calculates the average of 100 random "real" (float) numbers between 0 and 100 (0 <= x < 100)
    3. write a program that generates 101 random integers, stores them in an array, and calculates the median (hint, use the sort function to sort the array).
  2. write a program that reads a file of Uniprot accession strings and downloads the sequences in FASTA format to "stdout" (use urllib).
  3. repeat some of last week's homework using Python:

    1. Using one of the blastp (or ssearch36) tabular output files you generated for last week's homework, write a program that extracts the accession and E()-value from the output file.
    2. modify the program to extract the accessions, but only for results with E() < 0.001 (remember that the tabular output files are ordered by E()-value)
    3. write a program that downloads sequences for the blastp or ssearch36 accessions with 0.1 < E() <= 2.0, and runs another blastp search (tabular format) with the downloaded sequences, saving the results of each search in a separate file.


Biol4230 Schedule