diff --git a/README.md b/README.md index ffdbfc9..2c814a1 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ -[![GitHub Releases](https://img.shields.io/github/v/release/solislemuslab/minaa?display_name=tag)](https://github.com/solislemuslab/minaa/releases) [![GitHub license](https://img.shields.io/github/license/solislemuslab/minaa)](https://github.com/solislemuslab/minaa/blob/main/LICENCE) [![GitHub Issues](https://img.shields.io/github/issues/solislemuslab/minaa)](https://github.com/solislemuslab/minaa/issues) ![ ](https://img.shields.io/github/languages/code-size/solislemuslab/minaa) +[![GitHub Releases](https://img.shields.io/github/v/release/solislemuslab/minaa?display_name=tag)](https://github.com/solislemuslab/minaa/releases) [![GitHub license](https://img.shields.io/github/license/solislemuslab/minaa)](https://github.com/solislemuslab/minaa/blob/main/LICENCE) [![GitHub Issues](https://img.shields.io/github/issues/solislemuslab/minaa)](https://github.com/solislemuslab/minaa/issues) ![ ](https://img.shields.io/github/languages/code-size/solislemuslab/minaa) [![status](https://joss.theoj.org/papers/b4d9f26021065b1759d50413f60aa9c3/status.svg)](https://joss.theoj.org/papers/b4d9f26021065b1759d50413f60aa9c3) ## Description -**MiNAA** is a network alignment algorithm. That is, MiNAA takes as input a pair of node-edge networks, and finds a correspondance between them such that each node in one is mapped to its most similar node in the other. MiNAA is capable of using both *topological* (structural) information about the network, and *biological* information about the taxa each node represents, in order to produce a good approximation of the optimal alignment. Due to the complexity of this task, an approximation is the best that can be done in an efficient runtime. Network alignment in this setting is done primarily for comparative purposes. For example, an alignment might map clusters of taxa to each other, revealing conserved or analogous functions between microbial communities. See our [software note](https://arxiv.org/abs/2212.05880) (preprint) for additional details. +MiNAA takes as input a pair of node-edge networks, and finds a correspondance between them such that each node in one is mapped to its most similar node in the other. MiNAA is capable of using both *topological* (structural) information about the network, and *biological* information about the taxa each node represents, in order to produce a good approximation of the optimal alignment. Due to the complexity of this task, an approximation is the best that can be done in an efficient runtime. Network alignment in this setting is done primarily for comparative purposes. For example, an alignment might map clusters of taxa to each other, revealing conserved or analogous functions between microbial communities. See our [software note](https://arxiv.org/abs/2212.05880) (preprint) for additional details. ## Requirements @@ -75,6 +75,8 @@ Here we align network0 with network1 using no biological data. `-a=0.6` sets alp Here we align network0 with network1 using topological information and the given biological cost matrix, bio_costs. Since alpha and gamma were unspecified, they default to 0.5 and 1 respectively. Since beta was set to 0.85, 85% of the cost weight is from the topological cost matrix, and 15% is from the given biological cost matrix. +See the `example/` directory for a sample input and output to MiNAA, which you can look at and replicate yourself. + ## Simulations in the Manuscript All scripts and instructions to reproduce the analyses in the manuscript can be found in the `simulations` folder. diff --git a/paper/paper.md b/paper/paper.md index ee00dbd..cbcdd53 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -73,9 +73,9 @@ For example, for the original simulated network (Network $G$) with 10 nodes and We iterate over different numbers of nodes (10, 30, 50, 100, 250 and 500), and different proportions of edges changed (0.05 (5\%), 0.1, and 0.9). To achieve reliable results, each scenario is repeated 30 times and the average of the alignment matrices is computed. We expect Network $G$ to be properly aligned with a perturbation of itself with edge change rate of 0.05 or 0.1, but not with an edge change rate of 0.9. -\autoref{heatmap} displays the results of the averaged similarity matrices for all simulated networks, with rows representing the edge change rate and columns representing the number of nodes. For instance, for 10 nodes with 0.05 edge changes, the heatmap displays the mean of 30 alignment matrices. Given that we observe diagonal matrices for a small rate of edge change (0.05 and 0.1), we can conclude that our algorithm correctly aligns nodes under small perturbations of the networks. However, the results for the same networs with the edge change rate of 0.9 is far from diagonal which is also what we expected. +\autoref{heatmap} displays the results of the averaged similarity matrices for all simulated networks, with rows representing the edge change rate and columns representing the number of nodes. For instance, for 10 nodes with 0.05 edge changes, the heatmap displays the mean of 30 alignment matrices. Given that we observe diagonal matrices for a small rate of edge change (0.05 and 0.1), we can conclude that our algorithm correctly aligns nodes under small perturbations of the networks. However, the results for the same networks with the edge change rate of 0.9 is far from diagonal which is also what we expected. -![Averaged alignment matrices for all simulated networks, rows representing the rate of altered edge change and columns representing the number of nodes. As expected, for 0.05 or 0.1 edge change rate, the alignment matrices are close to identity matrices illustrating our method's ability to align the same nodes on perturbed networks.\label{heatmap}](graphics/heatmapGraph.pdf) +![Averaged alignment matrices for all simulated networks, rows representing the rate of altered edge change and columns representing the number of nodes. Each sub-matrix is a heat map, where a coordinate's color represents the rate at which those nodes were aligned. As expected, for 0.05 or 0.1 edge change rate, the alignment matrices are close to identity matrices, illustrating our method's ability to align the same nodes on perturbed networks.\label{heatmap}](graphics/heatmapGraph.pdf) We also present results on running time (see table below). diff --git a/src/file_io.cpp b/src/file_io.cpp index a5f8d6c..2b8f7bc 100644 --- a/src/file_io.cpp +++ b/src/file_io.cpp @@ -34,21 +34,10 @@ namespace FileIO */ std::string name_file(std::string file) { - #ifdef _WIN32 // Windows - { - auto si = file.find_last_of("\\") + 1; - auto ei = file.find_last_of("."); - auto file_name = file.substr(si, ei - si); - return file_name; - } - #else // Unix - { - auto si = file.find_last_of("/") + 1; - auto ei = file.find_last_of("."); - auto file_name = file.substr(si, ei - si); - return file_name; - } - #endif + auto start_index = file.find_last_of("/|\\") + 1; + auto end_index = file.find_last_of("."); + auto file_name = file.substr(start_index, end_index - start_index); + return file_name; } /**