Compiling from source ===================== This tool can be used as a GUI or from the command line. For the command line tool, a Makefile is included. You will need a g++ compiler for your operating system. $ make # command line tool The GUI is built using wxWidgets. Installation and build instructions can be found at https://www.wxwidgets.org/downloads/. For macOS and Linux, the Makefile an be used: $ make gui For Windows it is recommended to install Visual Studio and to follow the instructions from the wxWidgets website. The GUI can also be built for Windows on a Linux machine using the MinGW cross-compiler. This is done through the included Makefile. $ make win-gui # run gui.exe on a Windows machine Node-colored graphlet counting (Command Line) ============================================= Usage ----- Linux and Mac OS X: $ ./colored-graphlets_main -node [colored network file gw] [node color file] [output file] Windows 64-bit and 32-bit $ colored-graphlets_main.exe -node [colored network file gw] [node color file] [output file] The network file should be in standard GW format. Edge weights (e.g., "0" in "1 2 0 |{1}|" below) or edge names (e.g., "|{1}|" in "1 2 0 |{1}|" below), if any, will be ignored by our counting program. An example file is shown below: EXAMPLE.GRAPH string int -1 5 |{v1}| |{v2}| |{v3}| |{v4}| |{v5}| 10 1 2 0 |{1}| 2 3 0 |{2}| 3 4 0 |{3}| 4 1 0 |{4}| 2 4 0 |{5}| 5 3 0 |{6}| 2 5 0 |{7}| 4 5 0 |{8}| 1 3 0 |{9}| 1 5 0 |{10}| The node color file should consist of two tab separated columns. The first column should have the node name as it is in the network file. The second column should have the node color. The colors must be integers, and they must be natural numbers starting at 1. An example file is shown below: v1 1 v2 2 v3 2 v4 2 v5 1 Edge-colored graphlet counting (Command Line) ============================================ Usage ----- Linux and Mac: $ ./colored-graphlets_main -edge [colored network file gw] [output file] Windows 64-bit and 32-bit: $ ./colored-graphlets_main -edge [colored network file gw] [output file] The network file should be in standard GW format, except that the edge weights (e.g., "2" in "3 4 2 |{3}|" below) should be replaced by the edge colors. The colors must be integers, and they must be natural numbers starting at 1. An example file is shown below: EXAMPLE.GRAPH string int -1 5 |{v1}| |{v2}| |{v3}| |{v4}| |{v5}| 10 1 2 1 |{1}| 2 3 2 |{2}| 3 4 2 |{3}| 4 1 1 |{3}| 2 4 2 |{3}| 5 3 1 |{3}| 2 5 3 |{3}| 4 5 3 |{3}| 1 3 2 |{3}| 1 5 1 |{3}| GUI === The GUI can be run by executing the "gui.exe" (Windows) or "gui" (macOS or Linux) command. The GUI contains the options to count both node- and edge-colored graphlets. The specifications for the input files is the same as that described above for each counting method. Interpreting the output =================== Assume we have the following network file: EXAMPLE.GRAPH string int -1 3 |{v1}| |{v2}| |{v3}| 3 1 2 1 |{1}| 2 3 2 |{2}| 2 3 1 |{3}| An example edge-colored output is shown below: v1 1 0 0 0 0 1 0 0 0 ... v2 1 0 1 0 0 0 0 0 1 ... v3 0 0 1 0 0 1 0 0 0 ... For illustration, only the first nine orbits of the edge-colored GDV (see the paper for details) are shown. For example, v2 touches once orbit 8 of the edge-colored GDV. This network has two edge colors (color 1 and color 2), so there will be three possible edge-colored graphlets for each homogenous graphlet (corresponding to the color combinations: {1}, {2}, {1,2}). Mapping heterogenous orbits to homogenous orbits and colors ========================================================= Given all possible 73 orbits for 2-5 node homogenous graphlets (numbered 0 to 72), and k node/edge colors, there will be 73(2^k - 1) orbits in the node/edge-colored GDV. To map a heterogeneous orbit (O_hom) to a homogenous orbit (O_het), we simply take its orbit number (0 to 73(2^k - 1) - 1) and divide it by (2^k - 1). Round any non-whole numbers down to get a result between 0 and 72. Formally: O_hom = floor[ O_het / (2^k - 1) ] Each heterogenous orbit also maps to a specific set of colors (C). To find C, first find the modulus of the heterogeneous graphlet and (2^k - 1). Take this result and convert it to its binary representation (i.e. 7 is 111 in binary). We can read off the elements in C directly from the binary representation (het_2), where a color c is present if the ith (counting from the right) bit of het_2 is a 1. For example, if we are considering the number 5 (101), we can see that the first and third bits are 1, so C={1,3}. A full example is as follows. Consider 4 colors and heterogeneous orbit 25. 2^4 - 1 = 16. floor[ 25 / 16 ] = 1 so O_het 23 maps to O_hom 1. 25 % 16 = 9, which is 1001 in binary. Bits 1 and 4 are 1, so C={1,4}.