From a185a871f71ce2a94068399eaf9e6be8f2c8e1b9 Mon Sep 17 00:00:00 2001 From: Joseph Ramsey Date: Fri, 23 Dec 2022 06:04:19 -0500 Subject: [PATCH 1/6] Update README.md Adding a note as to where the public build are (in Maven Central) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cf2a83f..146b031 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,7 @@ ## Introduction Causal-cmd is a Java application that provides a Command-Line Interface (CLI) tool for causal discovery algorithms produced by the [Center for Causal Discovery](http://www.ccd.pitt.edu/). The documentation can be found here [https://bd2kccd.github.io/docs/causal-cmd/](https://bd2kccd.github.io/docs/causal-cmd/) + +Public builds are available here: + +https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/causal-cmd/ From 3eaee0ee4cff62dedd99e6cbb673365d9b2c8e08 Mon Sep 17 00:00:00 2001 From: Kevin Bui Date: Thu, 12 Jan 2023 23:55:29 -0500 Subject: [PATCH 2/6] Bumped up the project version number. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3144d48..1da37c7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 edu.pitt.dbmi causal-cmd - 1.4.2 + 1.5.0 jar From 3e941eec13306aabe2c87ba468f31e8ce96bf1f8 Mon Sep 17 00:00:00 2001 From: Kevin Bui Date: Thu, 12 Jan 2023 23:59:51 -0500 Subject: [PATCH 3/6] Update depdencies to their latest version. --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1da37c7..89c3be1 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ io.github.cmu-phil tetrad-lib - 7.1.2-2 + 7.1.3-SNAPSHOT org.slf4j @@ -45,7 +45,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.1 + 5.9.2 test From fbe2b521269c6d49d6077850656851126933bccd Mon Sep 17 00:00:00 2001 From: Kevin Bui Date: Fri, 13 Jan 2023 00:08:17 -0500 Subject: [PATCH 4/6] Replaced deprecated interface. --- src/main/java/edu/pitt/dbmi/causal/cmd/data/DataFiles.java | 6 +++--- .../java/edu/pitt/dbmi/causal/cmd/tetrad/TetradRunner.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/edu/pitt/dbmi/causal/cmd/data/DataFiles.java b/src/main/java/edu/pitt/dbmi/causal/cmd/data/DataFiles.java index ef21097..8248cb1 100644 --- a/src/main/java/edu/pitt/dbmi/causal/cmd/data/DataFiles.java +++ b/src/main/java/edu/pitt/dbmi/causal/cmd/data/DataFiles.java @@ -22,7 +22,7 @@ import edu.cmu.tetrad.data.DataType; import edu.cmu.tetrad.data.DataUtils; import edu.cmu.tetrad.data.DelimiterType; -import edu.cmu.tetrad.data.IKnowledge; +import edu.cmu.tetrad.data.Knowledge; import edu.cmu.tetrad.util.DataConvertUtils; import edu.pitt.dbmi.causal.cmd.AlgorithmRunException; import edu.pitt.dbmi.causal.cmd.CmdArgs; @@ -99,13 +99,13 @@ public static Metadata readInMetadata(CmdArgs cmdArgs, PrintStream out) throws I * @return knowledge information from file * @throws IOException when errors occur during reading file */ - public static IKnowledge readInKnowledge(CmdArgs cmdArgs, PrintStream out) throws IOException { + public static Knowledge readInKnowledge(CmdArgs cmdArgs, PrintStream out) throws IOException { Path file = cmdArgs.getKnowledgeFile(); if (file == null) { return null; } else { LogMessages.readingFileStart(file, LOGGER, out); - IKnowledge knowledge = DataUtils.loadKnowledge(file.toFile(), DelimiterType.WHITESPACE, "//"); + Knowledge knowledge = DataUtils.loadKnowledge(file.toFile(), DelimiterType.WHITESPACE, "//"); LogMessages.readingFileEnd(file, LOGGER, out); return knowledge; diff --git a/src/main/java/edu/pitt/dbmi/causal/cmd/tetrad/TetradRunner.java b/src/main/java/edu/pitt/dbmi/causal/cmd/tetrad/TetradRunner.java index 9284dc1..43943f3 100644 --- a/src/main/java/edu/pitt/dbmi/causal/cmd/tetrad/TetradRunner.java +++ b/src/main/java/edu/pitt/dbmi/causal/cmd/tetrad/TetradRunner.java @@ -26,7 +26,7 @@ import edu.cmu.tetrad.data.DataModel; import edu.cmu.tetrad.data.DataSet; import edu.cmu.tetrad.data.ICovarianceMatrix; -import edu.cmu.tetrad.data.IKnowledge; +import edu.cmu.tetrad.data.Knowledge; import edu.cmu.tetrad.graph.Dag; import edu.cmu.tetrad.graph.Graph; import edu.cmu.tetrad.graph.GraphUtils; @@ -87,7 +87,7 @@ public TetradRunner(CmdArgs cmdArgs) { public void runAlgorithm(PrintStream out) throws AlgorithmRunException, IOException { final List dataModels = DataFiles.readInDatasets(cmdArgs, out); final Algorithm algorithm = getAlgorithm(cmdArgs); - final IKnowledge knowledge = DataFiles.readInKnowledge(cmdArgs, out); + final Knowledge knowledge = DataFiles.readInKnowledge(cmdArgs, out); final boolean acceptsKnowledge = TetradAlgorithms.getInstance().acceptKnowledge(cmdArgs.getAlgorithmClass()); final boolean hasKnowledge = !(knowledge == null || knowledge.getVariables().isEmpty()); From d3f6dec2b3db52fa79e496400829dc2dae06276f Mon Sep 17 00:00:00 2001 From: Kevin Bui Date: Fri, 13 Jan 2023 00:57:10 -0500 Subject: [PATCH 5/6] Add unit test for bootstrapping. --- ...CausalCmdApplicationBootstrappingTest.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationBootstrappingTest.java diff --git a/src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationBootstrappingTest.java b/src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationBootstrappingTest.java new file mode 100644 index 0000000..eb8e14f --- /dev/null +++ b/src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationBootstrappingTest.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2019 University of Pittsburgh. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package edu.pitt.dbmi.causal.cmd; + +import java.io.IOException; +import java.nio.file.Path; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +/** + * + * Jan 13, 2023 12:16:29 AM + * + * @author Kevin V. Bui (kvb2univpitt@gmail.com) + */ +public class CausalCmdApplicationBootstrappingTest { + + @TempDir + public static Path tempDir; + + @Test + public void testFgesBootstrappingWithContinuousData() throws IOException { + String dataset = TestFiles.CONTINUOUS_DATA; + String dirOut = TestFiles.createSubDir(tempDir, "fges_bootstrapping").toString(); + String[] args = { + "--dataset", dataset, + "--delimiter", "tab", + "--data-type", "continuous", + "--algorithm", "fges", + "--score", "ebic-score", + "--default", + "--prefix", "fges-bootstrapping", + "--numberResampling", "10", + "--percentResampleSize", "100", + "--seed", "1673588774198", + "--out", dirOut + }; + CausalCmdApplication.main(args); + } + +} From 266e5911af82b887fb8a9c2f672102f96895385b Mon Sep 17 00:00:00 2001 From: Kevin Bui Date: Sun, 22 Jan 2023 13:28:28 -0500 Subject: [PATCH 6/6] Using the latest tetrad-lib. Added unit test for experimental algorithm BOSS. --- pom.xml | 2 +- .../CausalCmdApplicationExperimentalTest.java | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationExperimentalTest.java diff --git a/pom.xml b/pom.xml index 89c3be1..cf6a934 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ io.github.cmu-phil tetrad-lib - 7.1.3-SNAPSHOT + 7.1.3-1 org.slf4j diff --git a/src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationExperimentalTest.java b/src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationExperimentalTest.java new file mode 100644 index 0000000..5346889 --- /dev/null +++ b/src/test/java/edu/pitt/dbmi/causal/cmd/CausalCmdApplicationExperimentalTest.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2019 University of Pittsburgh. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package edu.pitt.dbmi.causal.cmd; + +import java.io.IOException; +import java.nio.file.Path; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +/** + * + * Jan 21, 2023 9:52:10 PM + * + * @author Kevin V. Bui (kvb2univpitt@gmail.com) + */ +public class CausalCmdApplicationExperimentalTest { + + @TempDir + public static Path tempDir; + + @Test + public void testBossWithContinuousData() throws IOException { + String dataset = TestFiles.CONTINUOUS_DATA; + String dirOut = TestFiles.createSubDir(tempDir, "boss_experimental").toString(); + String[] args = { + "--dataset", dataset, + "--delimiter", "tab", + "--data-type", "continuous", + "--experimental", + "--algorithm", "boss", + "--score", "ebic-score", + "--test", "fisher-z-test", + "--default", + "--prefix", "boss-experimental", + "--out", dirOut + }; + CausalCmdApplication.main(args); + } + +}