[ensembl-dev] Question about gene names as queries

Andreas Kusalananda Kähäri ak4 at sanger.ac.uk
Tue Sep 25 15:30:11 BST 2012


Also, the method returns a list reference (to a list of genes), not a
gene object.

Cheers,
A


On Tue, Sep 25, 2012 at 03:25:36PM +0100, Kieron Taylor wrote:
> Based upon the example requests made, the override flag is probably unnecessary. It only exists to allow specifically unusual short requests. FUT2% should not require any such intervention.
> 
> Also, watch the single quotes and their effect on variable names within them.
> 
> Kieron
> 
> On 25 Sep 2012, at 15:16, Brian Osborne wrote:
> 
> > Kieron,
> > 
> > Very nice. So something like:
> > 
> >      my $gene = $gene_adaptor->fetch_all_by_external_name('$id%',,1);
> > 
> > Should work and the wild-card will be used?
> > 
> > Thanks again,
> > 
> > Brian O.
> > 
> > 
> > On Sep 25, 2012, at 9:46 AM, Kieron Taylor <ktaylor at ebi.ac.uk> wrote:
> > 
> >> Hi Brian,
> >> 
> >> If you treat your display id as an external name, you'll find things a lot easier. Ensembl display labels are not necessarily the same as globally recognised labels, or rather there are things with display labels that are not currently named by convention.
> >> 
> >> Take a look at fetch_all_by_external_name() on the Gene Adaptor. There is a small performance penalty involved.
> >> 
> >> 
> >> Kieron
> >> 
> >> On 25 Sep 2012, at 14:29, Brian Osborne wrote:
> >> 
> >>> To whom it may concern,
> >>> 
> >>> I'm writing simple code using the most recent Perl API, this code downloads sequences using read-able id's like "FUT2". I noticed that when I use this id as a query at ensembl.org I retrieve ~20 genes, and the names of these genes are all "FUT2" except for the chimp gene, which is named "FUT2_PANTR". My code has  lines like this:
> >>> 
> >>>  my $gene_adaptor = $registry->get_adaptor( $species, 'Core', 'Gene' );
> >>>  my $gene = $gene_adaptor->fetch_by_display_label($id);
> >>> 
> >>> I would like to be able to loop over all the species (Human, Pig, Chimpanzee, etc.) and get all the FUT2 sequences but I can't get the chimp sequence since wild-cards don't work here (e.g. "$id%"). 
> >>> 
> >>> Your thoughts?
> >>> 
> >>> Thank you,
> >>> 
> >>> Brian O.
> >>> _______________________________________________
> >>> Dev mailing list    Dev at ensembl.org
> >>> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> >>> Ensembl Blog: http://www.ensembl.info/
> >> 
> >> Kieron Taylor PhD.
> >> Ensembl Core software developer
> >> 
> >> EMBL - European Bioinformatics Institute
> >> 
> 
> 
> 
> 
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
> 

-- 
Andreas Kusalananda Kähäri
Ensembl Gene Annotation Team

Sent from the tips of my fingers




More information about the Dev mailing list