Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Bio-Phylo CPAN distribution.

Report information
The Basics
Id: 21417
Status: resolved
Priority: 0/
Queue: Bio-Phylo

People
Owner: Nobody in particular
Requestors: easmith [...] beatrice.rutgers.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: remove_unbranched_internals does not appear to (always) work
Date: Sun, 10 Sep 2006 15:22:39 -0400
To: bug-bio-phylo [...] rt.cpan.org
From: Allen Smith <easmith [...] beatrice.rutgers.edu>
$Id: Tree.pm,v 1.23 2006/05/19 02:08:54 rvosa Exp $ The below program yields these results: (((((Saccharomyces-NUM3,Schizosaccharomyces-NUM3),(((Saccharomyces-NUM4,Schizosaccharomyces-NUM4),(((Drosophila-NUM4,Monosiga_brevicollis-NUM4),Mus-NUM4),Schistosoma-NUM4,Caenorhabditis-NUM4)),(((Funiculina,Eunicella),(Rhabdocalyptus,Beroe),(Monosiga_brevicollis-NUM2,Monosiga_ovata),((Danio,Mus-NUM2),Crassostrea),(Asbestopluma,Chondrosia),(Nematostella,Schistosoma-NUM2),Petrobiona,Petrosia,Caenorhabditis-NUM2,Drosophila-NUM2),((Schizosaccharomyces-NUM2,Pneumocystis),Dictyostelium,Saccharomyces-NUM2)))),(Caenorhabditis-NUM3,Schistosoma-NUM3))),Aplysia); (((((Saccharomyces-NUM3,Schizosaccharomyces-NUM3),(((Saccharomyces-NUM4,Schizosaccharomyces-NUM4),(((Drosophila-NUM4,Monosiga_brevicollis-NUM4),Mus-NUM4),Schistosoma-NUM4,Caenorhabditis-NUM4)),(((Funiculina,Eunicella),(Rhabdocalyptus,Beroe),(Monosiga_brevicollis-NUM2,Monosiga_ovata),((Danio,Mus-NUM2),Crassostrea),(Asbestopluma,Chondrosia),(Nematostella,Schistosoma-NUM2),Petrobiona,Petrosia,Caenorhabditis-NUM2,Drosophila-NUM2),((Schizosaccharomyces-NUM2,Pneumocystis),Dictyostelium,Saccharomyces-NUM2)))),(Caenorhabditis-NUM3,Schistosoma-NUM3))),Aplysia); This is despite that there are two parentheses around everything in front of ",Aplysia", of which one should get eliminated. Incidentally, the above is even worse if one uses the newick parser instead of the fastnewick parser: (n22,Aplysia); (n22,Aplysia); One gets essentially the same result if one tries using the _analyze method (called in a number of other subroutines, I note) on a tree, read in using fastnewick, with unbranched internals: (((((Saccharomyces-NUM3,Schizosaccharomyces-NUM3),(((Saccharomyces-NUM4,Schizosaccharomyces-NUM4),(((Drosophila-NUM4,Monosiga_brevicollis-NUM4),Mus-NUM4),Schistosoma-NUM4,Caenorhabditis-NUM4)),(((Funiculina,Eunicella),(Rhabdocalyptus,Beroe),(Monosiga_brevicollis-NUM2,Monosiga_ovata),((Danio,Mus-NUM2),Crassostrea),(Asbestopluma,Chondrosia),(Nematostella,Schistosoma-NUM2),Petrobiona,Petrosia,Caenorhabditis-NUM2,Drosophila-NUM2),((Schizosaccharomyces-NUM2,Pneumocystis),Dictyostelium,Saccharomyces-NUM2)))),(Caenorhabditis-NUM3,Schistosoma-NUM3))),Aplysia); (((((Saccharomyces-NUM3,Schizosaccharomyces-NUM3),(((Saccharomyces-NUM4,Schizosaccharomyces-NUM4),(((Drosophila-NUM4,Monosiga_brevicollis-NUM4),Mus-NUM4),Schistosoma-NUM4,Caenorhabditis-NUM4)),(((Funiculina,Eunicella),(Rhabdocalyptus,Beroe),(Monosiga_brevicollis-NUM2,Monosiga_ovata),((Danio,Mus-NUM2),Crassostrea),(Asbestopluma,Chondrosia),(Nematostella,Schistosoma-NUM2),Petrobiona,Petrosia,Caenorhabditis-NUM2,Drosophila-NUM2),((Schizosaccharomyces-NUM2,Pneumocystis),Dictyostelium,Saccharomyces-NUM2)))),(Caenorhabditis-NUM3,Schistosoma-NUM3))),Aplysia); (,Aplysia); sub get_tree { my $forest = Bio::Phylo::IO->parse(-string => $_[0], -format => "fastnewick"); unless (defined($forest)) { confess "Unable to parse '" . $_[0] . "' into forest; stopped"; } my $tree = $forest->first; unless (defined($tree)) { confess "Unable to parse forest from '" . $_[0] . "' into tree; stopped"; } return $tree; } sub to_newick { return Bio::Phylo::IO->unparse( -format => 'newick', -phylo => $_[0] ); } $tree = get_tree("(Aplysia,(((Schistosoma-NUM3,Caenorhabditis-NUM3),((((Saccharomyces-NUM2,Dictyostelium,(Pneumocystis,Schizosaccharomyces-NUM2)),(Drosophila-NUM2,Caenorhabditis-NUM2,Petrosia,Petrobiona,(Schistosoma-NUM2,Nematostella),(Chondrosia,Asbestopluma),(Crassostrea,(Mus-NUM2,Danio)),(Monosiga_ovata,Monosiga_brevicollis-NUM2),(Beroe,Rhabdocalyptus),(Eunicella,Funiculina))),((Caenorhabditis-NUM4,Schistosoma-NUM4,(Mus-NUM4,(Monosiga_brevicollis-NUM4,Drosophila-NUM4))),(Schizosaccharomyces-NUM4,Saccharomyces-NUM4))),(Schizosaccharomyces-NUM3,Saccharomyces-NUM3)))))"); print STDERR to_newick($tree) . "\n"; $tree->remove_unbranched_internals; print STDERR to_newick($tree) . "\n"; # for _analyze shown above: #$tree->_analyze; #print STDERR to_newick($tree) . "\n"; -- Allen Smith http://cesario.rutgers.edu/easmith/ There is only one sound argument for democracy, and that is the argument that it is a crime for any man to hold himself out as better than other men, and, above all, a most heinous offense for him to prove it. - H. L. Mencken
Thank you for bringing this to my attention. My apologies for the problems you have encountered, I will do my best to address these issues.
Subject: Re: [rt.cpan.org #21417] remove_unbranched_internals does not appear to (always) work
Date: Sat, 16 Sep 2006 07:08:52 -0400
To: bug-Bio-Phylo [...] rt.cpan.org
From: Allen Smith <easmith [...] beatrice.rutgers.edu>
In message <rt-3.6.HEAD-16550-1158392318-967.21417-6-0@rt.cpan.org> (on 16 September 2006 03:38:39 -0400), bug-Bio-Phylo@rt.cpan.org ( via RT) wrote: Show quoted text
> ><URL: http://rt.cpan.org/Ticket/Display.html?id=21417 > > >Thank you for bringing this to my attention.
Quite welcome. Show quoted text
>My apologies for the problems you have encountered,
No need to apologize, you're a volunteer the last time I checked... Show quoted text
>I will do my best to address these issues.
Thanks! -Allen -- Allen Smith http://cesario.rutgers.edu/easmith/ There is only one sound argument for democracy, and that is the argument that it is a crime for any man to hold himself out as better than other men, and, above all, a most heinous offense for him to prove it. - H. L. Mencken
I have tracked down what was wrong (incorrect child counts, so nodes with only a single child weren't identified). I fixed it, and added a regress_21417.t test to show the fix. An updated version of Bio::Phylo (v.0.16, release candidate) will be posted on CPAN this week. Best wishes, Rutger