Bio-Homology-InterologWalk

 view release on metacpan or  search on metacpan

lib/Bio/Homology/InterologWalk.pm  view on Meta::CPAN

               print("do_attributes(): no gene object found for id: $stableid. Leaving as is.\n");
               $label = $stableid;
               print "$stableid\t=\t$label   ($novelty)\n";
               print $out_data_name $stableid, "\t", "=", "\t", $label, "\n";
               next;
          }
          #Dynamically change gene_adaptor depending on the ID species if required
          if($tag_chimeras){
               my ($org, $object_type, $db_type) = $registry->get_species_and_object_type($stableid);
               if(!$org){
                    my $org = $sourceorg;  
               }else{
                    my ($genus, $species) = split(/_/, $org);
                    my $genus_sig = substr($genus, 0, 1);
                    my $species_sig = substr($species, 0, 3);
                    $short_sourceorg = join('',$genus_sig,$species_sig);
               }
               $gene_adaptor = $registry->get_adaptor($org, 'core', 'Gene');
          } 
         
          my $gene = $gene_adaptor->fetch_by_stable_id($stableid);
          if(!$gene){
               $gene = $gene_adaptor->fetch_by_display_label($stableid);
               if(!$gene){
                    $genesArray = $gene_adaptor->fetch_all_by_external_name($stableid);
                    if(scalar(@$genesArray) == 1){ 
                         $gene = @$genesArray[0];
                    }elsif(scalar(@$genesArray) > 1){
                         print("do_attributes(): warning - $stableid has ambiguous gene object in Ensembl. Choosing the first.\n");
                         $gene = @$genesArray[0];
                    }else{ #no gene object, leaving ID
                         print("do_attributes(): no gene object found for id: $stableid. Leaving as is.\n");
                         $label = $stableid;
                         print "$stableid\t=\t$label   ($novelty)\n";
                         print $out_data_name $stableid, "\t", "=", "\t", $label, "\n";
                         next;
                    }
               }
          }
          
          $label = $gene->external_name || $gene->display_id;
          $label = $stableid if(!$label);
          $label = $label . '_' . $short_sourceorg if($tag_chimeras);
          print "$stableid\t=\t$label   ($novelty)\n";
          print $out_data_name $stableid, "\t", "=", "\t", $label, "\n";
     }
     close $out_data_name;
     close $out_data_novel;
     $dbh->disconnect();
     return 1;
}






##################secondary pod documentation begins##############


=head1 BUGS AND LIMITATIONS

This is B<BETA> software. There will be bugs. The interface may change. Please be careful. Do not rely on it for anything mission-critical.


Please report any bugs you find, bug reports and any other feedback are most welcome. 

-Currently only the  EBI Intact DB is available for PPI retrieval. This will be expanded to account for  all available PSICQUIC-compliant PPI dbs transparently. 
This includes MINT, STRING, BioGrid and many more. For a full list of compliant DBs and for the status of the PSICQUIC service, check

http://www.ebi.ac.uk/Tools/webservices/psicquic/registry/registry?action=STATUS 



=head1 AUTHOR

Giuseppe Gallone  E<lt>ggallone AT cpan DOT orgE<gt>

CPAN ID: GGALLONE

http://homepages.inf.ed.ac.uk/s0789227/

University of Edinburgh

=head1 PUBLICATION

If you use Bio::Homology::InterologWalk in your work, please cite

Gallone G, Simpson TI, Armstrong JD and Jarman AP (2011) Bio::Homology::InterologWalk - A Perl module to build putative protein-protein interaction networks through interolog mapping
BMC Bioinformatics 2011, 12:289 doi:10.1186/1471-2105-12-289  

=head1 LICENSE AND COPYRIGHT

Bio::Homology::InterologWalk is Copyright (c) 2010 Giuseppe Gallone
All rights reserved.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.1 or,
at your option, any later version of Perl 5 you may have available.


=head1 DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOU...

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL...

=head1 ACKNOWLEDGEMENTS

The author would like to thank the following individuals and organisations for their invaluable support and priceless suggestions.

Andrew Jarman, Ian Simpson, Douglas Armstrong and all the Jarman Lab,  University of Edinburgh

Javier Herrero, Albert Vilella, Andy Yates, Glenn Proctor, Michael Han, Gautier Koscielny and all the Ensembl Team

Samuel Kerrien & Bruno Aranda and all the EBI-Intact Team

Dave Messina, BioPerl list

=cut



( run in 0.445 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )