Last active
December 31, 2015 14:59
-
-
Save avrilcoghlan/8003808 to your computer and use it in GitHub Desktop.
Perl script that uses the Ensembl Compara Perl API to print the protein tree with the stable id ENSGT00390000003602
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Print the protein tree with the stable id ENSGT00390000003602 | |
use strict; | |
use warnings; | |
use Bio::EnsEMBL::Registry; | |
my $registry = 'Bio::EnsEMBL::Registry'; | |
$registry->load_registry_from_db( | |
-host => 'ensembldb.ensembl.org', | |
-user => 'anonymous' | |
); | |
my $gta = $registry->get_adaptor('multi', 'compara', 'GeneTree'); | |
my $genetree = $gta->fetch_by_stable_id("ENSGT00390000003602"); | |
$genetree->print_tree(); # prints the tree in ASCII format | |
print "\n\n"; | |
print $genetree->newick_format('simple'),"\n\n"; # prints the tree in Newick format | |
print $genetree->nhx_format('full'),"\n\n"; # prints the tree in nhx format | |
print $genetree->nhx_format('display_label_composite'),"\n\n"; # includes the gene names and species names in nhx format |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment