Final project 2 - myTeachingURJC/2018-19-PNE GitHub Wiki

Final project 2: Specifications

  • Title: Browsing human and vertebrates genome
  • Date: June-11th-2019
  • Deadline: On July the 2nd, at 23:59h, a script will connect to github and download all your final projects. Changes made after that date will not be evaluated
  • IMPORTANT: You must follow all the project specifications. Read them carefully (many times). If this specification is broken in your project, you will not pass this subject (no matter how small the failure is). If you break any specification, your maximum score will be 2.0

Contents

Introduction

Let's practice all the concepts we have learnt so far by doing a final project. You should develop a python application for getting information about the human and other vertebrates genome

The application user interface is a web page with forms for querying the genome database. We will use the database from the ensembl project. The API REST can be found in this link: Ensembl REST API Endpoints

It is important that you spend time understanding this API and all the information available before you begin to code. There are many details and definitions involved that are necessary for a complete understanding of all the services provided by your application

Project structure

  • The project will be developed in your github account
  • It should be stored in the 2018-19-PNE-Final2-project repository
  • Your application filename must be server-new.py. It must be listening on port 8080
  • You can include any other additional files you need

Project levels

The project is divided into three levels: Basic, medium and advanced. You decide were to stop. But, you can only access to the next level if the previous one is working perfectly

Important! For every level you should include a Test report: a text file in which you show the endpoints tested, the argument passed and the response from the server. This is a document that demonstrate that your endpoints are working. Make sure you test all the endpoints you have implemented. Any endpoint not tested on this report will not be evaluated

Application API

Your application is a web server that should provided some services using the HTTP protocol. The response should be an HTML page with the required information. You must use the followings python libraries: http.server, socketserver and request. You are not allowed to use FLASK

All the items generated as response should be inside the

  • and HTML tags. For example, the list of species, echa chromosome of the karyotype, the genome length and so on

    All the HTML pages generated with the results should include a link to the main page, at the bottom

    Basic LEVEL

    • Maximum score: 6 points
    • Requirements: You should have finished all the practices (P0 - P7) and have more than 6 weeks of activity on github
    Endpoint Parameters Description
    /listSpecies limit (optional) List the names of all the species available in the database. The limit parameter (optional) indicates the maximum number of species to show. If it is not specified, all the species will be listed
    /karyotype specie (mandatory) Return information about the karyotype of a specie: The name (usually a number) of all the chromosomes
    /chromosomeLength specie, chromo Return the Length of the chromosome named "chromo" of the given specie
    / none Main endpoint. The server should return an HTML page with the forms for accessing to all the previous services

    If other endpoint different than the previous is introduced, the server should response with an HTML error page

    In the endpoints with more than 2 arguments, the character ";" should be used as a separator

    Examples

    These are examples of use of the previous endpoints

    Medium level

    • Maximum score: 8 points
    • Requirements: You should have finished the Basic level (with an score equal or greater than 5)
    Endpoint Parameters Description
    /geneSeq gene Return the sequence of a given human gene
    /geneInfo gene Return information about a human gene: start, end, Length, id and Chromose
    /geneCalc gene Performs some calculations on the given human gene and returns the total length and the percentage of all its bases
    /geneList chromo, start, end Return the names of the genes located in the chromosome "chromo" from the start to end positions

    Some endpoints are implemented directly using the REST API from ensamble but for others is neccesary to perform some calculations on the data

    Examples

    Advance level

    • Maximum score: 10 points
    • Requirements: You should have finished the Medium level (with an score equal or greater than 7)

    Convert the previous user API into a REST API. If the parameter json=true is included, the server will create a json object with the requested data and send it to the client. When the json parameter is not present, the server response with the previous HTML pages (It should behaves the same as in the basic and medium levels).

    In order to test the server, you should create a client that makes requests to the server, process the received json file and print the information on the console

    Aditional information

    For preventing the common error: "Port already in use" you should add this line. This way, you do not have to change manually the port for testing the server

    socketserver.TCPServer.allow_reuse_address = True

    Authors

    Credits

    • Alvaro del Castillo. He designed and created the original content of this subject. Thanks a lot :-)

    License

    Links

  • ⚠️ **GitHub.com Fallback** ⚠️