[ensembl-dev] a question about dN and dS

JiangMei gingerplum at hotmail.com
Thu Aug 30 01:49:01 BST 2012


Hi All.

Sorry to bother you. I'm trying to use ensembl-compara (database version 67) to extract the homologues. I also want to get the dN, dS and dN/dS. However, ENSEMBL can't output these values. Can anyone help me? 

The following is the script I used:

use Bio::EnsEMBL::Registry;
my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
      -host       =>'ensembldb.ensembl.org',
      -user       =>'anonymous',
      -db_version =>'67');
my $member_adaptor=$registry->get_adaptor('Multi','compara','Member');
my $member=$member_adaptor->fetch_by_source_stable_id('ENSEMBLGENE','FBgn0002780');
my $homology_adaptor=$registry->get_adaptor('Multi','compara','Homology');
my $homologies=$homology_adaptor->fetch_all_by_Member($member);

for $homology(@{$homologies}){
    for $mem(@{$homology->get_all_Members}){
        my $taxon=$mem->taxon; #check Bio::EnsEMBL::Compara::NCBITaxon for methods
        my $id=$mem->stable_id;
        print "$id\t",$taxon->taxon_id,"\t",$taxon->genus," ",$taxon->species,"\t";
     }
    print $homology->description,"\t",$homology->subtype,"\t";
    my $dn=$homology->dn;
    my $ds=$homology->ds;
    my $dnds=$homology->dnds_ratio;
    my $lnl=$homology->lnl;
    ($dn)?print "$dn\t$ds\t$dnds\t$lnl\n":print OUT "NA\tNA\tNA\tNA\n";
}


Wish your help! Thanks very much in advance!


Best, Mei
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20120830/3c8e1fb4/attachment.html>


More information about the Dev mailing list