[ensembl-dev] bug in the Ensembl core API?

Electra Tapanari et3 at sanger.ac.uk
Thu May 2 16:04:49 BST 2013




Hi all,

I came across a problem when using the ensembl core API.

When I am getting a slice where I define chromosome, start, end and
strand and then I get objects from the slice ie,
genes/transcripts/introns etc it returns me objects from both strands.


I used this code to test this:

   use strict;
   use Gencode::Default;


   #connect to database
   my $db = Gencode::Default->dbconnect("ens-livemirror", 3306,
"homo_sapiens_core_71_37", "ensro", undef);

   my $sa = $db->get_SliceAdaptor();

   my $slice=$sa->fetch_by_region('chromosome',"3",20000,600000,-1) or
die "\n 1.Couldn't get slice\n";

   foreach my $gene (@{$slice->get_all_Genes}){

       $gene=$gene->transform('chromosome');
       print $gene->stable_id."\t".$gene->strand."\n";

    }


This is the output:

ENSG00000223587    1
ENSG00000224918    -1
ENSG00000224318    -1
ENSG00000134121    1
ENSG00000252017    -1
ENSG00000231660    -1
ENSG00000234661    -1
ENSG00000224957    1


Isn't this wrong? that it returns me genes from both strands since I am
defining that I am interested in the slice of the negative strand only?

many thanks in advance,
Electra

-- 
Electra Tapanari
Bioinformatician-Gencode Data Coordinator
Havana Group
Morgan Building
Wellcome Trust Sanger Institute
Wellcome Trust Genome Campus
Hinxton
Cambridgeshire
CB10 1HH

E: electra.tapanari at sanger.ac.uk
T: +44 1223 496827







More information about the Dev mailing list