Skip to content

Commit

Permalink
Merge pull request #1324 from cmu-phil/6.9.0
Browse files Browse the repository at this point in the history
Making Official Release of Version 6.9.0
  • Loading branch information
jdramsey authored May 3, 2021
2 parents 3bf39f6 + 0c5a1e8 commit e53bc0c
Show file tree
Hide file tree
Showing 98 changed files with 3,528 additions and 11,135 deletions.
2 changes: 1 addition & 1 deletion data-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>edu.cmu</groupId>
<artifactId>tetrad</artifactId>
<version>6.8.1</version>
<version>6.9.0</version>
</parent>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>data-reader</artifactId>
Expand Down
276 changes: 246 additions & 30 deletions docs/manual/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.cmu</groupId>
<artifactId>tetrad</artifactId>
<version>6.8.1</version>
<version>6.9.0</version>
<packaging>pom</packaging>

<name>Tetrad Project</name>
Expand Down
2 changes: 1 addition & 1 deletion tetrad-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>edu.cmu</groupId>
<artifactId>tetrad</artifactId>
<version>6.8.1</version>
<version>6.9.0</version>
</parent>

<artifactId>tetrad-gui</artifactId>
Expand Down
85 changes: 85 additions & 0 deletions tetrad-gui/src/main/java/edu/cmu/tetradapp/FciTemp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
///////////////////////////////////////////////////////////////////////////////
// For information as to what this class does, see the Javadoc, below. //
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, //
// 2007, 2008, 2009, 2010, 2014, 2015 by Peter Spirtes, Richard Scheines, Joseph //
// Ramsey, and Clark Glymour. //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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 General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
///////////////////////////////////////////////////////////////////////////////
package edu.cmu.tetradapp;

import edu.cmu.tetrad.data.DataReader;
import edu.cmu.tetrad.data.DataSet;
import edu.cmu.tetrad.data.IKnowledge;
import edu.cmu.tetrad.graph.Graph;
import edu.cmu.tetrad.graph.GraphUtils;
import edu.cmu.tetrad.search.Fci;
import edu.cmu.tetrad.search.IndTestFisherZ;
import edu.cmu.tetrad.util.DataConvertUtils;
import edu.pitt.dbmi.data.reader.Data;
import edu.pitt.dbmi.data.reader.Delimiter;
import edu.pitt.dbmi.data.reader.tabular.ContinuousTabularDatasetFileReader;
import edu.pitt.dbmi.data.reader.tabular.ContinuousTabularDatasetReader;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;

public final class FciTemp {

public static void main(String... args) {
if (args.length != 3) {
throw new RuntimeException("java -jar edu.cmu.edu.tetrad.FciTemp [data] [knowledge] [alpha]");
}

Path dataFile = new File(args[0]).toPath();
Delimiter delimiter = Delimiter.TAB;

ContinuousTabularDatasetReader dataReader = new ContinuousTabularDatasetFileReader(dataFile, delimiter);
dataReader.setHasHeader(true);
DataSet dataSet;

try {
Data data = dataReader.readInData();
dataSet = (DataSet) DataConvertUtils.toDataModel(data);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Expecting a properly formatted data file: " + args[0]);
}

IKnowledge knowledge;

try {
knowledge = new DataReader().parseKnowledge(new File(args[1]));
} catch (IOException e) {
throw new RuntimeException("Expecting properly formatted knowledge file: " + args[1]);
}

double alpha = 0;
try {
alpha = Double.parseDouble(args[2]);
} catch (NumberFormatException e) {
throw new RuntimeException("Expecting a number for alpha");
}

Fci fci = new Fci(new IndTestFisherZ(dataSet, alpha));
fci.setKnowledge(knowledge);
fci.setHeuristic(1); // lexicographic order.

Graph graph = fci.search();

System.out.println(GraphUtils.graphToText(graph));
}
}
Loading

0 comments on commit e53bc0c

Please sign in to comment.