Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tools/beast2/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: beast2
owner: iuc
categories:
- Phylogenetics
description: "BEAST 2: Bayesian Evolutionary Analysis Sampling Trees"
long_description: BEAST 2 is a software platform for Bayesian evolutionary analysis of molecular sequences using MCMC. It is designed for phylogenetic inference, divergence time estimation, and testing evolutionary hypotheses based on genetic data.
homepage_url: https://www.beast2.org/
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/main/tools/beast2
type: unrestricted
suite:
name: "suite_beast2"
description: "A suite of tools for BEAST 2 in Galaxy"
type: repository_suite_definition
auto_tool_repositories:
name_template: "{{ tool_id }}"
description_template: "Wrapper for the BEAST 2 tool suite: {{ tool_name }}"
98 changes: 98 additions & 0 deletions tools/beast2/logcombiner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<tool id="beast2_logcombiner" name="BEAST2 LogCombiner" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
<description>Combine multiple trace or tree log files into a single log file</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements" />
<command detect_errors="exit_code"><![CDATA[
logcombiner
#for $log_file in $log
-log '$log_file'
#end for
-b $burnin
#if $resample
-resample $resample
#end if
#if $decimal
-decimal
#end if
#if $renumber
-renumber
#end if
-o '$output'
]]></command>
<inputs>
<param argument="-log" type="data" format="beast.trees,tabular" multiple="true" label="Log files" help="Select one or more log files to combine (trace or tree logs)" />
<param name="burnin" type="integer" value="10" min="0" max="100" label="Burnin percentage" help="Percentage of lines in the log file considered to be burnin" />
<param argument="-resample" type="integer" optional="true" label="Resample states" help="Specify number of states to resample" />
<param argument="-decimal" type="boolean" checked="false" truevalue="-decimal" falsevalue="" label="Convert to decimal format" help="Convert numbers from scientific notation to decimal format" />
<param argument="-renumber" type="boolean" checked="false" truevalue="-renumber" falsevalue="" label="Renumber output states" help="Renumber the states in the output file" />
</inputs>
<outputs>
<data name="output" format="tabular" label="${tool.name} on ${on_string}: Combined log"/>
</outputs>

<tests>
<!-- Test 1: Basic options -->
<test expect_num_outputs="1">
<param name="log" value="log1.log,log2.log,log3.log"/>
<output name="output" file="test1_logcombiner.log"/>
</test>
<!-- Test 2: Custom burnin percentage -->
<test expect_num_outputs="1">
<param name="log" value="log1.log,log2.log"/>
<param name="burnin" value="20" />
<output name="output" file="test2_logcombiner.log"/>
</test>
<!-- Test 3: Combine tree logs -->
<test expect_num_outputs="1">
<param name="log" value="trees1.trees,trees2.trees,trees3.trees"/>
<output name="output" file="test3_logcombiner.log"/>
</test>
<!-- Test 4: Resample States -->
<test expect_num_outputs="1">
<param name="log" value="log1.log,log2.log,log3.log"/>
<param name="resample" value="10" />
<output name="output" file="test4_logcombiner.log"/>
</test>
<!-- Test 5: Scientific to decimal conversion -->
<test expect_num_outputs="1">
<param name="log" value="trace_scientific.log"/>
<param name="decimal" value="true" />
<output name="output" file="test5_logcombiner.log"/>
</test>
<!-- Test 6: Combined Options -->
<test expect_num_outputs="1">
<param name="log" value="trace_scientific.log"/>
<param name="burnin" value="10" />
<param name="resample" value="8" />
<param name="decimal" value="true" />
<param name="renumber" value="true" />
<output name="output" file="test6_logcombiner.log"/>
</test>
</tests>

