-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blast v1 added #65
base: master
Are you sure you want to change the base?
blast v1 added #65
Conversation
except Exception as e: | ||
raise HTTPException(status_code=500, detail=str(e)) | ||
|
||
@app.post("/blastn") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of many APIs I suggest to have 1 api with the type of blast that a user should use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a single endpoint /blast, pass type of blast to request model (as enum)
return run_blast("blastx", query.sequence, query.descriptions, query.alignments, query.hitlist_size, query.expect) | ||
|
||
@app.post("/tblastn") | ||
async def tblastn(query: SequenceQuery): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add python typing for returns etc. everywhere
@@ -0,0 +1,15 @@ | |||
# FastAPI BLAST Service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add the info to main readme about new microservice
descriptions: int = 10 | ||
alignments: int = 10 | ||
hitlist_size: int = 10 | ||
expect: float = 10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
descriptions: int = 10 | |
alignments: int = 10 | |
hitlist_size: int = 10 | |
expect: float = 10.0 | |
descriptions: Optional[int] = 10 | |
alignments: Optional[int] = 10 | |
hitlist_size: Optional[int] = 10 | |
expect: Optional[float] = 10.0 |
@@ -0,0 +1,21 @@ | |||
# Use a PyTorch base image with CUDA support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Use a PyTorch base image with CUDA support |
else: | ||
raise HTTPException(status_code=400, detail="Invalid program") | ||
|
||
def run_blast(program, query, descriptions=10, alignments=10, hitlist_size=10, expect=10.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def run_blast(program, query, descriptions=10, alignments=10, hitlist_size=10, expect=10.0): | |
def run_blast(program: some type, query: SearchQuery, descriptions: int=10, alignments: int =10, hitlist_size: int =10, expect: float =10.0): |
Also please add the shell script to generate client and generate the client itself and add it to the changes. The script example can be found here: https://github.com/BasedLabs/NoLabs/blob/master/microservices/biobuddy/generate_client.sh And if everything successful the folder client/ should be generated (as in the example): https://github.com/BasedLabs/NoLabs/tree/master/microservices/biobuddy/client |
title="BLAST Query" | ||
) | ||
|
||
def choose_dataset(program): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def choose_dataset(program): | |
def choose_dataset(program: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Program can be enum with predefined values
else: | ||
raise HTTPException(status_code=400, detail="Invalid program") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else: | |
raise HTTPException(status_code=400, detail="Invalid program") | |
raise HTTPException(status_code=400, detail="Invalid program") |
No description provided.