Skip to content

Commit

Permalink
changed convert_ctd api endpoint response type
Browse files Browse the repository at this point in the history
  • Loading branch information
manulera committed Aug 16, 2023
1 parent 51f36f7 commit 4ab1ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ async def protein_modification_coordinates(systematic_id: str = Query(example="S
async def convert_ctd_description_to_normal_description(ctd_description: str = Query(example="CTD-S2A(r1-r6-2),S7A")):
return PlainTextResponse(ctd_convert_to_normal_variant(ctd_description))

@ app.get("/convert_ctd_position_to_position_list", response_model=list[str])
@ app.get("/convert_ctd_position_to_position_list", response_class=PlainTextResponse)
async def convert_ctd_position_to_position_list(ctd_description: str = Query(example="CTD-S2")):
# A bit of a hack, but better than using another function entirely, we append a triptophan (not in the repeats),
# to be able to use the variant function, and then we remove it.
return ctd_convert_to_normal_variant(ctd_description + 'W').replace('W', '').split(',')
return PlainTextResponse(ctd_convert_to_normal_variant(ctd_description + 'W').replace('W', ''))

0 comments on commit 4ab1ee2

Please sign in to comment.