Skip to content

Commit

Permalink
Format: Removed unused local variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ansengarvin committed Mar 10, 2024
1 parent b3d7a0e commit 0f0aa09
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions backend/src/api/protein.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,24 +350,13 @@ def edit_protein_entry(body: EditBody, req: Request):
# /pdb with two attributes returns both PDBs, superimposed and with different colors.
@router.get("/protein/pdb/{proteinA:str}/{proteinB:str}")
def search_proteins(proteinA: str, proteinB: str):
with Database() as db:
try:
entry_query = """SELECT proteins.name,
proteins.description,
proteins.length,
proteins.mass,
species.name,
proteins.thumbnail
FROM proteins
JOIN species ON species.id = proteins.species_id
WHERE proteins.name ILIKE %s"""

pdbA = stored_pdb_file_name(proteinA)
pdbB = stored_pdb_file_name(proteinB)

file = tm_align(proteinA, pdbA, proteinB, pdbB)

return FileResponse(file, filename=proteinA + "_" + proteinB + ".pdb")
except Exception as e:
log.error(e)
raise HTTPException(status_code=500, detail=str(e))
try:
pdbA = stored_pdb_file_name(proteinA)
pdbB = stored_pdb_file_name(proteinB)

file = tm_align(proteinA, pdbA, proteinB, pdbB)

return FileResponse(file, filename=proteinA + "_" + proteinB + ".pdb")
except Exception as e:
log.error(e)
raise HTTPException(status_code=500, detail=str(e))

0 comments on commit 0f0aa09

Please sign in to comment.