<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    Hi Nathalie,<br>
    <br>
    You are extracting phenotype features for the input mouse gene, not
    the human gene, which is why you are not seeing the human phenotype
    feature. If you change the print statement to: <br>
    <br>
    print 'gene is    '.$gene->external_name() ."  ".
    $gene->stable_id();<br>
    <br>
    You will see the 'ENSMUS' prefix on the gene name:<br>
    <br>
    human Orthologue: LEP    ENSG00000174697    7    128241284   
    128257628    1    <br>
    gene is    Lep  ENSMUSG00000059201    scalar  0<br>
    no PHE<br>
    <br>
    <br>
    <br>
    We store associations as reported, so querying by both gene and
    variant will return the most complete set of results<br>
    <br>
    fetch_all_by_Gene takes a gene object and returns associations
    reported to the gene<br>
    <meta http-equiv="content-type" content="text/html;
      charset=windows-1252">
    fetch_all_by_associated_gene() takes a gene name and returns variant
    associations in which it is mentioned<br>
    <br>
    <br>
    For example:<br>
    <br>
    use Bio::EnsEMBL::Registry;<br>
    <br>
    <br>
    Bio::EnsEMBL::Registry->load_registry_from_db(<br>
        -host=>  'ensembldb.ensembl.org', -user=>'anonymous',<br>
        -port=>'3306', 'db_version' => 83,);<br>
    Bio::EnsEMBL::Registry->set_reconnect_when_lost(1);# will help
    with connection issues<br>
    <br>
    <br>
    my $ga = Bio::EnsEMBL::Registry->get_adaptor("homo_sapiens",
    "core", "gene");<br>
    my $pfh_adaptor = Bio::EnsEMBL::Registry->get_adaptor('human',
    'variation', 'phenotypefeature'); <br>
    <br>
    my $gene = $ga->fetch_by_stable_id('ENSG00000174697');<br>
    <br>
    if ($gene){<br>
      print "gene is " .$gene->external_name() ."\n";<br>
    <br>
      my $pfs = $pfh_adaptor->fetch_all_by_Gene($gene);<br>
      foreach my $pm(@{$pfs}){<br>
        print
    "Direct\t",$pm->source_name,"\t",$pm->phenotype->description,
    "\n";<br>
      }<br>
     <br>
      my $pfsvar =
$pfh_adaptor->fetch_all_by_associated_gene($gene->external_name());<br>
      foreach my $pmv(@{$pfsvar}){<br>
        print
    "Assoc\t",$pmv->source_name,"\t",$pmv->phenotype->description,
    "\n";<br>
      }<br>
    } <br>
    <br>
    <br>
    Outputs:<br>
    <br>
    gene is LEP<br>
    Direct    Orphanet    Obesity due to congenital leptin deficiency<br>
    Direct    MIM morbid    LEPTIN DEFICIENCY OR DYSFUNCTION<br>
    Assoc    ClinVar    ClinVar: phenotype not specified<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    HGMD-PUBLIC    Annotated by HGMD but no phenotype
    description is publicly available<br>
    Assoc    Uniprot    Leptin deficiency<br>
    Assoc    OMIM    LEPTIN DYSFUNCTION<br>
    Assoc    OMIM    Leptin deficiency<br>
    Assoc    ClinVar    LEPTIN DYSFUNCTION<br>
    Assoc    ClinVar    Obesity, severe, due to leptin deficiency<br>
    Assoc    dbGaP    Blood pressure<br>
    Assoc    dbGaP    Erythrocyte Count<br>
    Assoc    NHGRI-EBI GWAS catalog    Type 2 diabetes<br>
    Assoc    dbGaP    Amyotrophic lateral sclerosis<br>
    Assoc    ClinVar    ClinVar: phenotype not specified<br>
    Assoc    ClinVar    ClinVar: phenotype not specified<br>
    <br>
    <br>
    Best wishes,<br>
    <br>
    Sarah<br>
    <br>
    <div class="moz-cite-prefix">On 26/02/2016 12:50, nconte wrote:<br>
    </div>
    <blockquote
      cite="mid:20160226125117.E3EC222F1E8_6D04A45B@hx-mx1.ebi.ac.uk"
      type="cite">Hello
      <br>
      I have an issue with phenotypeFeature fetch_all_by_Gene($gene)
      method. I am trying to retrieve phenotype from gene object and the
      script I have doesn't find any phenotype relating to this gene,
      whereas the ensembl website shows some  phenotype linked with gene
      <br>
