Skip to content

Commit

Permalink
feat: add transcript lookup for genes
Browse files Browse the repository at this point in the history
  • Loading branch information
katiestahl committed Nov 10, 2023
1 parent c11b094 commit 047cc77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion server/curfu/routers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ async def get_transcripts_for_gene(request: Request, gene: str) -> Dict:
:param str gene: gene term provided by user
:return: Dict containing transcripts if lookup succeeds, or warnings upon failure
"""
transcripts = await request.app.state.fusor.cool_seq_tool.uta_db.get_transcripts(gene)
normalized = request.app.state.fusor.gene_normalizer.normalize(gene)
symbol = normalized.gene_descriptor.label
print(symbol)
print(request.app.state.fusor.cool_seq_tool.uta_db)
transcripts = await request.app.state.fusor.cool_seq_tool.uta_db.get_transcripts(symbol)
transcripts_dict = transcripts.to_dict()
tx_for_gene = transcripts_dict["tx_ac"]
print(transcripts.glimpse())
if transcripts.is_empty():
return {"warnings": [f"No matching transcripts: {gene}"], "transcripts": []}
else:
Expand Down
2 changes: 1 addition & 1 deletion server/curfu/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class GetTranscriptsResponse(Response):
class GetGeneTranscriptsResponse(Response):
"""Response model for MANE transcript retrieval endpoint."""

transcripts: Optional[pl.DataFrame]
transcripts: Optional[Dict]


class ServiceInfoResponse(Response):
Expand Down

0 comments on commit 047cc77

Please sign in to comment.