[Bioperl-l] Bio::Tree::IO "Collapse" function

Lucia Peixoto luciap at sas.upenn.edu
Tue May 30 14:49:48 EDT 2006


Hi

I am here again, I finally got to write the "collapse nodes" function and have a
couple of questions.

In order to collpase any node $node, I first have to get the parent
which I can do as $parent=$node->ancestor

and then the children as:
@children=$node->get_all_Descendents (or should I use each descendent?)

Then before deleting $node I have to assign all its children to $parent,
and here is where I am kind of confussed.
Can I use the add_Descendent function for this?
I've been tryig to write something like this:
foreach $child (@children){
         $parent=add_Descendent->$child;
}
but this doesn't work and I think it is because I don't have any idea of what I
am doing
any suggestions?

thanks



Lucia Peixoto
Department of Biology,SAS
University of Pennsylvania


More information about the Bioperl-l mailing list