Script runs in Beast 2.4.5 but not 2.5.0

125 views
Skip to first unread message

Chrissen Gemmill

unread,
Jul 30, 2018, 11:13:29 PM7/30/18
to beast-users
Dear all, I am using a script to do multiple runs from different starting points. It works fine in Beast 2.4.5 (on my laptop and other machines) but refuses to run on our newish iMac using Beast 2.5.0. Any ideas on this? I am not technically savvy! Many many thanks for your help! 

This script works on my MacBook with 2.4.5
for((i=1; i<=6; i++)); do sed "s/crypto.log/crypto_$i.log/; s/crypto.trees/crypto$i.trees/" crypto.xml > crypto_"$i".xml; java -jar /Applications/BEAST\2.4.5/lib/beast.jar crypto_"$i".xml; done

I have been trying this script for an iMac using 2.5.0
for((i=1; i<=6; i++)); do sed "s/crypto.log/crypto_$i.log/; s/crypto.trees/crypto$i.trees/" crypto.xml > crypto_"$i".xml; java -jar /Applications/BEAST\2.5.0/lib/beast.jar crypto_"$i".xml; done 

Here is what Terminal says :

Last login: Tue Jul 31 15:04:38 on ttys000

fsen-pbrlimac-4:~ gemmill$ cd desktop

fsen-pbrlimac-4:desktop gemmill$ cd crypto

fsen-pbrlimac-4:crypto gemmill$ ls

crypto.nxs crypto.xml

fsen-pbrlimac-4:crypto gemmill$ for((i=1; i<=6; i++)); do sed "s/crypto.log/crypto_$i.log/; s/crypto.trees/crypto$i.trees/" crypto.xml > crypto_"$i".xml; java -jar /Applications/BEAST\2.5.0/lib/beast.jar crypto_"$i".xml; done

Error: Unable to access jarfile /Applications/BEAST2.5.0/lib/beast.jar

Error: Unable to access jarfile /Applications/BEAST2.5.0/lib/beast.jar

Error: Unable to access jarfile /Applications/BEAST2.5.0/lib/beast.jar

Error: Unable to access jarfile /Applications/BEAST2.5.0/lib/beast.jar

Error: Unable to access jarfile /Applications/BEAST2.5.0/lib/beast.jar

Error: Unable to access jarfile /Applications/BEAST2.5.0/lib/beast.jar

fsen-pbrlimac-4:crypto gemmill$ 


Here are my "instructions"

RUN BEAST2.4.5 VIA TERMINAL

·       Open Terminal and this document in Word (so you can copy and past)

·       In Terminal

o  Change the directory to desktop(cd=change directory), then change directory to folder PITTO. These two steps will look like this –– copy and paste the blue text or type it yourself

o   If you want to check that you are in the right place you can use lswhich will list all the files in the current directory[1].

 

              fsen-pbrlimac-2:~ PBRLgeneral$ cd desktop [hit return]

              fsen-pbrlimac-2:~ desktop PBRLgeneral$ cd PITTO [hit return]

 

You can then use the command lsto check that your .xml file is in this folder.

              fsen-pbrlimac-2:~ PITTO PBRLgeneral$ ls [hit return]

              àfsen-pbrlimac-2:~ PITTO PBRLgeneral$ PITTO.xml

 

Then copy and paste this script by Veronika Boskova[2]substitiuting your file name for PITTO (see examples below).

 

Pittosporumfile

for((i=1; i<=6; i++)); do sed "s/pitto.log/pitto_$i.log/; s/pitto.trees/pitto$i.trees/" pitto.xml > pitto_"$i".xml; java -jar /Applications/BEAST\ 2.5.0/lib/beast.jar pitto_"$i".xml; done

[hit return]

 

for((i=1; i<=6; i++)); do sed "s/pittos.log/pittos_$i.log/; s/pittos.trees/pittos$i.trees/" pittos.xml > pittos_"$i".xml; java -jar /Applications/BEAST\ 2.5.0/lib/beast.jar pittos_"$i".xml; done

 

Cryptocaryafile

for((i=1; i<=6; i++)); do sed "s/crypto.log/crypto_$i.log/; s/crypto.trees/crypto$i.trees/" crypto.xml > crypto_"$i".xml; java -jar /Applications/BEAST\2.5.0/lib/beast.jar crypto_"$i".xml; done

[hit return]

 

The file should be running now and will run five consecutive times, each starting with a new/different seed so that each search starts from a different point. There are a number of errors that can prevent the file from running, so you will need to trouble shoot a bit. Be sure that

·       Your .log and .tree file names in BEAUTi (and hence the .xml file) are the same as they are in the script

·       BEAST2 requires Java 8, and you will also need to have jdk1.8.0_121.jdk installed in your Library/Java/JavaVirtualMachines folder. Check for version updates as appropriate. 



[2]PhD Studnet, Department of Biosystems Science and Engineering,ETH Zürich

Remco Bouckaert

unread,
Jul 31, 2018, 1:00:38 AM7/31/18
to beast...@googlegroups.com
Hi Chrissen,

Short answer: add -Dbeast.load.jars=true before -jar. This should work if you run with Java 8.

Longer answer: With v2.5.0, the package loading has been changed — instead of discovering packages on the fly, it does this once and stores the class path in ~/.beast/2.5/beauti.properties. Each application launches a new java process with the class path stored  in the properties file, which should be faster than trying to discover all packages every time BEAST is started. As a consequence, when you start BEAST with 

