[Bioperl-l] a question on "move_id_to_bootstrap" usage

Jason Stajich jason at bioperl.org
Sun Jan 27 00:14:45 UTC 2008


I'm not sure why you still have the __DATA__ block if you are reading data
in from a file or are you trying to send an example of the code but forgot
to specify a different input point?

If you are reading from a file that looks like the tree in the __DATA__
block you notice that the bootstrap info is encoded as the branch_length,
NOT the id - the move_id_to_bootstrap only moves the ID to the BOOTSTRAP.
you'll have to write a custom routine or just run a simple loop on your tree
to move the data to the bootstrap - it would look just the
move_id_to_bootstrap except you'd use branch_length instead of id to get the
data that you want to set in the bootstrap.  I leave it as an exercise for
the reader, but if you can't figure it out let us know.


In the future please ask your questions on the mailing list as I don't have
much time to answer questions individually when someone else can help.

-jason

On Jan 23, 2008 1:57 PM, Anand <whatsinanemailid at gmail.com> wrote:

> HI Jason,
>
> Thanks a lot. I followed your suggestion and updated both the modules.
>
> I followed the code example on http://www.bioperl.org/wiki/HOWTO:Trees and
> tried to extract bootstrap values for my tree (which is output after
> seqboot, protdist, fitch and consense)
>
> When I try running my script, I am not able to print the bootstrap
> values...and it doesn't throw any error messages. Am I missing something?
>
> ====START of Code====
> #!/usr/bin/perl -w
> use strict;
> use lib "/home/anand/myperlmodules/lib/perl5/";
> use Bio::TreeIO;
> # $usage: $0 <consense_tree_file>
>
> my $infile = shift;
>
> my $treeio = Bio::TreeIO->new(-format => 'newick',
>                          -file => $infile,
>                          -internal_node_id => 'bootstrap',
>                          );
>
> while( my $tree = $treeio->next_tree ) {
>    for my $node ( $tree->get_nodes ) {
>        printf "id: %s bootstrap: %s\n", $node->id || '', $node->bootstrap
> || '', "\n";
>    }
> }
> __END__
> ((5815_1:100.0,(((5815_5:100.0,5815_7:100.0):100.0,5815_6:100.0):97.0
> ,5815_8:100.0):
> 98.0,5815_4:100.0,5815_2:100.0):100.0,5815_3:100.0);
> ====END of Code====
>
> Thanks in advance for your time and help,
>
> Anand
>
> PS: Just to preserve formatting, I have attached the consense_output_file
>
> On Jan 22, 2008 8:02 AM, Jason Stajich <jason at bioperl.org> wrote:
>
> > I suspect you may want to update everything in Bio/TreeIO and Bio/
> > Tree to be safe, I'm not exactly sure what was changed - you can look
> > at the commit logs to see what else changed at the time - http://
> > code.open-bio.org/.   You can also use that same server to grab a
> > fresh checkout of what is the current state of the code base.
> >
> > -jason
> > On Jan 22, 2008, at 12:59 AM, Anand wrote:
> >
> > > Hi Jason
> > >
> > > I have a question on the method "move_id_to_bootstrap". From this
> > > post:
> > > http://portal.open-bio.org/pipermail/bioperl-guts-l/2007-May/
> > > 025718.html
> > >
> > > it looks like it has been added very recently. As luck would have
> > > it, the
> > > TreeFunctionsI.pm in my bioperl installation is missing that method.
> > >
> > > My question: What is the best method to update TreeFunctionsI.pm so
> > > that it
> > > can have the "move_id_to_bootstrap" method? Does it have other update
> > > dependencies.
> > >
> > > Thanks in advance for your help and time,
> > >
> > > Anand
> >
> >
>



-- 
Jason Stajich
jason at bioperl.org
http://bioperl.org/wiki/User:Jason



More information about the Bioperl-l mailing list