Package edu.cmu.tetrad.graph
Class GraphSaveLoadUtils
java.lang.Object
edu.cmu.tetrad.graph.GraphSaveLoadUtils
Methods to load or save graphs.
- Author:
- josephramsey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic nu.xom.Element
convertToXml
(Graph graph) getCollidersFromGraph
(Node node, Graph graph) static nu.xom.Element
getRootElement
(File file) grabLayout
(List<Node> nodes) static String
graphRMatrixTxt
(Graph graph) static String
graphToDot
(Graph graph) Converts a graph to a Graphviz .dot filestatic void
graphToDot
(Graph graph, File file) static String
static String
static String
graphToXml
(Graph graph) static Graph
static Graph
loadGraphBNTPcMatrix
(List<Node> vars, DataSet dataSet) static Graph
loadGraphJson
(File file) static Graph
loadGraphPcalg
(File file) static String
loadGraphRMatrix
(Graph graph) static Graph
loadGraphRuben
(File file) static Graph
loadGraphTxt
(File file) static Graph
loadRSpecial
(File file) static Graph
parseGraphXml
(nu.xom.Element graphElement, Map<String, Node> nodes) static Graph
readerToGraphJson
(Reader reader) static Graph
readerToGraphRuben
(Reader reader) static Graph
readerToGraphTxt
(Reader reader) static Graph
readerToGraphTxt
(String graphString) static PrintWriter
-
Constructor Details
-
GraphSaveLoadUtils
public GraphSaveLoadUtils()
-
-
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.ParsingException
IOException
-
grabLayout
-
getCollidersFromGraph
- Returns:
- A list of triples of the form X*->Y<-*Z.
-