[ensembl-dev] gene centred info via slices

Bronwen Aken ba1 at sanger.ac.uk
Mon Oct 11 09:30:32 BST 2010


Hi Hardip,

At a glance your code looks fine. I'm not sure why it is slow. Are you connecting to our MySQL (host ensembldb.ensembl.org port 5306) or do you have local copies of the databases?

If you are only interested in one biotype eg. protein-coding then you could modify your gene-fetch query like:
foreach my $gene (@{$slice->get_all_Genes(undef, undef, undef, undef, 'protein_coding')}){

Cheers,
Bronwen


On 11 Oct 2010, at 06:06, Hardip Patel wrote:

> Dear all
> 
> I am trying to fetch gene centred information using following code. It takes a long time to extract information for all genes from human or mice at least.
> 
> I was wondering if the following code could be optimized to get information faster.
> 
> my $slice_adaptor = $registry->get_adaptor($spec, 'Core', 'slice');
>   foreach my $slice (@{$slice_adaptor->fetch_all('toplevel')}){
>     foreach my $gene (@{$slice->get_all_Genes}){
>       foreach my $transcript (@{$gene->get_all_Transcripts}){
>           foreach my $exon (@{$transcript->get_all_Exons}){
>             ####get transcript, UTR, exon, and intron start and end in cDNA coordinates and genomic coordinates
>         }
>       }
>     }
> }
> ------
> 
> Regards
> 
> -- 
> Hardip R. Patel
> 
> VCCRI 12th International Symposium 
> “Charting the depths of RNA: from molecules to therapies”
> 19 November 2010
> visit http://www.victorchang.edu.au for details
> 
> 
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20101011/deb4fb97/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2058 bytes
Desc: not available
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20101011/deb4fb97/attachment.p7s>


More information about the Dev mailing list