<help><![CDATA[
**What it does**

LogCombiner is a tool from the BEAST2 suite that combines multiple trace or tree log files into a single log file.

This is useful when you have run multiple independent MCMC chains and want to combine them for analysis.

**Inputs**

- **Log files**: One or more log files (trace or tree logs) to combine
- **Burnin percentage**: Percentage of lines to discard from the beginning of each log file (default: 10%)
- **Resample states** : Number of states to resample from the combined logs
- **Convert to decimal**: Convert scientific notation to decimal format
- **Renumber states**: Renumber the states in the output sequentially

**Output**

A single combined log file containing the merged data from all input files (after burnin removal).

]]></help>
<citations>
<citation type="doi">10.1371/journal.pcbi.1006650</citation>
</citations>
</tool>
29 changes: 29 additions & 0 deletions tools/beast2/macros.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<macros>
<token name="@TOOL_VERSION@">2.6.3</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@PROFILE@">25.0</token>
<xrefs>
<xref type="bio.tools">beast2</xref>
</xrefs>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">beast2</requirement>
</requirements>
</xml>
<xml name="xrefs">
<xrefs>
<xref type="bio.tools">beast2</xref>
</xrefs>
</xml>
<xml name="citations">
<citations>
<citation type="doi">10.1371/journal.pcbi.1003537</citation>
</citations>
</xml>
<xml name="creator">
<creator>
<person givenName="Saim" familyName="Momin" url="https://github.com/SaimMomin12"/>
<organization name="Galaxy Europe"/>
</creator>
</xml>
</macros>
11 changes: 11 additions & 0 deletions tools/beast2/test-data/input.trees
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#NEXUS
begin trees;
translate
1 taxonA,
2 taxonB,
3 taxonC,
4 taxonD;
tree STATE_0 = [&R] ((1:0.1,2:0.1):0.2,(3:0.15,4:0.15):0.25):0.1;
tree STATE_1 = [&R] ((1:0.12,2:0.12):0.18,(3:0.14,4:0.14):0.27):0.11;
tree STATE_2 = [&R] ((1:0.09,2:0.09):0.22,(3:0.16,4:0.16):0.24):0.09;
end
21 changes: 21 additions & 0 deletions tools/beast2/test-data/log1.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Sample posterior likelihood prior TreeHeight kappa alpha
0 -1234.56 -1000.12 -234.44 5.67 2.34 0.89
1000 -1230.45 -995.23 -235.22 5.65 2.36 0.91
2000 -1228.34 -992.11 -236.23 5.63 2.38 0.90
3000 -1225.67 -990.34 -235.33 5.61 2.35 0.92
4000 -1223.45 -988.56 -234.89 5.59 2.37 0.89
5000 -1221.23 -986.78 -234.45 5.57 2.39 0.91
6000 -1219.12 -985.01 -234.11 5.55 2.36 0.90
7000 -1217.89 -983.45 -234.44 5.53 2.38 0.92
8000 -1216.34 -982.12 -234.22 5.51 2.35 0.88
9000 -1215.23 -981.00 -234.23 5.49 2.37 0.91
10000 -1214.56 -980.34 -234.22 5.48 2.36 0.90
11000 -1213.45 -979.23 -234.22 5.47 2.38 0.89
12000 -1212.67 -978.45 -234.22 5.46 2.35 0.92
13000 -1211.89 -977.67 -234.22 5.45 2.37 0.91
14000 -1211.23 -977.01 -234.22 5.44 2.36 0.90
15000 -1210.67 -976.45 -234.22 5.43 2.38 0.89
16000 -1210.12 -975.90 -234.22 5.42 2.35 0.91
17000 -1209.67 -975.45 -234.22 5.41 2.37 0.90
18000 -1209.23 -975.01 -234.22 5.40 2.36 0.92
19000 -1208.89 -974.67 -234.22 5.39 2.38 0.89
21 changes: 21 additions & 0 deletions tools/beast2/test-data/log2.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Sample posterior likelihood prior TreeHeight kappa alpha
0 -1235.67 -1001.23 -234.44 5.68 2.33 0.88
1000 -1231.23 -996.01 -235.22 5.66 2.35 0.90
2000 -1229.12 -993.67 -235.45 5.64 2.37 0.89
3000 -1226.45 -991.23 -235.22 5.62 2.36 0.91
4000 -1224.23 -989.45 -234.78 5.60 2.38 0.90
5000 -1222.01 -987.67 -234.34 5.58 2.35 0.92
6000 -1220.23 -986.01 -234.22 5.56 2.37 0.89
7000 -1218.67 -984.45 -234.22 5.54 2.36 0.91
8000 -1217.12 -983.12 -234.00 5.52 2.38 0.90
9000 -1216.01 -982.01 -234.00 5.50 2.35 0.92
10000 -1215.34 -981.34 -234.00 5.49 2.37 0.89
11000 -1214.23 -980.23 -234.00 5.48 2.36 0.91
12000 -1213.45 -979.45 -234.00 5.47 2.38 0.90
13000 -1212.67 -978.67 -234.00 5.46 2.35 0.92
14000 -1212.01 -978.01 -234.00 5.45 2.37 0.89
15000 -1211.45 -977.45 -234.00 5.44 2.36 0.91
16000 -1210.90 -976.90 -234.00 5.43 2.38 0.90
17000 -1210.45 -976.45 -234.00 5.42 2.35 0.92
18000 -1210.01 -976.01 -234.00 5.41 2.37 0.89
19000 -1209.67 -975.67 -234.00 5.40 2.36 0.91
21 changes: 21 additions & 0 deletions tools/beast2/test-data/log3.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Sample posterior likelihood prior TreeHeight kappa alpha
0 -1236.78 -1002.34 -234.44 5.69 2.32 0.87
1000 -1232.34 -997.12 -235.22 5.67 2.34 0.89
2000 -1230.23 -994.78 -235.45 5.65 2.36 0.88
3000 -1227.56 -992.34 -235.22 5.63 2.35 0.90
4000 -1225.34 -990.56 -234.78 5.61 2.37 0.89
5000 -1223.12 -988.78 -234.34 5.59 2.34 0.91
6000 -1221.34 -987.12 -234.22 5.57 2.36 0.88
7000 -1219.78 -985.56 -234.22 5.55 2.35 0.90
8000 -1218.23 -984.23 -234.00 5.53 2.37 0.89
9000 -1217.12 -983.12 -234.00 5.51 2.34 0.91
10000 -1216.45 -982.45 -234.00 5.50 2.36 0.88
11000 -1215.34 -981.34 -234.00 5.49 2.35 0.90
12000 -1214.56 -980.56 -234.00 5.48 2.37 0.89
13000 -1213.78 -979.78 -234.00 5.47 2.34 0.91
14000 -1213.12 -979.12 -234.00 5.46 2.36 0.88
15000 -1212.56 -978.56 -234.00 5.45 2.35 0.90
16000 -1212.01 -978.01 -234.00 5.44 2.37 0.89
17000 -1211.56 -977.56 -234.00 5.43 2.34 0.91
18000 -1211.12 -977.12 -234.00 5.42 2.36 0.88
19000 -1210.78 -976.78 -234.00 5.41 2.35 0.90
20 changes: 20 additions & 0 deletions tools/beast2/test-data/output.trees
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#NEXUS

