jogoodma / homology-explorer

A tool for exploring orthology and paraology relationships in model organism species.
MIT License
1 stars 0 forks source link

Gene symbol search endpoint #1

Closed jogoodma closed 1 year ago

jogoodma commented 1 year ago

Please add an endpoint to the API that accepts a partial or full gene symbol and returns the top 20 hits.

/search/gene/symbol/{symbol} - Where {symbol} is either a partial or full gene symbol.

The result should be the fields of the corresponding rows of the top 20 matching records from Gene_Information.tsv in JSON format. The input should be matched on column 3 of this file (case insensitive). It should also accept an optional parameter for species that is in the form of the taxonomy id. This would then be used to filter the results further based on column 2 of this file.

e.g. Typing in kra would return the rows for

"KRASP1"
"KRAS"
"PRKRA"
"Kras"
"Prkra"
"Kras"
"kraken"
"kra"
"ANKRA2"
"Ankra2"
"Kras2-rs1"
"Kras2-rs2"
"Kras1-ps"
"Ankra2"
"Prkra"
"ankra2"
"kras"
"ankra2"
"kras"
"prkra"
greenmmq commented 1 year ago

@jogoodma this is coming along nicely. Do we have a key for labeling the speciesIDs? I'd like to add that to the dbBuilder.py.

jogoodma commented 1 year ago

Here you go. I pulled the speciesid from the gene info file and looked up the species, genus, and common name for each in the TaxonomyDB.

#taxonomyid    genus    species    common_name
10090    Mus    musculus    house mouse
10116    Rattus    norvegicus    Norway rat
3702    Arabidopsis    thaliana    thale cress
4896    Schizosaccharomyces    pombe    fission yeast
4932    Saccharomyces    cerevisiae    baker's yeast
6239    Caenorhabditis    elegans    worm
7227    Drosophila    melanogaster    fruit fly
7955    Danio    rerio    zebrafish
8364    Xenopus    tropicalis    tropical clawed frog
9606    Homo    sapiens    human
greenmmq commented 1 year ago

Thanks! I will add this to the dbBuilder.py and join it into the other API query results.

https://github.com/jogoodma/homology-explorer/commit/54a0f307a22878098b33fbfbb1e689c694928230 <-- this commit partially accomplishes this ticket.

Still need to add the species selection functionality though. Will come alongside the species table expansion.

greenmmq commented 1 year ago

https://github.com/jogoodma/homology-explorer/commit/1abb452fbebe30881ab47dd30c5c6a997c8cca0b

Finished request

jogoodma commented 1 year ago

This looks great. One small issue, can you make the search case insensitive?

greenmmq commented 1 year ago

ok! I applied the case insensitivity and switched from the frequency to the alpha sort.