~ubuntu-branches/ubuntu/precise/bioperl/precise

« back to all changes in this revision

Viewing changes to Bio/Tree/Statistics.pm

  • Committer: Bazaar Package Importer
  • Author(s): Ilya Barygin
  • Date: 2010-01-27 22:48:22 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100127224822-ebot4qbrjxcv38au
Tags: 1.6.1-1ubuntu1
* Merge from Debian testing, remaining changes:
  - disable tests, they produce a FTBFS trying to access the network 
    during run.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: Statistics.pm 14930 2008-10-14 10:48:16Z heikki $
 
1
# $Id: Statistics.pm 16123 2009-09-17 12:57:27Z cjfields $
2
2
#
3
3
# BioPerl module for Bio::Tree::Statistics
4
4
#
 
5
# Please direct questions and support issues to <bioperl-l@bioperl.org>
 
6
#
5
7
# Cared for by Jason Stajich <jason@bioperl.org>
6
8
#
7
9
# Copyright Jason Stajich
18
20
 
19
21
  use Bio::Tree::Statistics;
20
22
 
21
 
 
22
23
=head1 DESCRIPTION
23
24
 
24
25
This should be where Tree statistics are calculated.  It was
25
 
previously where statistics from a Coalescent simulation.  Currently
26
 
it is empty because we have not added any Tree specific statistic
27
 
calculations to this module yet.  We welcome any contributions.
 
26
previously where statistics from a Coalescent simulation.
 
27
 
 
28
It now contains several methods for calculating L<Tree-Trait
 
29
statistics>.
28
30
 
29
31
 
30
32
=head1 FEEDBACK
38
40
  bioperl-l@bioperl.org                  - General discussion
39
41
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
40
42
 
 
43
=head2 Support 
 
44
 
 
45
Please direct usage questions or support issues to the mailing list:
 
46
 
 
47
I<bioperl-l@bioperl.org>
 
48
 
 
49
rather than to the module maintainer directly. Many experienced and 
 
50
reponsive experts will be able look at the problem and quickly 
 
51
address it. Please include a thorough description of the problem 
 
52
with code and data examples if at all possible.
 
53
 
41
54
=head2 Reporting Bugs
42
55
 
43
56
Report bugs to the Bioperl bug tracking system to help us keep track
99
112
   my @consensus;
100
113
 
101
114
   # internal nodes are defined by their children
102
 
   
 
115
 
103
116
   my (%lookup,%internal);
104
117
   my $i = 0;
