<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi All. Sorry to bother you.<br><br>I wrote two scripts to fetch genes annotated with specific GO terms. The scripts are shown in the following:<br><br>Script 1:<br>#Store target genes in @genelist<br>my @genelist;<br><br>use Bio::EnsEMBL::Registry;<br>my $registry = 'Bio::EnsEMBL::Registry';<br>$registry->load_registry_from_db(<br>      -host       =>'ensembldb.ensembl.org',<br>      -user       =>'anonymous',<br>      -db_version =>'67');<br>my $go_adaptor=$registry->get_adaptor( 'Multi', 'Ontology', 'GOTerm' );<br>my $gene_adaptor=$registry->get_adaptor( 'drosophila melanogaster', 'Core', 'Gene' );<br><br>for $gene(@{$gene_adaptor->fetch_all}){<br>      my @db_links=@{$gene->get_all_DBLinks('GO')};<br>      for $dbe(@db_links){<br>            my $go_name=$dbe->description;<br>            push @genelist,$gene->stable_id if $go_name=~/transcription|chromatin/;<br>     }<br>}<br><br>Script 2:<br>#Store target genes in @genelist<br>my @genelist;<br><br>use Bio::EnsEMBL::Registry;<br>
my $registry = 'Bio::EnsEMBL::Registry';<br>
$registry->load_registry_from_db(<br>
      -host       =>'ensembldb.ensembl.org',<br>
      -user       =>'anonymous',<br>
      -db_version =>'67');<br>my $go_adaptor=$registry->get_adaptor( 'Multi', 'Ontology', 'GOTerm' );<br>my $gene_adaptor=$registry->get_adaptor( 'drosophila melanogaster', 'Core', 'Gene' );<br><br>for $term(@{$go_adaptor->fetch_all}){<br>
      my $name=$term->name;<br>
      my $acc=$term->accession;<br>
      if(($acc=~/^GO:/)&&($name=~/transcription|chromatin|histone/)){<br>
         for $gene(@{$gene_adaptor->fetch_all_by_GOTerm($term)}){<br>
               push @genelist,$gene->stable_id;<br>
         }<br>
     }<br>
}<br><br>Basically, Script 1 fetched all the genes, then got GO annotations for each gene. If GO matched the regular express, then push gene ID to @genelist. Script 2 fetched all the GO terms and if GO matched the regular expression, push gene ID to @genelist. The two scripts were supposed to get the same gene lists. However, They got different lists. Does anyone konw the reason? Are there anything wrong in the scripts?<br><br>Wish your help! Thanks a bunch! I really appreciate it.<br><br>Best, Mei<br>                                     </div></body>
</html>