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 20, 2023
1 parent 8ed2f1d commit 95dc81d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/curfu/routers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ 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
"""
<<<<<<< HEAD
<<<<<<< HEAD
normalized = request.app.state.fusor.gene_normalizer.normalize(gene)
symbol = normalized.gene_descriptor.label
Expand All @@ -78,6 +79,16 @@ async def get_transcripts_for_gene(request: Request, gene: str) -> Dict:
=======
transcripts = await request.app.state.fusor.cool_seq_tool.uta_db.get_transcripts(gene)
>>>>>>> c11b094 (feat!: adding transcript lookup for genes)
=======
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())
>>>>>>> 047cc77 (feat: add transcript lookup for genes)
if transcripts.is_empty():
return {"warnings": [f"No matching transcripts: {gene}"], "transcripts": []}
else:
Expand Down
4 changes: 4 additions & 0 deletions server/curfu/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,15 @@ class GetTranscriptsResponse(Response):
class GetGeneTranscriptsResponse(Response):
"""Response model for MANE transcript retrieval endpoint."""

<<<<<<< HEAD
<<<<<<< HEAD
transcripts: Optional[List[str]] = None
=======
transcripts: Optional[pl.DataFrame]
>>>>>>> c11b094 (feat!: adding transcript lookup for genes)
=======
transcripts: Optional[Dict]
>>>>>>> 047cc77 (feat: add transcript lookup for genes)


class ServiceInfoResponse(Response):
Expand Down

0 comments on commit 95dc81d

Please sign in to comment.