Skip to content

Commit

Permalink
reverting messed up commits
Browse files Browse the repository at this point in the history
  • Loading branch information
katiestahl committed Nov 20, 2023
1 parent 04a14b0 commit a1b2add
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ 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 @@ -101,10 +98,6 @@ 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 @@ -132,7 +125,6 @@ const GetCoordinates: React.FC = () => {
!exonEndText;

useEffect(() => {
console.log(inputComplete)
if (inputComplete) {
fetchResults();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { makeStyles, TextField, Typography } from "@material-ui/core";
import React, { KeyboardEventHandler } from "react";
import HelpTooltip from "../HelpTooltip/HelpTooltip";

interface Props {
fieldValue: string;
valueSetter: CallableFunction;
errorText: string;
keyHandler?: KeyboardEventHandler<HTMLDivElement> | undefined;
width?: number | undefined;
}

const TranscriptField: React.FC<Props> = ({
fieldValue,
valueSetter,
errorText,
keyHandler,
width,
}) => {
const useStyles = makeStyles(() => ({
textField: {
width: width ? width : 125,
},
}));
const classes = useStyles();

return (
<HelpTooltip
placement="bottom"
title={
<Typography>
RefSeq transcript identifier, e.g.{" "}
<Typography variant="overline">NM_002529.3</Typography>.
</Typography>
}
>
<TextField
margin="dense"
value={fieldValue}
onChange={(event) => valueSetter(event.target.value)}
error={errorText != ""}
onKeyDown={keyHandler}
label="Transcript"
helperText={errorText != "" ? errorText : null}
className={classes.textField}
/>
</HelpTooltip>
);
};

export default TranscriptField;
27 changes: 0 additions & 27 deletions server/curfu/routers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,40 +68,17 @@ 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
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"))
=======
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
<<<<<<< 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 @@ -311,13 +288,9 @@ 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
16 changes: 0 additions & 16 deletions server/curfu/schemas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Provide schemas for FastAPI responses."""
from enum import Enum
from typing import Dict, List, Literal, Optional, Tuple, Union
import polars as pl

from cool_seq_tool.schemas import GenomicData
from fusor.models import (
Expand Down Expand Up @@ -253,27 +252,12 @@ 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
=======
transcripts: Optional[pl.DataFrame]
>>>>>>> c11b094 (feat!: adding transcript lookup for genes)
=======
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 a1b2add

Please sign in to comment.