Skip to content

Fix GeneEdaSubsetPlugin to insert gene IDs as separate rows #17

Open
jbrestel wants to merge 2 commits intomasterfrom
eda-subset-multiple-genes
Open

Fix GeneEdaSubsetPlugin to insert gene IDs as separate rows #17
jbrestel wants to merge 2 commits intomasterfrom
eda-subset-multiple-genes

Conversation

@jbrestel
Copy link
Member

Rod malaria phenotype (plasmodb) has multiple organisms so the eda returns genes from multiple orgs as JSON array

The EDA tabular endpoint returns gene IDs as a JSON array in a single cell (e.g. ["PBANKA_1349800","PF3D7_1335900"]), but the code was trying to insert the whole array string as a single VARCHAR(30) value. Changed convertToTmpTableRow to convertToTmpTableRows (returning List<Object[]>) so each gene ID in the array becomes its own row in the temporary table.

Tested on my dev site. Other eda searches working too

…returns a JSON array

The EDA tabular endpoint returns gene IDs as a JSON array in a single cell
(e.g. ["PBANKA_1349800","PF3D7_1335900"]), but the code was trying to insert
the whole array string as a single VARCHAR(30) value. Changed convertToTmpTableRow
to convertToTmpTableRows (returning List<Object[]>) so each gene ID in the array
becomes its own row in the temporary table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Member

@ryanrdoherty ryanrdoherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but curious how/why you are allowing the VEUPATHDB_GENE_ID variable to be either a single ID or array of IDs. Seems like it would be better to have separate variables for ID vs IDs so clients know how to handle the data up front without examining it.

Edit: I see- EDA itself groups the values because there is more than one value per entity ID. Not a fan but I guess it's what we have to work with now..

The EDA can return multiple IDs for the same gene (canonical + aliases), all of
which resolve to the same gene via apidbtuning.geneid. This caused duplicate
transcript rows in the WDK cache table. Fixed by adding DISTINCT to the
gene-transcript join SQL. Also added _seenGeneIds deduplication in
GeneEdaSubsetPlugin to reduce unnecessary temp table insertions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants