Re: Combining .t files in LogCombiner

1,645 views
Skip to first unread message

Andrew Rambaut

unread,
Mar 29, 2013, 6:10:10 AM3/29/13
to beast...@googlegroups.com
LogCombiner was written for BEAST files. I have never tested it with mrbayes trees but if you want to add it as a feature request, I might be able to take a look. In the mean time, you may be able to do this manually by using a text editor? You would need to remove the burnin from each set manually as well.

Andrew


On 26 Mar 2013, at 03:11, penelop...@uqconnect.edu.au wrote:

Dear beast-users,

I am trying to combine .t files in LogCombiner v1.7.4 so I can run the combined file in TreeAnnotator v1.7.4 to generate the MCC tree. Even when I use other LogCombiner versions I get this error message:
Exception: 0
java.lang.ArrayIndexOutOfBoundsException: 0
    at dr.app.tools.LogCombiner.<init>(Unknown Source)
    at dr.app.tools.LogCombiner.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at apple.launcher.LaunchRunner.run(LaunchRunner.java:116)
    at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
    at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)

However, when I run either modified file (run1.t or run2.t) through TreeAnnotator v1.7.4 the program successfully generate the MCC tree (for each run separately). Any help with this matter would be appreciated.

Sincerely,
Penny Mills

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rupert Collins

unread,
Mar 29, 2013, 1:07:41 PM3/29/13
to beast...@googlegroups.com
Penny,

I encountered the same issue too. You can, as Andrew says, just copy and paste using a text editor. However, if you don't have a fancy machine, the text editors can become quite unresponsive when dealing with tree files of hundreds, or even sometimes tens of megabytes.

If you have access to a Unix machine (i.e. Mac or Linux), an alternative approach is using a shell script command in the terminal. This is what I did below. It does basically the same thing as LogCombiner.

Couple of things to bear in mind: 1) I don't know if the options for the commands are the same for Mac as Linux, but they should be very similar, if not the same; 2) this script does not deal with burnin, but you can set the burnin afterwards using TreeAnnotator (remember you now have double the trees, so you need double the burnin).

Hope this helps,

Rupert


#!/bin/bash
#change working directory
cd /file/path/to
#gets the taxon block from one of the files (in this case the first one) and makes a new tree file called "combined.t"
grep -v -e "tree rep" -e "end;" run1.t > combined.t
#searches for the trees using the term "tree rep" in both tree files and dumps them into alternate lines in the combined file
paste -d"\n" <(grep "tree rep" run1.t) <(grep "tree rep" run2.t) >> combined.t
#adds the closing nexus code
echo "end;" >> combined.t

Ricardo García-Sandoval

unread,
Nov 16, 2016, 7:49:35 AM11/16/16
to beast-users
Hi Rupert

Great solution! 

I just changes "tee rep" for "tree gen" and worked perfectly 

Thank you very much for such simple and great solution

very best

Ricardo

irene...@naturalis.nl

unread,
Apr 26, 2017, 1:46:29 AM4/26/17
to beast-users
Hi, can you please tell me where I can find the  burn in to be removed manually in text editor file?
thanks a lot

Op vrijdag 29 maart 2013 11:10:10 UTC+1 schreef rambaut:
Reply all
Reply to author
Forward
0 new messages