Begin taxa;
Dimensions ntax=4;
Taxlabels
taxonA
taxonB
taxonC
taxonD
;
End;
Begin trees;
Translate
1 taxonA,
2 taxonB,
3 taxonC,
4 taxonD
;
tree TREE1 = ((1[&CAheight_95%_HPD={0.08999999999999997,0.11000000000000004},CAheight_mean=0.09999999999999999,CAheight_median=0.09999999999999998,CAheight_range={0.08999999999999997,0.11000000000000004},height=0.09999999999999999,height_95%_HPD={0.08999999999999997,0.11000000000000004},height_median=0.09999999999999998,height_range={0.08999999999999997,0.11000000000000004},length=0.10333333333333333,length_95%_HPD={0.09000000000000002,0.12},length_median=0.09999999999999998,length_range={0.09000000000000002,0.12}]:0.10333333333333335,2[&CAheight_95%_HPD={0.08999999999999997,0.11000000000000004},CAheight_mean=0.09999999999999999,CAheight_median=0.09999999999999998,CAheight_range={0.08999999999999997,0.11000000000000004},height=0.09999999999999999,height_95%_HPD={0.08999999999999997,0.11000000000000004},height_median=0.09999999999999998,height_range={0.08999999999999997,0.11000000000000004},length=0.10333333333333333,length_95%_HPD={0.09000000000000002,0.12},length_median=0.09999999999999998,length_range={0.09000000000000002,0.12}]:0.10333333333333335)[&CAheight_95%_HPD={0.18,0.23000000000000004},CAheight_mean=0.20333333333333334,CAheight_median=0.19999999999999996,CAheight_range={0.18,0.23000000000000004},height=0.20333333333333334,height_95%_HPD={0.18,0.23000000000000004},height_median=0.19999999999999996,height_range={0.18,0.23000000000000004},length=0.20000000000000004,length_95%_HPD={0.18,0.22000000000000003},length_median=0.20000000000000007,length_range={0.18,0.22000000000000003},posterior=1.0]:0.19999999999999998,(3[&height=0.0,length=0.15000000000000002,length_95%_HPD={0.14,0.16000000000000003},length_median=0.15000000000000002,length_range={0.14,0.16000000000000003}]:0.15000000000000002,4[&height=0.0,length=0.15000000000000002,length_95%_HPD={0.14,0.16000000000000003},length_median=0.15000000000000002,length_range={0.14,0.16000000000000003}]:0.15000000000000002)[&CAheight_95%_HPD={0.14,0.16000000000000003},CAheight_mean=0.15000000000000002,CAheight_median=0.15000000000000002,CAheight_range={0.14,0.16000000000000003},height=0.15000000000000002,height_95%_HPD={0.14,0.16000000000000003},height_median=0.15000000000000002,height_range={0.14,0.16000000000000003},length=0.25333333333333335,length_95%_HPD={0.24,0.27},length_median=0.25,length_range={0.24,0.27},posterior=1.0]:0.2533333333333333)[&CAheight_95%_HPD={0.4,0.41000000000000003},CAheight_mean=0.4033333333333333,CAheight_median=0.4,CAheight_range={0.4,0.41000000000000003},height=0.4033333333333333,height_95%_HPD={0.4,0.41000000000000003},height_median=0.4,height_range={0.4,0.41000000000000003},length=0.0,posterior=1.0]:0.0;
End;
20 changes: 20 additions & 0 deletions tools/beast2/test-data/output_burnout.trees
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#NEXUS

Begin taxa;
Dimensions ntax=4;
Taxlabels
taxonA
taxonB
taxonC
taxonD
;
End;
Begin trees;
Translate
1 taxonA,
2 taxonB,
3 taxonC,
4 taxonD
;
tree TREE1 = ((1[&height=0.09999999999999999,height_95%_HPD={0.08999999999999997,0.11000000000000004},height_median=0.09999999999999998,height_range={0.08999999999999997,0.11000000000000004},length=0.10333333333333333,length_95%_HPD={0.09000000000000002,0.12},length_median=0.09999999999999998,length_range={0.09000000000000002,0.12}]:0.09999999999999998,2[&height=0.09999999999999999,height_95%_HPD={0.08999999999999997,0.11000000000000004},height_median=0.09999999999999998,height_range={0.08999999999999997,0.11000000000000004},length=0.10333333333333333,length_95%_HPD={0.09000000000000002,0.12},length_median=0.09999999999999998,length_range={0.09000000000000002,0.12}]:0.09999999999999998)[&height=0.20333333333333334,height_95%_HPD={0.18,0.23000000000000004},height_median=0.19999999999999996,height_range={0.18,0.23000000000000004},length=0.20000000000000004,length_95%_HPD={0.18,0.22000000000000003},length_median=0.20000000000000007,length_range={0.18,0.22000000000000003},posterior=1.0]:0.20000000000000007,(3[&height=0.0,length=0.15000000000000002,length_95%_HPD={0.14,0.16000000000000003},length_median=0.15000000000000002,length_range={0.14,0.16000000000000003}]:0.15000000000000002,4[&height=0.0,length=0.15000000000000002,length_95%_HPD={0.14,0.16000000000000003},length_median=0.15000000000000002,length_range={0.14,0.16000000000000003}]:0.15000000000000002)[&height=0.15000000000000002,height_95%_HPD={0.14,0.16000000000000003},height_median=0.15000000000000002,height_range={0.14,0.16000000000000003},length=0.25333333333333335,length_95%_HPD={0.24,0.27},length_median=0.25,length_range={0.24,0.27},posterior=1.0]:0.25)[&height=0.4033333333333333,height_95%_HPD={0.4,0.41000000000000003},height_median=0.4,height_range={0.4,0.41000000000000003},length=0.0,posterior=1.0]:0.0;
End;
20 changes: 20 additions & 0 deletions tools/beast2/test-data/output_hpd.trees
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#NEXUS

