[ensembl-dev] Issues with phenotypeFeature
nconte
nconte at ebi.ac.uk
Fri Feb 26 12:50:54 GMT 2016
Hello
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
http://www.ensembl.org/Homo_sapiens/Gene/Phenotype?db=core;g=ENSG00000174697;r=7:128241284-128257628;t=ENST00000308868
my starting point is a mouse gene from which i retrieve the human
orthologue, and then query the phenotype related to this orthologue.
the script below should work and print no PHE for human LEP gene
whereas there are phenotype linked to gene according to website
output:
human Orthologue: LEP ENSG00000174697 7 128241284 128257628 1
gene is Lep scalar 0
no PHE
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?
thanks
Nathalie
script:
#!/usr/local/bin/perl
use strict;
use warnings;
use DBI;
use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
-host=> 'ensembldb.ensembl.org', -user=>'anonymous',
-port=>'3306', 'db_version' => 83,);
Bio::EnsEMBL::Registry->set_reconnect_when_lost(1);# will help with
connection issues
my $gene_member_adaptor= Bio::EnsEMBL::Registry->get_adaptor("Multi",
"compara", "GeneMember");
my $homology_adaptor = Bio::EnsEMBL::Registry->get_adaptor("Multi",
"compara", "Homology");
my $pfh_adaptor = Bio::EnsEMBL::Registry->get_adaptor('human',
'variation', 'phenotypefeature');
my $gene_member =
$gene_member_adaptor->fetch_by_stable_id('ENSMUSG00000059201');
#get the ensembl object correspoding to this mouse stable ID
if ($gene_member){
#get orthologues in human
my $all_homologies =
$homology_adaptor->fetch_all_by_Member($gene_member, -TARGET_SPECIES =>
'homo_sapiens',-METHOD_LINK_TYPE => 'ENSEMBL_ORTHOLOGUES');
if (!scalar(@{$all_homologies})){
print "no orthologue with ensembl orthology method\n"; ##1
} # print a message if there is no corresponding mouse
orthologue
else{
#if there is/are orthologue(s) ,find them and print annotation about
these
foreach my $this_homology (@{$all_homologies}){
my $homologue_genes = $this_homology->gene_list();
my $homgene;
foreach $homgene(@{$homologue_genes}){
#get human orthologues only
if (defined ($homgene->genome_db->name) &&
$homgene->genome_db->name eq "homo_sapiens") {
print join("\t", "human Orthologue:
".$homgene->display_label,$homgene->stable_id,$homgene->dnafrag()->name(),
$homgene->dnafrag_start,$homgene->dnafrag_end,$homgene->dnafrag_strand,
"\n" ) ;
}
}
}
}
my $gene = $gene_member->get_Gene();
if ($gene){
print 'gene is '.$gene->external_name();
my $pfs = $pfh_adaptor->fetch_all_by_Gene($gene);
print "\t", 'scalar '.scalar(@$pfs), "\n";
if ( scalar(@$pfs)== 0 ){print "no PHE\n";}else{
foreach my $pm(@{$pfs}){
if ($pm){
#fill with info about ensembl gene phenotype
print "\t",$pm->source_name,"\t",$pm->phenotype->description,
"\n";
}else {next;}
}
}
} else{next;}
}else {print 'no gene member',"\n"};
__END__
More information about the Dev
mailing list