Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid GFF crashes apollo server #543

Open
dariober opened this issue Mar 13, 2025 · 0 comments
Open

Invalid GFF crashes apollo server #543

dariober opened this issue Mar 13, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@dariober
Copy link
Contributor

dariober commented Mar 13, 2025

Describe the bug

The gff file below is invalid because mrna09 in Parent=mrna09 does not exist. Adding an assembly from this file causes the apollo server to crash with error:

Error: some features reference other features that do not exist in the file (or in the same '###' scope). {"mrna09":{"Parent":[[{"seq_id":"chr9","source":null,"type":"CDS","start":7,"end":24,"score":null,"strand":"-","phase":"0","attributes":{"ID":["cds09.1"],"Parent":["mrna09"]},"child_features":[],"derived_features":[]}]],"Derives_from":[]}}
    at Parser._emitAllUnderConstructionFeatures (/workspaces/Apollo3/.yarn/cache/@gmod-gff-npm-1.2.0-4331ffa75f-ec4ad0c57d.zip/node_modules/@gmod/gff/src/parse.ts:223:13)
    at Parser.addLine (/workspaces/Apollo3/.yarn/cache/@gmod-gff-npm-1.2.0-4331ffa75f-ec4ad0c57d.zip/node_modules/@gmod/gff/src/parse.ts:134:18)
    at GFFTransform._addLine (/workspaces/Apollo3/.yarn/cache/@gmod-gff-npm-1.2.0-4331ffa75f-ec4ad0c57d.zip/node_modules/@gmod/gff/src/api.ts:106:19)
    at /workspaces/Apollo3/.yarn/cache/@gmod-gff-npm-1.2.0-4331ffa75f-ec4ad0c57d.zip/node_modules/@gmod/gff/src/api.ts:114:36
    at Array.forEach (<anonymous>)
    at GFFTransform._nextText (/workspaces/Apollo3/.yarn/cache/@gmod-gff-npm-1.2.0-4331ffa75f-ec4ad0c57d.zip/node_modules/@gmod/gff/src/api.ts:114:12)
    at GFFTransform._transform (/workspaces/Apollo3/.yarn/cache/@gmod-gff-npm-1.2.0-4331ffa75f-ec4ad0c57d.zip/node_modules/@gmod/gff/src/api.ts:122:10)
    at GFFTransform.Transform._write (node:internal/streams/transform:171:8)
    at writeOrBuffer (node:internal/streams/writable:572:12)
    at _write (node:internal/streams/writable:501:10)

Note that the database is still updated with a document corresponding to this assembly but Apollo does not see the assembly (e.g. you will not see it in "Delete assembly"). This means that restarting the server and re-loading the file (after fixing it) triggers the "assembly already exists" error.

To Reproduce Steps to reproduce the behavior:

  • Write this in file.gff3:
##gff-version 3
chr9	.	gene	1	30	.	-	.	ID=gene09
chr9	.	mRNA	1	30	.	-	.	ID=mrna09.1;Parent=gene09
chr9	.	CDS	7	24	.	-	0	ID=cds09.1;Parent=mrna09
##FASTA
>chr9
TTActaCCCACCAGTACTTTGCGGtcaCATnnnnnnnnnnnnnnnnnnnnn
  • On UI or cli add assembly from gff from file.gff3

  • Apollo frontend should disconnect from server and server logs should show the error above

Expected behavior

Apollo should gracefully fail to import the file without crashing and without writing to the database.

Version information:

JBrowse 3.0.3
Apollo 0.3.4

@dariober dariober added the bug Something isn't working label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant