@@ -0,0 +1,2891 @@
+package org.bdgp.OpenHiCAMM;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.BufferedWriter;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.io.OutputStreamWriter;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/** %0A * Java command-line interface to the graph-easy perl script.%0A * %0A * To install graph-easy:%0A * brew install cpanminus && sudo cpanm Graph::Easy # on Mac OS X%0A */%0Apublic class GraphEasy %7B%0A    public List%3CEdge%3E edges;%0A    %0A    public GraphEasy() %7B%0A        this.edges = new ArrayList%3CEdge%3E();%0A    %7D%0A    %0A    public void addEdge(Edge e) %7B%0A        this.edges.add(e);%0A    %7D%0A    %0A    public void addEdge(String node1, String node2) %7B%0A        this.edges.add(new Edge(node1, node2));%0A    %7D%0A%0A    public void addEdge(String node1) %7B%0A        this.edges.add(new Edge(node1, null));%0A    %7D%0A%0A    public String graph() throws IOException %7B%0A        StringBuilder sb = new StringBuilder();%0A        for (Edge edge : this.edges) %7B%0A            sb.append(edge);%0A            sb.append(%22 %22);%0A        %7D%0A        sb.append(String.format(%22%25n%22));%0A        String graphDesc = sb.toString();%0A        Process p;%0A        try %7B p = Runtime.getRuntime().exec(new String%5B%5D %7B%22graph-easy%22,%22--as=boxart%22%7D); %7D%0A        catch (IOException e) %7B%0A            // Try /usr/local/bin explicitly, because Mac OS X doesn't put /usr/local/bin %0A            // in the PATH by default.%0A            try %7B p = Runtime.getRuntime().exec(new String%5B%5D %7B%22/usr/local/bin/graph-easy%22,%22--as=boxart%22%7D); %7D%0A            catch (IOException e2) %7B return %22graph-easy is not installed, skipping.%22; %7D%0A        %7D%0A        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));%0A        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));%0A        out.write(graphDesc);%0A        out.flush();%0A        out.close();%0A        String line;%0A        StringBuilder graph = new StringBuilder();%0A        while ((line = in.readLine()) != null) %7B%0A            graph.append(String.format(%22%25s%25n%22, line));%0A        %7D%0A        in.close();%0A        return graph.toString();%0A    %7D%0A%0A    public class Edge %7B%0A        public String node1;%0A        public String node2;%0A        public Edge(String node1) %7B%0A            this.node1 = node1;%0A            this.node2 = null;%0A        %7D%0A        public Edge(String node1, String node2) %7B%0A            this.node1 = node1;%0A            this.node2 = node2;%0A        %7D%0A        public String toString() %7B%0A            if (node1 == null && node2 == null) %7B%0A                return %22%22;%0A            %7D%0A            else if (node1 != null && node2 == null) %7B%0A                return String.format(%22%5B%25s%5D%22, node1);%0A            %7D%0A            else if (node1 == null && node2 != null) %7B%0A                return String.format(%22%5B%25s%5D%22, node2);%0A            %7D%0A            else %7B%0A                return String.format(%22%5B%25s%5D --%3E %5B%25s%5D%22, node1, node2);%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

add GraphEasy class for running graph-easy tool