java -jar beast.jar

the class path is not set, so packages will not be loaded, and this only works if you do not use any extra packages. To get the v2.4.x behaviour back, you can start with 

java -Dbeast.load.jars=true -jar beast.jar

and packages will be discovered dynamically. Note this only works with Java 8. With Java 9, jar loading has been changed considerably, so that is why v2.5.0 (which should work with Java 9) behaves differently than before.

Hope this helps,

Remco

-- 
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 https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Chrissen Gemmill

unread,
Jul 31, 2018, 4:01:59 AM7/31/18
to beast...@googlegroups.com
Thanks so very very much Remco! Will try it tomorrow and let you know! 

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-users@googlegroups.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/lLlY2Ql2g8M/unsubscribe.
To unsubscribe from this group and all its topics, 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.



--
ngā mihi,
Chrissen


Dr. Chrissen E. C. Gemmill
CuratorTe Pā Whakahaumia o Te Whare Wānanga o Waikato


Te Kura Putaiao
Te Mātauranga Pūtaiao me te Pūkaha
Te Whare Wānanga o Waikato,
Private Bag 3105, Hamilton
Aotearoa

School of Science
Faculty of Science and Engineering
University of Waikato
Private Bag 3105, Hamilton
New Zealand



Chrissen Gemmill

unread,
Aug 1, 2018, 5:04:05 PM8/1/18
to beast...@googlegroups.com
Kia ora Remco,
yes working a charm! thank you so very very much! 

In the future with new versions, is there a way to know how to revise the script? 

On Tue, Jul 31, 2018 at 5:00 PM, Remco Bouckaert <higg...@gmail.com> wrote:
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-users@googlegroups.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/lLlY2Ql2g8M/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Remco Bouckaert

unread,
Aug 2, 2018, 7:56:43 PM8/2/18
to beast...@googlegroups.com
Hi Chrissen,

Good to hear it works now. It is a bit hard to predict which scripts people use. The release comes with its own scripts, which are of course updated if changes are required. Changes are notified with each release on the beast2.org site.

I don’t expect much change any time soon on the use of beast.jar, other than the one we just went through.

Cheers,

Remco

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

Chrissen Gemmill

unread,
Aug 26, 2018, 7:09:00 PM8/26/18
to beast-users
Hi there, I am trying the script below on this larger file (crypto.xml attached). And for this I have 1.2 GB of combined trees so I think something has gone very wrong. Please could you look at the xml and see what I have done wrong? I have never seen this before and wonder if it has to do with Beast2.5? Even my combined log file is large (33MB)? I am using an iMac running 10.12.6 with 8GB memory (ouch!). Many thanks! 

for((i=1; i<=6; i++)); do sed "s/crypto.log/crypto_$i.log/; s/crypto.trees/crypto$i.trees/" crypto.xml > crypto_"$i".xml; java -Dbeast.load.jars=true -jar /Applications/BEAST\ 2.5.0/lib/beast.jar crypto_"$i".xml; done

Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.antlr.v4.runtime.Parser.createTerminalNode(Parser.java:601)
at org.antlr.v4.runtime.Parser.consume(Parser.java:584)
at org.antlr.v4.runtime.Parser.match(Parser.java:203)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.node(Unknown Source)
at beast.util.treeparser.NewickParser.tree(Unknown Source)
at beast.util.TreeParser.parseNewick(Unknown Source)
at beast.util.TreeParser.initAndValidate(Unknown Source)
at beast.util.TreeParser.<init>(Unknown Source)
at beast.app.treeannotator.TreeAnnotator$MemoryFriendlyTreeSet.next(Unknown Source)
at beast.app.treeannotator.TreeAnnotator.<init>(Unknown Source)
at beast.app.treeannotator.TreeAnnotator.main(Unknown Source)
crypto.xml

Remco Bouckaert

unread,
Aug 27, 2018, 5:10:39 PM8/27/18
to beast...@googlegroups.com
Hi Chrissen,

The chain length is set to 10 000 000, and the log frequency is set to 1000, so the logs will contains 10 001 entries (1 extra at sample 0). To obtain smaller log files, you can reduce the log frequency, since you are running with 6 chains and combine the logs, it will be sufficient to log every 5000 samples. Changing the logEvery attribute on the trace and tree logs will do that.

Cheers,

Remco

--
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 https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.
<crypto.xml>

Chrissen Gemmill

unread,
Aug 27, 2018, 5:16:33 PM8/27/18
to beast...@googlegroups.com
DOH!!!!!! Thank you!!!! I didn't think about that! But you are right, I would use 5000 if I was doing 50million in one go! 

Do you think this approach is valid/good? I thought starting from different search points might help with the "coverage" in the search.

I am still having difficulty getting my head around the parameters and priors to use so have been using the defaults for the Yule (I thought this the best for this type of data). Is there something basic I can read to help me understand the various choices and distributions? I should go back the the BEAST book, but I found that a bit difficult. I need distributions and priors for real dummies! Maybe time to sit in on a stats course.

thank you so very much for your time!!!!

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

--
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/lLlY2Ql2g8M/unsubscribe.
To unsubscribe from this group and all its topics, 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.
Reply all
Reply to author
Forward
0 new messages