[ensembl-dev] [SPAM] - Re: LOC_ aliases - Bayesian Filter detected spam

Oliver, Gavin gavin.oliver at almacgroup.com
Wed Nov 24 15:54:46 GMT 2010


That's brilliant Ian - thanks a lot for taking the time to do that!

Gavin

-----Original Message-----
From: ianlongden at gmail.com [mailto:ianlongden at gmail.com] On Behalf Of
ian Longden
Sent: 24 November 2010 15:46
To: Oliver, Gavin
Cc: dev
Subject: [SPAM] - Re: [ensembl-dev] LOC_ aliases - Bayesian Filter
detected spam

There is no direct way to do this with the API, you may have to do
this in sql something like :-

select x.* from xref x, external_db e
  where x.external_db_id = e.external_db_id and
           e.db_name  = "EntrezGene" and
           x.display_label like "LOC%"
   limit 10;

you can do this from inside your scripts by dong something like:-

use Bio::EnsEMBL::Registry;
use strict;
my $reg = "Bio::EnsEMBL::Registry";

$reg->load_registry_from_db(
   -host => "ensembldb.ensembl.org",
   -user => "anonymous",
   -db_version => 60
);


my $dba = $reg->get_adaptor("human", "core", "dbentry");
my $gene_adaptor = $reg->get_adaptor("human", "core", "gene");

my $sql = 'select distinct(x.xref_id) from xref x, external_db e,
object_xref ox where x.external_db_id = e.external_db_id and
x.display_label like "LOC%" and ox.xref_id = x.xref_id and e.db_name
= "EntrezGene"';


my $sth = $dba->dbc->prepare($sql);
$sth->execute;

my $xref_id;
$sth->bind_columns(\$xref_id);

my $count = 0;
while($sth->fetch() and $count < 100){
  my $dbentry = $dba->fetch_by_dbID($xref_id);
  my @genes =
@{$gene_adaptor->fetch_all_by_external_name($dbentry->display_id)};
  foreach my $gene (@genes){
    print
$dbentry->display_id."\t".$gene->display_xref->display_id."\t".$gene->st
able_id."\n";
  }
  $count++
}
$sth->finish;



HTH,
Ian Longden
Ensembl Developer.


The contents of this message and any attachments to it are confidential and may be legally privileged. If you have received this message in error, you should delete it from your system immediately and advise the sender.

Almac Group (UK) Limited, registered no. NI061368.  Almac Sciences Limited, registered no. NI041550.  Almac Discovery Limited, registered no. NI046249.  Almac Pharma Services Limited, registered no. NI045055.  Almac Clinical Services Limited, registered no. NI041905.  Almac Clinical Technologies Limited, registered no. NI061202.  Almac Diagnostics Limited, registered no. NI043067.  All preceding companies are registered in Northern Ireland with a registered office address of Almac House, 20 Seagoe Industrial Estate, Craigavon, BT63 5QD, UK.  

Almac Sciences (Scotland) Limited, registered in Scotland no. SC154034. 

Almac Clinical Services LLC, Almac Clinical Technologies LLC, Almac Diagnostics LLC, Almac Pharma Services LLC and Almac Sciences LLC are Delaware limited liability companies and Almac Group Incorporated is a Delaware Corporation.  More information on the Almac Group can be found on the Almac website: www.almacgroup.com






More information about the Dev mailing list