Begin taxa;
Dimensions ntax=4;
Taxlabels
taxonA
taxonB
taxonC
taxonD
;
End;
Begin trees;
Translate
1 taxonA,
2 taxonB,
3 taxonC,
4 taxonD
;
tree TREE1 = ((1[&CAheight_95%_HPD={0.08999999999999997,0.11000000000000004},CAheight_mean=0.09999999999999999,CAheight_median=0.09999999999999998,CAheight_range={0.08999999999999997,0.11000000000000004},height=0.09999999999999999,height_95%_HPD={0.08999999999999997,0.11000000000000004},height_median=0.09999999999999998,height_range={0.08999999999999997,0.11000000000000004},length=0.10333333333333333,length_95%_HPD={0.09000000000000002,0.12},length_median=0.09999999999999998,length_range={0.09000000000000002,0.12}]:0.10333333333333335,2[&CAheight_95%_HPD={0.08999999999999997,0.11000000000000004},CAheight_mean=0.09999999999999999,CAheight_median=0.09999999999999998,CAheight_range={0.08999999999999997,0.11000000000000004},height=0.09999999999999999,height_95%_HPD={0.08999999999999997,0.11000000000000004},height_median=0.09999999999999998,height_range={0.08999999999999997,0.11000000000000004},length=0.10333333333333333,length_95%_HPD={0.09000000000000002,0.12},length_median=0.09999999999999998,length_range={0.09000000000000002,0.12}]:0.10333333333333335)[&CAheight_95%_HPD={0.18,0.23000000000000004},CAheight_mean=0.20333333333333334,CAheight_median=0.19999999999999996,CAheight_range={0.18,0.23000000000000004},height=0.20333333333333334,height_95%_HPD={0.18,0.23000000000000004},height_median=0.19999999999999996,height_range={0.18,0.23000000000000004},length=0.20000000000000004,length_95%_HPD={0.18,0.22000000000000003},length_median=0.20000000000000007,length_range={0.18,0.22000000000000003},posterior=1.0]:0.19999999999999998,(3[&height=0.0,length=0.15000000000000002,length_95%_HPD={0.14,0.16000000000000003},length_median=0.15000000000000002,length_range={0.14,0.16000000000000003}]:0.15000000000000002,4[&height=0.0,length=0.15000000000000002,length_95%_HPD={0.14,0.16000000000000003},length_median=0.15000000000000002,length_range={0.14,0.16000000000000003}]:0.15000000000000002)[&CAheight_95%_HPD={0.14,0.16000000000000003},CAheight_mean=0.15000000000000002,CAheight_median=0.15000000000000002,CAheight_range={0.14,0.16000000000000003},height=0.15000000000000002,height_95%_HPD={0.14,0.16000000000000003},height_median=0.15000000000000002,height_range={0.14,0.16000000000000003},length=0.25333333333333335,length_95%_HPD={0.24,0.27},length_median=0.25,length_range={0.24,0.27},posterior=1.0]:0.2533333333333333)[&CAheight_95%_HPD={0.4,0.41000000000000003},CAheight_mean=0.4033333333333333,CAheight_median=0.4,CAheight_range={0.4,0.41000000000000003},height=0.4033333333333333,height_95%_HPD={0.4,0.41000000000000003},height_median=0.4,height_range={0.4,0.41000000000000003},length=0.0,posterior=1.0]:0.0;
End;
Loading
Loading