Till KTH:s startsida Till KTH:s startsida

Advanced assignment

Data visualisation using MatPlotLib

Completing this assignment will raise your grade one step.

In this assignment you are to visualise Blast results.

Use the module matplotlib and write a program that parses a Blast output file and creates a histogram of all scores for the first Blast result (i.e., the Blast output from the first query) in the file. You will also use the argparse module to ensure a good command-line user-interface.

Requirements

  • Your program should take user input using the argparse module.
  • Your program should take two arguments: input file and output filename.
  • Read from the given input file and create a PDF with the histogram in the output file. 
    • Optional functionality: read from stdin if only on argument is given.
  • Appropriate help texts should be available.

To present

  1. Explain how the histogram is built.
  2. Show how you can use the results from the assignment "Remote Blast" as input to your program.

Lars Arvestad skapade sidan 2 november 2015

kommenterade 30 november 2015

What do you mean with 'create a histogram of all scores for the first Blast result in the file.'? The first blast result - one result - has only one score?

Lärare kommenterade 30 november 2015

What I mean is "for the first query". If the Blast contains results from several queries, you only need to produce a histogram for the first one (which then includes all the suboptimal hits). Does this make sense?

kommenterade 30 november 2015

Yeah, I guess so. But there is only one query in the cst3 file? But you want us to handle multiple queries anyways?

Lärare kommenterade 30 november 2015

No, I am saying your code does not need to handle multiple queries. I am making this assignment easier than it perhaps should be. :-)

kommenterade 30 november 2015

Ok, but now it does handle multiple queries. I think it says that it should handle multiple, but maybe I'm mistaken.

Lärare Lars Arvestad ändrade rättigheterna 30 november 2015

Kan därmed läsas av alla och ändras av lärare.
Lärare kommenterade 30 november 2015

I added a parenthesis which hopefully clarifies the assignment for future generations. But I won't fail you for writing a more general program which solves the assignment.