<a class="moz-txt-link-freetext" href="http://www.ensembl.org/Homo_sapiens/Gene/Phenotype?db=core;g=ENSG00000174697;r=7:128241284-128257628;t=ENST00000308868">http://www.ensembl.org/Homo_sapiens/Gene/Phenotype?db=core;g=ENSG00000174697;r=7:128241284-128257628;t=ENST00000308868</a>
      <br>
      <br>
      my starting point is a mouse gene from which i retrieve the human
      orthologue, and then query the phenotype related to this
      orthologue.
      <br>
      the script below should work and print no PHE for human LEP gene
      whereas there are phenotype linked to gene according to website
      <br>
      output:
      <br>
      human Orthologue: LEP    ENSG00000174697    7    128241284   
      128257628    1
      <br>
      gene is    Lep    scalar  0
      <br>
      no PHE
      <br>
      <br>
      <br>
      any advise would be great - Also is it better to find phenotypes
      relating to variation of a gene rather than to the gene itself in
      order to get the full picture of phenotype related to a specific
      gene?
      <br>
      thanks
      <br>
      Nathalie
      <br>
      <br>
      <br>
      script:
      <br>
      #!/usr/local/bin/perl
      <br>
      use strict;
      <br>
      use warnings;
      <br>
      use DBI;
      <br>
      use Bio::EnsEMBL::Registry;
      <br>
      <br>
      <br>
      Bio::EnsEMBL::Registry->load_registry_from_db(
      <br>
          -host=>  'ensembldb.ensembl.org', -user=>'anonymous',
      <br>
          -port=>'3306', 'db_version' => 83,);
      <br>
      Bio::EnsEMBL::Registry->set_reconnect_when_lost(1);# will help
      with connection issues
      <br>
      <br>
      <br>
      my $gene_member_adaptor=
      Bio::EnsEMBL::Registry->get_adaptor("Multi", "compara",
      "GeneMember");
      <br>
      my $homology_adaptor =
      Bio::EnsEMBL::Registry->get_adaptor("Multi", "compara",
      "Homology");
      <br>
      my $pfh_adaptor = Bio::EnsEMBL::Registry->get_adaptor('human',
      'variation', 'phenotypefeature');
      <br>
      <br>
      <br>
      my $gene_member =
      $gene_member_adaptor->fetch_by_stable_id('ENSMUSG00000059201');
      <br>
      #get the ensembl object correspoding to this mouse stable ID
      <br>
      <br>
                  if ($gene_member){
      <br>
      <br>
      #get orthologues in human
      <br>
                  my $all_homologies =
      $homology_adaptor->fetch_all_by_Member($gene_member,
      -TARGET_SPECIES => 'homo_sapiens',-METHOD_LINK_TYPE =>
      'ENSEMBL_ORTHOLOGUES');
      <br>
                      if (!scalar(@{$all_homologies})){
      <br>
      <br>
                      print   "no orthologue with ensembl orthology
      method\n";  ##1
      <br>
                         } # print a message if there is no
      corresponding mouse orthologue
      <br>
                          else{
      <br>
          #if there is/are orthologue(s) ,find them and print annotation
      about these
      <br>
                          foreach my $this_homology
      (@{$all_homologies}){
      <br>
                          my $homologue_genes =
      $this_homology->gene_list();
      <br>
                          my $homgene;
      <br>
                              foreach $homgene(@{$homologue_genes}){
      <br>
                              #get human orthologues only
      <br>
                                  if (defined
      ($homgene->genome_db->name) && 
      $homgene->genome_db->name eq "homo_sapiens") {
      <br>
      <br>
      <br>
                                  print  join("\t", "human Orthologue:
      ".$homgene->display_label,$homgene->stable_id,$homgene->dnafrag()->name(),
                             
      $homgene->dnafrag_start,$homgene->dnafrag_end,$homgene->dnafrag_strand,
      "\n" ) ;
      <br>
      <br>
                                  }
      <br>
      <br>
                              }
      <br>
                          }
      <br>
                      }
      <br>
      <br>
      <br>
                          my $gene = $gene_member->get_Gene();
      <br>
      <br>
                          if ($gene){
      <br>
                          print 'gene is    '.$gene->external_name();
      <br>
                          my $pfs =
      $pfh_adaptor->fetch_all_by_Gene($gene);
      <br>
                          print "\t", 'scalar  '.scalar(@$pfs), "\n";
      <br>
                              if ( scalar(@$pfs)== 0 ){print "no
      PHE\n";}else{
      <br>
                              foreach my $pm(@{$pfs}){
      <br>
                                  if ($pm){
      <br>
      <br>
                                  #fill with info about ensembl gene
      phenotype
      <br>
      <br>
                                  print
      "\t",$pm->source_name,"\t",$pm->phenotype->description,
      "\n";
      <br>
                                  }else {next;}
      <br>
                              }
      <br>
                          }
      <br>
      <br>
      <br>
                          } else{next;}
      <br>
      <br>
      <br>
      <br>
      <br>
                  }else {print 'no gene member',"\n"};
      <br>
      <br>
      <br>
      __END__
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      _______________________________________________
      <br>
      Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
      <br>
      Posting guidelines and subscribe/unsubscribe info:
      <a class="moz-txt-link-freetext" href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a>
      <br>
      Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
      <br>
    </blockquote>
    <br>
  </body>
</html>