Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Renaming leaves in tree obj in Bioinformatics toolbox

Subject: Renaming leaves in tree obj in Bioinformatics toolbox

From: Cueball

Date: 11 Jul, 2007 10:07:52

Message: 1 of 2

Greetings,

This is a question on behalf of a friend of mine who is using the bioinformatics toolbox. Since I don't use it, I can't answer it, but I
thought I'd post it here:

"I have a 'phylogenetic tree' object in matlab, and I want to leave all of it alone except the LeafNames, where I want to swap one vector
for another one of the same length, but with different values as the entries. How the heck do I do that?"

My understanding is that the leaf names on an existing tree can't be changed. But the first thing that came to mind is to re-create the
tree with the same info but with the desired names.

I suggested this but he said that he had loaded the tree from a newick formatted file using phytreetool. He tried "to save the tree into
newick, remove [the names], and bring the tree back - it reorganized the branches so that all the ordering of tree related data and such I
had done was moot."

Any pointers?
-Mark

Subject: Re: Renaming leaves in tree obj in Bioinformatics toolbox

From: Lucio Cetto

Date: 12 Jul, 2007 07:48:59

Message: 2 of 2

You should be able to do something like this:

tr = phytreeread('your newick file')
p = get(tr,'pointers')
d = get(tr,'distances')
names = {'name 1','name 2','name 3','name 4'};
% you should have as many leaf names as in
% the original tree
newtr = phytree(p,d,names);
view(newtr)

I hope this helps, let me know if you have any other question

Lucio Cetto
The MathWorks, Inc.

 Cueball wrote:
>
>
> Greetings,
>
> This is a question on behalf of a friend of mine who is using the
> bioinformatics toolbox. Since I don't use it, I can't answer it,
> but I
> thought I'd post it here:
>
> "I have a 'phylogenetic tree' object in matlab, and I want to leave
> all of it alone except the LeafNames, where I want to swap one
> vector
> for another one of the same length, but with different values as
> the entries. How the heck do I do that?"
>
> My understanding is that the leaf names on an existing tree can't
> be changed. But the first thing that came to mind is to re-create
> the
> tree with the same info but with the desired names.
>
> I suggested this but he said that he had loaded the tree from a
> newick formatted file using phytreetool. He tried "to save the tree
> into
> newick, remove [the names], and bring the tree back - it
> reorganized the branches so that all the ordering of tree related
> data and such I
> had done was moot."
>
> Any pointers?
> -Mark
>

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
bioinformatics Lucio Andrade-Cetto 07 Nov, 2007 08:57:02
phylogenetic tree Lucio Andrade-Cetto 07 Nov, 2007 08:56:58
phylogenetic tree Matthew Simoneau 12 Jul, 2007 11:09:05
bioinformatics Matthew Simoneau 12 Jul, 2007 11:09:05
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics