[Bioperl-l] Bio::Tree development
Jason Stajich
jason at bioperl.org
Fri Jan 19 21:34:29 UTC 2007
Just assume the bootstrap value will be available from bootstrap()
and please send in the function for collapsing by bootstrap. I never
finished consensus_tree building from bootstrap_replicates like I
wanted to, but this is a nice logical addition to the package.
On Jan 19, 2007, at 12:53 PM, Lucia Peixoto wrote:
> Hi
>
> One of the functions missing from TreeIO that will be good to
> implement is a
> collpase bootstrap function, meaning to collapse all nodes bellow a
> certain
> bootstrap value
>
> I do have a bit of code to do this, however it cannot be
> generalized until the
> bootstrap value is consistently captured by the same function, so
> far, for the
> trees I have at least, the internal ID is the bootstrap value, but
> that may not
> be true for all trees.Or it can be written asuming that you already
> set the
> boostrap to the right value.
>
> The function bootstrap in Bio::Tree::NodeI never gets the bootstrap
> right in any
> tree I've used (always newick format I am talking)
>
This has been discussed multiple times on the list - I don't know if
I've posted the answer on the wiki or not, but it should go to the
FAQ and/or Tree relevant pages.
Please understand that this is a limitation of the NEWICK FORMAT.
Everyone complains about it but I think you are complaining to the
wrong people. We don't assume the internal node IDs are bootstrap
values (often they are not). Some formats use "ID[BOOTSTRAP]" which
we parse into node id, and bootstrap.
If you know that the internal ids represent the bootstrap you can
easily move the data over
for my $node ( grep { ! $_->is_Leaf } $tree->get_nodes ) {
$node->bootstrap($node->id);
$node->id('');
}
if this is sufficiently annoying to you, write a function and submit
it as a patch after it has been tested.... Here is an example:
sub migrate_id_to_bootstrap {
my $tree = shift;
for my $node ( grep { ! $_->is_Leaf } $tree->get_nodes ) {
$node->bootstrap($node->id);
$node->id('');
}
}
-jason
> just an idea,
>
> Lucia
>
>
>
> Quoting Chris Fields <cjfields at uiuc.edu>:
>
>>
>> On Jan 19, 2007, at 1:18 PM, Sendu Bala wrote:
>> ...
>>>
>>>> * General code cleanup
>>>> Making sure everything is indented according to some standard. I've
>>>> seen previously that there doesn't seem to be any real standard for
>>>> how BioPerl code should look like. I would think that it would be a
>>>> lot clearer to understand lots of the code if it was indented
>>>> properly. As it is now, the indentation depth changes between
>>>> 2,3 and
>>>> 4 within the same file even.
>>>
>>> My own personal preference is an indent of 4 spaces.
>> ...
>>
>> Mine as well. Some people also use tabs vs spaces (I prefer
>> spaces). However, I think (Johan) you'll be hard-pressed to force a
>> standard there.
>>
>> You're always welcome to run it through perltidy prior to commits!
>>
>> chris
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>
>
> Lucia Peixoto
> Department of Biology,SAS
> University of Pennsylvania
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
--
Jason Stajich
Miller Research Fellow
University of California, Berkeley
lab: 510.642.8441
http://pmb.berkeley.edu/~taylor/people/js.html
More information about the Bioperl-l
mailing list