* Develop our own server for working with DNA sequences
* Develop our own server for working with DNA sequences
...
@@ -25,9 +26,9 @@
...
@@ -25,9 +26,9 @@
## Introduction
## Introduction
The goal of this new assignment is to develop our own **Seq** server to work with **DNA sequences**. We have been working with DNA sequences for many sessions, but always in our local computer. Now we will make these calculations available to other applications on Internet
The goal of this new assignment is to develop our own **Seq** server to work with **DNA sequences**. We have been working with DNA sequences for several sessions now, but always in our local computer. Now we will make these calculations available to other applications on the Internet
The first step is to **define** the set of **rules** and **commands** that the **clients** need to follow in order to access the **services**given by our **server**: we should define the **protocol**
The first step is to **define** the set of **rules** and **commands** that the **clients** need to use in order to access the **services**provided by our **server**. We should define the communications **protocol**
| Service name | Request message | Argument | Response message | Description |
| Service name | Request message | Argument | Response message | Description |
| **PING** | "PING" | none | "OK" | Ping service for testing whether the server is alive of not |
| **PING** | "PING" | none | "OK" | Ping service for testing whether the server is alive of not |
...
@@ -50,19 +51,19 @@ T: 3 (14.3%)
...
@@ -50,19 +51,19 @@ T: 3 (14.3%)
The names of the **valid** genes to call the **GENE service** are: **U5**, **ADA**, **FRAT1**, **FXN**, and **RNU6_269P**
The names of the **valid** genes to call the **GENE service** are: **U5**, **ADA**, **FRAT1**, **FXN**, and **RNU6_269P**
The server will be programmed **step by step**, following the guidelines given in the **exercises**.
The server will be programmed **step by step**, following the guidelines given in the **exercises** below.
## Localhost IP address
## Localhost IP address
There is a special **IP** address: **127.0.0.1**, which is used to identify **your local machines**. When programming a server, instead of having to used the real IP, it is much easier to use this IP. By doing so, you do not have to change the code when running the server in a different computer.
There is a special **IP** address: **127.0.0.1**, which is used to identify **your local machines**. When programming a server, instead of using the real IP, it is much easier to use this IP. By doing so, you do not have to change the code when running the server in a different computer.
**We will always use the 127.0.0.1 address** in our local servers.
**We will always use the 127.0.0.1 address** in our local servers.
## Exercises
## Exercises
We will implement the **Seq Server**, and develop some clients to test it. While developing the server, we will use the **echo** and **nc** linux commands for **sending messages** to the **server**. But you can also do it from your own client if you like.
We will implement the so called **Seq Server**, and develop some clients to test it. While developing the server, we will use the **echo** and **nc** linux commands for **sending messages** to the **server**. But you can also do it from your own client if you like.
The server will be stored in a file called **Seq-Server.py** within a folder with name **P03**. You will need to use the **Seq1 module** developed in **P01**, and extend it.
The server will be stored in a file called **Seq-Server.py** within a folder with name **P03**. You will need to use the **Seq1 module** developed in **P01**, and extend it. As you can see, we are building on previous work.
Upgrade the Seq server to respond to the **COMP command**. The client sends a message with the word **COMP** followed by a sequence. The server will return a **response message** with the complement of that sequence. It must be obtained using the **Seq Class**.
Upgrade the server to respond to the **COMP command**. The client sends a message with the word **COMP** followed by a sequence (the argument of the command). The server will return a **response message** with the complement of that sequence. As always, it must be obtained using the **Seq Class**.
Modify the Seq server and implement the **REV command**. The client sends a message with the word **REV** followed by a sequence. The server will return a **response message** with the reverse of the sequence. It must be obtained using the **Seq Class**.
Modify the server to implement the **REV command**. The client sends a message with the word **REV** followed by a sequence. The server will return a **response message** with the reverse of the sequence. It must be obtained using the **Seq Class**.
Work on the Seq server and implementing the **GENE command**. The client sends a message with the word **GENE** followed by a **gene name**: U5, ADA, FRAT1, FXN, or RNU6_269P. The server will return a **response message** with the whole sequence corresponding to that gene. It must be obtained using the **Seq Class** (and reading the gene from the corresponding file).
Work on the Seq server so it responds to the **GENE command**. The client sends a message with the word **GENE** followed by a specific (and valid) **gene name**: U5, ADA, FRAT1, FXN, or RNU6_269P. The server will return a **response message** with the whole sequence corresponding to that gene. It must be obtained using the **Seq Class** (and reading the gene from the corresponding file).