Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

blast v1 added #65

wants to merge 1 commit into from

Conversation

akudrinsky
Copy link
Contributor

No description provided.

except Exception as e:
raise HTTPException(status_code=500, detail=str(e))

@app.post("/blastn")
Copy link
Member

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.

Copy link
Member

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):
Copy link
Member

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
Copy link
Member

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

Comment on lines +9 to +12
descriptions: int = 10
alignments: int = 10
hitlist_size: int = 10
expect: float = 10.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):

@timurishmuratov7
Copy link
Member

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def choose_dataset(program):
def choose_dataset(program: str) -> str:

Copy link
Member

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

Comment on lines +17 to +18
else:
raise HTTPException(status_code=400, detail="Invalid program")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else:
raise HTTPException(status_code=400, detail="Invalid program")
raise HTTPException(status_code=400, detail="Invalid program")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants