[Bioperl-l] Checking a tree input

Jason Stajich jason.stajich at gmail.com
Wed Jul 17 20:13:52 UTC 2013


It depends on what format the bootstraps are stored in - are they as internal node labels or encoded in the ID string or encoded in the length of the branches?

Because there isn't an explicit format - there are variants of it for newick -  you can move them automatically passing in '-bootstrap_style' => 'traditional')  when initializating the parser.
or you can move them explicitly 

copy them from ID to boostrap slot in the objects after you have created it.
for my $node ( grep { ! $_->is_Leaf } $tree->get_nodes ) {
 $node->bootstrap($node->id);
}

Or you can use the connivence function which does the same thing.
$tree->move_id_to_bootstrap

Presumably these internal node IDs will be empty when there is no bootstrap so you can check them after the fact for your other use case when there are no boostraps.

On Jul 14, 2013, at 1:45 AM, soungalo <soungalo at walla.com> wrote:

> Hi there,
> Does anyone know if I can do the following:
> given an input file, check whether it is a newick tree or not, and if it is,
> check if it has bootstrap values.
> Regarding the bootstraps, I tried reading previous posts here, but I didn't
> get it - using the TreeIO module, the $node->bootstrap method keeps giving
> undefined values. In some trees, the bootstrap values are in the id field.
> Can you explain how to work with bootstraps ?
> Thanks!
> 
> 
> 
> --
> View this message in context: http://bioperl.996286.n3.nabble.com/Checking-a-tree-input-tp17041.html
> Sent from the Bioperl-L mailing list archive at Nabble.com.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Jason Stajich
jason.stajich at gmail.com
jason at bioperl.org





More information about the Bioperl-l mailing list