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 95dc81d commit 04a14b0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import {
Link,
InputLabel,
FormControl,
<<<<<<< HEAD
CircularProgress,
=======
>>>>>>> 005823a (feat: add transcript lookup for genes)
} from "@material-ui/core";
import React, { useEffect, useState } from "react";
import { GeneAutocomplete } from "../../main/shared/GeneAutocomplete/GeneAutocomplete";
Expand Down Expand Up @@ -98,6 +101,10 @@ const GetCoordinates: React.FC = () => {
const [exonEndOffset, setExonEndOffset] = useState<string>("");

const [geneTranscripts, setGeneTranscripts] = useState([]);
<<<<<<< HEAD
=======
const [geneTxWarnings, setGeneTxWarnings] = useState<string[]>();
>>>>>>> 005823a (feat: add transcript lookup for genes)
const [selectedTranscript, setSelectedTranscript] = useState("");

const [results, setResults] = useState<GenomicData | null>(null);
Expand Down Expand Up @@ -125,6 +132,7 @@ const GetCoordinates: React.FC = () => {
!exonEndText;

useEffect(() => {
console.log(inputComplete)
if (inputComplete) {
fetchResults();
}
Expand Down

This file was deleted.

12 changes: 12 additions & 0 deletions server/curfu/routers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,26 @@ async def get_transcripts_for_gene(request: Request, gene: str) -> Dict:
=======
normalized = request.app.state.fusor.gene_normalizer.normalize(gene)
symbol = normalized.gene_descriptor.label
<<<<<<< HEAD
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)
=======
transcripts = await request.app.state.fusor.cool_seq_tool.uta_db.get_transcripts(gene=symbol)
tx_for_gene = list(transcripts.rows_by_key("tx_ac"))
>>>>>>> 005823a (feat: add transcript lookup for genes)
if transcripts.is_empty():
return {"warnings": [f"No matching transcripts: {gene}"], "transcripts": []}
else:
return {"transcripts": tx_for_gene}
<<<<<<< HEAD

=======
>>>>>>> 005823a (feat: add transcript lookup for genes)

@router.get(
"/api/utilities/get_genomic",
Expand Down Expand Up @@ -303,9 +311,13 @@ async def get_sequence(
"""
_, path = tempfile.mkstemp(suffix=".fasta")
try:
<<<<<<< HEAD
request.app.state.fusor.cool_seq_tool.seqrepo_access.get_fasta_file(
sequence_id, Path(path)
)
=======
request.app.state.fusor.cool_seq_tool.seqrepo_access.get_fasta_file(sequence_id, Path(path))
>>>>>>> 005823a (feat: add transcript lookup for genes)
except KeyError:
resp = request.app.state.fusor.cool_seq_tool.seqrepo_access.translate_identifier( # noqa: E501
sequence_id, "refseq"
Expand Down
7 changes: 7 additions & 0 deletions server/curfu/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,15 @@ class GetTranscriptsResponse(Response):
"""Response model for MANE transcript retrieval endpoint."""

transcripts: Optional[List[ManeGeneTranscript]] = None
<<<<<<< HEAD

=======
>>>>>>> 005823a (feat: add transcript lookup for genes)

class GetGeneTranscriptsResponse(Response):
"""Response model for MANE transcript retrieval endpoint."""

<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
transcripts: Optional[List[str]] = None
Expand All @@ -267,6 +271,9 @@ class GetGeneTranscriptsResponse(Response):
=======
transcripts: Optional[Dict]
>>>>>>> 047cc77 (feat: add transcript lookup for genes)
=======
transcripts: Optional[List[str]] = None
>>>>>>> 005823a (feat: add transcript lookup for genes)


class ServiceInfoResponse(Response):
Expand Down

0 comments on commit 04a14b0

Please sign in to comment.