[Bioperl-l] Bio::Tree:Statistics parsimony question
Mark A. Jensen
maj at fortinbras.us
Fri Oct 23 09:12:31 EDT 2009
up to list...
----- Original Message -----
From: "Mark A. Jensen" <maj at fortinbras.us>
To: "Chris" <coldmeadow at gmail.com>
Sent: Friday, October 23, 2009 8:14 AM
Subject: Re: [Bioperl-l] Bio::Tree:Statistics parsimony question
> Hi Chris,
>
> looks like you could simply do
>
> @ps = map { $obj->ps($tree, $_) } @seq;
>
> or into a hash %ps with tags as keys:
>
> @ps{@seq} = map { $obj->ps($tree,$_) } @seq;
>
> cheers MAJ
> ----- Original Message -----
> From: "Chris" <coldmeadow at gmail.com>
> To: <bioperl-l at bioperl.org>
> Sent: Friday, October 23, 2009 1:10 AM
> Subject: [Bioperl-l] Bio::Tree:Statistics parsimony question
>
>
>> Hello,
>> I have been able to use the ps() method in Bio::Tree::Statistics to calulate
>> the parsimony for tag values from a tree if they are strings.
>>
>> This is the way I have been implementing the method:
>>
>> my $obj = Bio::Tree::Statistics->new();
>> my $pars = $obj->ps($tree,'seq');
>> print "Parsimony = $pars \n";
>>
>> Is it possible to do so if they are an array?
>>
>> say I have an array @seq = qw(A,A,C,G), I can add these as values to a leaf
>> node of a tree using;
>>
>> foreach my $char (@seq){
>> $node->add_tag_value('seq',$char);
>> }
>>
>> Does anybody have a suggestion to get the parsimony for each label of the
>> array of labels for such a tree ?
>>
>> Thanks in advance,
>> Chris.
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>>
More information about the Bioperl-l
mailing list