[ensembl-dev] homology
Andy Yates
ayates at ebi.ac.uk
Fri Nov 26 12:35:55 GMT 2010
Hi Koray,
I think the problem here is to do with your member object. Try using the following call:
my $member =
$member_adaptor->fetch_by_source_stable_id('ENSEMBLGENE','ENSDARG00000090113');
Homologies are Gene->Gene relations therefore you need to work with Gene Members not Peptide ones. Should you need to work with peptide members you should do the following calls first:
my $pep_member =
$member_adaptor->fetch_by_source_stable_id('ENSEMBLPEP','ENSDARP00000103634');
my $gene_member = $pep_member->gene_member();
This is documented in:
http://www.ensembl.org/info/docs/Pdoc/ensembl-compara/modules/Bio/EnsEMBL/Compara/Member.html
http://www.ensembl.org/info/docs/Pdoc/ensembl-compara/modules/Bio/EnsEMBL/Compara/DBSQL/MemberAdaptor.html
http://www.ensembl.org/info/docs/Pdoc/ensembl-compara/modules/Bio/EnsEMBL/Compara/Homology.html
http://www.ensembl.org/info/docs/Pdoc/ensembl-compara/modules/Bio/EnsEMBL/Compara/DBSQL/HomologyAdaptor.html
Hope this helps
Andy
On 26 Nov 2010, at 12:14, Koray Doğan Kaya wrote:
> I try to find homologous genes for a zebrafish gene. Whhat is the problem,
> isn't there any homologous genes? or the code...?
>
> use Bio::EnsEMBL::Registry;
> Bio::EnsEMBL::Registry->load_registry_from_db(
> -host => 'ensembldb.ensembl.org',
> -user => 'anonymous',
> -port => 5306);
> my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor(
> 'Multi','compara','Member');
>
> # fetch a Member
> # get the MemberAdaptor
> my $member_adaptor =
> Bio::EnsEMBL::Registry->get_adaptor('Multi','compara','Member');
>
> # fetch a Memmy $member =
> $member_adaptor->fetch_by_source_stable_id('ENSEMBLPROTEIN','ENSG00000004059');
> my $member =
> $member_adaptor->fetch_by_source_stable_id('ENSEMBLPEP','ENSDARP00000103634');
> # print out some information about the Member
> print $member->description, "\n";
>
>
>
> my $homology_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Multi',
> 'compara', 'Homology');
> my $homologies = $homology_adaptor->fetch_all_by_Member($member);
>
> # That will return a reference to an array with all homologies
> (orthologues in
> # other species and paralogues in the same one)
> # Then for each homology, you can get all the Members implicated
>
> foreach my $homology (@{$homologies}) {
> # You will find different kind of description
> # UBRH, MBRH, RHS, YoungParalogues
> # see ensembl-compara/docs/docs/schema_doc.html for more details
>
> print $homology->description," ", $homology->subtype,"\n";
> # And if they are defined dN and dS related values
> print " dn ", $homology->dn,"\n";
> print " ds ", $homology->ds,"\n";
> print " dnds_ratio ", $homology->dnds_ratio,"\n";
> }
>
> my $homology = $homologies->[0]; # take one of the homologies and look
> into it
>
> foreach my $member_attribute (@{$homology->get_all_Member_Attribute}) {
>
> # for each Member, you get information on the Member specifically and in
> # relation to the homology relation via Attribute object
>
> my ($member, $attribute) = @{$member_attribute};
> print (join " ", map { $member->$_ } qw(stable_id taxon_id))."\n";
> print (join " ", map { $attribute->$_ } qw(perc_id perc_pos
> perc_cov))."\n";
>
> }
>
>
>
>
> --
> M.Sc. Koray Dogan Kaya
> PhD Candidate
> Bilkent University,
> Department of Molecular Biology and Genetics
> 06800 / Ankara
> Turkey
> Mobile: (+90) 533 526 09 51
> Office: (+90) 312 290 24 03
> e-mail: kkaya at bilkent.edu.tr
>
>
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev
--
Andrew Yates Ensembl Genomes Engineer
EMBL-EBI Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK http://www.ensemblgenomes.org/
On 26 Nov 2010, at 12:14, Koray Doğan Kaya wrote:
> I try to find homologous genes for a zebrafish gene. Whhat is the problem,
> isn't there any homologous genes? or the code...?
>
> use Bio::EnsEMBL::Registry;
> Bio::EnsEMBL::Registry->load_registry_from_db(
> -host => 'ensembldb.ensembl.org',
> -user => 'anonymous',
> -port => 5306);
> my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor(
> 'Multi','compara','Member');
>
> # fetch a Member
> # get the MemberAdaptor
> my $member_adaptor =
> Bio::EnsEMBL::Registry->get_adaptor('Multi','compara','Member');
>
> # fetch a Memmy $member =
> $member_adaptor->fetch_by_source_stable_id('ENSEMBLPROTEIN','ENSG00000004059');
> my $member =
> $member_adaptor->fetch_by_source_stable_id('ENSEMBLPEP','ENSDARP00000103634');
> # print out some information about the Member
> print $member->description, "\n";
>
>
>
> my $homology_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Multi',
> 'compara', 'Homology');
> my $homologies = $homology_adaptor->fetch_all_by_Member($member);
>
> # That will return a reference to an array with all homologies
> (orthologues in
> # other species and paralogues in the same one)
> # Then for each homology, you can get all the Members implicated
>
> foreach my $homology (@{$homologies}) {
> # You will find different kind of description
> # UBRH, MBRH, RHS, YoungParalogues
> # see ensembl-compara/docs/docs/schema_doc.html for more details
>
> print $homology->description," ", $homology->subtype,"\n";
> # And if they are defined dN and dS related values
> print " dn ", $homology->dn,"\n";
> print " ds ", $homology->ds,"\n";
> print " dnds_ratio ", $homology->dnds_ratio,"\n";
> }
>
> my $homology = $homologies->[0]; # take one of the homologies and look
> into it
>
> foreach my $member_attribute (@{$homology->get_all_Member_Attribute}) {
>
> # for each Member, you get information on the Member specifically and in
> # relation to the homology relation via Attribute object
>
> my ($member, $attribute) = @{$member_attribute};
> print (join " ", map { $member->$_ } qw(stable_id taxon_id))."\n";
> print (join " ", map { $attribute->$_ } qw(perc_id perc_pos
> perc_cov))."\n";
>
> }
>
>
>
>
> --
> M.Sc. Koray Dogan Kaya
> PhD Candidate
> Bilkent University,
> Department of Molecular Biology and Genetics
> 06800 / Ankara
> Turkey
> Mobile: (+90) 533 526 09 51
> Office: (+90) 312 290 24 03
> e-mail: kkaya at bilkent.edu.tr
>
>
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev
--
Andrew Yates Ensembl Genomes Engineer
EMBL-EBI Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK http://www.ensemblgenomes.org/
More information about the Dev
mailing list