Fix: Strip None values from orthology mapping API response#1207
Fix: Strip None values from orthology mapping API response#1207
Conversation
b5c8b44 to
7f08870
Compare
|
We need to ensure that if the resulting JSON is empty after all the None/nulls are removed, the UI handles that situation appropriately if it isn't already doing so. Still need to figure out the root cause as well as per ticket #1150 |
…rtholog mapping
|
Looked at the root cause: The None values come from comma-separated gs2 values in the orthology files — calm1a maps to "CALM1,CALM3,CALM2" stored as a single string. map_single_gene() was treating this as one gene name, which never matches anything in the dataset's gene map, causing the mapping to fail and return None. Fixed by splitting gs2 values by comma so each ortholog is returned as a separate gene symbol. Tested against a real local dataset : calm1a now correctly returns CALM1, CALM3, CALM2 and all three are found in the dataset. Single-mapping genes like "Actb" are unaffected. |
|
Removed |

Fixes
#1150
The list comprehensions in both the GET and POST handlers of the orthologs API could include None values when normalize_gene() fails to find a match, which gets serialized
as null in the JSON response. Updated both comprehensions to filter out None results using a walrus operator guard.