Templates with BEAUti in BEAST 2

658 views
Skip to first unread message

François Michonneau

unread,
Sep 24, 2013, 4:09:40 PM9/24/13
to beast...@googlegroups.com

Hello all,

  Could someone provide me with an example that would demonstrate how to use templates with BEAUti (in BEAST 2)?

  I managed to do: ./beauti -nex mynexusfile.nex -template Standard.xml -out mybeastfile.xml -exitaction writexml

  (where Standard.xml is the file provided with BEAST in templates/)

  However, this file generated doesn't include the specification of the substitution models (which seem to be provided in the SubstModels.xml template). I suspect that both templates need to be specified but I haven't figured out how to do it.

  Furthermore, I'd like to link some of the partition for tree estimation (my mitchondrial markers) but use different clocks/substitution models for my different partitions, and looking at the XML from the template, I'm not sure what to modify to achieve this goal.

  Thank you,
  -- François

pepster

unread,
Sep 25, 2013, 3:48:01 PM9/25/13
to beast...@googlegroups.com
I think your best bet at the moment is to use the GUI. Is there any reason why this is not possible in your case?

-Joseph

 

  Thank you,
  -- François

François Michonneau

unread,
Sep 25, 2013, 5:28:35 PM9/25/13
to beast...@googlegroups.com

Hi Joseph,

  I have a dozen of alignments that I would like to analyze with the same parameters and was hoping I could automate the process to avoid mistakes.

  Thank you,
  -- François


--
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.

Alexei Drummond

unread,
Sep 25, 2013, 6:06:25 PM9/25/13
to beast...@googlegroups.com
Dear François,

I am well advised by our resident BEAST2 template expert (Remco Bouckaert) that you may have luck with the following:

Step 1: create an XML file for an analysis with 1 alignment with all
settings, subst models, site models etc. just the way you want to.

Step 2: edit the XML as follows: remove the alignment and replace any
reference to the alignment with <data idref="data"/> -- e.g. in the
treelikelihood and RandomTree. See templates/Standard.xml for example.
Let's call this file mytemplate.xml.

Step 3: for alignment k in nexus file alignment_k.nex run the following command
./beauti -nex alignment_k.nex -template mytemplate.xml -out
mybeastfile_k.xml -exitaction writexml

This is not very well tested, so it might run into problems. We would be happy to hear how you go so we can help out if you run into problems.

Cheers
Alexei

François Michonneau

unread,
Sep 25, 2013, 10:12:19 PM9/25/13
to beast...@googlegroups.com

Thank you! I'll give it a try and keep you posted.

  Cheers,
  -- François

Katie

unread,
Nov 16, 2016, 5:23:58 PM11/16/16
to beast-users
Hi, I just wanted to follow up on this thread. I am interested in fitting the same model and priors on several different alignments. To properly edit the XML, do I replace all instances of the alignment name with $(n)--as it appears in the Standard.xml ?

For example, if my alignment is called samps_Chromosome_sub0_dates1 :
        <parameter id="kappa.s:samps_Chromosome_sub0_dates1" lower="0.0" name="stateNode">2.0</parameter>
        <parameter id="ucldMean.c:samps_Chromosome_sub0_dates1" name="stateNode">1.0E-6</parameter>
 Replace with 
        <parameter id="kappa.s:$(n)" lower="0.0" name="stateNode">2.0</parameter>
        <parameter id="ucldMean.c:$(n)" name="stateNode">1.0E-6</parameter>

Thank you for your help!

Remco Bouckaert

unread,
Nov 21, 2016, 12:47:03 PM11/21/16
to beast...@googlegroups.com
Hi Katie,

The reason the $(n) bits appear in the BEAUti templates is to distinguish different partitions, so if you load multiple alignments there won’t be any name clashes.

If you only want to load a single alignment there is no need to replace the partition name by $(n), but if you do the $(n) will be replaced by the name of the alignment.

Cheers,
Remco

Katharine Walter

unread,
Jan 24, 2017, 1:36:51 PM1/24/17
to beast...@googlegroups.com
Dear Remco--
Thank you so much for your help! I am still having trouble using a template to generate multiple XML files with the same prior settings.

I have a predefined XML file and have deleted the pre-existing alignment. I am confused by Step 2 above--I am not sure what Alexei means by: 
replace any reference to the alignment with <data idref="data"/> -- 

I tried used the command as specified above: ./beauti -template sampsTick_Chromosome_sub0_relSky.xml -nex ~/mapping/Bb/vars/gubbins/sampsTick_sub0.fa -out test.xml

I receive the following error:
The element type "data" must be terminated by the matching end-tag "</data>".

I have attached the XML file I am trying to modify. My replacement FASTA has the same sample names and just represents a different subset of an alignment (I am subsetting my alignment to speed computational time). Please let me know what you think and how I might be able to fix my XML. Thank you!

Best,



To unsubscribe from this group and stop receiving emails from it, send an email to beast-users+unsubscribe@googlegroups.com.

To post to this group, send email to beast...@googlegroups.com.
Visit this group at https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

--
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/2_2gUG7uzYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beast-users+unsubscribe@googlegroups.com.
sampsTick_Chromosome_sub0_relSky.xml
Reply all
Reply to author
Forward
0 new messages