Compare commits
1 Commits
0.1.0
...
2b280e2bdf
| Author | SHA1 | Date | |
|---|---|---|---|
|
2b280e2bdf
|
16
README.md
16
README.md
@@ -58,7 +58,7 @@ contains all the needed dependencies.
|
|||||||
The following command creates the trains the Deep Learning model and shows the accuracy and AUC:
|
The following command creates the trains the Deep Learning model and shows the accuracy and AUC:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
poetry run python locimend/main.py train <data file> <label file>
|
poetry run python src/main.py train <data file> <label file>
|
||||||
```
|
```
|
||||||
|
|
||||||
- <data file>: FASTQ file containing the sequences with errors
|
- <data file>: FASTQ file containing the sequences with errors
|
||||||
@@ -69,7 +69,7 @@ Both files must contain the canonical and read simulated sequences in the same p
|
|||||||
A dataset is provided to train the model, in order to proceed execute the following command:
|
A dataset is provided to train the model, in order to proceed execute the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
poetry run python locimend/main.py train data/curesim-HVR.fastq data/HVR.fastq
|
poetry run python src/main.py train data/curesim-HVR.fastq data/HVR.fastq
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ A trained model is provided, which can be used to infer the correct sequences. T
|
|||||||
The following command will infer the correct sequence, and print it:
|
The following command will infer the correct sequence, and print it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
poetry run python locimend/main.py infer "<DNA sequence>"
|
poetry run python src/main.py infer "<dna sequence>"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### REST API
|
#### REST API
|
||||||
@@ -100,12 +100,6 @@ The API can be accessed at http://localhost:8000, with either a GET or POST requ
|
|||||||
|
|
||||||
| Request | Endpoint | Payload |
|
| Request | Endpoint | Payload |
|
||||||
|:----:|:-----:|:-----:|
|
|:----:|:-----:|:-----:|
|
||||||
| GET | / | Sequence as a path parameter (in the URL) |
|
| GET | /<sequence> | Sequence as a path parameter |
|
||||||
| POST | /| JSON |
|
| POST | /| JSON: {"sequence": "<sequence>"} |
|
||||||
|
|
||||||
For a POST request the JSON must have the following structure:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{"sequence": "<DNA sequence>"}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
from asyncio import run
|
from asyncio import run
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
from time import time
|
|
||||||
|
|
||||||
from locimend.model import infer_sequence, train_model
|
from model import infer_sequence, train_model
|
||||||
|
|
||||||
|
|
||||||
def parse_arguments() -> Namespace:
|
def parse_arguments() -> Namespace:
|
||||||
@@ -22,10 +21,7 @@ def parse_arguments() -> Namespace:
|
|||||||
|
|
||||||
async def execute_task(args):
|
async def execute_task(args):
|
||||||
if args.task == "train":
|
if args.task == "train":
|
||||||
start_time = time()
|
|
||||||
train_model(data_file=args.data_file, label_file=args.label_file)
|
train_model(data_file=args.data_file, label_file=args.label_file)
|
||||||
end_time = time()
|
|
||||||
print(f"Training time: {end_time - start_time}")
|
|
||||||
else:
|
else:
|
||||||
prediction = await infer_sequence(sequence=args.sequence)
|
prediction = await infer_sequence(sequence=args.sequence)
|
||||||
print(f"Error-corrected sequence: {prediction}")
|
print(f"Error-corrected sequence: {prediction}")
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user