openvax / pyensembl

Python interface to access reference genome features (such as genes, transcripts, and exons) from Ensembl
Apache License 2.0
365 stars 68 forks source link

is it possible to find the nearest feature when there is none at the locus #283

Open Cloufield opened 1 year ago

Cloufield commented 1 year ago

Hi , Thanks for the amazing package. I am wondering if there is a function like find_nearest_feature that can query the nearest features (like gene_name) given contig and position when there are no features at the locus. For example, currently gene_names_at_locus(contig, position, end=None, strand=None) only returns none when there are no genes in the locus. It would be extremely helpful if pyensembl could also find the nearest features.