From 476e6710f0f1e7e46191a412f1b893907535d0c0 Mon Sep 17 00:00:00 2001 From: alexeid Date: Wed, 1 Apr 2026 15:50:16 +1300 Subject: [PATCH 1/7] Restructure source tree to Maven standard layout Move src/ccd/ to src/main/java/ccd/ and src/test/ccd/ to src/test/java/ccd/ in preparation for beast3 migration. --- src/{ => main/java}/ccd/algorithms/BitSetUtil.java | 0 src/{ => main/java}/ccd/algorithms/CCDCombiner.java | 0 src/{ => main/java}/ccd/algorithms/GreedyMRCTree.java | 0 src/{ => main/java}/ccd/algorithms/RogueDetection.java | 0 src/{ => main/java}/ccd/algorithms/TreeDistances.java | 0 .../algorithms/credibleSets/CladeBasedCredibleCCDComputer.java | 0 .../credibleSets/CladeProbabilityCredibleCCDConstructor.java | 0 .../java}/ccd/algorithms/credibleSets/CredibleCCDComputer.java | 0 .../java}/ccd/algorithms/credibleSets/CredibleSetType.java | 0 src/{ => main/java}/ccd/algorithms/credibleSets/ICredibleSet.java | 0 .../credibleSets/PartitionProbabilityCredibleCCDComputer.java | 0 .../credibleSets/ProbabilityBasedCredibleSetComputer.java | 0 .../java}/ccd/algorithms/regularisation/CCD1Regularisor.java | 0 .../java}/ccd/algorithms/regularisation/CCDExpansion.java | 0 .../ccd/algorithms/regularisation/CCDRegularisationStrategy.java | 0 .../ccd/algorithms/regularisation/RegCCDParameterOptimiser.java | 0 src/{ => main/java}/ccd/model/AbstractCCD.java | 0 src/{ => main/java}/ccd/model/AttachingFilteredCCD.java | 0 src/{ => main/java}/ccd/model/CCD0.java | 0 src/{ => main/java}/ccd/model/CCD1.java | 0 src/{ => main/java}/ccd/model/CCD2.java | 0 src/{ => main/java}/ccd/model/CCDType.java | 0 src/{ => main/java}/ccd/model/Clade.java | 0 src/{ => main/java}/ccd/model/CladePartition.java | 0 src/{ => main/java}/ccd/model/ExtendedClade.java | 0 src/{ => main/java}/ccd/model/FilteredCCD.java | 0 src/{ => main/java}/ccd/model/FilteredTree.java | 0 src/{ => main/java}/ccd/model/HeightSettingStrategy.java | 0 src/{ => main/java}/ccd/model/ITreeDistribution.java | 0 src/{ => main/java}/ccd/model/OptRegCCD.java | 0 src/{ => main/java}/ccd/model/RegCCD.java | 0 src/{ => main/java}/ccd/model/SampleDistribution.java | 0 src/{ => main/java}/ccd/model/SamplingStrategy.java | 0 src/{ => main/java}/ccd/model/UnderflowException.java | 0 src/{ => main/java}/ccd/model/WrappedBeastTree.java | 0 src/{ => main/java}/ccd/model/bitsets/BitSet.java | 0 src/{ => main/java}/ccd/model/bitsets/BitSet128.java | 0 src/{ => main/java}/ccd/model/bitsets/BitSet192.java | 0 src/{ => main/java}/ccd/model/bitsets/BitSet256.java | 0 src/{ => main/java}/ccd/model/bitsets/BitSet64.java | 0 src/{ => main/java}/ccd/tools/CCD0ApproxPointEstimate.java | 0 src/{ => main/java}/ccd/tools/CCD0PointEstimate.java | 0 src/{ => main/java}/ccd/tools/CCD1PointEstimate.java | 0 src/{ => main/java}/ccd/tools/CCD2PointEstimate.java | 0 src/{ => main/java}/ccd/tools/CCDSampler.java | 0 src/{ => main/java}/ccd/tools/CCDSelectionPointEstimate.java | 0 src/{ => main/java}/ccd/tools/CCDToolUtil.java | 0 src/{ => main/java}/ccd/tools/DissonanceCalculator.java | 0 src/{ => main/java}/ccd/tools/EntropyCalculator.java | 0 src/{ => main/java}/ccd/tools/HIPSTR.java | 0 src/{ => main/java}/ccd/tools/PointEstimate.java | 0 src/{ => main/java}/ccd/tools/RogueAnalysis.java | 0 src/{ => main/java}/ccd/tools/SkeletonAnalysis.java | 0 src/{ => main/java}/ccd/tools/TreeCredibleLevel.java | 0 src/test/{ => java}/ccd/model/CCDCoreTest.java | 0 55 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => main/java}/ccd/algorithms/BitSetUtil.java (100%) rename src/{ => main/java}/ccd/algorithms/CCDCombiner.java (100%) rename src/{ => main/java}/ccd/algorithms/GreedyMRCTree.java (100%) rename src/{ => main/java}/ccd/algorithms/RogueDetection.java (100%) rename src/{ => main/java}/ccd/algorithms/TreeDistances.java (100%) rename src/{ => main/java}/ccd/algorithms/credibleSets/CladeBasedCredibleCCDComputer.java (100%) rename src/{ => main/java}/ccd/algorithms/credibleSets/CladeProbabilityCredibleCCDConstructor.java (100%) rename src/{ => main/java}/ccd/algorithms/credibleSets/CredibleCCDComputer.java (100%) rename src/{ => main/java}/ccd/algorithms/credibleSets/CredibleSetType.java (100%) rename src/{ => main/java}/ccd/algorithms/credibleSets/ICredibleSet.java (100%) rename src/{ => main/java}/ccd/algorithms/credibleSets/PartitionProbabilityCredibleCCDComputer.java (100%) rename src/{ => main/java}/ccd/algorithms/credibleSets/ProbabilityBasedCredibleSetComputer.java (100%) rename src/{ => main/java}/ccd/algorithms/regularisation/CCD1Regularisor.java (100%) rename src/{ => main/java}/ccd/algorithms/regularisation/CCDExpansion.java (100%) rename src/{ => main/java}/ccd/algorithms/regularisation/CCDRegularisationStrategy.java (100%) rename src/{ => main/java}/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java (100%) rename src/{ => main/java}/ccd/model/AbstractCCD.java (100%) rename src/{ => main/java}/ccd/model/AttachingFilteredCCD.java (100%) rename src/{ => main/java}/ccd/model/CCD0.java (100%) rename src/{ => main/java}/ccd/model/CCD1.java (100%) rename src/{ => main/java}/ccd/model/CCD2.java (100%) rename src/{ => main/java}/ccd/model/CCDType.java (100%) rename src/{ => main/java}/ccd/model/Clade.java (100%) rename src/{ => main/java}/ccd/model/CladePartition.java (100%) rename src/{ => main/java}/ccd/model/ExtendedClade.java (100%) rename src/{ => main/java}/ccd/model/FilteredCCD.java (100%) rename src/{ => main/java}/ccd/model/FilteredTree.java (100%) rename src/{ => main/java}/ccd/model/HeightSettingStrategy.java (100%) rename src/{ => main/java}/ccd/model/ITreeDistribution.java (100%) rename src/{ => main/java}/ccd/model/OptRegCCD.java (100%) rename src/{ => main/java}/ccd/model/RegCCD.java (100%) rename src/{ => main/java}/ccd/model/SampleDistribution.java (100%) rename src/{ => main/java}/ccd/model/SamplingStrategy.java (100%) rename src/{ => main/java}/ccd/model/UnderflowException.java (100%) rename src/{ => main/java}/ccd/model/WrappedBeastTree.java (100%) rename src/{ => main/java}/ccd/model/bitsets/BitSet.java (100%) rename src/{ => main/java}/ccd/model/bitsets/BitSet128.java (100%) rename src/{ => main/java}/ccd/model/bitsets/BitSet192.java (100%) rename src/{ => main/java}/ccd/model/bitsets/BitSet256.java (100%) rename src/{ => main/java}/ccd/model/bitsets/BitSet64.java (100%) rename src/{ => main/java}/ccd/tools/CCD0ApproxPointEstimate.java (100%) rename src/{ => main/java}/ccd/tools/CCD0PointEstimate.java (100%) rename src/{ => main/java}/ccd/tools/CCD1PointEstimate.java (100%) rename src/{ => main/java}/ccd/tools/CCD2PointEstimate.java (100%) rename src/{ => main/java}/ccd/tools/CCDSampler.java (100%) rename src/{ => main/java}/ccd/tools/CCDSelectionPointEstimate.java (100%) rename src/{ => main/java}/ccd/tools/CCDToolUtil.java (100%) rename src/{ => main/java}/ccd/tools/DissonanceCalculator.java (100%) rename src/{ => main/java}/ccd/tools/EntropyCalculator.java (100%) rename src/{ => main/java}/ccd/tools/HIPSTR.java (100%) rename src/{ => main/java}/ccd/tools/PointEstimate.java (100%) rename src/{ => main/java}/ccd/tools/RogueAnalysis.java (100%) rename src/{ => main/java}/ccd/tools/SkeletonAnalysis.java (100%) rename src/{ => main/java}/ccd/tools/TreeCredibleLevel.java (100%) rename src/test/{ => java}/ccd/model/CCDCoreTest.java (100%) diff --git a/src/ccd/algorithms/BitSetUtil.java b/src/main/java/ccd/algorithms/BitSetUtil.java similarity index 100% rename from src/ccd/algorithms/BitSetUtil.java rename to src/main/java/ccd/algorithms/BitSetUtil.java diff --git a/src/ccd/algorithms/CCDCombiner.java b/src/main/java/ccd/algorithms/CCDCombiner.java similarity index 100% rename from src/ccd/algorithms/CCDCombiner.java rename to src/main/java/ccd/algorithms/CCDCombiner.java diff --git a/src/ccd/algorithms/GreedyMRCTree.java b/src/main/java/ccd/algorithms/GreedyMRCTree.java similarity index 100% rename from src/ccd/algorithms/GreedyMRCTree.java rename to src/main/java/ccd/algorithms/GreedyMRCTree.java diff --git a/src/ccd/algorithms/RogueDetection.java b/src/main/java/ccd/algorithms/RogueDetection.java similarity index 100% rename from src/ccd/algorithms/RogueDetection.java rename to src/main/java/ccd/algorithms/RogueDetection.java diff --git a/src/ccd/algorithms/TreeDistances.java b/src/main/java/ccd/algorithms/TreeDistances.java similarity index 100% rename from src/ccd/algorithms/TreeDistances.java rename to src/main/java/ccd/algorithms/TreeDistances.java diff --git a/src/ccd/algorithms/credibleSets/CladeBasedCredibleCCDComputer.java b/src/main/java/ccd/algorithms/credibleSets/CladeBasedCredibleCCDComputer.java similarity index 100% rename from src/ccd/algorithms/credibleSets/CladeBasedCredibleCCDComputer.java rename to src/main/java/ccd/algorithms/credibleSets/CladeBasedCredibleCCDComputer.java diff --git a/src/ccd/algorithms/credibleSets/CladeProbabilityCredibleCCDConstructor.java b/src/main/java/ccd/algorithms/credibleSets/CladeProbabilityCredibleCCDConstructor.java similarity index 100% rename from src/ccd/algorithms/credibleSets/CladeProbabilityCredibleCCDConstructor.java rename to src/main/java/ccd/algorithms/credibleSets/CladeProbabilityCredibleCCDConstructor.java diff --git a/src/ccd/algorithms/credibleSets/CredibleCCDComputer.java b/src/main/java/ccd/algorithms/credibleSets/CredibleCCDComputer.java similarity index 100% rename from src/ccd/algorithms/credibleSets/CredibleCCDComputer.java rename to src/main/java/ccd/algorithms/credibleSets/CredibleCCDComputer.java diff --git a/src/ccd/algorithms/credibleSets/CredibleSetType.java b/src/main/java/ccd/algorithms/credibleSets/CredibleSetType.java similarity index 100% rename from src/ccd/algorithms/credibleSets/CredibleSetType.java rename to src/main/java/ccd/algorithms/credibleSets/CredibleSetType.java diff --git a/src/ccd/algorithms/credibleSets/ICredibleSet.java b/src/main/java/ccd/algorithms/credibleSets/ICredibleSet.java similarity index 100% rename from src/ccd/algorithms/credibleSets/ICredibleSet.java rename to src/main/java/ccd/algorithms/credibleSets/ICredibleSet.java diff --git a/src/ccd/algorithms/credibleSets/PartitionProbabilityCredibleCCDComputer.java b/src/main/java/ccd/algorithms/credibleSets/PartitionProbabilityCredibleCCDComputer.java similarity index 100% rename from src/ccd/algorithms/credibleSets/PartitionProbabilityCredibleCCDComputer.java rename to src/main/java/ccd/algorithms/credibleSets/PartitionProbabilityCredibleCCDComputer.java diff --git a/src/ccd/algorithms/credibleSets/ProbabilityBasedCredibleSetComputer.java b/src/main/java/ccd/algorithms/credibleSets/ProbabilityBasedCredibleSetComputer.java similarity index 100% rename from src/ccd/algorithms/credibleSets/ProbabilityBasedCredibleSetComputer.java rename to src/main/java/ccd/algorithms/credibleSets/ProbabilityBasedCredibleSetComputer.java diff --git a/src/ccd/algorithms/regularisation/CCD1Regularisor.java b/src/main/java/ccd/algorithms/regularisation/CCD1Regularisor.java similarity index 100% rename from src/ccd/algorithms/regularisation/CCD1Regularisor.java rename to src/main/java/ccd/algorithms/regularisation/CCD1Regularisor.java diff --git a/src/ccd/algorithms/regularisation/CCDExpansion.java b/src/main/java/ccd/algorithms/regularisation/CCDExpansion.java similarity index 100% rename from src/ccd/algorithms/regularisation/CCDExpansion.java rename to src/main/java/ccd/algorithms/regularisation/CCDExpansion.java diff --git a/src/ccd/algorithms/regularisation/CCDRegularisationStrategy.java b/src/main/java/ccd/algorithms/regularisation/CCDRegularisationStrategy.java similarity index 100% rename from src/ccd/algorithms/regularisation/CCDRegularisationStrategy.java rename to src/main/java/ccd/algorithms/regularisation/CCDRegularisationStrategy.java diff --git a/src/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java b/src/main/java/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java similarity index 100% rename from src/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java rename to src/main/java/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java diff --git a/src/ccd/model/AbstractCCD.java b/src/main/java/ccd/model/AbstractCCD.java similarity index 100% rename from src/ccd/model/AbstractCCD.java rename to src/main/java/ccd/model/AbstractCCD.java diff --git a/src/ccd/model/AttachingFilteredCCD.java b/src/main/java/ccd/model/AttachingFilteredCCD.java similarity index 100% rename from src/ccd/model/AttachingFilteredCCD.java rename to src/main/java/ccd/model/AttachingFilteredCCD.java diff --git a/src/ccd/model/CCD0.java b/src/main/java/ccd/model/CCD0.java similarity index 100% rename from src/ccd/model/CCD0.java rename to src/main/java/ccd/model/CCD0.java diff --git a/src/ccd/model/CCD1.java b/src/main/java/ccd/model/CCD1.java similarity index 100% rename from src/ccd/model/CCD1.java rename to src/main/java/ccd/model/CCD1.java diff --git a/src/ccd/model/CCD2.java b/src/main/java/ccd/model/CCD2.java similarity index 100% rename from src/ccd/model/CCD2.java rename to src/main/java/ccd/model/CCD2.java diff --git a/src/ccd/model/CCDType.java b/src/main/java/ccd/model/CCDType.java similarity index 100% rename from src/ccd/model/CCDType.java rename to src/main/java/ccd/model/CCDType.java diff --git a/src/ccd/model/Clade.java b/src/main/java/ccd/model/Clade.java similarity index 100% rename from src/ccd/model/Clade.java rename to src/main/java/ccd/model/Clade.java diff --git a/src/ccd/model/CladePartition.java b/src/main/java/ccd/model/CladePartition.java similarity index 100% rename from src/ccd/model/CladePartition.java rename to src/main/java/ccd/model/CladePartition.java diff --git a/src/ccd/model/ExtendedClade.java b/src/main/java/ccd/model/ExtendedClade.java similarity index 100% rename from src/ccd/model/ExtendedClade.java rename to src/main/java/ccd/model/ExtendedClade.java diff --git a/src/ccd/model/FilteredCCD.java b/src/main/java/ccd/model/FilteredCCD.java similarity index 100% rename from src/ccd/model/FilteredCCD.java rename to src/main/java/ccd/model/FilteredCCD.java diff --git a/src/ccd/model/FilteredTree.java b/src/main/java/ccd/model/FilteredTree.java similarity index 100% rename from src/ccd/model/FilteredTree.java rename to src/main/java/ccd/model/FilteredTree.java diff --git a/src/ccd/model/HeightSettingStrategy.java b/src/main/java/ccd/model/HeightSettingStrategy.java similarity index 100% rename from src/ccd/model/HeightSettingStrategy.java rename to src/main/java/ccd/model/HeightSettingStrategy.java diff --git a/src/ccd/model/ITreeDistribution.java b/src/main/java/ccd/model/ITreeDistribution.java similarity index 100% rename from src/ccd/model/ITreeDistribution.java rename to src/main/java/ccd/model/ITreeDistribution.java diff --git a/src/ccd/model/OptRegCCD.java b/src/main/java/ccd/model/OptRegCCD.java similarity index 100% rename from src/ccd/model/OptRegCCD.java rename to src/main/java/ccd/model/OptRegCCD.java diff --git a/src/ccd/model/RegCCD.java b/src/main/java/ccd/model/RegCCD.java similarity index 100% rename from src/ccd/model/RegCCD.java rename to src/main/java/ccd/model/RegCCD.java diff --git a/src/ccd/model/SampleDistribution.java b/src/main/java/ccd/model/SampleDistribution.java similarity index 100% rename from src/ccd/model/SampleDistribution.java rename to src/main/java/ccd/model/SampleDistribution.java diff --git a/src/ccd/model/SamplingStrategy.java b/src/main/java/ccd/model/SamplingStrategy.java similarity index 100% rename from src/ccd/model/SamplingStrategy.java rename to src/main/java/ccd/model/SamplingStrategy.java diff --git a/src/ccd/model/UnderflowException.java b/src/main/java/ccd/model/UnderflowException.java similarity index 100% rename from src/ccd/model/UnderflowException.java rename to src/main/java/ccd/model/UnderflowException.java diff --git a/src/ccd/model/WrappedBeastTree.java b/src/main/java/ccd/model/WrappedBeastTree.java similarity index 100% rename from src/ccd/model/WrappedBeastTree.java rename to src/main/java/ccd/model/WrappedBeastTree.java diff --git a/src/ccd/model/bitsets/BitSet.java b/src/main/java/ccd/model/bitsets/BitSet.java similarity index 100% rename from src/ccd/model/bitsets/BitSet.java rename to src/main/java/ccd/model/bitsets/BitSet.java diff --git a/src/ccd/model/bitsets/BitSet128.java b/src/main/java/ccd/model/bitsets/BitSet128.java similarity index 100% rename from src/ccd/model/bitsets/BitSet128.java rename to src/main/java/ccd/model/bitsets/BitSet128.java diff --git a/src/ccd/model/bitsets/BitSet192.java b/src/main/java/ccd/model/bitsets/BitSet192.java similarity index 100% rename from src/ccd/model/bitsets/BitSet192.java rename to src/main/java/ccd/model/bitsets/BitSet192.java diff --git a/src/ccd/model/bitsets/BitSet256.java b/src/main/java/ccd/model/bitsets/BitSet256.java similarity index 100% rename from src/ccd/model/bitsets/BitSet256.java rename to src/main/java/ccd/model/bitsets/BitSet256.java diff --git a/src/ccd/model/bitsets/BitSet64.java b/src/main/java/ccd/model/bitsets/BitSet64.java similarity index 100% rename from src/ccd/model/bitsets/BitSet64.java rename to src/main/java/ccd/model/bitsets/BitSet64.java diff --git a/src/ccd/tools/CCD0ApproxPointEstimate.java b/src/main/java/ccd/tools/CCD0ApproxPointEstimate.java similarity index 100% rename from src/ccd/tools/CCD0ApproxPointEstimate.java rename to src/main/java/ccd/tools/CCD0ApproxPointEstimate.java diff --git a/src/ccd/tools/CCD0PointEstimate.java b/src/main/java/ccd/tools/CCD0PointEstimate.java similarity index 100% rename from src/ccd/tools/CCD0PointEstimate.java rename to src/main/java/ccd/tools/CCD0PointEstimate.java diff --git a/src/ccd/tools/CCD1PointEstimate.java b/src/main/java/ccd/tools/CCD1PointEstimate.java similarity index 100% rename from src/ccd/tools/CCD1PointEstimate.java rename to src/main/java/ccd/tools/CCD1PointEstimate.java diff --git a/src/ccd/tools/CCD2PointEstimate.java b/src/main/java/ccd/tools/CCD2PointEstimate.java similarity index 100% rename from src/ccd/tools/CCD2PointEstimate.java rename to src/main/java/ccd/tools/CCD2PointEstimate.java diff --git a/src/ccd/tools/CCDSampler.java b/src/main/java/ccd/tools/CCDSampler.java similarity index 100% rename from src/ccd/tools/CCDSampler.java rename to src/main/java/ccd/tools/CCDSampler.java diff --git a/src/ccd/tools/CCDSelectionPointEstimate.java b/src/main/java/ccd/tools/CCDSelectionPointEstimate.java similarity index 100% rename from src/ccd/tools/CCDSelectionPointEstimate.java rename to src/main/java/ccd/tools/CCDSelectionPointEstimate.java diff --git a/src/ccd/tools/CCDToolUtil.java b/src/main/java/ccd/tools/CCDToolUtil.java similarity index 100% rename from src/ccd/tools/CCDToolUtil.java rename to src/main/java/ccd/tools/CCDToolUtil.java diff --git a/src/ccd/tools/DissonanceCalculator.java b/src/main/java/ccd/tools/DissonanceCalculator.java similarity index 100% rename from src/ccd/tools/DissonanceCalculator.java rename to src/main/java/ccd/tools/DissonanceCalculator.java diff --git a/src/ccd/tools/EntropyCalculator.java b/src/main/java/ccd/tools/EntropyCalculator.java similarity index 100% rename from src/ccd/tools/EntropyCalculator.java rename to src/main/java/ccd/tools/EntropyCalculator.java diff --git a/src/ccd/tools/HIPSTR.java b/src/main/java/ccd/tools/HIPSTR.java similarity index 100% rename from src/ccd/tools/HIPSTR.java rename to src/main/java/ccd/tools/HIPSTR.java diff --git a/src/ccd/tools/PointEstimate.java b/src/main/java/ccd/tools/PointEstimate.java similarity index 100% rename from src/ccd/tools/PointEstimate.java rename to src/main/java/ccd/tools/PointEstimate.java diff --git a/src/ccd/tools/RogueAnalysis.java b/src/main/java/ccd/tools/RogueAnalysis.java similarity index 100% rename from src/ccd/tools/RogueAnalysis.java rename to src/main/java/ccd/tools/RogueAnalysis.java diff --git a/src/ccd/tools/SkeletonAnalysis.java b/src/main/java/ccd/tools/SkeletonAnalysis.java similarity index 100% rename from src/ccd/tools/SkeletonAnalysis.java rename to src/main/java/ccd/tools/SkeletonAnalysis.java diff --git a/src/ccd/tools/TreeCredibleLevel.java b/src/main/java/ccd/tools/TreeCredibleLevel.java similarity index 100% rename from src/ccd/tools/TreeCredibleLevel.java rename to src/main/java/ccd/tools/TreeCredibleLevel.java diff --git a/src/test/ccd/model/CCDCoreTest.java b/src/test/java/ccd/model/CCDCoreTest.java similarity index 100% rename from src/test/ccd/model/CCDCoreTest.java rename to src/test/java/ccd/model/CCDCoreTest.java From 898fd5e48102ca24c2c9aa0d6f66762b09b82460 Mon Sep 17 00:00:00 2001 From: alexeid Date: Wed, 1 Apr 2026 16:48:07 +1300 Subject: [PATCH 2/7] Migrate CCD to beast3: Maven, JPMS, JUnit 5 Single-module Maven project (io.github.compevol:ccd) with JPMS module 'ccd'. Ant build.xml removed. commons-math3 imports updated to commons-math4-legacy. Test migrated from JUnit 4 to JUnit 5. version.xml updated to depend on BEAST.base >= 2.8.0. Added: pom.xml, module-info.java, assembly descriptor, ci-publish.yml, release.sh, LICENSE (LGPL 3.0). 26/26 tests pass, BEAST package ZIP produced. --- .github/workflows/ci-publish.yml | 55 ++++ LICENSE | 165 +++++++++++ build.xml | 224 --------------- pom.xml | 257 ++++++++++++++++++ release.sh | 91 +++++++ src/assembly/beast-package.xml | 35 +++ .../RegCCDParameterOptimiser.java | 14 +- src/main/java/ccd/model/OptRegCCD.java | 2 +- src/main/java/module-info.java | 29 ++ src/test/java/ccd/model/CCDCoreTest.java | 103 ++++--- version.xml | 12 +- 11 files changed, 700 insertions(+), 287 deletions(-) create mode 100644 .github/workflows/ci-publish.yml create mode 100644 LICENSE delete mode 100644 build.xml create mode 100644 pom.xml create mode 100755 release.sh create mode 100644 src/assembly/beast-package.xml create mode 100644 src/main/java/module-info.java diff --git a/.github/workflows/ci-publish.yml b/.github/workflows/ci-publish.yml new file mode 100644 index 0000000..1023d05 --- /dev/null +++ b/.github/workflows/ci-publish.yml @@ -0,0 +1,55 @@ +name: CI & Publish + +on: + push: + branches: [ master ] + tags: [ 'v*' ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 25 (Azul Zulu) + if: "!startsWith(github.ref, 'refs/tags/v')" + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: '25' + cache: maven + + - name: Set up JDK 25 (Azul Zulu) for Maven Central + if: startsWith(github.ref, 'refs/tags/v') + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: '25' + cache: maven + server-id: central + server-username: CENTRAL_USERNAME + server-password: CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - name: Set release version from tag + if: startsWith(github.ref, 'refs/tags/v') + run: | + VERSION=${GITHUB_REF_NAME#v} + echo "Publishing version: $VERSION" + mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false + + - name: Build and test + run: mvn verify + + - name: Publish to Maven Central + if: startsWith(github.ref, 'refs/tags/v') + run: mvn deploy -Prelease -DskipTests + env: + CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} + CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0a04128 --- /dev/null +++ b/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/build.xml b/build.xml deleted file mode 100644 index c2b8a2f..0000000 --- a/build.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - Build CCD. - Also used by Hudson CCD project. - JUnit test is available for this build. - $Id: build_CCD.xml $ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ** Required file version.xml does not exist. ** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..b850dd1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,257 @@ + + + 4.0.0 + + io.github.compevol + ccd + 1.1.0-SNAPSHOT + + CCD + Conditional Clade Distribution methods for BEAST 3 + + https://github.com/CompEvol/CCD + + + + GNU Lesser General Public License v3.0 + https://www.gnu.org/licenses/lgpl-3.0.html + + + + + + Jonathan Klawitter + + + Alexei Drummond + https://github.com/alexeid + + + + + scm:git:git://github.com/CompEvol/CCD.git + scm:git:ssh://github.com:CompEvol/CCD.git + https://github.com/CompEvol/CCD + + + + UTF-8 + UTF-8 + 25 + + 2.8.0-beta2 + 25.0.2 + beast.base + beast.base.minimal.BeastMain + + CCD + 1.1.0 + + + + + + io.github.compevol + beast-base + ${beast.version} + + + io.github.compevol + beast-pkgmgmt + ${beast.version} + + + + + io.github.compevol + beast-fx + ${beast.version} + true + + + org.openjfx + javafx-controls + ${javafx.version} + true + + + + + org.junit.jupiter + junit-jupiter + 5.8.2 + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.15.0 + + 25 + UTF-8 + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + ${project.build.testOutputDirectory} + + --add-reads ccd=ALL-UNNAMED + --add-reads beast.base=ALL-UNNAMED + --add-reads beast.pkgmgmt=ALL-UNNAMED + + + ${project.build.outputDirectory} + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + copy-version-xml + generate-resources + copy-resources + + ${project.build.directory} + + + ${project.basedir} + + version.xml + + + + + + + embed-version-xml-in-jar + generate-resources + copy-resources + + ${project.build.outputDirectory} + + + ${project.basedir} + + version.xml + + + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + + java + ${project.basedir} + --module-path %classpath -DBEAST_PACKAGE_PATH=${project.build.outputDirectory} -m ${beast.module}/${beast.main} ${beast.args} + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + attach-sources + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.7.1 + + + src/assembly/beast-package.xml + + ${beast.pkg.name}.v${beast.pkg.version} + false + + + + beast-package + package + single + + + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.11.2 + + none + + + + attach-javadocs + jar + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.7 + + + sign-artifacts + verify + sign + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.6.0 + true + + central + true + published + + + + + + + diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..a909fde --- /dev/null +++ b/release.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# +# Build and release a BEAST 3 package. +# +# Runs `mvn package` to produce the BEAST package ZIP (via maven-assembly-plugin), +# then optionally creates a GitHub release with the ZIP attached. +# +# Usage: +# ./release.sh # build + create package ZIP +# ./release.sh --release # also create a GitHub release with the ZIP attached +# +# The ZIP can then be submitted to CBAN (CompEvol/CBAN) by adding an entry +# to packages2.8.xml via pull request. See README.md for details. +# +set -euo pipefail + +# --- Extract metadata from version.xml --- + +if [[ ! -f version.xml ]]; then + echo "ERROR: version.xml not found in $(pwd)" >&2 + exit 1 +fi + +# Parse only the element (not etc.) +PKG_LINE=$(grep '&2 + exit 1 +fi + +ZIP_NAME="${PKG_NAME}.v${VERSION}.zip" +GITHUB_REPO=$(git remote get-url origin 2>/dev/null \ + | sed 's|.*github.com[:/]\(.*\)\.git$|\1|; s|.*github.com[:/]\(.*\)$|\1|') + +echo "=== ${PKG_NAME} v${VERSION} ===" +echo "" + +# --- Step 1: Maven build + assemble package ZIP --- + +echo "--- Building with Maven ---" +mvn clean package -Dmaven.test.skip=true +echo "" + +# Locate the ZIP produced by maven-assembly-plugin +ZIP_PATH="target/${ZIP_NAME}" +if [[ ! -f "$ZIP_PATH" ]]; then + echo "ERROR: expected ZIP not found at ${ZIP_PATH}" >&2 + exit 1 +fi + +# Copy to project root for convenience +cp "$ZIP_PATH" "$ZIP_NAME" + +echo "=== Package: ${ZIP_NAME} ===" +unzip -l "$ZIP_NAME" + +# --- Step 2: Optionally create GitHub release --- + +if [[ "${1:-}" == "--release" ]]; then + if [[ -z "$GITHUB_REPO" ]]; then + echo "ERROR: could not determine GitHub repo from git remote" >&2 + exit 1 + fi + + echo "" + echo "--- Creating GitHub release v${VERSION} on ${GITHUB_REPO} ---" + gh release create "v${VERSION}" "$ZIP_NAME" \ + --repo "$GITHUB_REPO" \ + --title "${PKG_NAME} v${VERSION}" \ + --generate-notes + + DOWNLOAD_URL="https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}/${ZIP_NAME}" + echo "" + echo "=== Release created ===" + echo "URL: https://github.com/${GITHUB_REPO}/releases/tag/v${VERSION}" + echo "" + echo "--- Next step: submit to CBAN ---" + echo "Add this entry to packages2.8.xml in https://github.com/CompEvol/CBAN via pull request:" + echo "" + cat < + + +XMLEOF +fi diff --git a/src/assembly/beast-package.xml b/src/assembly/beast-package.xml new file mode 100644 index 0000000..3ac58b3 --- /dev/null +++ b/src/assembly/beast-package.xml @@ -0,0 +1,35 @@ + + beast-package + + zip + + false + + + + + ${project.basedir}/version.xml + / + + + + ${project.build.directory}/${project.build.finalName}-sources.jar + ${beast.pkg.name}.src.jar + / + + + + + + + /lib + true + runtime + + io.github.compevol:ccd + + + + diff --git a/src/main/java/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java b/src/main/java/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java index 168c473..152aad6 100644 --- a/src/main/java/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java +++ b/src/main/java/ccd/algorithms/regularisation/RegCCDParameterOptimiser.java @@ -3,13 +3,13 @@ import beast.base.evolution.tree.Tree; import beastfx.app.treeannotator.TreeAnnotator; import ccd.model.RegCCD; -import org.apache.commons.math3.analysis.UnivariateFunction; -import org.apache.commons.math3.optim.MaxEval; -import org.apache.commons.math3.optim.nonlinear.scalar.GoalType; -import org.apache.commons.math3.optim.univariate.BrentOptimizer; -import org.apache.commons.math3.optim.univariate.SearchInterval; -import org.apache.commons.math3.optim.univariate.UnivariateObjectiveFunction; -import org.apache.commons.math3.optim.univariate.UnivariatePointValuePair; +import org.apache.commons.math4.legacy.analysis.UnivariateFunction; +import org.apache.commons.math4.legacy.optim.MaxEval; +import org.apache.commons.math4.legacy.optim.nonlinear.scalar.GoalType; +import org.apache.commons.math4.legacy.optim.univariate.BrentOptimizer; +import org.apache.commons.math4.legacy.optim.univariate.SearchInterval; +import org.apache.commons.math4.legacy.optim.univariate.UnivariateObjectiveFunction; +import org.apache.commons.math4.legacy.optim.univariate.UnivariatePointValuePair; import java.io.IOException; import java.io.PrintWriter; diff --git a/src/main/java/ccd/model/OptRegCCD.java b/src/main/java/ccd/model/OptRegCCD.java index c802c18..e4993b7 100644 --- a/src/main/java/ccd/model/OptRegCCD.java +++ b/src/main/java/ccd/model/OptRegCCD.java @@ -5,7 +5,7 @@ import ccd.algorithms.regularisation.CCD1Regularisor; import ccd.algorithms.regularisation.CCDRegularisationStrategy; import ccd.algorithms.regularisation.RegCCDParameterOptimiser; -import org.apache.commons.math3.analysis.UnivariateFunction; +import org.apache.commons.math4.legacy.analysis.UnivariateFunction; import java.util.List; diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java new file mode 100644 index 0000000..7f3db66 --- /dev/null +++ b/src/main/java/module-info.java @@ -0,0 +1,29 @@ +open module ccd { + requires beast.pkgmgmt; + requires beast.base; + requires static beast.fx; + requires static javafx.controls; + requires org.apache.commons.math4.legacy; + + exports ccd.algorithms; + exports ccd.algorithms.credibleSets; + exports ccd.algorithms.regularisation; + exports ccd.model; + exports ccd.model.bitsets; + exports ccd.tools; + + provides beastfx.app.treeannotator.services.TopologySettingService with + ccd.tools.CCD0PointEstimate, + ccd.tools.CCD1PointEstimate, + ccd.tools.CCD2PointEstimate, + ccd.tools.CCD0ApproxPointEstimate, + ccd.tools.HIPSTR; + + provides beast.base.core.BEASTInterface with + ccd.tools.CCDSampler, + ccd.tools.EntropyCalculator, + ccd.tools.SkeletonAnalysis, + ccd.tools.RogueAnalysis, + ccd.tools.DissonanceCalculator, + ccd.tools.TreeCredibleLevel; +} diff --git a/src/test/java/ccd/model/CCDCoreTest.java b/src/test/java/ccd/model/CCDCoreTest.java index 352718c..3b2e25f 100644 --- a/src/test/java/ccd/model/CCDCoreTest.java +++ b/src/test/java/ccd/model/CCDCoreTest.java @@ -1,4 +1,4 @@ -package test.ccd.model; +package ccd.model; import beast.base.evolution.tree.Tree; import beast.base.evolution.tree.TreeParser; @@ -8,15 +8,15 @@ import ccd.model.CCD2; import ccd.model.HeightSettingStrategy; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Core unit tests for CCD0, CCD1, and CCD2 models. @@ -42,7 +42,7 @@ public class CCDCoreTest { private List mixedTrees; // 6xT1 + 2xT2 + 2xT3 = 10 trees private Tree t1, t2, t3, unseenTree; - @Before + @BeforeEach public void setUp() { AbstractCCD.verbose = false; @@ -100,26 +100,26 @@ public void testCCD1_mixedTreesProbabilitiesReflectFrequencies() { double p3 = ccd.getProbabilityOfTree(t3); // All input trees should have positive probability - assertTrue("T1 should have positive probability", p1 > 0); - assertTrue("T2 should have positive probability", p2 > 0); - assertTrue("T3 should have positive probability", p3 > 0); + assertTrue(p1 > 0, "T1 should have positive probability"); + assertTrue(p2 > 0, "T2 should have positive probability"); + assertTrue(p3 > 0, "T3 should have positive probability"); // T1 appeared 6/10 times, should have highest probability - assertTrue("T1 should have highest probability", p1 > p2); - assertTrue("T1 should have highest probability", p1 > p3); + assertTrue(p1 > p2, "T1 should have highest probability"); + assertTrue(p1 > p3, "T1 should have highest probability"); } @Test public void testCCD1_containsTree() { CCD1 ccd = new CCD1(mixedTrees, 0.0); - assertTrue("CCD1 should contain T1", ccd.containsTree(t1)); - assertTrue("CCD1 should contain T2", ccd.containsTree(t2)); - assertTrue("CCD1 should contain T3", ccd.containsTree(t3)); + assertTrue(ccd.containsTree(t1), "CCD1 should contain T1"); + assertTrue(ccd.containsTree(t2), "CCD1 should contain T2"); + assertTrue(ccd.containsTree(t3), "CCD1 should contain T3"); // CCD1 only assigns nonzero probability to trees whose clade partitions // were all observed; an unseen topology with novel partitions should not be contained - assertFalse("CCD1 should not contain unseen topology", ccd.containsTree(unseenTree)); + assertFalse(ccd.containsTree(unseenTree), "CCD1 should not contain unseen topology"); } @Test @@ -130,7 +130,7 @@ public void testCCD1_getMAPTree() { // MAP should be T1 (highest frequency) double mapProb = ccd.getProbabilityOfTree(mapTree); double t1Prob = ccd.getProbabilityOfTree(t1); - assertEquals("MAP tree should have same probability as T1", t1Prob, mapProb, 1e-9); + assertEquals(t1Prob, mapProb, 1e-9, "MAP tree should have same probability as T1"); } @Test @@ -140,9 +140,8 @@ public void testCCD1_sampleTreeValid() { for (int i = 0; i < 100; i++) { Tree sampled = ccd.sampleTree(); - assertNotNull("Sampled tree should not be null", sampled); - assertTrue("Sampled tree should be contained in CCD", - ccd.getProbabilityOfTree(sampled) > 0); + assertNotNull(sampled, "Sampled tree should not be null"); + assertTrue(ccd.getProbabilityOfTree(sampled) > 0, "Sampled tree should be contained in CCD"); } } @@ -163,8 +162,8 @@ public void testCCD1_sampleTreeFrequencyApproximation() { } double empiricalFreq = (double) t1Count / nSamples; - assertEquals("Sampled frequency of T1 should approximate its CCD probability", - t1Prob, empiricalFreq, 0.05); + assertEquals(t1Prob, empiricalFreq, 0.05, + "Sampled frequency of T1 should approximate its CCD probability"); } @Test @@ -195,8 +194,8 @@ public void testCCD1_probabilitySumApproximatelyOne() { // CCD1 can assign probability to unobserved topologies that share // observed clade partitions. So sum of observed trees <= 1. - assertTrue("Sum of observed tree probabilities should be <= 1", sum <= 1.0 + 1e-9); - assertTrue("Sum of observed tree probabilities should be substantial", sum > 0.5); + assertTrue(sum <= 1.0 + 1e-9, "Sum of observed tree probabilities should be <= 1"); + assertTrue(sum > 0.5, "Sum of observed tree probabilities should be substantial"); } // ======================== CCD0 Tests ======================== @@ -206,7 +205,7 @@ public void testCCD0_singleTreeCladeCount() { List trees = Collections.singletonList(parseNewick(FOUR_TAXON_NEWICK)); CCD0 ccd = new CCD0(trees, 0.0); // CCD0 expands the graph, so may have more clades than observed - assertTrue("CCD0 should have at least 7 clades", ccd.getNumberOfClades() >= 7); + assertTrue(ccd.getNumberOfClades() >= 7, "CCD0 should have at least 7 clades"); } @Test @@ -218,11 +217,11 @@ public void testCCD0_identicalTreesMAPAndProbability() { double prob = ccd.getProbabilityOfTree(mapTree); // With identical trees, MAP tree should have the highest probability - assertTrue("MAP probability should be high", prob > 0.5); + assertTrue(prob > 0.5, "MAP probability should be high"); // The input topology should have highest probability double t1Prob = ccd.getProbabilityOfTree(t1); - assertTrue("T1 should have high probability", t1Prob > 0.5); + assertTrue(t1Prob > 0.5, "T1 should have high probability"); } @Test @@ -232,9 +231,9 @@ public void testCCD0_mixedTreesProbabilities() { double p1 = ccd.getProbabilityOfTree(t1); double p2 = ccd.getProbabilityOfTree(t2); - assertTrue("T1 should have positive probability", p1 > 0); - assertTrue("T2 should have positive probability", p2 > 0); - assertTrue("T1 should have higher probability than T2", p1 > p2); + assertTrue(p1 > 0, "T1 should have positive probability"); + assertTrue(p2 > 0, "T2 should have positive probability"); + assertTrue(p1 > p2, "T1 should have higher probability than T2"); } @Test @@ -243,12 +242,12 @@ public void testCCD0_getMAPTree() { Tree mapTree = ccd.getMAPTree(); double mapProb = ccd.getProbabilityOfTree(mapTree); - assertTrue("MAP tree should have positive probability", mapProb > 0); + assertTrue(mapProb > 0, "MAP tree should have positive probability"); // MAP should have probability >= any input tree - assertTrue("MAP >= T1", mapProb >= ccd.getProbabilityOfTree(t1) - 1e-9); - assertTrue("MAP >= T2", mapProb >= ccd.getProbabilityOfTree(t2) - 1e-9); - assertTrue("MAP >= T3", mapProb >= ccd.getProbabilityOfTree(t3) - 1e-9); + assertTrue(mapProb >= ccd.getProbabilityOfTree(t1) - 1e-9, "MAP >= T1"); + assertTrue(mapProb >= ccd.getProbabilityOfTree(t2) - 1e-9, "MAP >= T2"); + assertTrue(mapProb >= ccd.getProbabilityOfTree(t3) - 1e-9, "MAP >= T3"); } @Test @@ -258,9 +257,8 @@ public void testCCD0_sampleTreeValid() { for (int i = 0; i < 50; i++) { Tree sampled = ccd.sampleTree(); - assertNotNull("Sampled tree should not be null", sampled); - assertTrue("Sampled tree should have positive probability", - ccd.getProbabilityOfTree(sampled) > 0); + assertNotNull(sampled, "Sampled tree should not be null"); + assertTrue(ccd.getProbabilityOfTree(sampled) > 0, "Sampled tree should have positive probability"); } } @@ -276,7 +274,7 @@ public void testCCD0_burnin() { // T1 should dominate since burnin discards first 5 (T2) trees Tree mapTree = ccd.getMAPTree(); double mapProb = ccd.getProbabilityOfTree(mapTree); - assertTrue("MAP should have high probability after burnin", mapProb > 0.5); + assertTrue(mapProb > 0.5, "MAP should have high probability after burnin"); } @Test @@ -288,7 +286,7 @@ public void testCCD0_canAssignNonzeroProbToUnseenTopology() { // This is a property test: CCD0 may or may not contain unseen trees // depending on the expansion. We just check it doesn't crash. double prob = ccd.getProbabilityOfTree(unseenTree); - assertTrue("Probability should be non-negative", prob >= 0); + assertTrue(prob >= 0, "Probability should be non-negative"); } // ======================== CCD2 Tests ======================== @@ -301,8 +299,8 @@ public void testCCD2_singleTreeCladeCount() { CCD2 ccd = new CCD2(trees, 0.0); // 4-taxon rooted binary tree has 7 standard clades, // but CCD2 may count differently due to root handling - assertTrue("CCD2 should have at least 6 clades", ccd.getNumberOfClades() >= 6); - assertTrue("CCD2 should not exceed 7 clades", ccd.getNumberOfClades() <= 7); + assertTrue(ccd.getNumberOfClades() >= 6, "CCD2 should have at least 6 clades"); + assertTrue(ccd.getNumberOfClades() <= 7, "CCD2 should not exceed 7 clades"); } @Test @@ -324,20 +322,20 @@ public void testCCD2_mixedTreesProbabilities() { double p2 = ccd.getProbabilityOfTree(t2); double p3 = ccd.getProbabilityOfTree(t3); - assertTrue("T1 should have positive probability", p1 > 0); - assertTrue("T2 should have positive probability", p2 > 0); - assertTrue("T3 should have positive probability", p3 > 0); - assertTrue("T1 should have highest probability", p1 > p2); - assertTrue("T1 should have highest probability", p1 > p3); + assertTrue(p1 > 0, "T1 should have positive probability"); + assertTrue(p2 > 0, "T2 should have positive probability"); + assertTrue(p3 > 0, "T3 should have positive probability"); + assertTrue(p1 > p2, "T1 should have highest probability"); + assertTrue(p1 > p3, "T1 should have highest probability"); } @Test public void testCCD2_containsTree() { CCD2 ccd = new CCD2(mixedTrees, 0.0); - assertTrue("CCD2 should contain T1", ccd.containsTree(t1)); - assertTrue("CCD2 should contain T2", ccd.containsTree(t2)); - assertTrue("CCD2 should contain T3", ccd.containsTree(t3)); + assertTrue(ccd.containsTree(t1), "CCD2 should contain T1"); + assertTrue(ccd.containsTree(t2), "CCD2 should contain T2"); + assertTrue(ccd.containsTree(t3), "CCD2 should contain T3"); } @Test @@ -347,7 +345,7 @@ public void testCCD2_getMAPTree() { double mapProb = ccd.getProbabilityOfTree(mapTree); double t1Prob = ccd.getProbabilityOfTree(t1); - assertEquals("MAP tree should have same probability as T1", t1Prob, mapProb, 1e-9); + assertEquals(t1Prob, mapProb, 1e-9, "MAP tree should have same probability as T1"); } @Test @@ -357,9 +355,8 @@ public void testCCD2_sampleTreeValid() { for (int i = 0; i < 100; i++) { Tree sampled = ccd.sampleTree(); - assertNotNull("Sampled tree should not be null", sampled); - assertTrue("Sampled tree should have positive probability", - ccd.getProbabilityOfTree(sampled) > 0); + assertNotNull(sampled, "Sampled tree should not be null"); + assertTrue(ccd.getProbabilityOfTree(sampled) > 0, "Sampled tree should have positive probability"); } } @@ -412,9 +409,9 @@ public void testCCD1andCCD2_cladeCountRelationship() { int c2 = ccd2.getNumberOfClades(); // CCD2 should have at least as many clades as CCD1 - assertTrue("CCD2 should have >= CCD1 clades", c2 >= c1); + assertTrue(c2 >= c1, "CCD2 should have >= CCD1 clades"); // CCD0 expands the graph and should have the most clades - assertTrue("CCD0 should have >= CCD1 clades", c0 >= c1); + assertTrue(c0 >= c1, "CCD0 should have >= CCD1 clades"); } } diff --git a/version.xml b/version.xml index 895c6af..a48c604 100644 --- a/version.xml +++ b/version.xml @@ -1,6 +1,5 @@ - - + @@ -10,6 +9,15 @@ + + + + + + + + + From b091596809664d7e504cd8d0ff256c1e7526ca71 Mon Sep 17 00:00:00 2001 From: alexeid Date: Wed, 1 Apr 2026 16:49:22 +1300 Subject: [PATCH 3/7] Bump version to 1.2.0-SNAPSHOT for beast3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Distinguishes the beast3 release from the beast2 1.1.0 release, following the same minor-bump convention as morph-models (1.2→1.3) and sampled-ancestors (2.2→2.3). --- pom.xml | 4 ++-- version.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b850dd1..6658a27 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.compevol ccd - 1.1.0-SNAPSHOT + 1.2.0-SNAPSHOT CCD Conditional Clade Distribution methods for BEAST 3 @@ -47,7 +47,7 @@ beast.base.minimal.BeastMain CCD - 1.1.0 + 1.2.0 diff --git a/version.xml b/version.xml index a48c604..7503b38 100644 --- a/version.xml +++ b/version.xml @@ -1,4 +1,4 @@ - + From 5355af64ab45aac0505ca1d054e9853c43901dbc Mon Sep 17 00:00:00 2001 From: alexeid Date: Wed, 1 Apr 2026 16:51:23 +1300 Subject: [PATCH 4/7] Update README for beast3 Replace BEAST 2 references, Ant build instructions, and old install steps with Maven coordinates, JPMS module name, and JDK 25+ build instructions. --- README.md | 67 +++++++++++++++++++++---------------------------------- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 460cc61..9bc5667 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## CCD Package for [BEAST 2](https://www.beast2.org/) +# CCD Package for [BEAST 3](https://github.com/CompEvol) Implementation of the conditional clade distribution (CCD), which offers estimators of the posterior tree (topology) distribution learned from the sample, as well as associated tools and algorithms. Three parametrisations of a CCD are implemented, namely, based on clade frequencies (CCD0), clade split frequencies (CCD1), and pairs of clade split frequencies (CCD2). @@ -9,55 +9,42 @@ The package further includes tools for entropy-based rogue analysis and rogue re See the [CCD-Research repository](https://github.com/CompEvol/CCD-Research) for information, scripts, and data of the associated research papers, and see the instructions below on how to use the tools. -## Install the package +## Maven coordinates -### Installing through BEAUti - -CCD is a [BEAST2](http://beast2.org) package that requires BEAST 2 v2.7.6. -If you have not already done so, you can get BEAST 2 from [here](http://beast2.org). - -To install CCD, it is easiest to start BEAUti (a program that is part of BEAST), and select the menu `File/Manage packages`. A package manager dialog pops up, that looks something like this: - -![Package Manager](https://github.com/CompEvol/CCD/raw/master/doc/package_repos.png) - -If the CCD package is listed, just click on it to select it, and hit the `Install/Upgrade` button. - -If the CCD package is not listed, you may need to add a package repository by clicking the `Package repositories` button. A window pops up where you can click `Add URL` and add `https://raw.githubusercontent.com/CompEvol/CBAN/master/packages-extra-2.7.xml` in the entry. After clicking OK, the dialog should look something like this: +```xml + + io.github.compevol + ccd + 1.2.0 + +``` -![Package Repositories](https://github.com/CompEvol/CCD/raw/master/doc/package_repos0.png) +JPMS module name: `ccd` -Click OK and now CCD should be listed in the package manager (as in the first dialog above). Select and click Install/Upgrade to install. +## Build from source -### Install by hand +Requires JDK 25+. -* Download the package from [here](https://github.com/CompEvol/CCD/releases/download/v0.0.1/CCD.package.v0.0.4.zip) -* Create CCD directory inside BEAST package directory - * for Windows in Users\\BEAST\2.X\VSS - * for Mac in /Users/\/Library/Application Support/BEAST/2.X/VSS - * for Linux /home//.beast/2.X/VSS - Here is the username you use, and in “2.X” the X refers to the major version of BEAST, so 2.X=2.7 for version 2.7.6. -* Unzip the file `CCD.package.v0.0.1.zip` inside the CCD directory +```bash +git clone https://github.com/CompEvol/CCD.git +cd CCD +mvn clean verify +``` -## Build from code +This produces `target/CCD.v1.2.0.zip` (the BEAST package) and `target/ccd-1.2.0-SNAPSHOT.jar`. -* Get code for beast2, BeastFX and CCD repositories: - * git clone https://github.com/CompEvol/beast2.git - * git clone https://github.com/CompEvol/BeastFX.git - * git clone https://github.com/CompEvol/CCD.git -* Run `ant install` from the CCD directory - ## Usage ### Point Estimates -The tree topolgy point estimate provided by CCD's is called the CCD MAP tree and is best accessed through TreeAnnotator. +The tree topology point estimate provided by CCD's is called the CCD MAP tree and is best accessed through TreeAnnotator. See also the general [tutorial](https://beast2.blogs.auckland.ac.nz/treeannotator/); the steps are to start TreeAnnotator, and select `MAP (CCD0)` from the drop down box next to `Target tree type`: ![tree annotator](doc/treeannotator.png) TreeAnnotator and thus the CCD point estimates can also be accessed from the terminal. -Simply but `CCD0` as option for the topology (`-topology`). +Simply put `CCD0` as option for the topology (`-topology`). In full, the call from a terminal for Linux and OS X would be ``` @@ -74,16 +61,16 @@ For CCD1 based point estimates select `MAP (CCD1)` from the drop down box in the ### Phylogenetic Entropy, Rogue & Skeleton Analysis -The CCD package has three tools (small apps) to compute the phylogenetic entropy of a tree set, compute rogues scores for each clade, and conduct a skeleton anaylsis -that can each be executed with [BEAST2's AppLauncher](http://www.beast2.org/2019/07/23/better-apps-for-the-beast-appstore.html). +The CCD package has three tools (small apps) to compute the phylogenetic entropy of a tree set, compute rogues scores for each clade, and conduct a skeleton analysis +that can each be executed with BEAST's AppLauncher. Note that the given trees *need to be binary* and are assumed to be rooted; they are typically given by a NEXUS `.tree` file, but a list of Newick strings also works. For more information on the concepts see the [paper](https://www.biorxiv.org/content/10.1101/2024.09.25.615070v1) and for further information and example data see the [research paper repository](https://github.com/CompEvol/CCD-Research/tree/main/skeletonsAndRogues). #### Phylogenetic Entropy -You can compute the **phylogenetic entropy** of your posterior tree distribution with [BEAST2's AppLauncher](http://www.beast2.org/2019/07/23/better-apps-for-the-beast-appstore.html). -The tool `EntropyCalculator` computes the phylogenetic entrpoy of our posterior tree distribution (computed via CCD). You can call from the terminal with the following command: +You can compute the **phylogenetic entropy** of your posterior tree distribution with BEAST's AppLauncher. +The tool `EntropyCalculator` computes the phylogenetic entropy of your posterior tree distribution (computed via CCD). You can call from the terminal with the following command: ``` /path/to/applauncher EntropyCalculator -trees /path/to/treeInputFile.trees -burnin 10 -ccdType CCD0 ``` @@ -136,7 +123,7 @@ and `NumTopologies` (clade whose removal reduces the number of trees in the CCD - `minProbability`: minimum probability for clade to analyse (used to speed up computation, default: `0.5`) If you further specify an output file, then the given tree set will be reduced/filtered to the remaining taxa -- `out`: reduced tree output file; th given tree set will not be filtered if not specified +- `out`: reduced tree output file; the given tree set will not be filtered if not specified - `exclude`: file name of text file containing taxa to exclude from filtering - can be comma, tab or newline delimited ### Credible Level Evaluation @@ -153,7 +140,3 @@ The app has the following parameters: - `method`: whether to use probability-based method (`probability`, default) or a credible CCD (`credibleCCD`) For the probability-based method the following two parameters can be set: - `numsamples`: the number of trees sampled from the CCD to compute the credible level thresholds (default: `10000`) - - - - From 82190acc394a35108e01ea3c16342f9fdc45e0b4 Mon Sep 17 00:00:00 2001 From: alexeid Date: Wed, 1 Apr 2026 16:53:15 +1300 Subject: [PATCH 5/7] Add target/ and *.zip to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index d9aaecb..255db57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ CCD.iml build/ +target/ release/ out/ +*.zip .idea/ .classpath .DS_Store From 70650dbb2dc56cb0edcd3701ced9674a732db6aa Mon Sep 17 00:00:00 2001 From: alexeid Date: Wed, 1 Apr 2026 17:07:43 +1300 Subject: [PATCH 6/7] Document mvn exec:exec usage for running CCD tools Add examples for running TreeAnnotator with CCD topologies and BEAST with CCD on the module path, using the exec-maven-plugin. --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 9bc5667..ad558d2 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,27 @@ mvn clean verify This produces `target/CCD.v1.2.0.zip` (the BEAST package) and `target/ccd-1.2.0-SNAPSHOT.jar`. +### Running from Maven + +After building, you can run BEAST tools with CCD on the module path using `mvn exec:exec`. + +Run TreeAnnotator with CCD0 topology: + +```bash +mvn exec:exec \ + -Dbeast.module=beast.fx \ + -Dbeast.main=beastfx.app.treeannotator.TreeAnnotator \ + -Dbeast.args="-topology CCD0 -height mean -burnin 10 input.trees output.tree" +``` + +Available topologies: `CCD0`, `CCD1`, `CCD2`, `CCD0Approx`, `HIPSTR`. + +Run BEAST with CCD on the module path: + +```bash +mvn exec:exec -Dbeast.args="examples/myanalysis.xml" +``` + ## Usage ### Point Estimates From 16a2bc214c50a1a0d6805b7afcd255be34f9d3f1 Mon Sep 17 00:00:00 2001 From: alexeid Date: Mon, 4 May 2026 09:41:48 +1200 Subject: [PATCH 7/7] ci: clean-deploy on tag and skip redundant verify - Gate "Build and test" to non-tag pushes (the same mvn verify runs as part of the deploy lifecycle on tag). - Replace two-step `mvn deploy -Prelease -DskipTests` with single `mvn -Prelease clean deploy`. The previous flow left unsigned package outputs in target/ from an earlier run, so the second invocation could deploy artifact bytes that did not match the freshly generated .asc files. Sonatype rejected such tag releases with "Invalid signature" on zip/sources/javadoc while jar/pom verified. A single clean deploy from the tag avoids that. --- .github/workflows/ci-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-publish.yml b/.github/workflows/ci-publish.yml index 1023d05..d9e0027 100644 --- a/.github/workflows/ci-publish.yml +++ b/.github/workflows/ci-publish.yml @@ -44,11 +44,12 @@ jobs: mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false - name: Build and test + if: "!startsWith(github.ref, 'refs/tags/v')" run: mvn verify - name: Publish to Maven Central if: startsWith(github.ref, 'refs/tags/v') - run: mvn deploy -Prelease -DskipTests + run: mvn -Prelease clean deploy env: CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}