Skip to content

Conversation

@danielsf
Copy link

I've been using bkbit to scrape all of the gff3 files from a specific release of ENSEMBL and ingest them into a prototype tool for automatically mapping gene annotations from one species to another via accepted orthologs.

In the course of that work, I have encountered some quality-of-life fixes that I needed to make for myself. They are folded into this PR. I've tried to keep each change localized to a single commit, explaining myself in the commit message.

I understand that this commit

danielsf@b89b8f3

may be controversial. I am not very savvy with regex and was having a hard time interpreting some failures I was getting when the path for a specific gff3 file did not match the regex. I am open to the idea that I keep that commit isolated to my fork if you do not want to accept it.

danielsf added 6 commits June 24, 2025 12:36
this will allow us to ingest gff files like

https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/405/GCF_000001405.40_GRCh38.p14/GCF_000001405.40_GRCh38.p14_genomic.gff.gz

that do not encode the species, annotation, etc. in the URL

(provided users provide this metadata by hand to the GFF constructor)
this gives users the option of keeping the dict in memory,
in case they do not want the output written to stdout
(this is a quality of life improvement for processing
large numbers of Gff3 files in a script or notebook)
This will allow users who are downloading and processing
a large number of gff3 files to clean up after themselves
by creating a parent tmp_dir and deleting all of its contents
as needed.
also, if the model is missing, throw a custom error

Previous commits in this branch made it possible for users
to run data_translators/genome_annotation_translator.py
without triggering the code that tells them how to download
the NCBI model. This should fix that.

Throwing a custom error will also allow users of this code to
handle different failures modes (maybe ENSEMBL is publishing
a non-standard GFF3 file) in different ways.
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.

1 participant