105
118
   for my $tree ( $guide_tree, @$bs_trees ) {
106
119
       # Do this as a top down approach, can probably be
107
120
       # improved by caching internal node states, but not going
108
121
       # to worry about it right now.
109
 
       
 
122
 
110
123
       my @allnodes = $tree->get_nodes;
111
124
       my @internalnodes = grep { ! $_->is_Leaf } @allnodes;
112
125
       for my $node ( @internalnodes ) {
140
153
               in a binary tree
141
154
  Returns    : integer
142
155
  Exceptions : 
143
 
  Args       : Bio::Tree::TreeI object
144
 
               Bio::Tree::NodeI object within the tree, optional
 
156
  Args       : 1. Bio::Tree::TreeI object
 
157
               2. Bio::Tree::NodeI object within the tree, optional
145
158
 
146
159
Commonly used statistics assume a binary tree, but this methods
147
160
returns a value even for trees with polytomies.
174
187
=head2 Tree-Trait statistics
175
188
 
176
189
The following methods produce desciptors of trait distribution among
177
 
leaf nodes within the trees. They require that a trait has to be set
 
190
leaf nodes within the trees. They require that a trait has been set
178
191
for each leaf node. The tag methods of Bio::Tree::Node are used to
179
192
store them as key/value pairs. In this way, one tree can store more
180
 
than on trait.
 
193
than one trait.
181
194
 
182
195
Trees have method add_traits() to set trait values from a file.
183
196
 
 
197
 
 
198
=head2 fitch
 
199
 
 
200
  Example    : fitch($tree, $key, $node);
 
201
  Description: Calculates Parsimony Score (PS) and internal trait
 
202
               values using the Fitch 1971 parsimony algorithm for
 
203
               the subtree a defined by the (internal) node.
 
204
               Node defaults to the root.
 
205
  Returns    : true on success
 
206
  Exceptions : leaf nodes have to have the trait defined
 
207
  Args       : 1. Bio::Tree::TreeI object
 
208
               2. trait name string
 
209
               3. Bio::Tree::NodeI object within the tree, optional
 
210
 
 
211
Runs first L<fitch_up> that calculats parsimony scores and then
 
212
L<fitch_down> that should resolve most of the trait/character state
 
213
ambiguities.
 
214
 
 
215
Fitch, W.M., 1971. Toward defining the course of evolution: minimal
 
216
change for a specific tree topology. Syst. Zool. 20, 406-416.
 
217
 
 
218
You can access calculated parsimony values using:
 
219
 
 
220
  $score = $node->->get_tag_values('ps_score');
 
221
 
 
222
and the trait value with:
 
223
 
 
224
  $traitvalue = $node->->get_tag_values('ps_trait'); # only the first
 
225
  @traitvalues = $node->->get_tag_values('ps_trait');
 
226
 
 
227
Note that there can be more that one trait value, especially for the
 
228
root node.
 
229
 
 
230
=cut
 
231
 
 
232
sub fitch {
 
233
    my $self = shift;
 
234
    my $tree = shift;
 
235
    my $key = shift || $self->throw("Trait name is needed");
 
236
    my $node = shift || $tree->get_root_node;
 
237
 
 
238
    $self->fitch_up($tree, $key, $node);
 
239
    $self->fitch_down($tree, $node);
 
240
}
 
241
 
 
242
 
 
243
 
184
244
=head2 ps
185
245
 
186
246
  Example    : ps($tree, $key, $node);
190
250
               Node defaults to the root.
191
251
  Returns    : integer, 1< PS < n, where n is number of branches
192
252
  Exceptions : leaf nodes have to have the trait defined
193
 
  Args       : Bio::Tree::TreeI object
194
 
               trait name string
195
 
               Bio::Tree::NodeI object within the tree, optional
196
 
 
197
 
 
198
 
Fitch, W.M., 1971. Toward defining the course of evolution: minimal
199
 
change for a specific tree topology. Syst. Zool. 20, 406–416.
200
 
 
201
 
=cut
202
 
 
203
 
sub ps {
 
253
  Args       : 1. Bio::Tree::TreeI object
 
254
               2. trait name string
 
255
               3. Bio::Tree::NodeI object within the tree, optional
 
256
 
 
257
 
 
258
This is the first half of the Fitch algorithm that is enough for
 
259
calculating the resolved parsimony values. The trait/chararacter
 
260
states are commonly left in ambiguos state. To resolve them, run
 
261
L<fitch_down>.
 
262
 
 
263
=cut
 
264
 
 
265
sub ps { shift->fitch_up(@_) }
 
266
 
 
267
=head2 fitch_up
 
268
 
 
269
  Example    : fitch_up($tree, $key, $node);
 
270
  Description: Calculates Parsimony Score (PS) from the Fitch 1971
 
271
               parsimony algorithm for the subtree a defined
 
272
               by the (internal) node.
 
273
               Node defaults to the root.
 
274
  Returns    : integer, 1< PS < n, where n is number of branches
 
275
  Exceptions : leaf nodes have to have the trait defined
 
276
  Args       : 1. Bio::Tree::TreeI object
 
277
               2. trait name string
 
278
               3. Bio::Tree::NodeI object within the tree, optional
 
279
 
 
280
This is a more generic name for L<ps> and indicates that it performs
 
281
the first bottom-up tree traversal that calculates the parsimony score
 
282
but usually leaves trait/character states ambiguous. If you are
 
283
interested in internal trait states, running L<fitch_down> should
 
284
resolve most of the ambiguities.
 
285
 
 
286
=cut
 
287
 
 
288
sub fitch_up {
204
289
    my $self = shift;
205
290
    my $tree = shift;
206
291
    my $key = shift || $self->throw("Trait name is needed");
215
300
    }
216
301
 
217
302
    foreach my $child ($node->each_Descendent) {
218
 
        $self->ps($tree, $key, $child);
 
303
        $self->fitch_up($tree, $key, $child);
219
304
    }
220
305
 
221
306
    my %intersection;
248
333
}
249
334
 
250
335
 
 
336
=head2 fitch_down
 
337
 
 
338
  Example    : fitch_down($tree, $node);
 
339
  Description: Runs the second pass from Fitch 1971
 
340
               parsimony algorithm to resolve ambiguous
 
341
               trait states left by first pass.
 
342
               by the (internal) node.
 
343
               Node defaults to the root.
 
344
  Returns    : true
 
345
  Exceptions : dies unless the trait is defined in all nodes
 
346
  Args       : 1. Bio::Tree::TreeI object
 
347
               2. Bio::Tree::NodeI object within the tree, optional
 
348
 
 
349
Before running this method you should have ran L<fitch_up> (alias to
 
350
L<ps> ). Note that it is not guarantied that all states are completely
 
351
resolved.
 
352
 
 
353
=cut
 
354
 
 
355
 
 
356
sub fitch_down {
 
357
    my $self = shift;
 
358
    my $tree = shift;
 
359
    my $node = shift || $tree->get_root_node;
 
360
 
 
361
    my $key = 'ps_trait';
 
362
    $self->throw ("ERROR: ". $node->internal_id. " needs a value for $key")
 
363
        unless $node->has_tag($key);
 
364
 
 
365
    my $nodev;
 
366
    foreach my $trait ($node->get_tag_values($key) ) {
 
367
        $nodev->{$trait}++;
 
368
    }
 
369
 
 
370
    foreach my $child ($node->each_Descendent) {
 
371
        next if $child->is_Leaf;  # end of recursion
 
372
 
 
373
        my $intersection;
 
374
        foreach my $trait ($child->get_tag_values($key) ) {
 
375
            $intersection->{$trait}++ if $nodev->{$trait};
 
376
        }
 
377
 
 
378
        $self->fitch_down($tree, $child);
 
379
        $child->set_tag_value($key, keys %$intersection);
 
380
    }
 
381
    return 1;  # success
 
382
}
 
383
 
 
384
 
 
385
=head2 persistence
 
386
 
 
387
  Example    : persistence($tree, $node);
 
388
  Description: Calculates the persistence
 
389
               for node in the subtree defined by the (internal)
 
390
               node.  Node defaults to the root.
 
391
  Returns    : int, number of generations trait value has to remain same
 
392
  Exceptions : all the  nodes need to have the trait defined
 
393
  Args       : 1. Bio::Tree::TreeI object
 
394
               2. Bio::Tree::NodeI object within the tree, optional
 
395
 
 
396
 
 
397
Persistence is a measure of the stability the trait value has in a
 
398
tree. It expresses the number of generations the trait value remains
 
399
the same. All the decendants of the root in the same generation have
 
400
to share the same value.
 
401
 
 
402
Depends on Fitch's parsimony score (PS).
 
403
 
 
404
=cut
 
405
 
 
406
sub _persistence {
 
407
    my $self = shift;
 
408
    my $tree = shift;
 
409
    my $node = shift;
 
410
    my $value = shift || $self->throw("Value is needed");
 
411
 
 
412
 
 
413
    my $key  = 'ps_trait';
 
414
 
 
415
    $self->throw("Node is needed") unless $node->isa('Bio::Tree::NodeI');
 
416
 
 
417
    return 0 unless $node->get_tag_values($key) eq $value; # wrong value
 
418
    return 1 if $node->is_Leaf; # end of recursion
 
419
 
 
420
    my $persistence = 10000000; # an arbitrarily large number
 
421
    foreach my $child ($node->each_Descendent) {
 
422
        my $pers = $self->_persistence($tree, $child, $value);
 
423
        $persistence = $pers if $pers < $persistence;
 
424
    }
 
425
    return $persistence + 1;
 
426
}
 
427
 
 
428
sub persistence {
 
429
    my $self = shift;
 
430
    my $tree = shift;
 
431
    my $node = shift  || $tree->get_root_node;
 
432
    $self->throw("Node is needed") unless $node->isa('Bio::Tree::NodeI');
 
433
 
 
434
    my $key  = 'ps_trait';
 
435
    my $value = $node->get_tag_values($key);
 
436
 
 
437
    #calculate
 
438
    my $persistence =  $self->_persistence($tree, $node, $value);
 
439
    $node->set_tag_value('persistance', $persistence);
 
440
    return $persistence;
 
441
}
 
442
 
 
443
 
 
444
=head2 count_subclusters
 
445
 
 
446
  Example    : count_clusters($tree, $node);
 
447
  Description: Calculates the number of sub-clusters
 
448
               in the subtree defined by the (internal)
 
449
               node.  Node defaults to the root.
 
450
  Returns    : int, count
 
451
  Exceptions : all the  nodes need to have the trait defined
 
452
  Args       : 1. Bio::Tree::TreeI object
 
453
               2. Bio::Tree::NodeI object within the tree, optional
 
454
 
 
455
Depends on Fitch's parsimony score (PS).
 
456
 
 
457
=cut
 
458
 
 
459
sub _count_subclusters {
 
460
    my $self = shift;
 
461
    my $tree = shift;
 
462
    my $node = shift;
 
463
    my $value = shift || $self->throw("Value is needed");
 
464
 
 
465
    my $key  = 'ps_trait';
 
466
 
 
467
    $self->throw ("ERROR: ". $node->internal_id. " needs a value for trait $key")
 
468
        unless $node->has_tag($key);
 
469
 
 
470
    if ($node->get_tag_values($key) eq $value) {
 
471
        if ($node->get_tag_values('ps_score') == 0) {
 
472
            return 0;
 
473
        } else {
 
474
            my $count = 0;
 
475
            foreach my $child ($node->each_Descendent) {
 
476
                $count += $self->_count_subclusters($tree, $child, $value);
 
477
            }
 
478
            return $count;
 
479
        }
 
480
    }
 
481
    return 1;
 
482
}
 
483
 
 
484
sub count_subclusters {
 
485
    my $self = shift;
 
486
    my $tree = shift;
 
487
    my $node = shift  || $tree->get_root_node;
 
488
    $self->throw("Node is needed") unless $node->isa('Bio::Tree::NodeI');
 
489
 
 
490
    my $key  = 'ps_trait';
 
491
    my $value = $node->get_tag_values($key);
 
492
 
 
493
    return $self->_count_subclusters($tree, $node, $value);
 
494
}
 
495
 
 
496
=head2 count_leaves
 
497
 
 
498
  Example    : count_leaves($tree, $node);
 
499
  Description: Calculates the number of leaves with same trait
 
500
               value as root in the subtree defined by the (internal)
 
501
               node.  Requires an unbroken line of identical trait values.
 
502
               Node defaults to the root.
 
503
  Returns    : int, number of leaves with this trait value
 
504
  Exceptions : all the  nodes need to have the trait defined
 
505
  Args       : 1. Bio::Tree::TreeI object
 
506
               2. Bio::Tree::NodeI object within the tree, optional
 
507
 
 
508
Depends on Fitch's parsimony score (PS).
 
509
 
 
510
=cut
 
511
 
 
512
sub _count_leaves {
 
513
    my $self = shift;
 
514
    my $tree = shift;
 
515
    my $node = shift  || $tree->get_root_node;
 
516
    my $value = shift;
 
517
 
 
518
    my $key  = 'ps_trait';
 
519
 
 
520
    $self->throw ("ERROR: ". $node->internal_id. " needs a value for trait $key")
 
521
        unless $node->has_tag($key);
 
522
 
 
523
    if ($node->get_tag_values($key) eq $value) {
 
524
        #print $node->id, ": ", $node->get_tag_values($key), "\n";
 
525
        return 1 if $node->is_Leaf; # end of recursion
 
526
 
 
527
            my $count = 0;
 
528
            foreach my $child ($node->each_Descendent) {
 
529
                $count += $self->_count_leaves($tree, $child, $value);
 
530
            }
 
531
            return $count;
 
532
    }
 
533
    return 0;
 
534
}
 
535
 
 
536
sub count_leaves {
 
537
    my $self = shift;
 
538
    my $tree = shift;
 
539
    my $node = shift  || $tree->get_root_node;
 
540
    $self->throw("Node is needed") unless $node->isa('Bio::Tree::NodeI');
 
541
 
 
542
    my $key  = 'ps_trait';
 
543
    my $value = $node->get_tag_values($key);
 
544
 
 
545
    return $self->_count_leaves($tree, $node, $value);
 
546
}
 
547
 
 
548
=head2 phylotype_length
 
549
 
 
550
  Example    : phylotype_length($tree, $node);
 
551
  Description: Sums up the branch lengths within phylotype
 
552
               exluding the subclusters where the trait values
 
553
               are different
 
554
  Returns    : float, length
 
555
  Exceptions : all the  nodes need to have the trait defined
 
556
  Args       : 1. Bio::Tree::TreeI object
 
557
               2. Bio::Tree::NodeI object within the tree, optional
 
558
 
 
559
Depends on Fitch's parsimony score (PS).
 
560
 
 
561
=cut
 
562
 
 
563
sub _phylotype_length {
 
564
    my $self = shift;
 
565
    my $tree = shift;
 
566
    my $node = shift;
 
567
    my $value = shift;
 
568
 
 
569
    my $key  = 'ps_trait';
 
570
 
 
571
    $self->throw ("ERROR: ". $node->internal_id. " needs a value for trait $key")
 
572
        unless $node->has_tag($key);
 
573
 
 
574
    return 0 if $node->get_tag_values($key) ne $value;
 
575
    return $node->branch_length if $node->is_Leaf; # end of recursion
 
576
 
 
577
    my $length = 0;
 
578
    foreach my $child ($node->each_Descendent) {
 
579
        my $sub_len = $self->_phylotype_length($tree, $child, $value);
 
580
        $length += $sub_len;
 
581
        $length += $child->branch_length if not $child->is_Leaf and $sub_len;
 
582
    }
 
583
    return $length;
 
584
}
 
585
 
 
586
 
 
587
sub phylotype_length {
 
588
    my $self = shift;
 
589
    my $tree = shift;
 
590
    my $node = shift  || $tree->get_root_node;
 
591
 
 
592
    my $key  = 'ps_trait';
 
593
    my $value = $node->get_tag_values($key);
 
594
 
 
595
    return $self->_phylotype_length($tree, $node, $value);
 
596
}
 
597
 
 
598
=head2 sum_of_leaf_distances
 
599
 
 
600
  Example    : sum_of_leaf_distances($tree, $node);
 
601
  Description: Sums up the branch lengths from root to leaf
 
602
               exluding the subclusters where the trait values
 
603
               are different
 
604
  Returns    : float, length
 
605
  Exceptions : all the  nodes need to have the trait defined
 
606
  Args       : 1. Bio::Tree::TreeI object
 
607
               2. Bio::Tree::NodeI object within the tree, optional
 
608
 
 
609
Depends on Fitch's parsimony score (PS).
 
610
 
 
611
=cut
 
612
 
 
613
sub _sum_of_leaf_distances {
 
614
    my $self = shift;
 
615
    my $tree = shift;
 
616
    my $node = shift;
 
617
    my $value = shift;
 
618
 
 
619
    my $key  = 'ps_trait';
 
620
 
 
621
    $self->throw ("ERROR: ". $node->internal_id. " needs a value for trait $key")
 
622
        unless $node->has_tag($key);
 
623
    return 0 if $node->get_tag_values($key) ne $value;
 
624
    #return $node->branch_length if $node->is_Leaf; # end of recursion
 
625
    return 0 if $node->is_Leaf; # end of recursion
 
626
 
 
627
    my $length = 0;
 
628
    foreach my $child ($node->each_Descendent) {
 
629
        $length += $self->_count_leaves($tree, $child, $value) * $child->branch_length +
 
630
        $self->_sum_of_leaf_distances($tree, $child, $value);
 
631
    }
 
632
    return $length;
 
633
}
 
634
 
 
635
sub sum_of_leaf_distances {
 
636
    my $self = shift;
 
637
    my $tree = shift;
 
638
    my $node = shift  || $tree->get_root_node;
 
639
 
 
640
    my $key  = 'ps_trait';
 
641
    my $value = $node->get_tag_values($key);
 
642
 
 
643
    return $self->_sum_of_leaf_distances($tree, $node, $value);
 
644
}
 
645
 
 
646
=head2 genetic_diversity
 
647
 
 
648
  Example    : genetic_diversity($tree, $node);
 
649
  Description: Diversity is the sum of root to leaf distances
 
650
               within the phylotype normalised by number of leaf
 
651
               nodes
 
652
  Returns    : float, value of genetic diversity
 
653
  Exceptions : all the  nodes need to have the trait defined
 
654
  Args       : 1. Bio::Tree::TreeI object
 
655
               2. Bio::Tree::NodeI object within the tree, optional
 
656
 
 
657
Depends on Fitch's parsimony score (PS).
 
658
 
 
659
=cut
 
660
 
 
661
sub genetic_diversity {
 
662
    my $self = shift;
 
663
    my $tree = shift;
 
664
    my $node = shift  || $tree->get_root_node;
 
665
 
 
666
    return $self->sum_of_leaf_distances($tree, $node) /
 
667
        $self->count_leaves($tree, $node);
 
668
}
 
669
 
 
670
=head2 statratio
 
671
 
 
672
  Example    : statratio($tree, $node);
 
673
  Description: Ratio of the stem length and the genetic diversity of the
 
674
               phylotype L<genetic_diversity>
 
675
  Returns    : float, separation score
 
676
  Exceptions : all the  nodes need to have the trait defined
 
677
  Args       : 1. Bio::Tree::TreeI object
 
678
               2. Bio::Tree::NodeI object within the tree, optional
 
679
 
 
680
TStatratio gives a measure of separation and variability within the phylotype.
 
681
Larger values identify more rapidly evolving and recent phylotypes.
 
682
 
 
683
Depends on Fitch's parsimony score (PS).
 
684
 
 
685
=cut
 
686
 
 
687
sub statratio {
 
688
    my $self = shift;
 
689
    my $tree = shift;
 
690
    my $node = shift  || $tree->get_root_node;
 
691
 
 
692
    my $div = $self->genetic_diversity($tree, $node);
 
693
    return 0 if $div == 0;
 
694
    return $node->branch_length / $div;
 
695
 
 
696
}
 
697
 
251
698
 
252
699
=head2 ai
253
700
 
257
704
               node.  Node defaults to the root.
258
705
  Returns    : real
259
706
  Exceptions : leaf nodes have to have the trait defined
260
 
  Args       : Bio::Tree::TreeI object
261
 
               trait name string
262
 
               Bio::Tree::NodeI object within the tree, optional
263
 
 
264
 
 
265
 
Association index (AI) gives a more fine grained results than PS since
266
 
the result is a real number. ~0 <= AI.
267
 
 
268
 
Wang, T.H., Donaldson, Y.K., Brettle, R.P., Bell, J.E., Simmonds, P.,
 
707
  Args       : 1. Bio::Tree::TreeI object
 
708
               2. trait name string
 
709
               3. Bio::Tree::NodeI object within the tree, optional
 
710
 
 
711
  Association index (AI) gives a more fine grained results than PS since
 
712
  the result is a real number. ~0 E<lt>= AI.
 
713
 
 
714
  Wang, T.H., Donaldson, Y.K., Brettle, R.P., Bell, J.E., Simmonds, P.,
269
715
  2001.  Identification of shared populations of human immunodeficiency
270
716
  Virus Type 1 infecting microglia and tissue macrophages outside the
271
 
  central nervous system. J. Virol. 75 (23), 11686–11699.
 
717
  central nervous system. J. Virol. 75 (23), 11686-11699.
272
718
 
273
719
=cut
274
720
 
318
764
               Node defaults to the root;
319
765
  Returns    : hashref with trait values as keys
320
766
  Exceptions : leaf nodes have to have the trait defined
321
 
  Args       : Bio::Tree::TreeI object
322
 
               trait name string
323
 
               Bio::Tree::NodeI object within the tree, optional
324
 
 
325
 
 
326
 
* Monophyletic Clade (MC) size statistics by Salemi at al 2005. It is
327
 
calculated for each trait value. 1<= MC <= nx, where nx is the
328
 
number of tips with value x:
 
767
  Args       : 1. Bio::Tree::TreeI object
 
768
               2. trait name string
 
769
               3. Bio::Tree::NodeI object within the tree, optional
 
770
 
 
771
  Monophyletic Clade (MC) size statistics by Salemi at al 2005. It is
 
772
  calculated for each trait value. 1 E<lt>= MC E<lt>= nx, where nx is the
 
773
  number of tips with value x:
329
774
 
330
775
   pick the internal node with maximim value for
331
776
      number of of tips with only trait x
332
777
 
333
 
MC was defined by Parker et al 2008.
 
778
  MC was defined by Parker et al 2008.
334
779
 
335
 
Salemi, M., Lamers, S.L., Yu, S., de Oliveira, T., Fitch, W.M., McGrath, M.S.,
 
780
  Salemi, M., Lamers, S.L., Yu, S., de Oliveira, T., Fitch, W.M., McGrath, M.S.,
336
781
   2005. Phylodynamic analysis of Human Immunodeficiency Virus Type 1 in
337
782
   distinct brain compartments provides a model for the neuropathogenesis of
338
 
   AIDS. J. Virol. 79 (17), 11343–11352.
 
783
   AIDS. J. Virol. 79 (17), 11343-11352.
339
784
 
340
 
Parker, J., Rambaut A., Pybus O., 2008. Correlating viral phenotypes
 
785
  Parker, J., Rambaut A., Pybus O., 2008. Correlating viral phenotypes
341
786
   with phylogeny: Accounting for phylogenetic uncertainty Infection,
342
 
   Genetics and Evolution 8 (2008), 239–246.
 
787
   Genetics and Evolution 8 (2008), 239-246.
343
788
 
344
789
=cut
345
790