[ensembl-dev] getting exons from database directly

Andrea Edwards edwardsa at cs.man.ac.uk
Fri May 6 15:45:16 BST 2011


Hello

I'm sorry for the basic question but I was looking at the ensembl core 
schema and trying to retrieve just the exons on chromosomes and couldn't 
work out why i am getting such different figures than with biomart and 
the perl api

For example for cow there are 25670 exons in genes with biomart and the 
api but with this sql  ~210k exons. This code is just looking for exons 
on chromosomes 1-30 and X

select count(distinct stable_id) from exon e inner join exon_stable_id 
es using(exon_id) inner join seq_region sr using(seq_region_id) where 
sr.coord_system_id = 2 and sr.name REGEXP '^[1-9]|^X'  and e.is_current=1

I get 8k just on chromosome 1

I'm sure this is simple and perhaps its because its Friday afternoon but 
I'm just not seeing it!!




More information about the Dev mailing list