Heikki Lehvaslaiho | 10 Sep 13:31

phylogeny-trait association methods into BioPerl

FYI,

I've been recently writing code to analyse phylogeny-trait associations. These 
traits are typically geographical location of the sequence but they can be any 
phenotypic characters associated with the sequences.

This involves trees, i.e. Bio::Tree::Tree and Bio::Tree::Node objects and 
strings describing the traits. I've been using tags to store trait values 
within nodes. The tag methods are:

Bio::Tree::Node::add_tag_value
Bio::Tree::Node::get_all_tags
Bio::Tree::Node::get_tag_values
Bio::Tree::Node::has_tag
Bio::Tree::Node::remove_all_tags
Bio::Tree::Node::remove_tag

Question: Is  there any particular reason why there is no 
set_tag_value(scalar|@array) method? 

I am getting tired of writing:
  $node->remove_tag($key);
  map {$node->add_tag_value($key)} @values ;
so I am going to implement that unless there is are strong objections.

Otherwise it has been smooth sailing. I am going to add 
Bio::Tree::TreeFunctions::is_binary() and start populating 
Bio::Tree::Statistics soon with these methods:

ps() - Parsimony Score (PS) from Fitch 1971 
(Continue reading)

Hilmar Lapp | 10 Sep 15:44

Re: phylogeny-trait association methods into BioPerl

Sounds great Heikki!

Just FYI, there is a considerable amount of code and packages for  
comparative analysis in R. You might want to look into the resources  
linked to from the http://r-phylo.org page. There is also a R-SIG- 
Phylo special interest group mailing list (should be linked from the  
aforementioned site).

	-hilmar

On Sep 10, 2008, at 5:32 AM, Heikki Lehvaslaiho wrote:

> FYI,
>
> I've been recently writing code to analyse phylogeny-trait  
> associations. These
> traits are typically geographical location of the sequence but they  
> can be any
> phenotypic characters associated with the sequences.
>
> This involves trees, i.e. Bio::Tree::Tree and Bio::Tree::Node  
> objects and
> strings describing the traits. I've been using tags to store trait  
> values
> within nodes. The tag methods are:
>
> Bio::Tree::Node::add_tag_value
> Bio::Tree::Node::get_all_tags
> Bio::Tree::Node::get_tag_values
> Bio::Tree::Node::has_tag
(Continue reading)

Jason Stajich | 10 Sep 19:44

Re: phylogeny-trait association methods into BioPerl

Those are just take from Bio::SeqFeature::Generic tag manipulation  
methods so please feel free to add a better one - maybe can propagate  
that new method to Bio::SeqFeature::Generic as well?

Would be nice to see those other methods add as well so am glad to see  
them.

-jason
On Sep 10, 2008, at 4:32 AM, Heikki Lehvaslaiho wrote:

> FYI,
>
> I've been recently writing code to analyse phylogeny-trait  
> associations. These
> traits are typically geographical location of the sequence but they  
> can be any
> phenotypic characters associated with the sequences.
>
> This involves trees, i.e. Bio::Tree::Tree and Bio::Tree::Node  
> objects and
> strings describing the traits. I've been using tags to store trait  
> values
> within nodes. The tag methods are:
>
> Bio::Tree::Node::add_tag_value
> Bio::Tree::Node::get_all_tags
> Bio::Tree::Node::get_tag_values
> Bio::Tree::Node::has_tag
> Bio::Tree::Node::remove_all_tags
> Bio::Tree::Node::remove_tag
(Continue reading)

Heikki Lehvaslaiho | 19 Sep 18:22

Re: phylogeny-trait association methods into BioPerl

The code is now in SVN. Bio::Tree::TreeFunctionsI::add_trait() can be used to 
set trait values in a tree.

Enjoy,

   -Heikki

On Wednesday 10 September 2008 13:32:06 Heikki Lehvaslaiho wrote:
> FYI,
>
> I've been recently writing code to analyse phylogeny-trait associations.
> These traits are typically geographical location of the sequence but they
> can be any phenotypic characters associated with the sequences.
>
> This involves trees, i.e. Bio::Tree::Tree and Bio::Tree::Node objects and
> strings describing the traits. I've been using tags to store trait values
> within nodes. The tag methods are:
>
> Bio::Tree::Node::add_tag_value
> Bio::Tree::Node::get_all_tags
> Bio::Tree::Node::get_tag_values
> Bio::Tree::Node::has_tag
> Bio::Tree::Node::remove_all_tags
> Bio::Tree::Node::remove_tag
>
> Question: Is  there any particular reason why there is no
> set_tag_value(scalar|@array) method?
>
> I am getting tired of writing:
>   $node->remove_tag($key);
(Continue reading)

miraceti | 8 Oct 21:05

Re: phylogeny-trait association methods into BioPerl

Hi, thanks for introducing this into bioperl,
I was having a hard time trying to figure out how to use mesquite on many
many trees automatically.
Now I can use bioperl instead.
I was testing the ps() function with some discrete character states,
and I noticed the ancestor states are different from what I would get by
hand.
I think it's because of this line

map {$node->set_tag_value('ps_trait', $_)} keys %union;

it replaces the trait values every time it does map,
instead of storing all possible values.
Could you look into this?
thanks

Mira Han

On Fri, Sep 19, 2008 at 12:22 PM, Heikki Lehvaslaiho <heikki <at> sanbi.ac.za>wrote:

> The code is now in SVN. Bio::Tree::TreeFunctionsI::add_trait() can be used
> to
> set trait values in a tree.
>
> Enjoy,
>
>   -Heikki
>
> On Wednesday 10 September 2008 13:32:06 Heikki Lehvaslaiho wrote:
> > FYI,
(Continue reading)

Heikki Lehvaslaiho | 9 Oct 07:36

Re: phylogeny-trait association methods into BioPerl

Mira,

Thanks for spotting this.  This really proved the point that many eyes are 
better than one pair. I knew that the outcome for the test tree is 4 and still 
accepted 5!

When writing this, I moved from using add_tag_value() into new method 
set_tag_value():

map {$node->add_tag_value('ps_trait', $_)} keys %union; # worked initially
map {$node->set_tag_value('ps_trait', $_)} keys %union; # wrong
$node->set_tag_value('ps_trait',keys %union);  # correct and a lot simpler

I'll commit the changes the moment I get svn to respond. The connection is 
closing prematurely for me:

svn update
===========================================
 dev.open-bio.org - Authorized Access Only
===========================================
Connection closed by 207.154.17.71
svn: Connection closed unexpectedly

   -Heikki

On Wednesday 08 October 2008 21:05:38 miraceti wrote:
> Hi, thanks for introducing this into bioperl,
> I was having a hard time trying to figure out how to use mesquite on many
> many trees automatically.
> Now I can use bioperl instead.
(Continue reading)

Heikki Lehvaslaiho | 9 Oct 10:22

Re: phylogeny-trait association methods into BioPerl

Looks like the SVN problem was at my end. It is sorted out now and I've 
committed the fix.

   -Heikki

On Thursday 09 October 2008 07:36:47 Heikki Lehvaslaiho wrote:

> I'll commit the changes the moment I get svn to respond. The connection is
> closing prematurely for me:
>
> svn update
> ===========================================
>  dev.open-bio.org - Authorized Access Only
> ===========================================
> Connection closed by 207.154.17.71
> svn: Connection closed unexpectedly

Gmane