Re: Starting tree with BEAST 2.0.1

637 views
Skip to first unread message

Remco Bouckaert

unread,
Feb 19, 2013, 3:50:32 PM2/19/13
to beast...@googlegroups.com
Hi Gael,

To start the tree with a tree in Newick format, you need the TreeParser
to initialise the tree. You can insert this in the XML by editing it
(this is not possible in BEAUti yet) for example, like so:

<stateNode spec='beast.util.TreeParser' id='Tree.t:xyz'
IsLabelledNewick='true'>
<input name='newick'>
(chimp:0.009603178109055574,bonobo:0.009603178109055574):0.01049225186311567):0.013... rest of newick tree here
</input>
</stateNode>


It is a bit tricky, because you have to ensure that

- the id (here id='Tree.t:xyz') is the same as in your original file.

- the element name (here stateNode) should be the same as in the
original file.

- if there is an initaliser generated by BEAUti of the form
<init estimate="false" id="RandomTree.t:xxx" initial="@Tree.t:xxx"
spec="beast.evolution.tree.RandomTree" taxa="@xxx">
remove this element from the file, otherwise the tree will be Newick
tree will be overwritten by a random tree.

Cheers,

Remco

Gael Kergoat

unread,
Feb 20, 2013, 1:03:43 PM2/20/13
to beast...@googlegroups.com
Hi Remco, 


Thank you so much for the detailed answer!

That was just what I was looking for. 

Best


Gael. 

Lisa B

unread,
Nov 19, 2013, 6:18:20 PM11/19/13
to beast...@googlegroups.com
Hi,

I'm running BEAST v2.0.2 and I have a similar question about how to specify the starting tree in the xml file.  I followed the instructions Remco posted but I get the error below.  I'm not sure I understand correctly the instruction:  "the id (here id='Tree.t:xyz') is the same as in your original file."  If anyone has seen this error or knows where I'm going wrong, I'd appreciate the help.


Error 104 parsing the xml input file

IDs should be unique. Duplicate id 'Tree.t:tree' found

Error detected about here:
  <beast>
      <run id='mcmc' spec='MCMC'>
          <stateNode id='Tree.t:tree' spec='beast.util.TreeParser'>

Alexei Drummond

unread,
Nov 19, 2013, 8:13:27 PM11/19/13
to beast...@googlegroups.com
Dear Gael,

You will notice that the error says "IDs should be unique. Duplicate id 'Tree.t:tree' found".

You should only have id=<name> once in the XML for any particular name <name>. That is because the attribute "id" signifies the definition/creation of a new object, each of which should have a unique name. In this case the unique name is "Tree.t:tree". You can't create two objects with the same name. If you want to refer to an object again later in the XML you should refer to it with idref="Tree.t:tree" rather than id="Tree.t:tree".

Cheers
Alexei

--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at http://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/groups/opt_out.

Gael Kergoat

unread,
Nov 21, 2013, 5:17:45 AM11/21/13
to beast...@googlegroups.com
Thank you so much for the information!


Best


Gael. 


2013/11/20 Alexei Drummond <alexei....@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "beast-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beast-users/ZqddZhJpr9Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beast-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages