Package edu.cmu.tetrad.graph
Class GraphPersistence
java.lang.Object
edu.cmu.tetrad.graph.GraphPersistence
Methods to load or save graphs.
- Author:
- josephramsey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic nu.xom.ElementconvertToXml(Graph graph) getCollidersFromGraph(Node node, Graph graph) static nu.xom.ElementgetRootElement(File file) grabLayout(List<Node> nodes) static StringgraphRMatrixTxt(Graph graph) static StringgraphToDot(Graph graph) Converts a graph to a Graphviz .dot filestatic voidgraphToDot(Graph graph, File file) static Stringstatic Stringstatic StringgraphToXml(Graph graph) static Graphstatic GraphloadGraphBNTPcMatrix(List<Node> vars, DataSet dataSet) static GraphloadGraphJson(File file) static GraphloadGraphPcalg(File file) static StringloadGraphRMatrix(Graph graph) static GraphloadGraphRuben(File file) static GraphloadGraphTxt(File file) static GraphloadRSpecial(File file) static GraphparseGraphXml(nu.xom.Element graphElement, Map<String, Node> nodes) static GraphreaderToGraphJson(Reader reader) static GraphreaderToGraphRuben(Reader reader) static GraphreaderToGraphTxt(Reader reader) static GraphreaderToGraphTxt(String graphString) static PrintWriter
-
Constructor Details
-
GraphPersistence
public GraphPersistence()
-
-
Method Details
-
loadGraph
-
loadGraphTxt
-
loadGraphRuben
-
loadGraphJson
-
loadGraphBNTPcMatrix
-
graphRMatrixTxt
- Throws:
IllegalArgumentException
-
loadRSpecial
-
loadGraphPcalg
-
loadGraphRMatrix
- Throws:
IllegalArgumentException
-
readerToGraphTxt
- Throws:
IOException
-
readerToGraphTxt
- Throws:
IOException
-
saveGraph
- Parameters:
graph- The graph to be saved.file- The file to save it in.xml- True if to be saved in XML, false if in text.- Returns:
- I have no idea whey I'm returning this; it's already closed...
-
readerToGraphRuben
- Throws:
IOException
-
readerToGraphJson
- Throws:
IOException
-
graphToDot
Converts a graph to a Graphviz .dot file -
graphToDot
-
convertToXml
- Returns:
- an XML element representing the given graph. (Well, only a basic graph for now...)
-
graphToXml
-
graphToLavaan
-
graphToPcalg
-
parseGraphXml
public static Graph parseGraphXml(nu.xom.Element graphElement, Map<String, Node> nodes) throws nu.xom.ParsingException- Throws:
nu.xom.ParsingException
-
getRootElement
- Throws:
nu.xom.ParsingExceptionIOException
-
grabLayout
-
getCollidersFromGraph
- Returns:
- A list of triples of the form X*->Y<-*Z.
-