[Bioperl-l] TreeIO, how it works?

Wolverine Fran flope004 at hotmail.com
Mon Feb 12 02:40:08 UTC 2007


Hi,

I have a problem. I don't understand how TreeIO reads the trees:
my input: ((dog:0.04,cat:0.08):0.12,(human:0.15,mouse:0.2));

An unrooted tree with 4 tips and 2 internal nodes.
when I asked for:
print "Total number of nodes ",$tree->number_nodes;

I get 6 but when I ask for:
foreach my $node (@nodes) {
	print $node->internal_id,",";
}
I get 6,0,1,2,3,4,5. Total 7.

The root is number 6 and 2 and 5 are my internal nodes.
If I set the root to be number 5 this node 6 is still present.
Why? what is the node 6?

when I try the following:
  $node5 = $tree->find_node(-internal_id => '5');
  $node6 = $tree->find_node(-internal_id => '6');
  $node2 = $tree->find_node(-internal_id => '2');
  $distance1 = $tree->distance(-nodes =>[$node5,$node2]);
  $distance2 = $tree->distance(-nodes =>[$node5,$node6]);
  $distance3 = $tree->distance(-nodes =>[$node2,$node6]);
  or any other distance I get 2 warnings:
  -------------------- WARNING ---------------------
MSG: Must provide a valid array reference for -nodes
---------------------------------------------------

-------------------- WARNING ---------------------
MSG: Could not find distance!
---------------------------------------------------
What am I doing incorrectly?

I am practicing with AlignIO and TreeIO to calculate the maximum likelihood 
for a given tree. So,
other information about that would be of great help. I am practicing with 
this to see how Bioperl can
help me with more complex problems.

Thank you very much for your help!

_________________________________________________________________
Acepta el reto MSN Premium: Correos más divertidos con fotos y textos 
increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis. 
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_correosmasdivertidos




More information about the Bioperl-l mailing list