Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: naturalis/bio-phylo
base: 1b353597d3
...
head fork: naturalis/bio-phylo
compare: ab7443dffc
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
2  lib/Bio/Phylo.pm
@@ -26,7 +26,7 @@ require Bio::Phylo::Mediators::TaxaMediator;
# Include the revision number from subversion in $VERSION
my $rev = '$Id: Phylo.pm 1660 2011-04-02 18:29:40Z rvos $';
$rev =~ s/^[^\d]+(\d+)\b.*$/$1/;
-our $VERSION = "0.46";
+our $VERSION = "0.47";
$VERSION .= "_$rev";
{
my $taxamediator = 'Bio::Phylo::Mediators::TaxaMediator';
View
8 lib/Bio/Phylo/Forest.pm
@@ -431,10 +431,14 @@ Creates an MRP matrix object.
for grep { $_->is_internal } @{ $node->get_children };
};
for my $tree ( @{ $self->get_entities } ) {
- $recursion->( $tree->get_root, $tree, $taxa, $recursion );
+ if ( my $root = $tree->get_root ) {
+ $recursion->( $root, $tree, $taxa, $recursion );
+ }
}
for my $datum ( @{ $matrix->get_entities } ) {
- $datum->set_char( $data{ $datum->get_name } );
+ if ( my $data = $data{ $datum->get_name } ) {
+ $datum->set_char( $data ) if @{ $data };
+ }
}
$matrix->set_charlabels( \@charlabels );
$matrix->set_statelabels( \@statelabels );
View
9 lib/Bio/Phylo/Treedrawer.pm
@@ -1089,12 +1089,13 @@ sub _compute_rooted_coordinates {
$tree->visit(
sub {
my $node = shift;
+ if ( not $tallest_tip ) {
+ throw 'BadArgs' => "This tree has no branch lengths, can't draw a phylogram";
+ }
$node->set_x( $padding + $node->get_x * ( $width / $tallest_tip ) );
- $node->set_y(
- $padding + $node->get_y * ( $height / $tip_counter ) );
+ $node->set_y( $padding + $node->get_y * ( $height / $tip_counter ) );
if ( !$phylo && $node->is_terminal ) {
- $node->set_x(
- $padding + $tallest_tip * ( $width / $tallest_tip ) );
+ $node->set_x( $padding + $tallest_tip * ( $width / $tallest_tip ) );
}
}
);
View
15 lib/Bio/Phylo/Treedrawer/Abstract.pm
@@ -148,7 +148,7 @@ sub _draw_collapsed {
$node->set_collapsed(0);
# get the height of the tallest node inside the collapsed clade, for
- # cladograms this is the number of internodes, for phylograms it's the
+ # cladograms this is 1, for phylograms it's the
# sum of the branch lengths
my $tallest = 0;
my $clado = $td->get_mode =~ m/clado/i;
@@ -156,17 +156,10 @@ sub _draw_collapsed {
$tallest = 1;
}
else {
- $node->visit_level_order(
- sub {
+ $node->visit_depth_first(
+ '-pre' => sub {
my $n = shift;
- my $height;
- if ( $n == $node ) {
- $height = 0;
- }
- else {
- $height =
- $n->get_parent->get_generic('height') + $n->get_branch_length;
- }
+ my $height = $n->get_parent->get_generic('height') + $n->get_branch_length;
$n->set_generic( 'height' => $height );
$tallest = $height if $height > $tallest;
}
View
3  lib/Bio/Phylo/Util/CONSTANT.pm
@@ -59,6 +59,7 @@ BEGIN {
_NEXML_VERSION_
_PI_
_NS_PHYLOXML_
+ _NS_TB2PURL_
);
%EXPORT_TAGS = (
'all' => [@EXPORT_OK],
@@ -122,6 +123,7 @@ BEGIN {
_NS_BIOPHYLO_
_NS_SKOS_
_NS_PHYLOXML_
+ _NS_TB2PURL_
)
]
);
@@ -146,6 +148,7 @@ sub _NS_CDAO_ () { 'http://www.evolutionaryontology.org/cdao/1.0/cdao.owl#'
sub _NS_BIOPHYLO_ () { 'http://search.cpan.org/dist/Bio-Phylo/terms#' }
sub _NS_SKOS_ () { 'http://www.w3.org/2004/02/skos/core#' }
sub _NS_PHYLOXML_ () { 'http://www.phyloxml.org/1.10/terms#' }
+sub _NS_TB2PURL_ () { 'http://purl.org/phylo/treebase/phylows/' }
sub _NEXML_VERSION_ () { '0.9' }
sub _NONE_ () { 1 }

No commit comments for this range

Something went wrong with that request. Please try again.