Re: [biopp-help-forum:980] Mapping of sequences to internal node names with bppancestor

63 views
Skip to first unread message

Julien Yann Dutheil

unread,
Jan 24, 2013, 3:39:07 AM1/24/13
to biopp-he...@googlegroups.com
Dear Ari,

The option you are looking for is
output.tree_ids.file=youroutputfile
Which will output a newick tree with the corresponding ids. I realize
this option is only documented in the non-homogeneous model section,
maybe we should move it to a more general place. I will investigate
why the Nhx option does not work. It could be that ID tags are
actually independent of the node ids used internally.

All th ebest,

Julien.

On Wed, Jan 23, 2013 at 11:03 PM, Ari Loytynoja <ari.lo...@gmail.com> wrote:
> Hi,
>
> I try to use bppancestor (version 0.5.0; from bppSuite version 0.7.0) to
> infer ancestral sequences for a set of aligned sequences related by a
> matching phylogeny. The method looks very promising but I have a problem
> with the output: I don't understand the numbering of the inferred ancestral
> sequences and don't know which sequence belongs to which internal node. The
> naive mappings that I tried (based on a recursion through the tree) don't
> seem to do it right.
>
> The command that I use could be like this:
> bppancestor input.sequence.file=input.fas input.sequence.format=Fasta
> input.sequence.sites_to_use=all input.sequence.max_gap_allowed=100
> input.tree.file=input.tre input.tree.format=NHX
> output.sequence.file=output.fas output.sequence.format=Fasta alphabet=DNA
> model=HKY85 initFreqs=observed
>
> My input trees are rooted and are automatically unrooted by bppancestor.
> (This may be related to the problem.) In this case, I used the NHX format
> for the input tree and named the internal nodes with tags "ND=integer".
> After trial and error, bppancestor accepts the input tree file but doesn't
> seem to do anything with the node name information.
>
> Am I missing something? Is there a way to identify the internal nodes and
> map the inferred sequences to the right ones?
>
> If not, I see two easy solutions to fix this:
> (1) use the node names given in the NHX file for the ancestral sequences;
> (2) output the phylogenetic tree with the internal node names.
>
> I tested also the second option and found out that the argument
> "output.tree.file=file path" is ignored by bppancestor.
>
> Thanks a lot in advance!
>
> Regards, Ari
>
> --
> You received this message because you are subscribed to the Google Groups
> "Bio++ Usage Help Forum" group.
> To post to this group, send email to biopp-he...@googlegroups.com.
> To unsubscribe from this group, send email to
> biopp-help-for...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/biopp-help-forum/-/19LARbPDd7EJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Julien Y. Dutheil, Ph-D
0 (+49) 6421 178 986

§ Max Planck Institute for Terrestrial Microbiology
Department of Organismic Interactions
Marburg -- GERMANY

§ Intitute of Evolutionary Sciences - Montpellier
University of Montpellier 2 -- FRANCE

Julien Yann Dutheil

unread,
Jan 24, 2013, 3:45:02 AM1/24/13
to biopp-he...@googlegroups.com
Hi again,

The Nhx option should have worked... would you mind sending your data,
tree and option file so that I give it a look? (you can send the data
outside of the forum if you prefer).

Ari Loytynoja

unread,
Jan 24, 2013, 6:11:59 AM1/24/13
to biopp-he...@googlegroups.com
Hi Julien,

I found the solution from an answer to another question right after sending mine.  Sorry for not checking the forum more carefully -- I just couldn't believe that someone would have had exactly the same problem!

Although I do have a solution, I've attached attached the data set that I used to experiment with the options and the output that I received. My use of "ND" tag is based on some comments I saw in Nhx.cpp file; I didn't look at the source code more thoroughly than that. 

Best regards, Ari

bppancestor input.sequence.file=input.fas input.sequence.format=Fasta input.sequence.sites_to_use=all input.sequence.max_gap_allowed=100 input.tree.file=input.tre input.tree.format=NHX output.sequence.file=output.fas output.sequence.format=Fasta alphabet=DNA model=HKY85 initFreqs=observed

******************************************************************
*     Bio++ Ancestral Sequence Reconstruction, version 0.5.0     *
* Authors: J. Dutheil                       Created on: 10/09/08 *
*          B. Boussau                       Last Modif: 17/06/11 *
******************************************************************

$ cat input.fas
>A1
CGCACCTAATCTTCCATGAATGACTAGGAGATAGGGAGCAGGTCCTTATACACCCTGTTG
>A2
CGCACCTAATCTTCCATGAATGACTAGGAGATAGGGAGAACGTCCTTATACACCCTGTTG
>A3
CGCACCTAATCTTCCATGAATGACTAGGAGATACGGATCAGGTCGTTATTCACCCTGTTG
>A4
CGCACCTAATCTTCCATGAATGACTAGGAGATACGGATCAGGTCCTTATTCACCCTGTTG
>A5
CTGACCTAATCTTTCATGAATGACTAGGACATAGGGTGCATGTCGGTATTCACCCTGTTG
>A6
CTGACCTAATCTTTGATGAATGACTAGGAGATAGGGAGCAGGTCCTTATTCACCCTGTTT
>A7
CGCACCTAATCTTCCATGAATGACTAGGAGATAGGGAGCAGATCCTTATTCCCCATGTTG
>A8
CTCACCTAATCTGCCATGAATGACTAGGAGATAGGGAGCAGGTCCTTATTCAGCATGTTG

$ cat input.tre
(((A1:0.02[&&NHX:ND=A1],A2:0.02[&&NHX:ND=A2]):0.02[&&NHX:ND=1],(A3:0.02[&&NHX:ND=A3],A4:0.02[&&NHX:ND=A4]):0.02[&&NHX:ND=2]):0.02[&&NHX:ND=17],((A5:0.02[&&NHX:ND=A5],A6:0.02[&&NHX:ND=A6]):0.02[&&NHX:ND=3],(A7:0.02[&&NHX:ND=A7],A8:0.02[&&NHX:ND=A8]):0.02[&&NHX:ND=4]):0.02[&&NHX:ND=5])[&&NHX:ND=6];

$ cat output.fas 
>2
CGCACCTAATCTTCCATGAATGACTAGGAGATAGGGAGCAGGTCCTTATACACCCTGTTG
>5
CGCACCTAATCTTCCATGAATGACTAGGAGATACGGATCAGGTCCTTATTCACCCTGTTG
>9
CTGACCTAATCTTTCATGAATGACTAGGAGATAGGGAGCAGGTCCTTATTCACCCTGTTG
>12
CTCACCTAATCTTCCATGAATGACTAGGAGATAGGGAGCAGGTCCTTATTCACCATGTTG
>13
CTCACCTAATCTTCCATGAATGACTAGGAGATAGGGAGCAGGTCCTTATTCACCCTGTTG
>6
CGCACCTAATCTTCCATGAATGACTAGGAGATAGGGAGCAGGTCCTTATTCACCCTGTTG

Julien Yann Dutheil

unread,
Jan 24, 2013, 9:23:14 AM1/24/13
to biopp-he...@googlegroups.com
Dear Ari,

There was indeed a bug in the Nhx parser! It is now fixed, and the
node ids will be properly read. Note that only integer ids are allowed
though.

Thanks for having reported this,

Best,

Julien.
> https://groups.google.com/d/msg/biopp-help-forum/-/LMjkdRAeLfEJ.
Reply all
Reply to author
Forward
0 new messages